Find a child node by key in a map node. */
| 314 | |
| 315 | /* Find a child node by key in a map node. */ |
| 316 | static const cbm_yaml_node_t *find_child(const cbm_yaml_node_t *node, const char *key) { |
| 317 | if (!node || !key) { |
| 318 | return NULL; |
| 319 | } |
| 320 | for (int i = 0; i < node->child_count; i++) { |
| 321 | if (node->children[i]->key && strcmp(node->children[i]->key, key) == 0) { |
| 322 | return node->children[i]; |
| 323 | } |
| 324 | } |
| 325 | return NULL; |
| 326 | } |
| 327 | |
| 328 | /* Navigate to a node by dot-separated path. */ |
| 329 | static const cbm_yaml_node_t *navigate(const cbm_yaml_node_t *root, const char *path) { |