unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

fdlist.h (1196B)

      1 #ifndef FDLIST_H
      2 #define FDLIST_H
      3 
      4 /* $Id$ */
      5 
      6 #define FD_DESC_SZ	(100)
      7 
      8 typedef void (*IOCallbackFunc)(int fd, int revents, void *data);
      9 
     10 typedef enum FDCloseMethod { FDCLOSE_SOCKET=0, FDCLOSE_FILE=1, FDCLOSE_NONE=3 } FDCloseMethod;
     11 
     12 typedef struct fd_entry {
     13 	int fd;
     14 	char desc[FD_DESC_SZ];
     15 	IOCallbackFunc read_callback;
     16 	IOCallbackFunc write_callback;
     17 	void *data;
     18 	time_t deadline;
     19 	unsigned char is_open;
     20 	FDCloseMethod close_method;
     21 	unsigned int backend_flags;
     22 } FDEntry;
     23 
     24 extern MODVAR FDEntry fd_table[MAXCONNECTIONS + 1];
     25 
     26 extern int fd_open(int fd, const char *desc, FDCloseMethod close_method);
     27 extern int fd_close(int fd);
     28 extern void fd_unnotify(int fd);
     29 extern int fd_socket(int family, int type, int protocol, const char *desc);
     30 extern int fd_accept(int sockfd);
     31 extern void fd_desc(int fd, const char *desc);
     32 extern int fd_fileopen(const char *path, unsigned int flags);
     33 
     34 #define FD_SELECT_READ		0x1
     35 #define FD_SELECT_WRITE		0x2
     36 
     37 extern void fd_setselect(int fd, int flags, IOCallbackFunc iocb, void *data);
     38 extern void fd_select(int delay);		/* backend-specific */
     39 extern void fd_refresh(int fd);			/* backend-specific */
     40 extern void fd_fork(); /* backend-specific */
     41 
     42 #endif