diff options
Diffstat (limited to 'usr/src/lib/libresolv2/include/isc/eventlib.h')
| -rw-r--r-- | usr/src/lib/libresolv2/include/isc/eventlib.h | 133 |
1 files changed, 65 insertions, 68 deletions
diff --git a/usr/src/lib/libresolv2/include/isc/eventlib.h b/usr/src/lib/libresolv2/include/isc/eventlib.h index 92988f63ca..a4cfdf9092 100644 --- a/usr/src/lib/libresolv2/include/isc/eventlib.h +++ b/usr/src/lib/libresolv2/include/isc/eventlib.h @@ -1,33 +1,26 @@ /* - * Copyright 1997-2002 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* - * Copyright (c) 1995-1999 by Internet Software Consortium + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1995-1999, 2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS - * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. */ /* eventlib.h - exported interfaces for eventlib * vix 09sep95 [initial] * - * $Id: eventlib.h,v 1.23 2001/05/29 05:47:09 marka Exp $ + * $Id: eventlib.h,v 1.7 2008/11/14 02:36:51 marka Exp $ */ -#pragma ident "%Z%%M% %I% %E% SMI" - #ifndef _EVENTLIB_H #define _EVENTLIB_H @@ -36,6 +29,8 @@ #include <sys/time.h> #include <stdio.h> +#include <isc/platform.h> + #ifndef __P # define __EVENTLIB_P_DEFINED # ifdef __STDC__ @@ -57,14 +52,13 @@ typedef struct { void *opaque; } evEvent; #define evInitID(id) ((id)->opaque = NULL) #define evTestID(id) ((id).opaque != NULL) -typedef void (*evConnFunc)__P((evContext ctx, void *uap, int fd, - const void *la, int lalen, - const void *ra, int ralen)); -typedef void (*evFileFunc)__P((evContext ctx, void *uap, int fd, int evmask)); -typedef void (*evStreamFunc)__P((evContext ctx, void *uap, int fd, int bytes)); -typedef void (*evTimerFunc)__P((evContext ctx, void *uap, - struct timespec due, struct timespec inter)); -typedef void (*evWaitFunc)__P((evContext ctx, void *uap, const void *tag)); +typedef void (*evConnFunc)__P((evContext, void *, int, const void *, int, + const void *, int)); +typedef void (*evFileFunc)__P((evContext, void *, int, int)); +typedef void (*evStreamFunc)__P((evContext, void *, int, int)); +typedef void (*evTimerFunc)__P((evContext, void *, + struct timespec, struct timespec)); +typedef void (*evWaitFunc)__P((evContext, void *, const void *)); typedef struct { unsigned char mask[256/8]; } evByteMask; #define EV_BYTEMASK_BYTE(b) ((b) / 8) @@ -84,6 +78,8 @@ typedef struct { unsigned char mask[256/8]; } evByteMask; #define EV_WRITE 2 #define EV_EXCEPT 4 +#define EV_WASNONBLOCKING 8 /* Internal library use. */ + /* eventlib.c */ #define evCreate __evCreate #define evSetDebug __evSetDebug @@ -93,21 +89,19 @@ typedef struct { unsigned char mask[256/8]; } evByteMask; #define evDrop __evDrop #define evMainLoop __evMainLoop #define evHighestFD __evHighestFD - -int evCreate __P((evContext *ctx)); -void evSetDebug __P((evContext ctx, int lev, FILE *out)); -int evDestroy __P((evContext ctx)); -int evGetNext __P((evContext ctx, evEvent *ev, int options)); -int evDispatch __P((evContext ctx, evEvent ev)); -void evDrop __P((evContext ctx, evEvent ev)); -int evMainLoop __P((evContext ctx)); -int evHighestFD __P((evContext ctx)); - -#ifdef SUNW_POLL -extern void evPollfdAdd(evContext ctx, int pollfd_chunk_size, int fd, - short events); -extern void evPollfdDel(evContext ctx, int fd); -#endif /* SUNW_POLL */ +#define evGetOption __evGetOption +#define evSetOption __evSetOption + +int evCreate __P((evContext *)); +void evSetDebug __P((evContext, int, FILE *)); +int evDestroy __P((evContext)); +int evGetNext __P((evContext, evEvent *, int)); +int evDispatch __P((evContext, evEvent)); +void evDrop __P((evContext, evEvent)); +int evMainLoop __P((evContext)); +int evHighestFD __P((evContext)); +int evGetOption __P((evContext *, const char *, int *)); +int evSetOption __P((evContext *, const char *, int)); /* ev_connects.c */ #define evListen __evListen @@ -117,11 +111,10 @@ extern void evPollfdDel(evContext ctx, int fd); #define evUnhold __evUnhold #define evTryAccept __evTryAccept -int evListen __P((evContext ctx, int fd, int maxconn, - evConnFunc func, void *uap, evConnID *id)); -int evConnect __P((evContext ctx, int fd, const void *ra, int ralen, - evConnFunc func, void *uap, evConnID *id)); -int evCancelConn __P((evContext ctx, evConnID id)); +int evListen __P((evContext, int, int, evConnFunc, void *, evConnID *)); +int evConnect __P((evContext, int, const void *, int, + evConnFunc, void *, evConnID *)); +int evCancelConn __P((evContext, evConnID)); int evHold __P((evContext, evConnID)); int evUnhold __P((evContext, evConnID)); int evTryAccept __P((evContext, evConnID, int *)); @@ -130,9 +123,8 @@ int evTryAccept __P((evContext, evConnID, int *)); #define evSelectFD __evSelectFD #define evDeselectFD __evDeselectFD -int evSelectFD __P((evContext ctx, int fd, int eventmask, - evFileFunc func, void *uap, evFileID *id)); -int evDeselectFD __P((evContext ctx, evFileID id)); +int evSelectFD __P((evContext, int, int, evFileFunc, void *, evFileID *)); +int evDeselectFD __P((evContext, evFileID)); /* ev_streams.c */ #define evConsIovec __evConsIovec @@ -142,14 +134,14 @@ int evDeselectFD __P((evContext ctx, evFileID id)); #define evUntimeRW __evUntimeRW #define evCancelRW __evCancelRW -struct iovec evConsIovec __P((void *buf, size_t cnt)); -int evWrite __P((evContext ctx, int fd, const struct iovec *iov, int cnt, - evStreamFunc func, void *uap, evStreamID *id)); -int evRead __P((evContext ctx, int fd, const struct iovec *iov, int cnt, - evStreamFunc func, void *uap, evStreamID *id)); -int evTimeRW __P((evContext ctx, evStreamID id, evTimerID timer)); -int evUntimeRW __P((evContext ctx, evStreamID id)); -int evCancelRW __P((evContext ctx, evStreamID id)); +struct iovec evConsIovec __P((void *, size_t)); +int evWrite __P((evContext, int, const struct iovec *, int, + evStreamFunc func, void *, evStreamID *)); +int evRead __P((evContext, int, const struct iovec *, int, + evStreamFunc func, void *, evStreamID *)); +int evTimeRW __P((evContext, evStreamID, evTimerID timer)); +int evUntimeRW __P((evContext, evStreamID)); +int evCancelRW __P((evContext, evStreamID)); /* ev_timers.c */ #define evConsTime __evConsTime @@ -160,9 +152,11 @@ int evCancelRW __P((evContext ctx, evStreamID id)); #define evTimeVal __evTimeVal #define evNowTime __evNowTime +#define evUTCTime __evUTCTime #define evLastEventTime __evLastEventTime #define evSetTimer __evSetTimer #define evClearTimer __evClearTimer +#define evConfigTimer __evConfigTimer #define evResetTimer __evResetTimer #define evSetIdleTimer __evSetIdleTimer #define evClearIdleTimer __evClearIdleTimer @@ -170,17 +164,19 @@ int evCancelRW __P((evContext ctx, evStreamID id)); #define evTouchIdleTimer __evTouchIdleTimer struct timespec evConsTime __P((time_t sec, long nsec)); -struct timespec evAddTime __P((struct timespec add1, struct timespec add2)); -struct timespec evSubTime __P((struct timespec minu, struct timespec subtra)); +struct timespec evAddTime __P((struct timespec, struct timespec)); +struct timespec evSubTime __P((struct timespec, struct timespec)); struct timespec evNowTime __P((void)); +struct timespec evUTCTime __P((void)); struct timespec evLastEventTime __P((evContext)); struct timespec evTimeSpec __P((struct timeval)); struct timeval evTimeVal __P((struct timespec)); -int evCmpTime __P((struct timespec a, struct timespec b)); -int evSetTimer __P((evContext ctx, evTimerFunc func, void *uap, - struct timespec due, struct timespec inter, - evTimerID *id)); -int evClearTimer __P((evContext ctx, evTimerID id)); +int evCmpTime __P((struct timespec, struct timespec)); +int evSetTimer __P((evContext, evTimerFunc, void *, struct timespec, + struct timespec, evTimerID *)); +int evClearTimer __P((evContext, evTimerID)); +int evConfigTimer __P((evContext, evTimerID, const char *param, + int value)); int evResetTimer __P((evContext, evTimerID, evTimerFunc, void *, struct timespec, struct timespec)); int evSetIdleTimer __P((evContext, evTimerFunc, void *, struct timespec, @@ -196,10 +192,9 @@ int evTouchIdleTimer __P((evContext, evTimerID)); #define evUnwait __evUnwait #define evDefer __evDefer -int evWaitFor __P((evContext ctx, const void *tag, evWaitFunc func, void *uap, - evWaitID *id)); -int evDo __P((evContext ctx, const void *tag)); -int evUnwait __P((evContext ctx, evWaitID id)); +int evWaitFor __P((evContext, const void *, evWaitFunc, void *, evWaitID *)); +int evDo __P((evContext, const void *)); +int evUnwait __P((evContext, evWaitID)); int evDefer __P((evContext, evWaitFunc, void *)); #ifdef __EVENTLIB_P_DEFINED @@ -207,3 +202,5 @@ int evDefer __P((evContext, evWaitFunc, void *)); #endif #endif /*_EVENTLIB_H*/ + +/*! \file */ |
