Add:core:Further works on event system abstraction
[navit-package] / navit / event.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19
20 struct event_idle;
21 struct event_timeout;
22 struct event_watch;
23 struct callback;
24
25 struct event_methods {
26         void (*main_loop_run)(void);
27         void (*main_loop_quit)(void);
28         struct event_watch *(*add_watch)(int fd, int w, struct callback *cb);
29         void (*remove_watch)(struct event_watch *ev);
30         struct event_timeout *(*add_timeout)(int timeout, int multi, struct callback *cb);
31         void (*remove_timeout)(struct event_timeout *ev);
32         struct event_idle *(*add_idle)(struct callback *cb);
33         void (*remove_idle)(struct event_idle *ev);
34 };
35
36 /* prototypes */
37 void event_main_loop_run(void);
38 void event_main_loop_quit(void);
39 struct event_watch *event_add_watch(int fd, int w, struct callback *cb);
40 void event_remove_watch(struct event_watch *ev);
41 struct event_timeout *event_add_timeout(int timeout, int multi, struct callback *cb);
42 void event_remove_timeout(struct event_timeout *ev);
43 struct event_idle *event_add_idle(struct callback *cb);
44 void event_remove_idle(struct event_idle *ev);
45 int event_request_system(char *system, char *requestor);
46 /* end of prototypes */