summaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-17 19:55:36 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-17 19:55:36 +0200
commit380195f7cd5e57acf2c1cf2bc41069e6b0b979ed (patch)
tree32a88fb22a7fbe8f1fd5c105156d1f928c93950d /src/protocol.h
downloadbokf-a154c5d9585d54ebdaae7234e65bbf120121698d.tar.gz
bokf-a154c5d9585d54ebdaae7234e65bbf120121698d.zip
Initial commit: daemon, clients, docs, Docker deploy pipelinev0.1.0
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/protocol.h b/src/protocol.h
new file mode 100644
index 0000000..de7cb3a
--- /dev/null
+++ b/src/protocol.h
@@ -0,0 +1,30 @@
+#ifndef BOKF_PROTOCOL_H
+#define BOKF_PROTOCOL_H
+
+#include <sqlite3.h>
+#include <stdint.h>
+
+#include "sessions.h"
+#include "yyjson.h"
+
+struct req {
+ sqlite3 *db;
+ yyjson_mut_doc *rdoc;
+ const char *id;
+ const char *cmd;
+ struct session *sess;
+ int64_t org_id;
+ int has_org;
+ int is_admin;
+ const char *role;
+ int dry_run;
+ yyjson_val *args;
+ const char *err_code;
+ char err_msg[512];
+ yyjson_mut_val *err_details;
+};
+
+/* Returns a malloc'd response line (no trailing newline). */
+char *protocol_handle_line(sqlite3 *db, const char *line, size_t len);
+
+#endif