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

Function rst_code_ext

internal/cbm/doclink_rst.c:1187–1208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1185}
1186
1187static bool rst_code_ext(const char *path) {
1188 const char *base = strrchr(path, '/');
1189 base = base ? base + 1 : path;
1190 if (strncmp(base, "Makefile", strlen("Makefile")) == 0 ||
1191 strncmp(base, "Kconfig", strlen("Kconfig")) == 0) {
1192 return true;
1193 }
1194 const char *dot = strrchr(base, '.');
1195 if (!dot) {
1196 return false;
1197 }
1198 char ext[16];
1199 size_t el = strlen(dot);
1200 if (el >= sizeof(ext)) {
1201 return false;
1202 }
1203 for (size_t i = 0; i <= el; i++) {
1204 char c = dot[i];
1205 ext[i] = (char)(c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c);
1206 }
1207 return rst_in(ext, CODE_EXT);
1208}
1209
1210static void rst_directive_tokens(rst_doc_t *d, const rst_dir_t *dir) {
1211 CBMArena *a = d->ctx->arena;

Callers 1

rst_directive_tokensFunction · 0.85

Calls 1

rst_inFunction · 0.85

Tested by

no test coverage detected