/[cvs]/eggdrop1.9/testcode/sockbuf.h
ViewVC logotype

Contents of /eggdrop1.9/testcode/sockbuf.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Thu Apr 25 04:06:41 2002 UTC (17 years, 11 months ago) by stdarg
Branch: MAIN
Changes since 1.2: +1 -0 lines
File MIME type: text/x-csrc
* Implemented string/int variable linking for the tcl module
* Started working on linking variables in the perl module
* Some minor fixes as I came across them

1 #ifndef _SOCKBUF_H_
2 #define _SOCKBUF_H_
3
4 /* Flags for sockbuf_t structure. */
5 #define SOCKBUF_BLOCK 1
6 #define SOCKBUF_SERVER 2
7 #define SOCKBUF_CLIENT 4
8 #define SOCKBUF_DELETE 8
9 #define SOCKBUF_NOREAD 16
10
11 /* Event types. */
12 enum {
13 SOCKBUF_READ, SOCKBUF_EMPTY, SOCKBUF_EOF, SOCKBUF_ERR, SOCKBUF_CONNECT,
14 SOCKBUF_WRITE,
15 SOCKBUF_NEVENTS /* Marker for how many events are defined. */
16 };
17
18 typedef struct sockbuf_iobuf_b {
19 unsigned char *data;
20 int len;
21 int max;
22 } sockbuf_iobuf_t;
23
24 typedef int (*Function)();
25 typedef Function sockbuf_event_t[];
26 typedef Function *sockbuf_event_b;
27
28 int sockbuf_filter(int idx, int event, int level, void *arg);
29 int sockbuf_write(int idx, unsigned char *data, int len);
30 int sockbuf_write_filter(int idx, int level, unsigned char *data, int len);
31 int sockbuf_new(int sock, int flags);
32 int sockbuf_delete(int idx);
33 int sockbuf_set_handler(int idx, sockbuf_event_t handler, void *client_data);
34 int sockbuf_set_sock(int idx, int sock, int flags);
35 int sockbuf_attach_listener(int fd);
36 int sockbuf_detach_listener(int fd);
37 int sockbuf_attach_filter(int idx, sockbuf_event_t filter, void *client_data);
38 int sockbuf_detach_filter(int idx, sockbuf_event_t filter, void *client_data);
39 int sockbuf_update_all(int timeout);
40
41 #endif /* _SOCKBUF_H_ */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23