~aejsmith/upstart/profiles

« back to all changes in this revision

Viewing changes to init/event.h

  • Committer: Scott James Remnant
  • Date: 2007-05-18 18:54:45 UTC
  • Revision ID: scott@netsplit.com-20070518185445-ug8nuxv889p0jelh
* init/event.h (EventEmission): Rename to Event, and rename event
member to info.
* init/event.c (event_emit_next_id): Rename to event_next_id
(event_emit): Rename to event_new, and add standard parent argument.
(event_emit_find_by_id): Rename to event_find_by_id
(event_poll): Iterate over Events in the list
(event_pending, event_finished): Operate on Event
* init/tests/test_event.c (test_emit): Rename to test_new and
adjust for names and arguments.
(test_emit_find_by_id): Rename to test_find_by_id and adjust for
names.
(test_emit_finished, test_poll): Adjust names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
 
70
70
 
71
71
/**
72
 
 * EventEmission:
73
 
 * @event: event being emitted,
 
72
 * Event:
 
73
 * @entry: list header,
74
74
 * @id: unique id assigned to each emission,
 
75
 * @info: information about event,
75
76
 * @progress: progress of emission,
76
77
 * @jobs: number of jobs holding this event,
77
78
 * @failed: whether this event has failed.
84
85
 * information on the emission of a single event; including the event
85
86
 * itself.
86
87
 **/
87
 
typedef struct event_emission {
88
 
        EventInfo        event;
 
88
typedef struct event {
 
89
        NihList          entry;
89
90
        unsigned int     id;
 
91
 
 
92
        EventInfo        info;
90
93
        EventProgress    progress;
91
94
 
92
95
        int              jobs;
93
96
        int              failed;
94
 
} EventEmission;
 
97
} Event;
95
98
 
96
99
 
97
100
/**
173
176
 
174
177
NIH_BEGIN_EXTERN
175
178
 
176
 
int          paused;
177
 
unsigned int emission_id;
178
 
int          emission_id_wrapped;
179
 
NihList *events;
180
 
 
181
 
 
182
 
void           event_init            (void);
183
 
 
184
 
EventInfo *    event_info_new        (const void *parent, const char *name,
185
 
                                      char **args, char **env)
186
 
        __attribute__ ((warn_unused_result, malloc));
187
 
EventInfo *    event_info_copy       (const void *parent,
188
 
                                      const EventInfo *old_event)
189
 
        __attribute__ ((warn_unused_result, malloc));
190
 
 
191
 
int            event_match           (EventInfo *event1, EventInfo *event2);
192
 
 
193
 
EventEmission *event_emit            (const char *name,
194
 
                                      char **args, char **env)
 
179
int           paused;
 
180
unsigned int  event_id;
 
181
int           emission_id_wrapped;
 
182
NihList      *events;
 
183
 
 
184
 
 
185
void       event_init       (void);
 
186
 
 
187
EventInfo *event_info_new   (const void *parent, const char *name,
 
188
                             char **args, char **env)
 
189
        __attribute__ ((warn_unused_result, malloc));
 
190
EventInfo *event_info_copy  (const void *parent, const EventInfo *old_event)
 
191
        __attribute__ ((warn_unused_result, malloc));
 
192
 
 
193
int        event_match      (EventInfo *event1, EventInfo *event2);
 
194
 
 
195
Event     *event_new        (const void *parent, const char *name,
 
196
                             char **args, char **env)
195
197
        __attribute__ ((malloc));
196
 
EventEmission *event_emit_find_by_id (unsigned int id);
197
 
void           event_emit_finished   (EventEmission *emission);
198
 
 
199
 
void           event_poll            (void);
 
198
 
 
199
Event     *event_find_by_id (unsigned int id);
 
200
void       event_emit_finished   (Event *event);
 
201
 
 
202
void       event_poll            (void);
200
203
 
201
204
NIH_END_EXTERN
202
205