| Alarmd Reference Manual | ||||
|---|---|---|---|---|
void (*TimerCallback) (gpointer user_data,gboolean delayed);void (*TimerCancel) (gpointer user_data); TimerPlugin;gboolean plugin_initialize (TimerPlugin *plugin);
void (*TimerCallback) (gpointer user_data,gboolean delayed);
Callback notify for timed events.
user_data : |
user data set when the callback was connected. |
delayed : |
TRUE if the event is happening after supposed time. |
void (*TimerCancel) (gpointer user_data);
Callback called when an event is taken off the timer.
user_data : |
user data set when the callback was connected. |
typedef struct {
/* Filled in by alarmd: */
gboolean is_startup;
/* Filled by the plugin: */
gboolean (*set_event)(TimerPlugin *plugin, time_t wanted_time, TimerCallback cb, TimerCancel cancel, gpointer user_data);
gboolean (*remove_event)(TimerPlugin *plugin);
time_t (*get_time)(TimerPlugin *plugin);
void (*time_changed)(TimerPlugin *plugin);
void (*plugin_deinit)(TimerPlugin *plugin);
guint priority;
gboolean can_power_up;
gpointer plugin_data;
} TimerPlugin;
Struct that defines the API for a timer plugin.
is_startup; |
Boolean that indicates if alarmd is starting up. |
set_event () |
Function the events should call when they put self on the timer. |
remove_event () |
Function that removes the currently timed event. |
get_time () |
Gets the time of the currently timed event. |
time_changed () |
Indicates that the system time has changed. |
plugin_deinit () |
Deinitializes the plugin. |
priority; |
Priority of the plugin. |
can_power_up; |
TRUE if the plugin can power up the device. |
plugin_data; |
Plugins internal data. |
gboolean plugin_initialize (TimerPlugin *plugin);
Function all timer plugins should implement. Fills in the struct that describes the plugin.
plugin : |
Pointer to the struct the plugin should fill. |
| Returns : | TRUE if plugin initialization was successful. |