struct uloop_fd;
struct uloop_timeout;
struct uloop_process;
+struct uloop_interval;
typedef void (*uloop_fd_handler)(struct uloop_fd *u, unsigned int events);
typedef void (*uloop_timeout_handler)(struct uloop_timeout *t);
typedef void (*uloop_process_handler)(struct uloop_process *c, int ret);
+typedef void (*uloop_interval_handler)(struct uloop_interval *t);
#define ULOOP_READ (1 << 0)
#define ULOOP_WRITE (1 << 1)
pid_t pid;
};
+struct uloop_interval
+{
+ uloop_interval_handler cb;
+ uint64_t expirations;
+
+ union {
+ struct uloop_fd ufd;
+ struct {
+ int64_t fired;
+ unsigned int msecs;
+ } time;
+ } private;
+};
+
extern bool uloop_cancelled;
extern bool uloop_handle_sigchld;
extern uloop_fd_handler uloop_fd_set_cb;
int uloop_process_add(struct uloop_process *p);
int uloop_process_delete(struct uloop_process *p);
+int uloop_interval_set(struct uloop_interval *timer, unsigned int msecs);
+int uloop_interval_cancel(struct uloop_interval *timer);
+int64_t uloop_interval_remaining(struct uloop_interval *timer);
+
bool uloop_cancelling(void);
static inline void uloop_end(void)