summaryrefslogtreecommitdiff
path: root/include/gsmd/select.h
blob: b75c3381130408361d5e4d63ffc47669e5c36db4 (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
25
26
#ifndef __GSMD_SELECT_H
#define __GSMD_SELECT_H

#ifdef __GSMD__

#include <common/linux_list.h>

#define GSMD_FD_READ	0x0001
#define GSMD_FD_WRITE	0x0002
#define GSMD_FD_EXCEPT	0x0004

struct gsmd_fd {
	struct llist_head list;
	int fd;				/* file descriptor */
	unsigned int when;
	int (*cb)(int fd, unsigned int what, void *data);
	void *data;			/* void * to pass to callback */
};

extern int gsmd_register_fd(struct gsmd_fd *ufd);
extern void gsmd_unregister_fd(struct gsmd_fd *ufd);
extern int gsmd_select_main(void);

#endif /* __GSMD__ */

#endif
personal git repositories of Harald Welte. Your mileage may vary