MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / sqlite_camel_split

Function sqlite_camel_split

src/store/store.c:806–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806static void sqlite_camel_split(sqlite3_context *ctx, int argc, sqlite3_value **argv) {
807 (void)argc;
808 const char *input = (const char *)sqlite3_value_text(argv[0]);
809 if (!input || !input[0]) {
810 sqlite3_result_text(ctx, input ? input : "", SQLITE_AUTO_LEN, CBM_SQLITE_TRANSIENT);
811 return;
812 }
813 char buf[CAMEL_SPLIT_BUF];
814 int len = snprintf(buf, sizeof(buf), "%s ", input);
815 if (len < 0 || len >= (int)sizeof(buf)) {
816 /* Input too long — fall back to the original string unmodified. */
817 sqlite3_result_text(ctx, input, SQLITE_AUTO_LEN, CBM_SQLITE_TRANSIENT);
818 return;
819 }
820 for (int i = 0; input[i] && len < (int)sizeof(buf) - CAMEL_BUF_GUARD; i++) {
821 if (camel_should_split(input, i)) {
822 buf[len++] = ' ';
823 }
824 buf[len++] = input[i];
825 }
826 buf[len] = '\0';
827 sqlite3_result_text(ctx, buf, len, CBM_SQLITE_TRANSIENT);
828}
829
830/* ── REGEXP function for SQLite ──────────────────────────────────── */
831

Callers

nothing calls this directly

Calls 1

camel_should_splitFunction · 0.85

Tested by

no test coverage detected