struct headerFormatFunc_s {
rpmtdFormats fmt; /*!< Value of extension */
const char *name; /*!< Name of extension. */
- void *func; /*!< Pointer to formatter function. */
+ headerTagFormatFunction func; /*!< Pointer to formatter function. */
};
/* forward declarations */
static const struct headerFormatFunc_s rpmHeaderFormats[];
-void *rpmHeaderFormatFuncByName(const char *fmt);
-void *rpmHeaderFormatFuncByValue(rpmtdFormats fmt);
-
/**
* barebones string representation with no extra formatting
* @param td tag data container
return val;
}
-void *rpmHeaderFormatFuncByName(const char *fmt)
+headerTagFormatFunction rpmHeaderFormatFuncByName(const char *fmt)
{
const struct headerFormatFunc_s * ext;
- void *func = NULL;
+ headerTagFormatFunction func = NULL;
for (ext = rpmHeaderFormats; ext->name != NULL; ext++) {
if (rstreq(ext->name, fmt)) {
return func;
}
-void *rpmHeaderFormatFuncByValue(rpmtdFormats fmt)
+headerTagFormatFunction rpmHeaderFormatFuncByValue(rpmtdFormats fmt)
{
const struct headerFormatFunc_s * ext;
- void *func = NULL;
+ headerTagFormatFunction func = NULL;
for (ext = rpmHeaderFormats; ext->name != NULL; ext++) {
if (fmt == ext->fmt) {
#include <rpm/rpmtypes.h>
#include <rpm/rpmstring.h>
#include "lib/header_internal.h"
+#include "lib/misc.h" /* tag function proto */
#include "debug.h"
(((_e)->info.tag >= RPMTAG_HEADERIMAGE) && ((_e)->info.tag < RPMTAG_HEADERREGIONS))
#define ENTRY_IN_REGION(_e) ((_e)->info.offset < 0)
-/** \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
- * @param flags modifier flags
- * @return 0 on success
- */
-typedef int (*headerTagTagFunction) (Header h, rpmtd td, headerGetFlags hgflags);
-
-extern void *rpmHeaderTagFunc(rpmTag tag);
-
/* Convert a 64bit value to network byte order. */
static uint64_t htonll( uint64_t n ) {
uint32_t *i = (uint32_t*)&n;
#include <rpm/rpmtag.h>
#include <rpm/rpmstring.h>
#include <rpm/rpmpgp.h>
+#include "lib/misc.h" /* format function protos */
#include "debug.h"
#define PARSER_IN_EXPR 2
/** \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 td tag data container
- * @param formatPrefix
- * @return formatted string
- */
-typedef char * (*headerTagFormatFunction) (rpmtd td, char * formatPrefix);
-
-extern void *rpmHeaderFormatFuncByName(const char *fmt);
-
-/** \ingroup header
*/
typedef struct sprintfTag_s * sprintfTag;
struct sprintfTag_s {
#include <string.h>
#include <rpm/rpmtypes.h>
+#include <rpm/header.h> /* for headerGetFlags typedef, duh.. */
#ifdef __cplusplus
extern "C" {
RPM_GNUC_INTERNAL
unsigned int hashFunctionString(const char * string);
+
+typedef char * (*headerTagFormatFunction) (rpmtd td, char * formatPrefix);
+typedef int (*headerTagTagFunction) (Header h, rpmtd td, headerGetFlags hgflags);
+
+RPM_GNUC_INTERNAL
+headerTagTagFunction rpmHeaderTagFunc(rpmTag tag);
+
+RPM_GNUC_INTERNAL
+headerTagFormatFunction rpmHeaderFormatFuncByName(const char *fmt);
+
+RPM_GNUC_INTERNAL
+headerTagFormatFunction rpmHeaderFormatFuncByValue(rpmtdFormats fmt);
+
/*
* These may be called w/ a NULL argument to flush the cache -- they return
* -1 if the user can't be found.
#include <rpm/rpmtd.h>
#include <rpm/rpmstring.h>
#include <rpm/rpmpgp.h>
+#include "lib/misc.h" /* format function prototypes */
#include "debug.h"
-typedef char * (*headerTagFormatFunction) (rpmtd td, char *formatPrefix);
-
-extern void *rpmHeaderFormatFuncByValue(rpmtdFormats fmt);
-
rpmtd rpmtdNew(void)
{
rpmtd td = xmalloc(sizeof(*td));
#include <rpm/rpmfi.h>
#include <rpm/rpmstring.h>
#include <rpm/rpmlog.h>
+#include "lib/misc.h" /* tag function proto */
#include "debug.h"
struct headerTagFunc_s {
rpmTag tag; /*!< Tag of extension. */
- void *func; /*!< Pointer to formatter function. */
+ headerTagTagFunction func; /*!< Pointer to formatter function. */
};
/* forward declarations */
static const struct headerTagFunc_s rpmHeaderTagExtensions[];
-void *rpmHeaderTagFunc(rpmTag tag);
-
/** \ingroup rpmfi
* Retrieve file names from header.
*
return (fc > 0);
}
-void *rpmHeaderTagFunc(rpmTag tag)
+headerTagTagFunction rpmHeaderTagFunc(rpmTag tag)
{
const struct headerTagFunc_s * ext;
- void *func = NULL;
+ headerTagTagFunction func = NULL;
for (ext = rpmHeaderTagExtensions; ext->func != NULL; ext++) {
if (ext->tag == tag) {