Fix:maptool:Another name for faroe islands
[navit-package] / navit / event.c
index 456d1c3..99658e4 100644 (file)
@@ -24,8 +24,8 @@
 #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)
 {
@@ -38,13 +38,15 @@ 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
@@ -66,9 +68,9 @@ event_remove_timeout(struct event_timeout *ev)
 }
 
 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
@@ -77,8 +79,14 @@ event_remove_idle(struct event_idle *ev)
        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) {