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

Function append_roots_json

src/ui/http_server.c:647–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645#include <dirent.h>
646
647static void append_roots_json(char *buf, size_t bufsz, int *pos) {
648 http_appendf(buf, bufsz, pos, ",\"roots\":[");
649#ifdef _WIN32
650 DWORD drives = GetLogicalDrives();
651 int count = 0;
652 for (int i = 0; i < 26; i++) {
653 if (!(drives & (1u << i))) {
654 continue;
655 }
656 if (count++ > 0) {
657 buf[(*pos)++] = ',';
658 }
659 http_appendf(buf, bufsz, pos, "\"%c:/\"", 'A' + i);
660 }
661#else
662 http_appendf(buf, bufsz, pos, "\"/\"");
663#endif
664 http_appendf(buf, bufsz, pos, "]");
665}
666
667/* GET /api/browse?path=/some/dir — list subdirectories for file picker */
668static void handle_browse(cbm_http_conn_t *c, const cbm_http_req_t *req) {

Callers 1

handle_browseFunction · 0.85

Calls 1

http_appendfFunction · 0.85

Tested by

no test coverage detected