diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-06-16 23:00:21 +0200 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-06-16 23:05:04 +0200 |
| commit | 00a0cb3821ce2bd0fc589ae64ed9cbb791ce44bb (patch) | |
| tree | 62eef257fb06ea36ea92e719dff750bede0bd281 /core/server.c | |
| parent | bb52acc8b7ad073068c9a2dc656d4fecf935d710 (diff) | |
Diffstat (limited to 'core/server.c')
| -rw-r--r-- | core/server.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/core/server.c b/core/server.c index 82b6da5..9a06825 100644 --- a/core/server.c +++ b/core/server.c @@ -1,3 +1,15 @@ +// index +// [section] includes +// [section] macros +// [section] structs +// [section] globals +// [section] event array render function +// [section] sql callbacks +// [section] main functions + +// ---------------------------------------------------------------------------- +// [section] includes +// ---------------------------------------------------------------------------- #include <arpa/inet.h> #include <assert.h> #include <json-c/json.h> @@ -12,14 +24,14 @@ #include "sql.c" // ---------------------------------------------------------------------------- -// Defines +// [section] macros // ---------------------------------------------------------------------------- #define BACKLOG 10 #define EVA_SIZE (sizeof(uint64_t) * MVEC_SIZE) #define MAX_HM_PIXEL_COUNT 0x400 // must equal DEFVAL_HM_PIXEL_COUNT in client.cpp // ---------------------------------------------------------------------------- -// Declarations +// [section] structs // ---------------------------------------------------------------------------- struct Socket { int fd; @@ -43,13 +55,13 @@ struct RenderContext { }; // ---------------------------------------------------------------------------- -// Globals +// [section] globals // ---------------------------------------------------------------------------- struct json_object *g_response_header; size_t g_blob_count; // ---------------------------------------------------------------------------- -// Event array render function +// [section] event array render function // ---------------------------------------------------------------------------- int eva_render(void *data) { assert(data); @@ -101,7 +113,7 @@ int eva_render(void *data) { } // ---------------------------------------------------------------------------- -// SQL callbacks +// [section] sql callbacks // ---------------------------------------------------------------------------- void sql_callback_add_column_name(sqlite3_stmt *sql_stmt, void *data) { assert(sql_stmt); @@ -168,7 +180,7 @@ void sql_callback_add_data(sqlite3_stmt *sql_stmt, void *data) { } // ---------------------------------------------------------------------------- -// Main functions +// [section] main functions // ---------------------------------------------------------------------------- void sig_handler(int signo) { (void)signo; |
