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

Function gd_reject

tests/test_store_graph_digest.c:99–108  ·  view source on GitHub ↗

Caller closes the connection immediately after this failure helper. */

Source from the content-addressed store, hash-verified

97}
98/* Caller closes the connection immediately after this failure helper. */
99static bool gd_reject(cbm_store_t *s,cbm_store_graph_digest_status_t want) {
100 cbm_store_read_scope_t *scope=NULL; cbm_store_graph_digest_t out;
101 memset(&out,0xa5,sizeof(out));
102 int opened=cbm_store_read_scope_open(s,NULL,NULL,&scope);
103 int rc=opened==CBM_STORE_OK?cbm_store_graph_digest(scope,(const unsigned char *)"p",1,&gd_room,&out):-1;
104 bool zero=gd_zero(&out);
105 int latch=scope?cbm_store_read_scope_check(scope):0;
106 int closed=cbm_store_read_scope_close(scope);
107 return opened==CBM_STORE_OK && rc==(int)want && zero && latch==CBM_STORE_ERR && closed==CBM_STORE_ERR;
108}
109static int gd_stmt_count(sqlite3 *db) {
110 int n=0;for(sqlite3_stmt *s=sqlite3_next_stmt(db,NULL);s;s=sqlite3_next_stmt(db,s))n++;
111 return n;

Callers 1

Calls 5

cbm_store_graph_digestFunction · 0.85
gd_zeroFunction · 0.85

Tested by

no test coverage detected