Split tag type and return type to separate fields in tag table
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 09:27:27 +0000 (12:27 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 09:27:27 +0000 (12:27 +0300)
- rpmTagType is a pure enum really, avoid mixing it up unnecessarily

lib/gentagtbl.sh
lib/tagname.c

index 953775a..fd76239 100755 (executable)
@@ -67,9 +67,9 @@ ${AWK} '/[\t ](RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ && !/unimplemente
        tn = substr(tnarg, index(tnarg, "_") + 1)
        sn = (substr(tn, 1, 1) tolower(substr(tn, 2)))
        if ($2 == "=") {
-               printf("    { \"%s\", \"%s\", %s, RPM_%s_TYPE + RPM_%s_RETURN_TYPE, %d },\n", tnarg, sn, tnarg, tt, ta, ext)
+               printf("    { \"%s\", \"%s\", %s, RPM_%s_TYPE, RPM_%s_RETURN_TYPE, %d },\n", tnarg, sn, tnarg, tt, ta, ext)
        } else {
-               printf("    { \"%s\", \"%s\", %s, RPM_%s_TYPE + RPM_%s_RETURN_TYPE, %d },\n", tnarg, sn, $3, tt, ta, ext)
+               printf("    { \"%s\", \"%s\", %s, RPM_%s_TYPE, RPM_%s_RETURN_TYPE, %d },\n", tnarg, sn, $3, tt, ta, ext)
        }
 }' < $1 | sort
 
index 5ea62b5..4995543 100644 (file)
@@ -17,6 +17,7 @@ struct headerTagTableEntry_s {
     const char * shortname;    /*!< "Human readable" short name. */
     rpmTag val;                        /*!< Tag numeric value. */
     rpmTagType type;           /*!< Tag type. */
+    rpmTagReturnType retype;   /*!< Tag return type. */
     int extension;             /*!< Extension or "real" tag */
 };
 
@@ -201,7 +202,8 @@ static rpmTagType _tagType(rpmTag tag)
                    i--;
                }
                t = _rpmTags.byValue[i];
-               return t->type;
+               /* XXX this is dumb */
+               return (rpmTagType)(t->type | t->retype);
            }
        }
        break;