Ditch the tagtable argument of (internal) headerDump() function
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 21 May 2008 14:26:52 +0000 (17:26 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 21 May 2008 14:26:52 +0000 (17:26 +0300)
- might as well ditch the function too I guess...

lib/header_internal.c
lib/header_internal.h
tools/dumpdb.c

index 2d504fd..73d1c66 100644 (file)
@@ -29,13 +29,10 @@ char ** headerGetLangs(Header h)
     return table;      /* LCL: double indirection? */
 }
 
-/* FIX: shrug */
-void headerDump(Header h, FILE *f, int flags,
-       const struct headerTagTableEntry_s * tags)
+void headerDump(Header h, FILE *f, int flags)
 {
     int i;
     indexEntry p;
-    const struct headerTagTableEntry_s * tage;
     const char * tag;
     const char * type;
 
@@ -81,13 +78,7 @@ void headerDump(Header h, FILE *f, int flags,
            break;
        }
 
-       tage = tags;
-       while (tage->name && tage->val != p->info.tag) tage++;
-
-       if (!tage->name)
-           tag = "(unknown)";
-       else
-           tag = tage->name;
+       tag = rpmTagGetName(p->info.tag);
 
        fprintf(f, "Entry      : %3.3d (%d)%-14s %-18s 0x%.8x %.8d\n", i,
                p->info.tag, tag, type, (unsigned) p->info.offset,
index f1e04ef..f679ae7 100644 (file)
@@ -133,10 +133,8 @@ static inline int headerUsageCount(Header h)  {
  * @param h            header
  * @param f            file handle
  * @param flags                0 or HEADER_DUMP_INLINE
- * @param tags         array of tag name/value pairs
  */
-void headerDump(Header h, FILE *f, int flags,
-               const struct headerTagTableEntry_s * tags);
+void headerDump(Header h, FILE *f, int flags);
 #define HEADER_DUMP_INLINE   1
 
 #ifdef __cplusplus
index 69a3f06..d6151f2 100644 (file)
@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
            if (!(dspBlockNum != 0 && dspBlockNum != blockNum))
                continue;
 
-           headerDump(h, stdout, HEADER_DUMP_INLINE, rpmTagTable);
+           headerDump(h, stdout, HEADER_DUMP_INLINE);
            fprintf(stdout, "Offset: %d\n", _RECNUM);
     
            if (dspBlockNum && blockNum > dspBlockNum)