2 * Copyright (c) 1995, Index Data I/S
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.6 1995-05-16 08:51:02 quinn
8 * License, documentation, and memory fixes
10 * Revision 1.5 1995/05/15 11:56:37 quinn
11 * Asynchronous facilities. Restructuring of seshigh code.
13 * Revision 1.4 1995/03/27 08:34:23 quinn
14 * Added dynamic server functionality.
15 * Released bindings to session.c (is now redundant)
17 * Revision 1.3 1995/03/15 08:37:42 quinn
18 * Now we're pretty much set for nonblocking I/O.
20 * Revision 1.2 1995/03/14 10:28:00 quinn
21 * More work on demo server.
23 * Revision 1.1 1995/03/10 18:22:45 quinn
24 * The rudiments of an asynchronous server.
33 typedef void (*IOC_CALLBACK)(struct iochan *i, int event);
39 #define EVENT_INPUT 0x01
40 #define EVENT_OUTPUT 0x02
41 #define EVENT_EXCEPT 0x04
42 #define EVENT_TIMEOUT 0x08
43 #define EVENT_WORK 0x10
52 #define iochan_destroy(i) (void)((i)->destroyed = 1)
53 #define iochan_getfd(i) ((i)->fd)
54 #define iochan_setfd(i, f) ((i)->fd = (f))
55 #define iochan_getdata(i) ((i)->data)
56 #define iochan_setdata(i, d) ((i)->data = d)
57 #define iochan_getflags(i) ((i)->flags)
58 #define iochan_setflags(i, d) ((i)->flags = d)
59 #define iochan_setflag(i, d) ((i)->flags |= d)
60 #define iochan_clearflag(i, d) ((i)->flags &= ~(d))
61 #define iochan_getflag(i, d) ((i)->flags & d ? 1 : 0)
62 #define iochan_getfun(i) ((i)->fun)
63 #define iochan_setfun(i, d) ((i)->fun = d)
64 #define iochan_setevent(i, e) ((i)->force_event = (e))
65 #define iochan_getnext(i) ((i)->next)
67 IOCHAN iochan_getchan(void);
68 IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags);