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

Function tir_write

src/mcp/test_impact_result_json.c:119–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117} tir_writer;
118
119static bool tir_write(tir_writer *w, const void *bytes, size_t count) {
120 if (count > w->limit - w->used)
121 return tir_fail(w->context, CBM_TEST_RESULT_LIMIT);
122 const unsigned char *source = bytes;
123 for (size_t pos = 0; pos < count;) {
124 size_t step = count - pos < 4096 ? count - pos : 4096;
125 if (!tir_step(w->context, step, 0))
126 return false;
127 if (w->bytes)
128 memcpy(w->bytes + w->used + pos, source + pos, step);
129 pos += step;
130 }
131 w->used += count;
132 return true;
133}
134
135static bool tir_write_literal(tir_writer *w, const char *s) {
136 tir_bytes b = tir_literal(s);

Callers 4

tir_write_literalFunction · 0.85
tir_write_stringFunction · 0.85
tir_write_numberFunction · 0.85
tir_write_childrenFunction · 0.85

Calls 2

tir_failFunction · 0.85
tir_stepFunction · 0.85

Tested by

no test coverage detected