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

Function dm_control_source

tests/test_doc_mentions.c:580–594  ·  view source on GitHub ↗

The returned length includes the replaced marker even when byte is NUL. */

Source from the content-addressed store, hash-verified

578
579/* The returned length includes the replaced marker even when byte is NUL. */
580static int dm_control_source(char *source, size_t capacity, size_t which, unsigned byte) {
581 int n = snprintf(source, capacity,
582 "%s/// <see cref=\"global::Good.Target\"/>\n"
583 "public class Tail { }\nnamespace . { public class Hidden { } }\n",
584 dm_control_cases[which].text);
585 if (n <= 0 || (size_t)n >= capacity) {
586 return -1;
587 }
588 char *mark = strchr(source, '~');
589 if (!mark) {
590 return -1;
591 }
592 *mark = (char)byte;
593 return n;
594}
595
596static bool dm_control_write(const char *path, const char *source, size_t length) {
597 FILE *file = cbm_fopen(path, "wb");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected