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

Function dk_prop

src/pipeline/pass_docker.c:1773–1788  ·  view source on GitHub ↗

A plain JSON string property (an image reference holds no escapes). */

Source from the content-addressed store, hash-verified

1771
1772/* A plain JSON string property (an image reference holds no escapes). */
1773static bool dk_prop(const char *props, const char *key, char *out, size_t out_sz) {
1774 char pat[CBM_SZ_64];
1775 snprintf(pat, sizeof(pat), "\"%s\":\"", key);
1776 const char *p = props ? strstr(props, pat) : NULL;
1777 if (!p) {
1778 return false;
1779 }
1780 p += strlen(pat);
1781 const char *e = strchr(p, '"');
1782 if (!e || (size_t)(e - p) >= out_sz || memchr(p, '\\', (size_t)(e - p))) {
1783 return false;
1784 }
1785 memcpy(out, p, (size_t)(e - p));
1786 out[e - p] = '\0';
1787 return true;
1788}
1789
1790/* The tag of image reference `ref`: after the ':' that follows its last
1791 * '/' (a registry port is no tag), up to a '@' digest; "" for none. */

Callers 2

dk_hub_refFunction · 0.85
dk_hub_collectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected