~ubuntu-branches/debian/sid/upstart/sid

« back to all changes in this revision

Viewing changes to nih/signal.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2006-12-13 17:27:37 UTC
  • mfrom: (1.1.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20061213172737-i8969k38jl3b8ruu
Tags: 0.3.1-1
* New upstream release:
  - start, stop and status are now symlinks to initctl, not to a
    different, separate utility.
  - initctl completely rewritten to behave properly.
  - some upstart-specific options to shutdown and reboot dropped, as
    these are considered SysV-compat tools.
  - "console none" fixed.  LP: #70782.
  - improved documentation.  LP: #68805.

* shutdown and reboot moved to upstart-compat-sysv.

* Replace the /usr/share/doc/* directory in upstart-logd,
  upstart-compat-sysv, system-services and startup-tasks with a symlink to
  /usr/share/doc/upstart.  This was actually done in a previous package,
  but the migration missed.  LP: #70895.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
 
29
29
/**
30
 
 * NihSignalCb:
31
 
 * @data: pointer given with callback,
 
30
 * NihSignalHandler:
 
31
 * @data: pointer given with handler,
32
32
 * @signal: signal watch structure.
33
33
 *
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.
37
37
 **/
38
38
typedef struct nih_signal NihSignal;
39
 
typedef void (*NihSignalCb) (void *, NihSignal *);
 
39
typedef void (*NihSignalHandler) (void *, NihSignal *);
40
40
 
41
41
/**
42
42
 * 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.
47
47
 *
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.
52
52
 *
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.
55
55
 **/
56
56
struct nih_signal {
57
 
        NihList      entry;
58
 
        int          signum;
 
57
        NihList           entry;
 
58
        int               signum;
59
59
 
60
 
        NihSignalCb  callback;
61
 
        void        *data;
 
60
        NihSignalHandler  handler;
 
61
        void             *data;
62
62
};
63
63
 
64
64
 
65
65
NIH_BEGIN_EXTERN
66
66
 
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);
71
 
 
72
 
NihSignal *nih_signal_add_callback (void *parent, int signum,
73
 
                                    NihSignalCb callback, void *data);
74
 
 
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);
 
71
 
 
72
NihSignal *nih_signal_add_handler (const void *parent, int signum,
 
73
                                   NihSignalHandler handler, void *data);
 
74
 
 
75
void       nih_signal_handler     (int signum);
 
76
void       nih_signal_poll        (void);
77
77
 
78
78
NIH_END_EXTERN
79
79