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

Function meta_contains

tests/test_artifact.c:738–750  ·  view source on GitHub ↗

True iff /.codebase-memory/artifact.json contains substr. */

Source from the content-addressed store, hash-verified

736
737/* True iff <repo>/.codebase-memory/artifact.json contains substr. */
738static bool meta_contains(const char *repo, const char *substr) {
739 char path[1024];
740 snprintf(path, sizeof(path), "%s/.codebase-memory/artifact.json", repo);
741 FILE *fp = fopen(path, "r");
742 if (!fp) {
743 return false;
744 }
745 char buf[4096];
746 size_t n = fread(buf, 1, sizeof(buf) - 1, fp);
747 fclose(fp);
748 buf[n] = '\0';
749 return strstr(buf, substr) != NULL;
750}
751
752static int64_t row_mtime(cbm_file_hash_t *rows, int n, const char *rel) {
753 for (int i = 0; i < n; i++) {

Callers 2

test_artifact.cFile · 0.85

Calls 2

fopenFunction · 0.85
freadFunction · 0.85

Tested by

no test coverage detected