summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-12-18 15:17:09 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2010-12-18 15:17:09 -0500
commit3c8e408d34b54df57a700813636dd78ddc26c45b (patch)
tree3f41e8cb1cc8bb5b84384840ebdf5b296e0c1732 /include
parent4d07c227812b49e71de49b3e64ec6da1fbc30aed (diff)
Periodic tasks
Diffstat (limited to 'include')
-rw-r--r--include/types.h7
-rw-r--r--include/urweb.h2
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