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

Function cli_slurp_file

src/main.c:814–822  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

812
813/* Slurp a file path into a heap, NUL-terminated string. Caller frees. */
814static char *cli_slurp_file(const char *path) {
815 FILE *f = fopen(path, "rb");
816 if (!f) {
817 return NULL;
818 }
819 char *s = cli_slurp_stream(f);
820 (void)fclose(f);
821 return s;
822}
823
824/* True if the first non-whitespace byte of s is '{' (raw-JSON detection). */
825static bool cli_first_nonspace_is_brace(const char *s) {

Callers 1

run_cliFunction · 0.85

Calls 2

fopenFunction · 0.85
cli_slurp_streamFunction · 0.85

Tested by

no test coverage detected