summaryrefslogtreecommitdiff
path: root/rpmdb
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-01-30 13:03:54 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-01-30 13:03:54 +0200
commit7751f84bf03076eb6ad90ad0d10144846726bdfb (patch)
tree474d78ba21e4fb55d416f9064b3afb99c7ec2992 /rpmdb
parentecabf137102a980528f166b9690efb8adbcef95f (diff)
downloadrpm-7751f84bf03076eb6ad90ad0d10144846726bdfb.tar.gz
rpm-7751f84bf03076eb6ad90ad0d10144846726bdfb.tar.bz2
rpm-7751f84bf03076eb6ad90ad0d10144846726bdfb.zip
Move HGE and related prototypes to header.h
Diffstat (limited to 'rpmdb')
-rw-r--r--rpmdb/header.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/rpmdb/header.h b/rpmdb/header.h
index a37dbd9e4..eec2468dc 100644
--- a/rpmdb/header.h
+++ b/rpmdb/header.h
@@ -582,6 +582,81 @@ uint32_t headerGetColor(Header h);
*/
int headerIsSource(Header h);
+/* ==================================================================== */
+/** \name RPMTS */
+/**
+ * Prototype for headerFreeData() vector.
+ *
+ * @param data address of data (or NULL)
+ * @param type type of data (or to force free)
+ * @return NULL always
+ */
+typedef
+ void * (*HFD_t) (rpm_data_t data, rpm_tagtype_t type);
+
+/**
+ * Prototype for headerGetEntry() vector.
+ *
+ * Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with
+ * RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE
+ * entry is present).
+ *
+ * @param h header
+ * @param tag tag
+ * @retval type address of tag value data type (or NULL)
+ * @retval p address of pointer to tag value(s) (or NULL)
+ * @retval c address of number of values (or NULL)
+ * @return 1 on success, 0 on failure
+ */
+typedef int (*HGE_t) (Header h, rpm_tag_t tag,
+ rpm_tagtype_t * type,
+ rpm_data_t * p,
+ rpm_count_t * c);
+
+/**
+ * Prototype for headerAddEntry() vector.
+ *
+ * Duplicate tags are okay, but only defined for iteration (with the
+ * exceptions noted below). While you are allowed to add i18n string
+ * arrays through this function, you probably don't mean to. See
+ * headerAddI18NString() instead.
+ *
+ * @param h header
+ * @param tag tag
+ * @param type tag value data type
+ * @param p pointer to tag value(s)
+ * @param c number of values
+ * @return 1 on success, 0 on failure
+ */
+typedef int (*HAE_t) (Header h, rpm_tag_t tag, rpm_tagtype_t type,
+ rpm_constdata_t p, rpm_count_t c);
+
+/**
+ * Prototype for headerModifyEntry() vector.
+ * If there are multiple entries with this tag, the first one gets replaced.
+ *
+ * @param h header
+ * @param tag tag
+ * @param type tag value data type
+ * @param p pointer to tag value(s)
+ * @param c number of values
+ * @return 1 on success, 0 on failure
+ */
+typedef int (*HME_t) (Header h, rpm_tag_t tag, rpm_tagtype_t type,
+ rpm_constdata_t p, rpm_count_t c);
+
+/**
+ * Prototype for headerRemoveEntry() vector.
+ * Delete tag in header.
+ * Removes all entries of type tag from the header, returns 1 if none were
+ * found.
+ *
+ * @param h header
+ * @param tag tag
+ * @return 0 on success, 1 on failure (INCONSISTENT)
+ */
+typedef int (*HRE_t) (Header h, rpm_tag_t tag);
+
#ifdef __cplusplus
}
#endif