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

Function check_inline_props

src/cypher/cypher.c:2761–2781  ·  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

2759 * Values that look like regex patterns are matched with POSIX ERE;
2760 * plain values use exact strcmp. */
2761static bool check_inline_props(const cbm_node_t *n, const cbm_prop_filter_t *props, int count,
2762 cbm_store_t *store) {
2763 for (int i = 0; i < count; i++) {
2764 const char *actual = node_prop(n, props[i].key, store);
2765 if (looks_like_regex(props[i].value)) {
2766 cbm_regex_t re;
2767 if (cbm_regcomp(&re, props[i].value, CBM_REG_EXTENDED | CBM_REG_NOSUB) == 0) {
2768 bool matched = cbm_regexec(&re, actual, 0, NULL, 0) == 0;
2769 cbm_regfree(&re);
2770 if (!matched) {
2771 return false;
2772 }
2773 } else if (strcmp(actual, props[i].value) != 0) {
2774 return false;
2775 }
2776 } else if (strcmp(actual, props[i].value) != 0) {
2777 return false;
2778 }
2779 }
2780 return true;
2781}
2782
2783/* ── Result building helpers ────────────────────────────────────── */
2784

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