diff options
author | June McEnroe <june@causal.agency> | 2020-07-12 14:12:53 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-07-12 14:12:53 -0400 |
commit | 858d2cd9be35a5f6c051b37bfb2a02e920a888b4 (patch) | |
tree | 001cc4d79cd13a1f73fd79c9744719303d8b0662 /events.c | |
parent | Always show later messages link when using before query (diff) | |
download | scooper-858d2cd9be35a5f6c051b37bfb2a02e920a888b4.tar.gz scooper-858d2cd9be35a5f6c051b37bfb2a02e920a888b4.zip |
Use X macro for statements
Diffstat (limited to '')
-rw-r--r-- | events.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/events.c b/events.c index 0604d21..423ce1e 100644 --- a/events.c +++ b/events.c @@ -159,13 +159,13 @@ enum kcgi_err eventsPage(struct kreq *req) { || khtml_elem(&html, KELEM_TABLE); if (error) return error; - sqlite3_reset(stmt.eventsTopic); - dbBindText(stmt.eventsTopic, ":network", scope.network); - dbBindText(stmt.eventsTopic, ":context", scope.context); - dbBindText(stmt.eventsTopic, ":time", time); - dbBindInt(stmt.eventsTopic, ":public", contextsPublic); + sqlite3_reset(stmt.topic); + dbBindText(stmt.topic, ":network", scope.network); + dbBindText(stmt.topic, ":context", scope.context); + dbBindText(stmt.topic, ":time", time); + dbBindInt(stmt.topic, ":public", contextsPublic); - int result = sqlite3_step(stmt.eventsTopic); + int result = sqlite3_step(stmt.topic); if (result == SQLITE_ROW) { error = 0 || khtml_elem(&html, KELEM_THEAD) @@ -176,10 +176,10 @@ enum kcgi_err eventsPage(struct kreq *req) { KATTR_COLSPAN, "3", KATTR__MAX ) - || khtml_puts(&html, sqlite3_column_text(stmt.eventsTopic, 0)) + || khtml_puts(&html, sqlite3_column_text(stmt.topic, 0)) || khtml_closeelem(&html, 3); if (error) return error; - result = sqlite3_step(stmt.eventsTopic); + result = sqlite3_step(stmt.topic); } if (result != SQLITE_DONE) errx(EX_SOFTWARE, "%s", sqlite3_errmsg(db)); |