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

Function progress_tool_name

src/cli/progress_sink.c:118–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118static void progress_tool_name(const char *tool_name, char out[CBM_SZ_64]) {
119 size_t offset = 0;
120 if (tool_name) {
121 for (; tool_name[offset] && offset + 1 < CBM_SZ_64; offset++) {
122 unsigned char ch = (unsigned char)tool_name[offset];
123 bool safe = (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||
124 (ch >= '0' && ch <= '9') || ch == '_' || ch == '-';
125 if (!safe) {
126 offset = 0;
127 break;
128 }
129 out[offset] = (char)ch;
130 }
131 }
132 if (offset == 0) {
133 (void)snprintf(out, CBM_SZ_64, "%s", "tool");
134 } else {
135 out[offset] = '\0';
136 }
137}
138
139void cbm_cli_progress_start(FILE *out, const char *tool_name) {
140 FILE *stream = out ? out : stderr;

Callers 2

cbm_cli_progress_startFunction · 0.85
cbm_cli_progress_finishFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected