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

Function file_ext

src/store/store.c:5557–5575  ·  view source on GitHub ↗

Get lowercase file extension from path */

Source from the content-addressed store, hash-verified

5555
5556/* Get lowercase file extension from path */
5557static const char *file_ext(const char *path) {
5558 if (!path) {
5559 return NULL;
5560 }
5561 const char *dot = strrchr(path, '.');
5562 if (!dot) {
5563 return NULL;
5564 }
5565 static CBM_TLS char buf[CBM_SZ_16];
5566 int len = (int)strlen(dot);
5567 if (len >= (int)sizeof(buf)) {
5568 return NULL;
5569 }
5570 for (int i = 0; i < len; i++) {
5571 buf[i] = (char)((dot[i] >= 'A' && dot[i] <= 'Z') ? dot[i] + CBM_SZ_32 : dot[i]);
5572 }
5573 buf[len] = '\0';
5574 return buf;
5575}
5576
5577/* ── Architecture aspect implementations ───────────────────────── */
5578

Callers 1

arch_languagesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected