diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-17 19:55:36 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-17 19:55:36 +0200 |
| commit | 380195f7cd5e57acf2c1cf2bc41069e6b0b979ed (patch) | |
| tree | 32a88fb22a7fbe8f1fd5c105156d1f928c93950d /src/protocol.h | |
| download | bokf-380195f7cd5e57acf2c1cf2bc41069e6b0b979ed.tar.gz bokf-380195f7cd5e57acf2c1cf2bc41069e6b0b979ed.zip | |
Initial commit: daemon, clients, docs, Docker deploy pipelinev0.1.0
Diffstat (limited to 'src/protocol.h')
| -rw-r--r-- | src/protocol.h | 30 |
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 |
