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 flags; /* see EVENT_FD_* flags */
31 void (*handler)(struct event_context *ev, struct fd_event *fde, time_t t, uint16 flags);
36 /* list of timed events */
38 struct timed_event *next, *prev;
40 void (*handler)(struct event_context *ev, struct timed_event *te, time_t t);
45 /* list of loop events - called on each select() */
47 struct loop_event *next, *prev;
48 void (*handler)(struct event_context *ev, struct loop_event *le, time_t t);
53 /* list of signal events */
55 struct signal_event *next, *prev;
57 void (*handler)(struct event_context *ev, struct signal_event *se, int signum, void *sigarg);
62 /* the maximum file descriptor number in fd_events */
65 /* information for exiting from the event loop */
73 /* bits for fd_event.flags */
74 #define EVENT_FD_READ 1
75 #define EVENT_FD_WRITE 2