summaryrefslogtreecommitdiff
path: root/include/gsmd/select.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gsmd/select.h')
-rw-r--r--include/gsmd/select.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/gsmd/select.h b/include/gsmd/select.h
new file mode 100644
index 0000000..b75c338
--- /dev/null
+++ b/include/gsmd/select.h
@@ -0,0 +1,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