summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-05-16 16:07:41 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-05-16 16:07:41 +0300
commit696184533aa34b7ae29c5567e1255f00505d884f (patch)
tree0c6d71b001d153ea54bf79b4de0b664e2af442ee /lib
parent44bdb776b7d557941d377d0adfdedd2940546164 (diff)
downloadrpm-696184533aa34b7ae29c5567e1255f00505d884f.tar.gz
rpm-696184533aa34b7ae29c5567e1255f00505d884f.tar.bz2
rpm-696184533aa34b7ae29c5567e1255f00505d884f.zip
Eliminate the now unnecessary extension type fields
Diffstat (limited to 'lib')
-rw-r--r--lib/formats.c56
-rw-r--r--lib/header.c4
-rw-r--r--lib/header.h9
-rw-r--r--lib/headerfmt.c4
4 files changed, 30 insertions, 43 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 75d22c82b..1f2645037 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -1002,35 +1002,35 @@ static int groupTag(Header h, rpmtd td)
}
const struct headerSprintfExtension_s rpmHeaderTagExtensions[] = {
- { HEADER_EXT_TAG, "RPMTAG_GROUP", { groupTag } },
- { HEADER_EXT_TAG, "RPMTAG_DESCRIPTION", { descriptionTag } },
- { HEADER_EXT_TAG, "RPMTAG_SUMMARY", { summaryTag } },
- { HEADER_EXT_TAG, "RPMTAG_FILECLASS", { fileclassTag } },
- { HEADER_EXT_TAG, "RPMTAG_FILENAMES", { filenamesTag } },
- { HEADER_EXT_TAG, "RPMTAG_FILEPROVIDE", { fileprovideTag } },
- { HEADER_EXT_TAG, "RPMTAG_FILEREQUIRE", { filerequireTag } },
- { HEADER_EXT_TAG, "RPMTAG_FSNAMES", { fsnamesTag } },
- { HEADER_EXT_TAG, "RPMTAG_FSSIZES", { fssizesTag } },
- { HEADER_EXT_TAG, "RPMTAG_INSTALLPREFIX", { instprefixTag } },
- { HEADER_EXT_TAG, "RPMTAG_TRIGGERCONDS", { triggercondsTag } },
- { HEADER_EXT_TAG, "RPMTAG_TRIGGERTYPE", { triggertypeTag } },
- { HEADER_EXT_LAST, NULL, { NULL } }
+ { "RPMTAG_GROUP", { groupTag } },
+ { "RPMTAG_DESCRIPTION", { descriptionTag } },
+ { "RPMTAG_SUMMARY", { summaryTag } },
+ { "RPMTAG_FILECLASS", { fileclassTag } },
+ { "RPMTAG_FILENAMES", { filenamesTag } },
+ { "RPMTAG_FILEPROVIDE", { fileprovideTag } },
+ { "RPMTAG_FILEREQUIRE", { filerequireTag } },
+ { "RPMTAG_FSNAMES", { fsnamesTag } },
+ { "RPMTAG_FSSIZES", { fssizesTag } },
+ { "RPMTAG_INSTALLPREFIX", { instprefixTag } },
+ { "RPMTAG_TRIGGERCONDS", { triggercondsTag } },
+ { "RPMTAG_TRIGGERTYPE", { triggertypeTag } },
+ { NULL, { NULL } }
};
const struct headerSprintfExtension_s rpmHeaderFormats[] = {
- { HEADER_EXT_FORMAT, "armor", { armorFormat } },
- { HEADER_EXT_FORMAT, "base64", { base64Format } },
- { HEADER_EXT_FORMAT, "pgpsig", { pgpsigFormat } },
- { HEADER_EXT_FORMAT, "depflags", { depflagsFormat } },
- { HEADER_EXT_FORMAT, "fflags", { fflagsFormat } },
- { HEADER_EXT_FORMAT, "perms", { permsFormat } },
- { HEADER_EXT_FORMAT, "permissions", { permsFormat } },
- { HEADER_EXT_FORMAT, "triggertype", { triggertypeFormat } },
- { HEADER_EXT_FORMAT, "xml", { xmlFormat } },
- { HEADER_EXT_FORMAT, "octal", { octalFormat } },
- { HEADER_EXT_FORMAT, "hex", { hexFormat } },
- { HEADER_EXT_FORMAT, "date", { dateFormat } },
- { HEADER_EXT_FORMAT, "day", { dayFormat } },
- { HEADER_EXT_FORMAT, "shescape", { shescapeFormat } },
- { HEADER_EXT_LAST, NULL, { NULL } }
+ { "armor", { armorFormat } },
+ { "base64", { base64Format } },
+ { "pgpsig", { pgpsigFormat } },
+ { "depflags", { depflagsFormat } },
+ { "fflags", { fflagsFormat } },
+ { "perms", { permsFormat } },
+ { "permissions", { permsFormat } },
+ { "triggertype", { triggertypeFormat } },
+ { "xml", { xmlFormat } },
+ { "octal", { octalFormat } },
+ { "hex", { hexFormat } },
+ { "date", { dateFormat } },
+ { "day", { dayFormat } },
+ { "shescape", { shescapeFormat } },
+ { NULL, { NULL } }
};
diff --git a/lib/header.c b/lib/header.c
index eb12af74e..5f0606d82 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -1381,9 +1381,7 @@ static headerTagTagFunction findExtFunc(rpmTag tag)
headerTagTagFunction func = NULL;
const char *tagname = rpmTagGetName(tag);
- for (; ext != NULL && ext->type != HEADER_EXT_LAST; ext++) {
- if (ext->name == NULL)
- continue;
+ for (; ext != NULL && ext->name != NULL; ext++) {
if (!rstrcasecmp(ext->name + sizeof("RPMTAG"), tagname)) {
func = ext->u.tagFunction;
break;
diff --git a/lib/header.h b/lib/header.h
index e6cca0385..e74566c07 100644
--- a/lib/header.h
+++ b/lib/header.h
@@ -38,14 +38,6 @@ struct headerTagTableEntry_s {
typedef struct headerTagIndices_s * headerTagIndices;
/** \ingroup header
- */
-enum headerSprintfExtensionType {
- HEADER_EXT_LAST = 0, /*!< End of extension chain. */
- HEADER_EXT_FORMAT, /*!< headerTagFormatFunction() extension */
- HEADER_EXT_TAG /*!< headerTagTagFunction() extension */
-};
-
-/** \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.
@@ -76,7 +68,6 @@ typedef int (*headerTagTagFunction) (Header h, rpmtd td);
*/
typedef const struct headerSprintfExtension_s * headerSprintfExtension;
struct headerSprintfExtension_s {
- enum headerSprintfExtensionType type; /*!< Type of extension. */
const char * name; /*!< Name of extension. */
union {
void * generic; /*!< Private extension. */
diff --git a/lib/headerfmt.c b/lib/headerfmt.c
index 95eda3c8c..8b941ad3a 100644
--- a/lib/headerfmt.c
+++ b/lib/headerfmt.c
@@ -244,9 +244,7 @@ static int findTag(headerSprintfArgs hsa, sprintfToken token, const char * name)
bingo:
/* Search extensions for specific format. */
if (stag->type != NULL)
- for (; ext != NULL && ext->type != HEADER_EXT_LAST; ext++) {
- if (ext->name == NULL)
- continue;
+ for (; ext != NULL && ext->name != NULL; ext++) {
if (!strcmp(ext->name, stag->type)) {
stag->fmt = ext->u.formatFunction;
break;