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

Function file_ext

src/store/store.c:3626–3644  ·  view source on GitHub ↗

Get lowercase file extension from path */

Source from the content-addressed store, hash-verified

3624
3625/* Get lowercase file extension from path */
3626static const char *file_ext(const char *path) {
3627 if (!path) {
3628 return NULL;
3629 }
3630 const char *dot = strrchr(path, '.');
3631 if (!dot) {
3632 return NULL;
3633 }
3634 static CBM_TLS char buf[CBM_SZ_16];
3635 int len = (int)strlen(dot);
3636 if (len >= (int)sizeof(buf)) {
3637 return NULL;
3638 }
3639 for (int i = 0; i < len; i++) {
3640 buf[i] = (char)((dot[i] >= 'A' && dot[i] <= 'Z') ? dot[i] + CBM_SZ_32 : dot[i]);
3641 }
3642 buf[len] = '\0';
3643 return buf;
3644}
3645
3646/* ── Architecture aspect implementations ───────────────────────── */
3647

Callers 1

arch_languagesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected