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

Function cbm_parse_range

src/pipeline/pass_gitdiff.c:19–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include <string.h>
18
19void cbm_parse_range(const char *s, int *out_start, int *out_count) {
20 *out_start = 0;
21 *out_count = SKIP_ONE;
22
23 const char *comma = strchr(s, ',');
24 if (!comma) {
25 *out_start = (int)strtol(s, NULL, CBM_DECIMAL_BASE);
26 return;
27 }
28
29 /* Parse start */
30 char buf[CBM_SZ_32];
31 size_t len = (size_t)(comma - s);
32 if (len >= sizeof(buf)) {
33 len = sizeof(buf) - SKIP_ONE;
34 }
35 memcpy(buf, s, len);
36 buf[len] = '\0';
37 *out_start = (int)strtol(buf, NULL, CBM_DECIMAL_BASE);
38
39 /* Parse count */
40 *out_count = (int)strtol(comma + SKIP_ONE, NULL, CBM_DECIMAL_BASE);
41}
42
43#define HUNK_LINE_BUF 1536
44

Callers 2

parse_hunk_lineFunction · 0.85
test_pipeline.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected