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

Function text_matches_candidate

src/cli/config_text_edit.c:1213–1223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211}
1212
1213static int text_matches_candidate(const char *data, size_t data_len, const char *candidate,
1214 bool *matches) {
1215 size_t candidate_len = 0U;
1216 if (!matches || text_bounded_strlen(candidate, TEXT_MAX_BYTES, &candidate_len) != TEXT_OK ||
1217 text_validate_bytes(candidate, candidate_len, 1) != TEXT_OK) {
1218 return TEXT_ERROR;
1219 }
1220 *matches =
1221 data_len == candidate_len && (data_len == 0U || memcmp(data, candidate, data_len) == 0);
1222 return TEXT_OK;
1223}
1224
1225/* Read-only classification: WOULD a migrate of this document succeed?
1226 * Returns TEXT_OK when the path is absent or already byte-identical to the

Calls 2

text_bounded_strlenFunction · 0.85
text_validate_bytesFunction · 0.85

Tested by

no test coverage detected