Repository navigation
C API Integration
Joel Guerra edited this page Jun 11, 2026
·
1 revision
SnoutDB provides an experimental C ABI for embedding local analytics in native applications and languages with a C foreign-function interface.
./scripts/build-cabi.shOutputs:
- macOS:
libsnout.dylib - Linux:
libsnout.so
Public header:
include/snoutdb.h
#include "snoutdb.h"
SnoutTable *table = snout_import_csv("calls.csv");
if (table == NULL) {
fprintf(stderr, "%s\n", snout_last_error());
return 1;
}
printf("rows: %lld\n", (long long)snout_row_count(table));
snout_close(table);SnoutResult *result = snout_query(
table,
"region",
"avg=jitter_ms count=rows",
NULL,
0,
"avg=jitter_ms desc",
10
);
if (result == NULL) {
fprintf(stderr, "%s\n", snout_last_error());
}
snout_result_free(result);- Free every
SnoutTable*withsnout_close. - Free every
SnoutResult*withsnout_result_free. - Returned string pointers are temporary; copy them before the next relevant API call when they must be retained.
- Do not share one handle between threads without external synchronization.
The ABI is experimental and may change before v1.0.0.