void free_X_nodes(X_node * x) { /* frees the list of X_nodes pointed to by x, and all of the expressions */ X_node * y; for (; x!= NULL; x = y) { y = x->next; free_Exp(x->exp); xfree((char *)x, sizeof(X_node)); } }
/** * Returns 0 iff the length of the disjunct list is 0. * If this is the case, it frees the structure rooted at l. */ static int and_purge_E_list(E_list * l) { if (l == NULL) return 1; if ((l->e = purge_Exp(l->e)) == NULL) { free_E_list(l->next); xfree((char *)l, sizeof(E_list)); return 0; } if (and_purge_E_list(l->next) == 0) { free_Exp(l->e); xfree((char *)l, sizeof(E_list)); return 0; } return 1; }
void free_E_list(E_list * l) { if (l == NULL) return; free_E_list(l->next); free_Exp(l->e); xfree((char *)l, sizeof(E_list)); }