diff options
author | Adam Chlipala <adam@chlipala.net> | 2010-12-18 15:17:09 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2010-12-18 15:17:09 -0500 |
commit | 3c8e408d34b54df57a700813636dd78ddc26c45b (patch) | |
tree | 3f41e8cb1cc8bb5b84384840ebdf5b296e0c1732 /include | |
parent | 4d07c227812b49e71de49b3e64ec6da1fbc30aed (diff) |
Periodic tasks
Diffstat (limited to 'include')
-rw-r--r-- | include/types.h | 7 | ||||
-rw-r--r-- | include/urweb.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/types.h b/include/types.h index 2adda753..01776213 100644 --- a/include/types.h +++ b/include/types.h @@ -59,6 +59,11 @@ typedef void (*uw_callback_with_retry)(void *, int will_retry); 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 @@ typedef struct { int (*check_mime)(const char *); void (*on_error)(uw_context, char *); + + uw_periodic *periodics; // 0-terminated array } uw_app; #define ERROR_BUF_LEN 1024 diff --git a/include/urweb.h b/include/urweb.h index a0decd11..9314d089 100644 --- a/include/urweb.h +++ b/include/urweb.h @@ -293,4 +293,6 @@ uw_Basis_int uw_Basis_rand(uw_context); extern int uw_time_max, uw_supports_direct_status, uw_min_heap; +failure_kind uw_runCallback(uw_context, void (*callback)(uw_context)); + #endif |