Add yet more rpmTagTagTagFoo() functions
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 09:30:05 +0000 (12:30 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 09:30:05 +0000 (12:30 +0300)
- Two stupid new getters: one for the real tag type, and another
  for the return type. rpmTagGetType() returns both requiring bitmasking
  all over the place

lib/rpmtag.h
lib/tagname.c

index 0011f65..7fc6fbc 100644 (file)
@@ -401,11 +401,25 @@ const char * rpmTagGetName(rpmTag tag);
 /** \ingroup rpmtag
  * Return tag data type from value.
  * @param tag          tag value
- * @return             tag data type, RPM_NULL_TYPE on not found.
+ * @return             tag data type + return type, RPM_NULL_TYPE on not found.
  */
 rpmTagType rpmTagGetType(rpmTag tag);
 
 /** \ingroup rpmtag
+ * Return tag data type from value.
+ * @param tag          tag value
+ * @return             tag data type, RPM_NULL_TYPE on not found.
+ */
+rpmTagType rpmTagGetTagType(rpmTag tag);
+
+/** \ingroup rpmtag
+ * Return tag data type from value.
+ * @param tag          tag value
+ * @return             tag data return type, RPM_NULL_TYPE on not found.
+ */
+rpmTagReturnType rpmTagGetReturnType(rpmTag tag);
+
+/** \ingroup rpmtag
  * Return tag data class from value.
  * @param tag          tag value
  * @return             tag data class, RPM_NULL_CLASS on not found.
index 4995543..5861044 100644 (file)
@@ -253,6 +253,16 @@ rpmTagType rpmTagGetType(rpmTag tag)
     return ((*rpmTags->tagType)(tag));
 }
 
+rpmTagType rpmTagGetTagType(rpmTag tag)
+{
+    return (rpmTagType)((*rpmTags->tagType)(tag) & RPM_MASK_TYPE);
+}
+
+rpmTagReturnType rpmTagGetReturnType(rpmTag tag)
+{
+    return ((*rpmTags->tagType)(tag) & RPM_MASK_RETURN_TYPE);
+}
+
 rpmTagClass rpmTagTypeGetClass(rpmTagType type)
 {
     rpmTagClass class;