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

Function dk_json_add

src/pipeline/pass_docker.c:1305–1318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1303} dk_json_list_t;
1304
1305static void dk_json_add(dk_t *d, dk_json_list_t *l, const char *item) {
1306 if (!item || !l->json || cbm_ht_get(l->seen, item)) {
1307 return;
1308 }
1309 cbm_ht_set(l->seen, item, (void *)item);
1310 size_t cap = strlen(item) * PAIR_LEN + PAIR_LEN;
1311 char *esc = cbm_arena_alloc(d->a, cap);
1312 if (!esc) {
1313 l->json = NULL;
1314 return;
1315 }
1316 cbm_json_escape(esc, (int)cap, item);
1317 l->json = cbm_arena_sprintf(d->a, "%s%s\"%s\"", l->json, l->json[SKIP_ONE] ? "," : "", esc);
1318}
1319
1320static void dk_file_add(dk_t *d, const char *src, void *ud) {
1321 dk_json_list_t *l = ud;

Callers 2

dk_file_addFunction · 0.85
dk_ignore_addFunction · 0.85

Calls 5

cbm_ht_getFunction · 0.85
cbm_ht_setFunction · 0.85
cbm_json_escapeFunction · 0.85
cbm_arena_allocFunction · 0.50
cbm_arena_sprintfFunction · 0.50

Tested by

no test coverage detected