31
* @data: pointer given with callback,
31
* @data: pointer given with handler,
32
32
* @signal: signal watch structure.
34
* The signal callback is called whenever the signal has been raised, it
35
* is passed the #NihSignal structure rather than the actual signal so that
34
* A signal handler is called whenever the signal has been raised, it
35
* is passed the NihSignal structure rather than the actual signal so that
36
36
* it can be removed if desired.
38
38
typedef struct nih_signal NihSignal;
39
typedef void (*NihSignalCb) (void *, NihSignal *);
39
typedef void (*NihSignalHandler) (void *, NihSignal *);
43
43
* @entry: list header,
44
44
* @signum: signal to catch,
45
* @callback: function called when caught,
46
* @data: pointer passed to callback.
45
* @handler: function called when caught,
46
* @data: pointer passed to @handler.
48
48
* This structure contains information about a function that should be
49
49
* called whenever a particular signal is raised. The calling is done
50
50
* inside the main loop rather than inside the signal handler, so the
51
51
* function is free to do whatever it wishes.
53
* The callback can be removed by using #nih_list_remove as they are
53
* The callback can be removed by using nih_list_remove() as they are
54
54
* held in a list internally.
56
56
struct nih_signal {
60
NihSignalHandler handler;
67
int nih_signal_set_handler (int signum, void (*handler)(int));
68
int nih_signal_set_default (int signum);
69
int nih_signal_set_ignore (int signum);
70
void nih_signal_reset (void);
72
NihSignal *nih_signal_add_callback (void *parent, int signum,
73
NihSignalCb callback, void *data);
75
void nih_signal_handler (int signum);
76
void nih_signal_poll (void);
67
int nih_signal_set_handler (int signum, void (*handler)(int));
68
int nih_signal_set_default (int signum);
69
int nih_signal_set_ignore (int signum);
70
void nih_signal_reset (void);
72
NihSignal *nih_signal_add_handler (const void *parent, int signum,
73
NihSignalHandler handler, void *data);
75
void nih_signal_handler (int signum);
76
void nih_signal_poll (void);