int resrc_reqst_clear_found (resrc_reqst_t *resrc_reqst) { if (resrc_reqst) { resrc_reqst->nfound = 0; if (resrc_reqst_num_children (resrc_reqst)) { resrc_reqst_t *child = resrc_reqst_list_first (resrc_reqst->children); while (child) { resrc_reqst_clear_found (child); child = resrc_reqst_list_next (resrc_reqst->children); } } return 0; } return -1; }
/* * cycles through all of the resource requests and returns true if all * of the requested children were selected */ static bool select_children (flux_t *h, resrc_tree_list_t *children, resrc_reqst_list_t *reqst_children, resrc_tree_t *selected_parent) { resrc_reqst_t *child_reqst = NULL; bool selected = false; child_reqst = resrc_reqst_list_first (reqst_children); while (child_reqst) { resrc_reqst_clear_found (child_reqst); selected = false; if (!select_child (h, children, child_reqst, selected_parent)) break; selected = true; child_reqst = resrc_reqst_list_next (reqst_children); } return selected; }