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

Function file_ext

src/store/store.c:8827–8845  ·  view source on GitHub ↗

Get lowercase file extension from path */

Source from the content-addressed store, hash-verified

8825
8826/* Get lowercase file extension from path */
8827static const char *file_ext(const char *path) {
8828 if (!path) {
8829 return NULL;
8830 }
8831 const char *dot = strrchr(path, '.');
8832 if (!dot) {
8833 return NULL;
8834 }
8835 static CBM_TLS char buf[CBM_SZ_16];
8836 int len = (int)strlen(dot);
8837 if (len >= (int)sizeof(buf)) {
8838 return NULL;
8839 }
8840 for (int i = 0; i < len; i++) {
8841 buf[i] = (char)((dot[i] >= 'A' && dot[i] <= 'Z') ? dot[i] + CBM_SZ_32 : dot[i]);
8842 }
8843 buf[len] = '\0';
8844 return buf;
8845}
8846
8847/* ── Architecture aspect implementations ───────────────────────── */
8848

Callers 1

arch_languagesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected