int doCheck(PTDNFRPMTS pTS) { int nResult = 0; rpmpsi psi = NULL; rpmProblem prob = NULL; nResult = rpmtsCheck(pTS->pTS); rpmps ps = rpmtsProblems(pTS->pTS); if(ps) { int nProbs = rpmpsNumProblems(ps); if(nProbs > 0) { printf("Found %d problems\n", nProbs); psi = rpmpsInitIterator(ps); while(rpmpsNextIterator(psi) >= 0) { prob = rpmpsGetProblem(psi); printf("Prob = %s, type = %d, nevr1=%s, nevr2=%s\n", rpmProblemGetStr(prob), rpmProblemGetType(prob), rpmProblemGetPkgNEVR(prob), rpmProblemGetAltNEVR(prob)); rpmProblemFree(prob); } rpmpsFreeIterator(psi); } } return nResult; }
rpmps rpmpsFree(rpmps ps) { if (ps == NULL) return NULL; if (ps->nrefs > 1) { return rpmpsUnlink(ps); } if (ps->probs) { rpmpsi psi = rpmpsInitIterator(ps); while (rpmpsNextIterator(psi) >= 0) { rpmProblemFree(rpmpsGetProblem(psi)); } rpmpsFreeIterator(psi); ps->probs = _free(ps->probs); } ps = _free(ps); return NULL; }
static void rpmprob_dealloc(rpmProblemObject *s) { s->prob = rpmProblemFree(s->prob); Py_TYPE(s)->tp_free((PyObject *)s); }