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

Function tir_path

src/mcp/test_impact_result_json.c:95–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95bool tir_path(tir_context *c, tir_json *object, tir_bytes file) {
96 bool utf8 = tir_utf8(c, file);
97 if (c->status != CBM_TEST_RESULT_OK)
98 return false;
99 tir_json *text = file.length && utf8 ? tir_string(c, file) : tir_null(c);
100 tir_json *hex = file.length && !utf8 ? tir_hex(c, file.data, file.length) : tir_null(c);
101 return tir_add(c, object, "file", text) && tir_add(c, object, "file_hex", hex);
102}
103
104tir_json *tir_digest(tir_context *c, cbm_test_result_digest_t digest) {
105 return digest.present ? tir_hex(c, digest.bytes, 32) : tir_null(c);

Callers 2

tir_case_jsonFunction · 0.85
tir_warnings_jsonFunction · 0.85

Calls 5

tir_utf8Function · 0.85
tir_stringFunction · 0.85
tir_nullFunction · 0.85
tir_hexFunction · 0.85
tir_addFunction · 0.85

Tested by

no test coverage detected