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

Function cli_slurp_file

src/main.c:644–652  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

642
643/* Slurp a file path into a heap, NUL-terminated string. Caller frees. */
644static char *cli_slurp_file(const char *path) {
645 FILE *f = fopen(path, "rb");
646 if (!f) {
647 return NULL;
648 }
649 char *s = cli_slurp_stream(f);
650 (void)fclose(f);
651 return s;
652}
653
654/* True if the first non-whitespace byte of s is '{' (raw-JSON detection). */
655static 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