2 * Copyright (c) 1995, Index Data I/S
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.9 1997-09-01 09:31:48 adam
8 * Removed definition statserv_remove from statserv.h to eventl.h.
10 * Revision 1.8 1995/06/19 12:39:09 quinn
11 * Fixed bug in timeout code. Added BER dumper.
13 * Revision 1.7 1995/06/16 10:31:34 quinn
14 * Added session timeout.
16 * Revision 1.6 1995/05/16 08:51:02 quinn
17 * License, documentation, and memory fixes
19 * Revision 1.5 1995/05/15 11:56:37 quinn
20 * Asynchronous facilities. Restructuring of seshigh code.
22 * Revision 1.4 1995/03/27 08:34:23 quinn
23 * Added dynamic server functionality.
24 * Released bindings to session.c (is now redundant)
26 * Revision 1.3 1995/03/15 08:37:42 quinn
27 * Now we're pretty much set for nonblocking I/O.
29 * Revision 1.2 1995/03/14 10:28:00 quinn
30 * More work on demo server.
32 * Revision 1.1 1995/03/10 18:22:45 quinn
33 * The rudiments of an asynchronous server.
44 typedef void (*IOC_CALLBACK)(struct iochan *i, int event);
50 #define EVENT_INPUT 0x01
51 #define EVENT_OUTPUT 0x02
52 #define EVENT_EXCEPT 0x04
53 #define EVENT_TIMEOUT 0x08
54 #define EVENT_WORK 0x10
65 #define iochan_destroy(i) (void)((i)->destroyed = 1)
66 #define iochan_getfd(i) ((i)->fd)
67 #define iochan_setfd(i, f) ((i)->fd = (f))
68 #define iochan_getdata(i) ((i)->data)
69 #define iochan_setdata(i, d) ((i)->data = d)
70 #define iochan_getflags(i) ((i)->flags)
71 #define iochan_setflags(i, d) ((i)->flags = d)
72 #define iochan_setflag(i, d) ((i)->flags |= d)
73 #define iochan_clearflag(i, d) ((i)->flags &= ~(d))
74 #define iochan_getflag(i, d) ((i)->flags & d ? 1 : 0)
75 #define iochan_getfun(i) ((i)->fun)
76 #define iochan_setfun(i, d) ((i)->fun = d)
77 #define iochan_setevent(i, e) ((i)->force_event = (e))
78 #define iochan_getnext(i) ((i)->next)
79 #define iochan_settimeout(i, t) ((i)->max_idle = (t), (i)->last_event = time(0))
81 IOCHAN iochan_getchan(void);
82 IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags);
84 int __stdcall event_loop(IOCHAN iochans);
86 int event_loop(IOCHAN dummylistener);
89 void statserv_remove (IOCHAN pIOChannel);