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

Function dk_entry

src/pipeline/pass_docker.c:1079–1098  ·  view source on GitHub ↗

ENTRYPOINT / CMD of the current stage: its argv, as written. */

Source from the content-addressed store, hash-verified

1077
1078/* ENTRYPOINT / CMD of the current stage: its argv, as written. */
1079static void dk_entry(dk_t *d, TSNode ins, dk_entry_t *e) {
1080 const char *w[DK_MAX_WORDS];
1081 int n = 0;
1082 for (uint32_t i = 0; i < ts_node_named_child_count(ins); i++) {
1083 TSNode c = ts_node_named_child(ins, i);
1084 if (dk_type(c, "json_string_array")) {
1085 n = dk_json_array(d, c, w, DK_MAX_WORDS);
1086 } else if (dk_type(c, "shell_command")) {
1087 n = dk_words(d, d->src + ts_node_start_byte(c), d->src + ts_node_end_byte(c), w,
1088 DK_MAX_WORDS);
1089 }
1090 }
1091 const char **argv = cbm_arena_alloc(d->a, (size_t)(n ? n : SKIP_ONE) * sizeof(*argv));
1092 if (!argv) {
1093 return;
1094 }
1095 memcpy((void *)argv, w, (size_t)n * sizeof(*argv));
1096 *e = (dk_entry_t){
1097 .argv = argv, .argc = n, .line = dk_line(ins), .workdir = d->workdir, .set = true};
1098}
1099
1100static bool dk_interpreter(const char *base) {
1101 static const char *const NAMES[] = {"node", "php", "ruby", "perl", "bun",

Callers 1

dk_fileFunction · 0.85

Calls 5

dk_typeFunction · 0.85
dk_json_arrayFunction · 0.85
dk_wordsFunction · 0.85
dk_lineFunction · 0.85
cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected