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

Function sp_count

tests/test_spawns.c:250–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250static int sp_count(sp_proj_t *p, const char *sql, const char *a, const char *b) {
251 sqlite3 *db = cbm_store_get_db(p->store);
252 sqlite3_stmt *stmt = NULL;
253 if (!db || sqlite3_prepare_v2(db, sql, -1, &stmt, NULL) != SQLITE_OK) {
254 sqlite3_finalize(stmt);
255 return -1;
256 }
257 int n = sqlite3_bind_parameter_count(stmt);
258 const char *values[] = {p->project, a, b};
259 for (int i = 0; i < n && i < 3; i++) {
260 sqlite3_bind_text(stmt, i + 1, values[i], -1, SQLITE_TRANSIENT);
261 }
262 int count = sqlite3_step(stmt) == SQLITE_ROW ? sqlite3_column_int(stmt, 0) : -1;
263 sqlite3_finalize(stmt);
264 return count;
265}
266
267/* SPAWNS edges from the definition named `caller` to the Process `program`. */
268static int sp_spawns(sp_proj_t *p, const char *caller, const char *program) {

Callers 3

sp_spawnsFunction · 0.85
sp_callsFunction · 0.85
test_spawns.cFile · 0.85

Calls 1

cbm_store_get_dbFunction · 0.85

Tested by

no test coverage detected