2 Chapter 25. Amanda Event API
3 Prev Part V. Technical Background Next
5 -------------------------------------------------------------------------------
7 Chapter 25. Amanda Event API
18 XML-conversion;Updates
69 Refer to http://www.amanda.org/docs/eventapi.html for the current version of
74 This is a document of the API for the event handler. The purpose of the event
75 handler is to allow scheduling and serialization of multiple different types of
83 event_handle_t *event_register(event_id_t data, event_type_t type, event_fn_t
85 Sets up an event of the given type to call the given function with the given
87 The 'data' argument is type specific.
88 EV_READFD, EV_WRITEFD - the file descriptor to monitor EV_SIG - the signal
89 number to monitor EV_TIME - the number of seconds between each pulse EV_WAIT -
90 the wait identifier used with event_wakeup() EV_DEAD - internal use only
94 void event_release(event_handle_t *handle);
95 Remove an event from the queue. This can happen at any time, even while the
100 void event_loop(int dontblock);
101 Process all pending events. If the argument is zero, this will keep running
102 until all events have been released. If the argument is nonzero, this will do
103 one pass over all pending events, and fire the ones that are immediately ready,
108 void event_wait(event_id_t id);
109 Like event_loop(0), except that it will stop as soon as the event id is
114 int event_wakeup(event_id_t id);
115 Fire all EV_WAIT events registered with an argument value of 'id' immediately.
116 Returns the number of events that were fired.
123 This is an opaque structure that describes a registered event. It is only
124 useful to keep if you need to unregister the event later.
128 This is type-specific data. The contents and format depend on on the type of
129 the event. This is an unsigned integral type.
133 This is an enumerated type describing the different events we handle.
137 typedef void (*event_fn_t)(void *arg);
138 This is a function signature for the type of function that needs to get passed
139 to event_register. The argument to the function is a pointer of the caller's
147 This type of event will fire when the file descriptor passed to event_register
148 has data waiting to be read.
152 This type of event will fire when the file descriptor passed to event_register
153 can have data written to it without blocking.
157 This type of event will fire when the signal number passed to event_register
158 has been caught. Note that if a signal is caught while processing is not in
159 event_loop(), the event will be delayed until processing returns to event_loop
164 This type of event will fire repeatedly with a delay of the number of seconds
165 passed to event_register between each interval.
169 This type of event will fire when someone calls event_wakeup() with the numeric
170 argument equal to the argument this event was registered with.
171 -------------------------------------------------------------------------------
174 Chapter 24. Amanda Internals Home Chapter 26. Amanda Security API