Navit SVN

/work/compile/navit/src/navit/event.h

00001 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 struct event_idle;
00025 struct event_timeout;
00026 struct event_watch;
00027 struct callback;
00028 struct callback_list;
00029 struct file;
00030 
00031 enum event_watch_cond {
00032         event_watch_cond_read=1,
00033         event_watch_cond_write,
00034         event_watch_cond_except,
00035 };
00036 
00037 struct event_methods {
00038         void (*main_loop_run)(void);
00039         void (*main_loop_quit)(void);
00040         struct event_watch *(*add_watch)(void *fd, enum event_watch_cond cond, struct callback *cb);
00041         void (*remove_watch)(struct event_watch *ev);
00042         struct event_timeout *(*add_timeout)(int timeout, int multi, struct callback *cb);
00043         void (*remove_timeout)(struct event_timeout *ev);
00044         struct event_idle *(*add_idle)(int priority, struct callback *cb);
00045         void (*remove_idle)(struct event_idle *ev);
00046         void (*call_callback)(struct callback_list *cb);
00047 };
00048 
00049 
00050 /* prototypes */
00051 enum event_watch_cond;
00052 struct callback;
00053 struct callback_list;
00054 struct event_idle;
00055 struct event_timeout;
00056 struct event_watch;
00057 void event_main_loop_run(void);
00058 void event_main_loop_quit(void);
00059 int event_main_loop_has_quit(void);
00060 struct event_watch *event_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb);
00061 void event_remove_watch(struct event_watch *ev);
00062 struct event_timeout *event_add_timeout(int timeout, int multi, struct callback *cb);
00063 void event_remove_timeout(struct event_timeout *ev);
00064 struct event_idle *event_add_idle(int priority, struct callback *cb);
00065 void event_remove_idle(struct event_idle *ev);
00066 void event_call_callback(struct callback_list *cb);
00067 char const *event_system(void);
00068 int event_request_system(const char *system, const char *requestor);
00069 /* end of prototypes */
00070 #ifdef __cplusplus
00071 }
00072 #endif