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 27 28 29 30 31 32 33
|
/*
* ion/mainloop/select.h
*
* Based on a contributed readfds code.
*
* See the included file LICENSE for details.
*/
#ifndef ION_LIBMAINLOOP_SELECT_H
#define ION_LIBMAINLOOP_SELECT_H
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <libtu/obj.h>
#include <libtu/types.h>
INTRSTRUCT(WInputFd);
DECLSTRUCT(WInputFd){
int fd;
void *data;
void (*process_input_fn)(int fd, void *data);
WInputFd *next, *prev;
};
extern bool mainloop_register_input_fd(int fd, void *data,
void (*callback)(int fd, void *data));
extern void mainloop_unregister_input_fd(int fd);
extern void mainloop_select();
#endif /* ION_LIBMAINLOOP_SELECT_H */
|