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

Function file_ext

src/store/store.c:5456–5474  ·  view source on GitHub ↗

Get lowercase file extension from path */

Source from the content-addressed store, hash-verified

5454
5455/* Get lowercase file extension from path */
5456static const char *file_ext(const char *path) {
5457 if (!path) {
5458 return NULL;
5459 }
5460 const char *dot = strrchr(path, '.');
5461 if (!dot) {
5462 return NULL;
5463 }
5464 static CBM_TLS char buf[CBM_SZ_16];
5465 int len = (int)strlen(dot);
5466 if (len >= (int)sizeof(buf)) {
5467 return NULL;
5468 }
5469 for (int i = 0; i < len; i++) {
5470 buf[i] = (char)((dot[i] >= 'A' && dot[i] <= 'Z') ? dot[i] + CBM_SZ_32 : dot[i]);
5471 }
5472 buf[len] = '\0';
5473 return buf;
5474}
5475
5476/* ── Architecture aspect implementations ───────────────────────── */
5477

Callers 1

arch_languagesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected