return val;
}
+
+static char * expandFormat(rpmtd td, char * formatPrefix)
+{
+ char *val = NULL;
+ if (rpmtdClass(td) != RPM_STRING_CLASS) {
+ val = xstrdup(_("(not a string)"));
+ } else {
+ val = rpmExpand(td->data, NULL);
+ }
+ strcat(formatPrefix, "s");
+ return val;
+}
+
void *rpmHeaderFormatFuncByName(const char *fmt)
{
const struct headerFormatFunc_s * ext;
{ RPMTD_FORMAT_ARRAYSIZE, "arraysize", arraysizeFormat },
{ RPMTD_FORMAT_FSTATE, "fstate", fstateFormat },
{ RPMTD_FORMAT_VFLAGS, "vflags", vflagsFormat },
+ { RPMTD_FORMAT_EXPAND, "expand", expandFormat },
{ -1, NULL, NULL }
};
RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int types) */
RPMTD_FORMAT_FSTATE = 16, /* file states (int types) */
RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
+ RPMTD_FORMAT_EXPAND = 18, /* macro expansion (string types) */
} rpmtdFormats;
/** \ingroup rpmtd