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