dde95a42fd5374d1b2b595cb5cd2302e0a3a0fa5
[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.3  2000-07-20 14:16:00  minima
12  * can use Sourceforge now!
13  * added user->qra cleaning
14  * added 4 digit qra to user broadcast dxspots if available
15  *
16  * Revision 1.2  2000/03/26 14:22:59  djk
17  * removed some irrelevant log info
18  *
19  * Revision 1.1  2000/03/26 00:03:30  djk
20  * first cut of client
21  *
22  * Revision 1.1  1997/01/03 23:44:31  djk
23  * initial workings
24  *
25  *
26  */
27
28 #ifndef _SEL_H
29 #define _SEL_H
30
31 static char _sel_h_rcsid[] = "$Id$";
32
33 #include "chain.h"
34
35 typedef struct {
36         int cnum;                                                  /* from open */
37         short err;                                                 /* error flag, to delay closing if required */
38         short sort;                                                /* this thing's sort */
39         short flags;                                               /* fdset flags */
40         char *name;                                                /* device name */
41         void *fcb;                                                 /* any fcb associated with this thing */
42         reft *msgbase;                                     /* any messages for this port */
43         int (*handler)();                                  /* the handler for this thingy */
44 } sel_t;
45
46 extern sel_t *sel;
47 extern int sel_max;
48 extern int sel_top;
49 extern int sel_inuse;
50 extern time_t sel_systime;
51 extern struct timeval sel_tv;
52
53 #define SEL_INPUT 1
54 #define SEL_OUTPUT 2
55 #define SEL_ERROR 4
56 #define SEL_IOALL 7
57
58 void sel_init(int, long, long);                                    /* initialise the select thing */
59 void sel_run();                                            /* run the select multiplexor */
60 sel_t *sel_open(int, void *, char *, int (*)(), int, int);/*  initialise a slot */
61 void sel_close(sel_t *);
62 int sel_error(sel_t *, int);               /* set/clear error flag */
63
64 #endif