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

Function td_field

src/discover/test_conventions.c:21–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19};
20
21static yyjson_val *td_field(yyjson_val *object, const char *name, bool *valid) {
22 if (!yyjson_is_obj(object)) {
23 *valid = false;
24 return NULL;
25 }
26 yyjson_val *found = NULL, *key, *value;
27 size_t index, maximum, len = strlen(name);
28 yyjson_obj_foreach(object, index, maximum, key, value) {
29 if (yyjson_get_len(key) == len && memcmp(yyjson_get_str(key), name, len) == 0) {
30 if (found) {
31 *valid = false;
32 return NULL;
33 }
34 found = value;
35 }
36 }
37 return found;
38}
39
40static const char *td_string(yyjson_val *value, size_t *len) {
41 const char *text = yyjson_get_str(value);

Callers 2

td_recordFunction · 0.85
td_projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected