]> Pileus Git - ~andy/lamechat/blobdiff - util.h
Add idle helper.
[~andy/lamechat] / util.h
diff --git a/util.h b/util.h
index dbcd31019ac660088e79161e10f78d0c7e9d265e..6310a90580e79e86b8ea73021fc4c7b19b601036 100644 (file)
--- a/util.h
+++ b/util.h
@@ -40,6 +40,12 @@ typedef struct {
        void *data;
 } poll_t;
 
+typedef struct {
+       poll_t    poll;
+       cb_t      timer;
+       void     *data;
+} idle_t;
+
 /* Debug functions */
 void util_init(void);
 
@@ -71,6 +77,10 @@ int poll_del(poll_t *poll);
 int poll_run(int timeout);
 void poll_quit(void);
 
+/* Idle functions */
+void idle_add(idle_t *idle);
+void idle_set(idle_t *idle, int first, int next);
+
 /* Debug functions */
 void debug(char *fmt, ...);
 void error(char *fmt, ...);