static rpmds singleDSPool(rpmstrPool pool, rpmTagVal tagN, rpmsid N, rpmsid EVR, rpmsenseFlags Flags, unsigned int instance, rpm_color_t Color, int triggerIndex) { rpmds ds = NULL; const char * Type; rpmTagVal tagTi; if (dsType(tagN, &Type, NULL, NULL, &tagTi)) goto exit; ds = rpmdsCreate(pool, tagN, Type, 1, instance); ds->N = xmalloc(1 * sizeof(*ds->N)); ds->N[0] = N; ds->EVR = xmalloc(1 * sizeof(*ds->EVR)); ds->EVR[0] = EVR; ds->Flags = xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags; if (tagTi != RPMTAG_NOT_FOUND) { ds->ti = xmalloc(sizeof(*ds->ti)); ds->ti[0] = triggerIndex; } ds->i = 0; if (Color) rpmdsSetColor(ds, Color); exit: return ds; }
static rpmds singleDS(rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags, unsigned int instance, rpm_color_t Color) { rpmds ds = NULL; const char * Type; if (dsType(tagN, &Type, NULL, NULL)) goto exit; ds = xcalloc(1, sizeof(*ds)); ds->Type = Type; ds->tagN = tagN; ds->Count = 1; ds->nopromote = _rpmds_nopromote; ds->instance = instance; ds->N = rpmdsDupArgv(&N, 1); ds->EVR = rpmdsDupArgv(&EVR, 1); ds->Flags = xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags; ds->i = 0; if (Color) rpmdsSetColor(ds, Color); exit: return rpmdsLink(ds); }
static VALUE rpmds_Color_set(VALUE s, VALUE v) { rpmds ds = rpmds_ptr(s); int color = FIX2INT(v); if (_debug) fprintf(stderr, "==> %s(0x%lx) ptr %p\n", __FUNCTION__, s, ds); (void) rpmdsSetColor(ds, color); return INT2FIX(rpmdsColor(ds)); }