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

Function sphinx_add

src/discover/discover.c:967–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

965}
966
967static void sphinx_add(sphinx_suffixes_t *out, const char *s, size_t n) {
968 if (n < PAIR_LEN || n >= SPHINX_SUFFIX_LEN || s[0] != '.' || out->count >= SPHINX_SUFFIXES ||
969 (n == strlen(".rst") && memcmp(s, ".rst", n) == 0)) {
970 return;
971 }
972 for (size_t i = SKIP_ONE; i < n; i++) {
973 if (!isalnum((unsigned char)s[i]) && s[i] != '_' && s[i] != '-') {
974 return;
975 }
976 }
977 memcpy(out->ext[out->count], s, n);
978 out->ext[out->count][n] = '\0';
979 out->count++;
980}
981
982/* `source_suffix = '.txt'`, `= ['.rst', '.txt']` or
983 * `= {'.rst': 'restructuredtext', '.txt': 'restructuredtext'}` (a dict

Callers 1

sphinx_parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected