#include "debug.h"
static struct event_methods event_methods;
-static char *e_requestor;
-static char *e_system;
+static const char *e_requestor;
+static const char *e_system;
void event_main_loop_run(void)
{
void event_main_loop_quit(void)
{
- event_methods.main_loop_quit();
+ if (event_methods.main_loop_quit)
+ event_methods.main_loop_quit();
+ exit(0);
}
struct event_watch *
-event_add_watch(int fd, int w, struct callback *cb)
+event_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb)
{
- return event_methods.add_watch(fd, w, cb);
+ return event_methods.add_watch(fd, cond, cb);
}
void
}
struct event_idle *
-event_add_idle(struct callback *cb)
+event_add_idle(int priority, struct callback *cb)
{
- return event_methods.add_idle(cb);
+ return event_methods.add_idle(priority,cb);
}
void
event_methods.remove_idle(ev);
}
+void
+event_call_callback(struct callback_list *cb)
+{
+ event_methods.call_callback(cb);
+}
+
int
-event_request_system(char *system, char *requestor)
+event_request_system(const char *system, const char *requestor)
{
void (*event_type_new)(struct event_methods *meth);
if (e_system) {