first cut of client
[spider.git] / src / sel.h
1 /*
2  * sel.c
3  * 
4  * util routines for do the various select activities
5  * 
6  * Copyright 1996 (c) D-J Koopman
7  * 
8  * $Header$
9  * 
10  * $Log$
11  * Revision 1.1  2000-03-26 00:03:30  djk
12  * first cut of client
13  *
14  * Revision 1.3  1998/01/02 19:39:57  djk
15  * made various changes to cope with glibc
16  * fixed problem with extended status in etsi_router
17  *
18  * Revision 1.2  1997/06/18 18:44:31  djk
19  * A working hayes implementation!
20  *
21  * Revision 1.1  1997/01/28 16:14:23  djk
22  * moved these into lib as general routines to use with sel
23  *
24  * Revision 1.3  1997/01/20 22:30:31  djk
25  * Added modem connection for incoming SMS messages
26  * Added stats message
27  * Added multipack
28  *
29  * Revision 1.2  1997/01/13 23:34:56  djk
30  * The first working test version of smsd
31  *
32  * Revision 1.1  1997/01/03 23:44:31  djk
33  * initial workings
34  *
35  *
36  */
37
38 #ifndef _SEL_H
39 #define _SEL_H
40
41 static char _sel_h_rcsid[] = "$Id$";
42
43 #include "chain.h"
44
45 typedef struct {
46         int cnum;                                                  /* from open */
47         short err;                                                 /* error flag, to delay closing if required */
48         short sort;                                                /* this thing's sort */
49         short flags;                                               /* fdset flags */
50         char *name;                                                /* device name */
51         void *fcb;                                                 /* any fcb associated with this thing */
52         reft *msgbase;                                     /* any messages for this port */
53         int (*handler)();                                  /* the handler for this thingy */
54 } sel_t;
55
56 extern sel_t *sel;
57 extern int sel_max;
58 extern int sel_top;
59 extern int sel_inuse;
60 extern time_t sel_systime;
61 extern struct timeval sel_tv;
62
63 #define SEL_INPUT 1
64 #define SEL_OUTPUT 2
65 #define SEL_ERROR 4
66 #define SEL_IOALL 7
67
68 #define SEL_ETSI 1
69 #define SEL_RMIP 2
70 #define SEL_SVLP 3
71 #define SEL_TCP 4
72 #define SEL_X28 5
73 #define SEL_STDIO 6
74 #define SEL_DIALDLE 7
75 #define SEL_NOKIA 8
76
77 void sel_init(int, long, long);                                    /* initialise the select thing */
78 void sel_run();                                            /* run the select multiplexor */
79 sel_t *sel_open(int, void *, char *, int (*)(), int, int);/*  initialise a slot */
80 void sel_close(sel_t *);
81 int sel_error(sel_t *, int);               /* set/clear error flag */
82
83 #endif