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

Function http_append_json_escaped

src/ui/http_server.c:1787–1796  ·  view source on GitHub ↗

Append src JSON-escaped, under http_appendf's clamp contract: once *pos has * reached bufsz nothing more is written. */

Source from the content-addressed store, hash-verified

1785/* Append src JSON-escaped, under http_appendf's clamp contract: once *pos has
1786 * reached bufsz nothing more is written. */
1787static void http_append_json_escaped(char *buf, size_t bufsz, int *pos, const char *src) {
1788 if (*pos < 0) {
1789 return;
1790 }
1791 if ((size_t)*pos >= bufsz) {
1792 *pos = (int)bufsz;
1793 return;
1794 }
1795 *pos += cbm_json_escape(buf + *pos, (int)(bufsz - (size_t)*pos), src);
1796}
1797
1798/* GET /api/index-status — returns status of all index jobs */
1799static void handle_index_status(cbm_http_server_t *server, cbm_http_conn_t *c) {

Callers 1

handle_index_statusFunction · 0.85

Calls 1

cbm_json_escapeFunction · 0.85

Tested by

no test coverage detected