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

Function file_ext

src/store/store.c:5650–5668  ·  view source on GitHub ↗

Get lowercase file extension from path */

Source from the content-addressed store, hash-verified

5648
5649/* Get lowercase file extension from path */
5650static const char *file_ext(const char *path) {
5651 if (!path) {
5652 return NULL;
5653 }
5654 const char *dot = strrchr(path, '.');
5655 if (!dot) {
5656 return NULL;
5657 }
5658 static CBM_TLS char buf[CBM_SZ_16];
5659 int len = (int)strlen(dot);
5660 if (len >= (int)sizeof(buf)) {
5661 return NULL;
5662 }
5663 for (int i = 0; i < len; i++) {
5664 buf[i] = (char)((dot[i] >= 'A' && dot[i] <= 'Z') ? dot[i] + CBM_SZ_32 : dot[i]);
5665 }
5666 buf[len] = '\0';
5667 return buf;
5668}
5669
5670/* ── Architecture aspect implementations ───────────────────────── */
5671

Callers 1

arch_languagesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected