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

Function yaml_splice

src/cli/config_yaml_edit.c:1819–1827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1817}
1818
1819static int yaml_splice(yaml_buf_t *out, const yaml_doc_t *doc, size_t start, size_t end,
1820 const char *replacement, size_t replacement_len) {
1821 if (start > end || end > doc->len || yaml_buf_append(out, doc->data, start) != 0 ||
1822 yaml_buf_append(out, replacement, replacement_len) != 0 ||
1823 yaml_buf_append(out, doc->data + end, doc->len - end) != 0) {
1824 return YAML_ERROR;
1825 }
1826 return 0;
1827}
1828
1829static int yaml_append_separator_if_needed(yaml_buf_t *buf, const yaml_doc_t *doc, size_t offset) {
1830 if (offset > 0U && doc->data[offset - YAML_UNIT] != '\n') {

Calls 1

yaml_buf_appendFunction · 0.85

Tested by

no test coverage detected