diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-04-05 14:03:53 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-04-05 14:03:53 +0000 | 
| commit | 8fa8629fa44075dfa41b1bff96a7951dd40cfb0a (patch) | |
| tree | 1d7ef94b106dd33c796af7e80929d073b8ecbd05 /common/glib-ectomy.h | |
| parent | 737b2a1a36c13e575d3cfb21f7e42553407cb6d2 (diff) | |
added timeout new function
Diffstat (limited to 'common/glib-ectomy.h')
| -rw-r--r-- | common/glib-ectomy.h | 27 | 
1 files changed, 26 insertions, 1 deletions
| diff --git a/common/glib-ectomy.h b/common/glib-ectomy.h index e921b40d..56dac08b 100644 --- a/common/glib-ectomy.h +++ b/common/glib-ectomy.h @@ -28,16 +28,36 @@ typedef ssize_t	gssize;  #define SSIZE_MAX	INT_MAX  #endif +#define MIN_TIMEOUT(a, b)  (((a) < (b)) ? (a) : (b)) +  typedef struct _GIOChannel {  	int fd;  } GIOChannel; +typedef int (timeout_func_t)(void *data); + +typedef struct { +	glong tv_sec; +	glong tv_usec; +} time_val_t; + +struct timeout { +	guint id; +	guint interval; +	time_val_t expiration; +	void *data; +	timeout_func_t *func; +}; +  typedef struct _GMainContext { -	int dummy; +	guint next_id; +	glong timeout; +	struct slist *ltimeout;  } GMainContext;  typedef struct _GMainLoop {  	int bail; +	GMainContext *context;  } GMainLoop;  typedef enum { @@ -89,9 +109,14 @@ void g_io_remove_watch(guint id);  GMainLoop *g_main_loop_new(GMainContext *context, gboolean is_running);  void g_main_loop_run(GMainLoop *loop);  void g_main_loop_quit(GMainLoop *loop); +void g_main_loop_unref(GMainLoop *loop); +guint g_timeout_add(guint interval, timeout_func_t *func, void *data); +gint g_timeout_remove(const guint id); +  #define g_main_new(is_running)	g_main_loop_new(NULL, is_running);  #define g_main_run(loop)	g_main_loop_run(loop)  #define g_main_quit(loop)	g_main_loop_quit(loop) +#define g_main_unref(loop)	g_main_loop_unref(loop)  #endif /* __GLIB_ECTOMY_H */ | 
