From eef5417deabb40304cc225ded2ebc7bf48dc2c46 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 16 May 2008 16:26:19 +0300 Subject: Make extension formatter functions opaque - tag extensions are only needed by headerGet(), formats only by headerFormat() --- lib/header.h | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'lib/header.h') diff --git a/lib/header.h b/lib/header.h index e74566c07..237d36ff1 100644 --- a/lib/header.h +++ b/lib/header.h @@ -37,43 +37,13 @@ struct headerTagTableEntry_s { */ typedef struct headerTagIndices_s * headerTagIndices; -/** \ingroup header - * HEADER_EXT_FORMAT format function prototype. - * This will only ever be passed RPM_INT32_TYPE or RPM_STRING_TYPE to - * help keep things simple. - * - * @param type tag type - * @param data tag value - * @param formatPrefix - * @param padding - * @param element RPM_BIN_TYPE: no. bytes of data - * @return formatted string - */ -typedef char * (*headerTagFormatFunction)(rpmTagType type, - rpm_constdata_t data, char * formatPrefix, - size_t padding, rpm_count_t element); - -/** \ingroup header - * HEADER_EXT_TAG format function prototype. - * This is allowed to fail, which indicates the tag doesn't exist. - * - * @param h header - * @retval td tag data container - * @return 0 on success - */ -typedef int (*headerTagTagFunction) (Header h, rpmtd td); - /** \ingroup header * Define header tag output formats. */ typedef const struct headerSprintfExtension_s * headerSprintfExtension; struct headerSprintfExtension_s { - const char * name; /*!< Name of extension. */ - union { - void * generic; /*!< Private extension. */ - headerTagFormatFunction formatFunction; /*!< HEADER_EXT_TAG extension. */ - headerTagTagFunction tagFunction; /*!< HEADER_EXT_FORMAT extension. */ - } u; + const char *name; /*!< Name of extension. */ + void *func; /*!< Pointer to formatter function. */ }; /** \ingroup rpmtag -- cgit v1.2.3