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

Function push_pattern_token

src/pipeline/pass_semantic_edges.c:136–142  ·  view source on GitHub ↗

Append a single token to `tokens` if there's capacity. Consolidates the * `if (count < max_tokens) { tokens[count++] = strdup(...); }` pattern. */

Source from the content-addressed store, hash-verified

134/* Append a single token to `tokens` if there's capacity. Consolidates the
135 * `if (count < max_tokens) { tokens[count++] = strdup(...); }` pattern. */
136static int push_pattern_token(char **tokens, int count, int max_tokens, const char *text) {
137 if (count >= max_tokens) {
138 return count;
139 }
140 tokens[count] = cbm_mem_strdup(CBM_MEM_CLASS_SEMANTIC, text);
141 return tokens[count] ? count + SKIP_ONE : count;
142}
143
144/* True if `s` contains any of the space-separated substrings in `needles`. */
145static bool has_any(const char *s, const char *const *needles) {

Callers 4

inject_callee_tokensFunction · 0.85
inject_decorator_tokensFunction · 0.85

Calls 1

cbm_mem_strdupFunction · 0.85

Tested by

no test coverage detected