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

Function resp_has_key

tests/test_incremental.c:923–932  ·  view source on GitHub ↗

Check response contains a specific key (in nested JSON) */

Source from the content-addressed store, hash-verified

921
922/* Check response contains a specific key (in nested JSON) */
923static int resp_has_key(const char *resp, const char *key) {
924 if (!resp)
925 return 0;
926 char pattern[64];
927 snprintf(pattern, sizeof(pattern), "\"%s\"", key);
928 if (strstr(resp, pattern) != NULL)
929 return 1;
930 snprintf(pattern, sizeof(pattern), "\\\"%s\\\"", key);
931 return strstr(resp, pattern) != NULL;
932}
933
934/* Check response does NOT contain a specific key */
935static int resp_lacks_key(const char *resp, const char *key) {

Callers 2

resp_lacks_keyFunction · 0.85
test_incremental.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected