1 /***********************************************************************
5 * Abstraction of select call into "event-handling" to make programming
6 * easier. This header includes "private" definitions which users
7 * of the event-handling code should not care about.
9 * Copyright (C) 2001 Roaring Penguin Software Inc.
11 * This program may be distributed according to the terms of the GNU
12 * General Public License, version 2 or (at your option) any later version.
14 * $Id: eventpriv.h,v 1.1.48.1 2005/08/08 12:05:25 honor Exp $
18 ***********************************************************************/
20 #ifndef INCLUDE_EVENTPRIV_H
21 #define INCLUDE_EVENTPRIV_H 1
23 #include <sys/types.h>
26 /* Handler structure */
27 typedef struct EventHandler_t
{
28 struct EventHandler_t
*next
; /* Link in list */
29 int fd
; /* File descriptor for select */
30 unsigned int flags
; /* Select on read or write; enable timeout */
31 struct timeval tmout
; /* Absolute time for timeout */
32 EventCallbackFunc fn
; /* Callback function */
33 void *data
; /* Extra data to pass to callback */
36 /* Selector structure */
37 typedef struct EventSelector_t
{
38 EventHandler
*handlers
; /* Linked list of EventHandlers */
39 int nestLevel
; /* Event-handling nesting level */
40 int opsPending
; /* True if operations are pending */
41 int destroyPending
; /* If true, a destroy is pending */
45 #define EVENT_FLAG_DELETED 256