2 Unix SMB/CIFS implementation.
3 main select loop and event handling
4 Copyright (C) Andrew Tridgell 2003
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 please read the comments in events.c before modifying
25 struct event_context {
26 /* list of filedescriptor events */
28 struct fd_event *next, *prev;
30 uint16_t flags; /* see EVENT_FD_* flags */
31 void (*handler)(struct event_context *ev, struct fd_event *fde,
32 struct timeval t, uint16_t flags);
37 /* list of timed events */
39 struct timed_event *next, *prev;
40 struct timeval next_event;
41 void (*handler)(struct event_context *ev, struct timed_event *te,
47 /* list of loop events - called on each select() */
49 struct loop_event *next, *prev;
50 void (*handler)(struct event_context *ev, struct loop_event *le,
56 /* list of signal events */
58 struct signal_event *next, *prev;
60 void (*handler)(struct event_context *ev, struct signal_event *se, int signum, void *sigarg);
65 /* the maximum file descriptor number in fd_events */
68 /* information for exiting from the event loop */
74 /* we hang the events off here, to make merging easy */
79 /* bits for fd_event.flags */
80 #define EVENT_FD_READ 1
81 #define EVENT_FD_WRITE 2