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

Function platform_stem_len

internal/cbm/helpers.c:1918–1929  ·  view source on GitHub ↗

Length of `stem` without a trailing `_ ` / `- ` / `. ` * platform suffix (the longest one), or `len` when it has none. */

Source from the content-addressed store, hash-verified

1916/* Length of `stem` without a trailing `_<token>` / `-<token>` / `.<token>`
1917 * platform suffix (the longest one), or `len` when it has none. */
1918static size_t platform_stem_len(const char *stem, size_t len) {
1919 size_t best = len;
1920 for (size_t sep = 1; sep < len; sep++) {
1921 char c = stem[sep - 1];
1922 if ((c == '_' || c == '-' || c == '.') && platform_token_eq(stem + sep, len - sep)) {
1923 if (sep - 1 < best) {
1924 best = sep - 1;
1925 }
1926 }
1927 }
1928 return best;
1929}
1930
1931static bool c_family_variant_lang(CBMLanguage lang) {
1932 return lang == CBM_LANG_C || lang == CBM_LANG_CPP || lang == CBM_LANG_CUDA ||

Callers 1

cbm_platform_neutral_qnFunction · 0.85

Calls 1

platform_token_eqFunction · 0.85

Tested by

no test coverage detected