From ecabf137102a980528f166b9690efb8adbcef95f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 30 Jan 2008 13:00:26 +0200 Subject: [PATCH] Move rpmTagType stuff to rpmtag.h now that they can move --- lib/rpmtag.h | 51 +++++++++++++++++++++++++++++++++++++++++ rpmdb/header.c | 1 + rpmdb/header.h | 49 --------------------------------------- rpmdb/header_common.c | 1 + rpmdb/header_internal.c | 1 + 5 files changed, 54 insertions(+), 49 deletions(-) diff --git a/lib/rpmtag.h b/lib/rpmtag.h index 35a2acc44..2f0d93e52 100644 --- a/lib/rpmtag.h +++ b/lib/rpmtag.h @@ -1,6 +1,8 @@ #ifndef _RPMTAG_H #define _RPMTAG_H +#include + #ifdef __cplusplus extern "C" { #endif @@ -282,6 +284,55 @@ typedef enum rpmTag_e { #define RPMTAG_NOT_FOUND -1 +/** \ingroup header + * The basic types of data in tags from headers. + */ +typedef enum rpmTagType_e { +#define RPM_MIN_TYPE 0 + RPM_NULL_TYPE = 0, + RPM_CHAR_TYPE = 1, + RPM_INT8_TYPE = 2, + RPM_INT16_TYPE = 3, + RPM_INT32_TYPE = 4, +/* RPM_INT64_TYPE = 5, ---- These aren't supported (yet) */ + RPM_STRING_TYPE = 6, + RPM_BIN_TYPE = 7, + RPM_STRING_ARRAY_TYPE = 8, + RPM_I18NSTRING_TYPE = 9, + RPM_MASK_TYPE = 0x0000ffff +#define RPM_MAX_TYPE 9 +#define RPM_FORCEFREE_TYPE 0xff +} rpmTagType; + +/** \ingroup header + * New rpm data types under consideration/development. + * These data types may (or may not) be added to rpm at some point. In order + * to avoid incompatibility with legacy versions of rpm, these data (sub-)types + * are introduced into the header by overloading RPM_BIN_TYPE, with the binary + * value of the tag a 16 byte image of what should/will be in the header index, + * followed by per-tag private data. + */ +typedef enum rpmSubTagType_e { + RPM_REGION_TYPE = -10, + RPM_BIN_ARRAY_TYPE = -11, + /*!<@todo Implement, kinda like RPM_STRING_ARRAY_TYPE for known (but variable) + length binary data. */ + RPM_XREF_TYPE = -12 + /*!<@todo Implement, intent is to to carry a (???,tagNum,valNum) cross + reference to retrieve data from other tags. */ +} rpmSubTagType; + +/** \ingroup header + * * Identify how to return the header data type. + * */ +typedef enum rpmTagReturnType_e { + RPM_ANY_RETURN_TYPE = 0, + RPM_SCALAR_RETURN_TYPE = 0x00010000, + RPM_ARRAY_RETURN_TYPE = 0x00020000, + RPM_MAPPING_RETURN_TYPE = 0x00040000, + RPM_MASK_RETURN_TYPE = 0xffff0000 +} rpmTagReturnType; + /** \ingroup rpmtag * Return tag name from value. * @param tag tag value diff --git a/rpmdb/header.c b/rpmdb/header.c index 542b82f74..2f791a827 100644 --- a/rpmdb/header.c +++ b/rpmdb/header.c @@ -10,6 +10,7 @@ #include "system.h" +#include #include #include "rpmdb/header_internal.h" diff --git a/rpmdb/header.h b/rpmdb/header.h index 2ba12c2f7..a37dbd9e4 100644 --- a/rpmdb/header.h +++ b/rpmdb/header.h @@ -170,55 +170,6 @@ enum hMagic { HEADER_MAGIC_YES = 1 }; -/** \ingroup header - * The basic types of data in tags from headers. - */ -typedef enum rpmTagType_e { -#define RPM_MIN_TYPE 0 - RPM_NULL_TYPE = 0, - RPM_CHAR_TYPE = 1, - RPM_INT8_TYPE = 2, - RPM_INT16_TYPE = 3, - RPM_INT32_TYPE = 4, -/* RPM_INT64_TYPE = 5, ---- These aren't supported (yet) */ - RPM_STRING_TYPE = 6, - RPM_BIN_TYPE = 7, - RPM_STRING_ARRAY_TYPE = 8, - RPM_I18NSTRING_TYPE = 9, - RPM_MASK_TYPE = 0x0000ffff -#define RPM_MAX_TYPE 9 -#define RPM_FORCEFREE_TYPE 0xff -} rpmTagType; - -/** \ingroup header - * New rpm data types under consideration/development. - * These data types may (or may not) be added to rpm at some point. In order - * to avoid incompatibility with legacy versions of rpm, these data (sub-)types - * are introduced into the header by overloading RPM_BIN_TYPE, with the binary - * value of the tag a 16 byte image of what should/will be in the header index, - * followed by per-tag private data. - */ -typedef enum rpmSubTagType_e { - RPM_REGION_TYPE = -10, - RPM_BIN_ARRAY_TYPE = -11, - /*!<@todo Implement, kinda like RPM_STRING_ARRAY_TYPE for known (but variable) - length binary data. */ - RPM_XREF_TYPE = -12 - /*!<@todo Implement, intent is to to carry a (???,tagNum,valNum) cross - reference to retrieve data from other tags. */ -} rpmSubTagType; - -/** \ingroup header - * * Identify how to return the header data type. - * */ -typedef enum rpmTagReturnType_e { - RPM_ANY_RETURN_TYPE = 0, - RPM_SCALAR_RETURN_TYPE = 0x00010000, - RPM_ARRAY_RETURN_TYPE = 0x00020000, - RPM_MAPPING_RETURN_TYPE = 0x00040000, - RPM_MASK_RETURN_TYPE = 0xffff0000 -} rpmTagReturnType; - /** * Header private tags. * @note General use tags should start at 1000 (RPM's tag space starts there). diff --git a/rpmdb/header_common.c b/rpmdb/header_common.c index c3686adad..dc2661678 100644 --- a/rpmdb/header_common.c +++ b/rpmdb/header_common.c @@ -3,6 +3,7 @@ */ #include +#include #include "rpmdb/header_method.h" /** \ingroup header diff --git a/rpmdb/header_internal.c b/rpmdb/header_internal.c index 971f7e156..4f2f32a17 100644 --- a/rpmdb/header_internal.c +++ b/rpmdb/header_internal.c @@ -4,6 +4,7 @@ #include "system.h" +#include #include "rpmdb/header_internal.h" #include "debug.h"