diff include/types.h @ 1349:87156c44824f

Periodic tasks
author Adam Chlipala <adam@chlipala.net>
date Sat, 18 Dec 2010 15:17:09 -0500
parents b106ca8200b1
children b02cb9da5686
line wrap: on
line diff
--- a/include/types.h	Sat Dec 18 14:17:45 2010 -0500
+++ b/include/types.h	Sat Dec 18 15:17:09 2010 -0500
@@ -59,6 +59,11 @@
 typedef void (*uw_logger)(void*, const char *fmt, ...);
 
 typedef struct {
+  void (*callback)(uw_context);
+  unsigned int period;
+} uw_periodic;
+
+typedef struct {
   int inputs_len, timeout;
   char *url_prefix;
 
@@ -80,6 +85,8 @@
   int (*check_mime)(const char *);
 
   void (*on_error)(uw_context, char *);
+
+  uw_periodic *periodics; // 0-terminated array
 } uw_app;
 
 #define ERROR_BUF_LEN 1024