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

Function has_strategy_with_key

tests/test_configlink.c:65–78  ·  view source on GitHub ↗

Check if any CONFIGURES edge has given strategy AND config_key. */

Source from the content-addressed store, hash-verified

63
64/* Check if any CONFIGURES edge has given strategy AND config_key. */
65static bool has_strategy_with_key(const cbm_gbuf_edge_t **edges, int count, const char *strategy,
66 const char *config_key) {
67 char strat_needle[64];
68 snprintf(strat_needle, sizeof(strat_needle), "\"strategy\":\"%s\"", strategy);
69 char key_needle[128];
70 snprintf(key_needle, sizeof(key_needle), "\"config_key\":\"%s\"", config_key);
71
72 for (int i = 0; i < count; i++) {
73 if (edges[i]->properties_json && strstr(edges[i]->properties_json, strat_needle) &&
74 strstr(edges[i]->properties_json, key_needle))
75 return true;
76 }
77 return false;
78}
79
80/* Recursive remove */
81static void rm_rf(const char *path) {

Callers 1

test_configlink.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected