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

Function item

tests/test_runtime_settings.c:53–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 cbm_rmdir(fixture->path);
52}
53static yyjson_val *item(yyjson_doc *document, const char *key) {
54 yyjson_val *items = yyjson_obj_get(yyjson_doc_get_root(document), "settings");
55 size_t index, max;
56 yyjson_val *value;
57 yyjson_arr_foreach(items, index, max,
58 value) if (strcmp(yyjson_get_str(yyjson_obj_get(value, "key")), key) ==
59 0) return value;
60 return NULL;
61}
62static yyjson_doc *read_snapshot(const char *path) {
63 char *json = cbm_runtime_settings_get_json(path);
64 yyjson_doc *document = json ? yyjson_read(json, strlen(json), 0) : NULL;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected