From 812761a1f8ff94e4913529840b905360ff843fc4 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Wed, 21 Jan 2009 16:26:54 -0800 Subject: Move waiter to library Move the waiter routines into the petitboot library. The waiter routines are generic enough to be used for both server and client. Does not change the waiter source. jk: move to lib/waiter/ instead of lib/ Signed-off-by: Geoff Levand Signed-off-by: Jeremy Kerr --- lib/waiter/waiter.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/waiter/waiter.h (limited to 'lib/waiter/waiter.h') diff --git a/lib/waiter/waiter.h b/lib/waiter/waiter.h new file mode 100644 index 0000000..ff8a5ff --- /dev/null +++ b/lib/waiter/waiter.h @@ -0,0 +1,23 @@ +#ifndef _WAITER_H +#define _WAITER_H + +#include + +struct waiter; + +enum events { + WAIT_IN = POLLIN, + WAIT_OUT = POLLOUT, +}; + +typedef int (*waiter_cb)(void *); + +struct waiter *waiter_register(int fd, int events, + waiter_cb callback, void *arg); + +void waiter_remove(struct waiter *waiter); + +int waiter_poll(void); +#endif /* _WAITER_H */ + + -- cgit v1.1