| 179 | th_mkdir_p(f->source) == 0 && th_mkdir_p(f->destination) == 0 && pf_env_start(f); |
| 180 | } |
| 181 | static bool pf_role(const cbm_node_t *node, const char *role) { |
| 182 | if (!node->properties_json) |
| 183 | return false; |
| 184 | yyjson_doc *doc = yyjson_read(node->properties_json, strlen(node->properties_json), 0); |
| 185 | yyjson_val *root = doc ? yyjson_doc_get_root(doc) : NULL; |
| 186 | yyjson_val *field = yyjson_is_obj(root) ? yyjson_obj_get(root, "test_role") : NULL; |
| 187 | bool ok = yyjson_is_obj(root) && (role ? pf_text(yyjson_get_str(field), role) : !field); |
| 188 | yyjson_doc_free(doc); |
| 189 | return ok; |
| 190 | } |
| 191 | static bool pf_node(cbm_store_t *store, const char *qn, const char *name, const char *file, |
| 192 | const char *role, cbm_node_t *out) { |
| 193 | memset(out, 0, sizeof(*out)); |