libxbps: revamped trans states/cb to be more generic, not just for transactions.

This commit is contained in:
Juan RP
2011-11-11 09:41:48 +01:00
parent dc4f7af890
commit 86f1f18571
11 changed files with 191 additions and 198 deletions

View File

@@ -207,8 +207,8 @@ xbps_end(struct xbps_handle *xh)
free(xh->xfcd);
if (xh->xucd != NULL)
free(xh->xucd);
if (xh->xtcd != NULL)
free(xh->xtcd);
if (xh->xscd != NULL)
free(xh->xscd);
free(xh);
xh = NULL;
@@ -227,24 +227,24 @@ xbps_handle_alloc(void)
{
struct xbps_handle *xh;
xh = calloc(1, sizeof(struct xbps_handle));
xh = malloc(sizeof *xh);
if (xh == NULL)
return NULL;
xh->xtcd = calloc(1, sizeof(struct xbps_transaction_cb_data));
if (xh->xtcd == NULL) {
xh->xscd = malloc(sizeof *xh->xscd);
if (xh->xscd == NULL) {
free(xh);
return NULL;
}
xh->xucd = calloc(1, sizeof(struct xbps_unpack_cb_data));
xh->xucd = malloc(sizeof *xh->xucd);
if (xh->xucd == NULL) {
free(xh->xtcd);
free(xh->xscd);
free(xh);
return NULL;
}
xh->xfcd = calloc(1, sizeof(struct xbps_fetch_cb_data));
xh->xfcd = malloc(sizeof *xh->xfcd);
if (xh->xfcd == NULL) {
free(xh->xucd);
free(xh->xtcd);
free(xh->xscd);
free(xh);
return NULL;
}