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

Function cbm_split_camel_case

src/pipeline/pass_enrichment.c:45–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45int cbm_split_camel_case(const char *s, char **out, int max_out) {
46 if (!s || !out || max_out <= 0) {
47 return 0;
48 }
49 size_t len = strlen(s);
50 if (len == 0) {
51 return 0;
52 }
53
54 int count = 0;
55 size_t start = 0;
56
57 for (size_t i = SKIP_ONE; i < len; i++) {
58 if (s[i] >= 'A' && s[i] <= 'Z' && s[i - SKIP_ONE] >= 'a' && s[i - SKIP_ONE] <= 'z') {
59 if (count < max_out) {
60 out[count] = cbm_strndup(s + start, i - start);
61 count++;
62 }
63 start = i;
64 }
65 }
66 /* Emit remaining */
67 if (count < max_out) {
68 out[count] = cbm_strndup(s + start, len - start);
69 count++;
70 }
71 return count;
72}
73
74/* Strip decorator syntax: leading @, #[...], and arguments (...).
75 * Operates in-place on buf. Returns pointer to the cleaned token start. */

Callers 2

cbm_tokenize_decoratorFunction · 0.85
test_pipeline.cFile · 0.85

Calls 1

cbm_strndupFunction · 0.85

Tested by

no test coverage detected