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

Function pc_role

tests/test_pipeline_conventions.c:148–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147static bool pc_text(const char *a, const char *b) { return a && b && strcmp(a, b) == 0; }
148static bool pc_role(const cbm_node_t *n, const char *role) {
149 if (!n || !n->properties_json) return false;
150 yyjson_doc *doc = yyjson_read(n->properties_json, strlen(n->properties_json), 0);
151 yyjson_val *root = doc ? yyjson_doc_get_root(doc) : NULL;
152 yyjson_val *value = yyjson_is_obj(root) ? yyjson_obj_get(root, "test_role") : NULL;
153 bool ok = yyjson_is_obj(root) && (role ? yyjson_is_str(value) &&
154 pc_text(yyjson_get_str(value), role) : value == NULL);
155 yyjson_doc_free(doc);
156 return ok;
157}
158static bool pc_node(cbm_store_t *s, const char *qn, const char *name, const char *file,
159 const char *role, cbm_node_t *out) {
160 memset(out, 0, sizeof(*out));

Callers 3

pc_nodeFunction · 0.85
pc_no_rolesFunction · 0.85

Calls 1

pc_textFunction · 0.85

Tested by

no test coverage detected