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

Function check_inline_props

src/cypher/cypher.c:2537–2557  ·  view source on GitHub ↗

Check inline property filters. * Values that look like regex patterns are matched with POSIX ERE; * plain values use exact strcmp. */

Source from the content-addressed store, hash-verified

2535 * Values that look like regex patterns are matched with POSIX ERE;
2536 * plain values use exact strcmp. */
2537static bool check_inline_props(const cbm_node_t *n, const cbm_prop_filter_t *props, int count,
2538 cbm_store_t *store) {
2539 for (int i = 0; i < count; i++) {
2540 const char *actual = node_prop(n, props[i].key, store);
2541 if (looks_like_regex(props[i].value)) {
2542 cbm_regex_t re;
2543 if (cbm_regcomp(&re, props[i].value, CBM_REG_EXTENDED | CBM_REG_NOSUB) == 0) {
2544 bool matched = cbm_regexec(&re, actual, 0, NULL, 0) == 0;
2545 cbm_regfree(&re);
2546 if (!matched) {
2547 return false;
2548 }
2549 } else if (strcmp(actual, props[i].value) != 0) {
2550 return false;
2551 }
2552 } else if (strcmp(actual, props[i].value) != 0) {
2553 return false;
2554 }
2555 }
2556 return true;
2557}
2558
2559/* ── Result building helpers ────────────────────────────────────── */
2560

Callers 3

scan_pattern_nodesFunction · 0.85
process_edgesFunction · 0.85
expand_var_lengthFunction · 0.85

Calls 5

node_propFunction · 0.85
looks_like_regexFunction · 0.85
cbm_regcompFunction · 0.85
cbm_regexecFunction · 0.85
cbm_regfreeFunction · 0.85

Tested by

no test coverage detected