Add and use (internal) method for setting header instance
authorPanu Matilainen <pmatilai@redhat.com>
Sun, 30 Nov 2008 15:22:24 +0000 (17:22 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Sun, 30 Nov 2008 15:22:24 +0000 (17:22 +0200)
- avoid mucking with header internals directly...

lib/header.c
lib/header_internal.h
lib/rpmdb.c

index 78b4f89..7ff05bf 100644 (file)
@@ -1959,3 +1959,8 @@ unsigned int headerGetInstance(Header h)
 {
     return h ? h->instance : 0;
 }
+
+void headerSetInstance(Header h, unsigned int instance)
+{
+    h->instance = instance;
+}    
index 6139a4a..cd34392 100644 (file)
@@ -103,6 +103,14 @@ RPM_GNUC_INTERNAL
 uint64_t htonll( uint64_t n );
 
 /** \ingroup header
+ * Set header instance (rpmdb record number)
+ * @param h            header
+ * @param instance     record number
+ */
+RPM_GNUC_INTERNAL
+void headerSetInstance(Header h, unsigned int instance);
+
+/** \ingroup header
  * Return array of locales found in header.
  * The array is terminated with a NULL sentinel.
  * @param h            header
index bc5c9ed..2fe429b 100644 (file)
@@ -2097,7 +2097,7 @@ top:
            goto top;
        return NULL;
     }
-    mi->mi_h->instance = mi->mi_offset;
+    headerSetInstance(mi->mi_h, mi->mi_offset);
 
     mi->mi_prevoffset = mi->mi_offset;
     mi->mi_modified = 0;