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

Function cli_slurp_file

src/main.c:315–323  ·  view source on GitHub ↗

Slurp a file path into a heap, NUL-terminated string. Caller frees. */

Source from the content-addressed store, hash-verified

313
314/* Slurp a file path into a heap, NUL-terminated string. Caller frees. */
315static char *cli_slurp_file(const char *path) {
316 FILE *f = fopen(path, "rb");
317 if (!f) {
318 return NULL;
319 }
320 char *s = cli_slurp_stream(f);
321 (void)fclose(f);
322 return s;
323}
324
325/* True if the first non-whitespace byte of s is '{' (raw-JSON detection). */
326static bool cli_first_nonspace_is_brace(const char *s) {

Callers 1

run_cliFunction · 0.85

Calls 1

cli_slurp_streamFunction · 0.85

Tested by

no test coverage detected