2 * ion/mainloop/signal.h
4 * Copyright (c) Tuomo Valkonen 1999-2007.
6 * See the included file LICENSE for details.
9 #ifndef ION_LIBMAINLOOP_SIGNAL_H
10 #define ION_LIBMAINLOOP_SIGNAL_H
13 #include <sys/signal.h>
18 #include <libtu/obj.h>
19 #include <libtu/types.h>
20 #include <libextl/extl.h>
26 typedef void WTimerHandler(WTimer *timer, Obj *obj);
33 WTimerHandler *handler;
38 extern bool timer_init(WTimer *timer);
39 extern void timer_deinit(WTimer *timer);
41 extern WTimer *create_timer();
42 extern WTimer *create_timer_extl_owned();
44 extern void timer_set(WTimer *timer, uint msecs, WTimerHandler *handler,
46 extern void timer_set_extl(WTimer *timer, uint msecs, ExtlFn fn);
48 extern void timer_reset(WTimer *timer);
49 extern bool timer_is_set(WTimer *timer);
51 extern bool mainloop_check_signals();
52 extern void mainloop_trap_signals(const sigset_t *set);
54 extern WHook *mainloop_sigchld_hook;
55 extern WHook *mainloop_sigusr2_hook;
57 /* Returns monotonic time if possible */
58 extern int mainloop_gettime(struct timeval *val);
60 #endif /* ION_LIBMAINLOOP_SIGNAL_H */