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

Function find_line_value

src/pipeline/pass_pkgmap.c:200–221  ·  view source on GitHub ↗

Find a line starting with a prefix in source. Returns pointer to first char * after prefix, or NULL. Handles leading whitespace. */

Source from the content-addressed store, hash-verified

198/* Find a line starting with a prefix in source. Returns pointer to first char
199 * after prefix, or NULL. Handles leading whitespace. */
200static const char *find_line_value(const char *src, int src_len, const char *prefix) {
201 size_t plen = strlen(prefix);
202 const char *p = src;
203 const char *end = src + src_len;
204 while (p < end) {
205 /* Skip leading whitespace */
206 while (p < end && (*p == ' ' || *p == '\t')) {
207 p++;
208 }
209 if (p + plen <= end && memcmp(p, prefix, plen) == 0) {
210 return p + plen;
211 }
212 /* Skip to next line */
213 while (p < end && *p != '\n') {
214 p++;
215 }
216 if (p < end) {
217 p++; /* skip \n */
218 }
219 }
220 return NULL;
221}
222
223/* Extract a quoted string value from position. Handles both "..." and '...'
224 * Returns heap-allocated string, or NULL. */

Callers 5

parse_go_modFunction · 0.85
parse_cargo_tomlFunction · 0.85
parse_pyproject_tomlFunction · 0.85
parse_build_gradleFunction · 0.85
parse_mix_exsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected