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

Function ss_file_open

tests/test_store_scope.c:70–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 cbm_node_free_fields(&row); return ok;
69}
70static bool ss_file_open(ss_file_t *f) {
71 memset(f,0,sizeof(*f)); const char *dir=th_mktempdir("cbm-store-scope");
72 if (!dir || strlen(dir)>=sizeof(f->dir)) return false;
73 memcpy(f->dir,dir,strlen(dir)+1);
74 int n=snprintf(f->path,sizeof(f->path),"%s/graph.db",dir);
75 if (n<=0 || (size_t)n>=sizeof(f->path)) return false;
76 f->writer=cbm_store_open_path(f->path);
77 if (!ss_seed(f->writer,&f->ids) || !ss_text(f->writer,"PRAGMA journal_mode","wal")) return false;
78 f->reader=cbm_store_open_path_query(f->path);
79 return f->reader && ss_line(f->reader,f->ids.root,11);
80}
81static bool ss_file_close(ss_file_t *f) {
82 cbm_store_close(f->reader); cbm_store_close(f->writer); f->reader=f->writer=NULL;
83 return !f->dir[0] || th_rmtree(f->dir)==0;

Callers 1

test_store_scope.cFile · 0.85

Calls 6

th_mktempdirFunction · 0.85
cbm_store_open_pathFunction · 0.85
ss_seedFunction · 0.85
ss_textFunction · 0.85
ss_lineFunction · 0.85

Tested by

no test coverage detected