// détruit une prop, avec tous ses champs void propRelease(prop pnt) { if (pnt) { propRelease(pnt->nxt); stringRelease(pnt->name); stringRelease(pnt->val); propFree(pnt); } }
int whereSetConditions(struct WhereStruct *whr, const wchar_t *name, const wchar_t *value, unsigned int data) { struct PropertyStruct *prop = propInit(name, value); if (prop == NULL) return EXIT_FAILURE; prop->userData = data; if (whereInsertConditions(whr, prop) == EXIT_SUCCESS) return EXIT_SUCCESS; propFree(prop); return EXIT_FAILURE; }
void whereFree(struct WhereStruct *whr) { struct PropertyStruct **pCond = whr->conditions; if (pCond != NULL) { unsigned int cnt = whr->condCount; for ( ; cnt != 0; --cnt) propFree(*pCond++); free(whr->conditions); } free(whr); }