diff options
author | June McEnroe <june@causal.agency> | 2020-07-09 20:14:27 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-07-09 20:14:27 -0400 |
commit | fb214d0c8096a345f5da30900d9ced0aa777cdc3 (patch) | |
tree | 8458f7beca535e49ed531880b32fefc194d7de8b /server.h | |
parent | Add events page stub (diff) | |
download | scooper-fb214d0c8096a345f5da30900d9ced0aa777cdc3.tar.gz scooper-fb214d0c8096a345f5da30900d9ced0aa777cdc3.zip |
Implement very basic events listing
Diffstat (limited to '')
-rw-r--r-- | server.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server.h b/server.h index 9b665d7..0e77f7c 100644 --- a/server.h +++ b/server.h @@ -37,20 +37,23 @@ extern sqlite3 *db; extern const char *NetworksQuery; extern const char *ContextsQuery; -extern const char *EventsQuery; +extern const char *EventsAfterQuery; +extern const char *EventsBeforeQuery; extern const char *SearchQuery; extern struct Statements { sqlite3_stmt *networks; sqlite3_stmt *contexts; - sqlite3_stmt *events; + sqlite3_stmt *eventsAfter; + sqlite3_stmt *eventsBefore; sqlite3_stmt *search; } stmt; static inline void dbClose(void) { if (stmt.networks) sqlite3_finalize(stmt.networks); if (stmt.contexts) sqlite3_finalize(stmt.contexts); - if (stmt.events) sqlite3_finalize(stmt.events); + if (stmt.eventsAfter) sqlite3_finalize(stmt.eventsAfter); + if (stmt.eventsBefore) sqlite3_finalize(stmt.eventsBefore); if (stmt.search) sqlite3_finalize(stmt.search); sqlite3_close(db); } @@ -92,6 +95,7 @@ extern const char *Pages[PagesLen]; X(Network, "network", kvalid_stringne) \ X(Context, "context", kvalid_stringne) \ X(After, "after", kvalid_stringne) \ + X(Before, "before", kvalid_stringne) \ X(Query, "query", kvalid_stringne) enum { @@ -104,6 +108,7 @@ enum { extern const struct kvalid Keys[KeysLen]; extern bool pagePublic; +extern int pageLimit; enum kcgi_err pageNetworks(struct kreq *req); enum kcgi_err pageContexts(struct kreq *req); |