00001 #ifndef FDSET_H
00002 #define FDSET_H
00003
00004 #include "dllist.h"
00005
00006 struct fdset
00007 {
00008 struct dl_head list[1];
00009 int del_count;
00010 };
00011
00012 struct fdset_node
00013 {
00014 struct dl_node node[1];
00015 int fd;
00016 void (*handler)(void *data, int fd);
00017 void *data;
00018 };
00019
00020 extern struct fdset fds[1];
00021
00022 int fdset_init(struct fdset *fds);
00023 int fdset_add_fd(struct fdset *fds, int fd, void *handler, void *data);
00024 int fdset_del_fd(struct fdset *fds, int fd);
00025 int fdset_select(struct fdset *fds, int timeout );
00026
00027 #endif