aboutsummaryrefslogtreecommitdiff
path: root/core/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/server.c')
-rw-r--r--core/server.c24
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;