2 * ion/mainloop/signal.h
4 * Copyright (c) Tuomo Valkonen 1999-2007.
6 * Ion is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
12 #ifndef ION_LIBMAINLOOP_SIGNAL_H
13 #define ION_LIBMAINLOOP_SIGNAL_H
16 #include <sys/signal.h>
21 #include <libtu/obj.h>
22 #include <libtu/types.h>
23 #include <libextl/extl.h>
29 typedef void WTimerHandler(WTimer *timer, Obj *obj);
36 WTimerHandler *handler;
41 extern bool timer_init(WTimer *timer);
42 extern void timer_deinit(WTimer *timer);
44 extern WTimer *create_timer();
45 extern WTimer *create_timer_extl_owned();
47 extern void timer_set(WTimer *timer, uint msecs, WTimerHandler *handler,
49 extern void timer_set_extl(WTimer *timer, uint msecs, ExtlFn fn);
51 extern void timer_reset(WTimer *timer);
52 extern bool timer_is_set(WTimer *timer);
54 extern bool mainloop_check_signals();
55 extern void mainloop_trap_signals(const sigset_t *set);
57 extern WHook *mainloop_sigchld_hook;
58 extern WHook *mainloop_sigusr2_hook;
60 #endif /* ION_LIBMAINLOOP_SIGNAL_H */