about summary refs log tree commit diff
path: root/server.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server.h11
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);