Check if any CONFIGURES edge has given strategy AND config_key. */
| 63 | |
| 64 | /* Check if any CONFIGURES edge has given strategy AND config_key. */ |
| 65 | static bool has_strategy_with_key(const cbm_gbuf_edge_t **edges, int count, const char *strategy, |
| 66 | const char *config_key) { |
| 67 | char strat_needle[64]; |
| 68 | snprintf(strat_needle, sizeof(strat_needle), "\"strategy\":\"%s\"", strategy); |
| 69 | char key_needle[128]; |
| 70 | snprintf(key_needle, sizeof(key_needle), "\"config_key\":\"%s\"", config_key); |
| 71 | |
| 72 | for (int i = 0; i < count; i++) { |
| 73 | if (edges[i]->properties_json && strstr(edges[i]->properties_json, strat_needle) && |
| 74 | strstr(edges[i]->properties_json, key_needle)) |
| 75 | return true; |
| 76 | } |
| 77 | return false; |
| 78 | } |
| 79 | |
| 80 | /* Recursive remove */ |
| 81 | static void rm_rf(const char *path) { |