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

Function cbm_skip_directive

internal/cbm/cbm.c:2227–2244  ·  view source on GitHub ↗

Index just past a preprocessor directive starting at `i` (its continuation * lines included), and the lines it spans added to *line. */

Source from the content-addressed store, hash-verified

2225/* Index just past a preprocessor directive starting at `i` (its continuation
2226 * lines included), and the lines it spans added to *line. */
2227static int cbm_skip_directive(const char *src, int len, int i, uint32_t *line) {
2228 while (i < len) {
2229 if (src[i] != '\n') {
2230 i++;
2231 continue;
2232 }
2233 int b = i - 1;
2234 if (b >= 0 && src[b] == '\r') {
2235 b--;
2236 }
2237 (*line)++;
2238 i++;
2239 if (b < 0 || src[b] != '\\') {
2240 break;
2241 }
2242 }
2243 return i;
2244}
2245
2246/* Index just past a comment or a string/character literal starting at `i`
2247 * (lines it spans added to *line), or `i` when none starts there. */

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected