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

Function dk_value

src/pipeline/pass_docker.c:152–164  ·  view source on GitHub ↗

A value as written: quotes of a quoted string removed. */

Source from the content-addressed store, hash-verified

150
151/* A value as written: quotes of a quoted string removed. */
152static const char *dk_value(const dk_t *d, TSNode n) {
153 const char *s = dk_text(d, n);
154 size_t l = s ? strlen(s) : 0;
155 if (l >= PAIR_LEN && (s[0] == '"' || s[0] == '\'') && s[l - SKIP_ONE] == s[0]) {
156 char *v = cbm_arena_alloc(d->a, l - SKIP_ONE);
157 if (v) {
158 memcpy(v, s + SKIP_ONE, l - PAIR_LEN);
159 v[l - PAIR_LEN] = '\0';
160 }
161 return v;
162 }
163 return s;
164}
165
166static const dk_var_t *dk_find(const dk_var_t *v, const char *name, size_t nl) {
167 for (; v; v = v->next) {

Callers 2

dk_argFunction · 0.85
dk_envFunction · 0.85

Calls 2

dk_textFunction · 0.85
cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected