summaryrefslogtreecommitdiff
path: root/include/fds.h
blob: ed0c8be99995775116261953df2b0394ec51fa64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef _FDS_H_
#define _FDS_H_

#include "linux_list.h"

struct fds {
	int	maxfd;
	fd_set	readfds;
	struct list_head list;
};

struct fds_item {
	struct list_head        head;
	int                     fd;
	void			(*cb)(void *data);
	void			*data;
};

struct fds *create_fds(void);
void destroy_fds(struct fds *);
int register_fd(int fd, void (*cb)(void *data), void *data, struct fds *fds);
int unregister_fd(int fd, struct fds *fds);

#endif