diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-12 17:58:37 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-12 17:58:37 +0200 |
commit | b9010a3510033bfd83f07b47eda1cfa269b38429 (patch) | |
tree | 2fa8467d18f4e32ca0baa969e217c9b260153469 /lib/header.c | |
parent | 90cb50ff7abab62d99cfcda1f64f451aa2fe41cb (diff) | |
download | rpm-b9010a3510033bfd83f07b47eda1cfa269b38429.tar.gz rpm-b9010a3510033bfd83f07b47eda1cfa269b38429.tar.bz2 rpm-b9010a3510033bfd83f07b47eda1cfa269b38429.zip |
Add rpmdb record number to headers retrieved from rpmdb
- set "instance" number on retrieval from rpmdb
- add public headerGetInstance() function for retrieving the value
- ported from rpm5.org, useful for number of things
Diffstat (limited to 'lib/header.c')
-rw-r--r-- | lib/header.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/header.c b/lib/header.c index fa38c89f9..78b4f89fb 100644 --- a/lib/header.c +++ b/lib/header.c @@ -141,6 +141,7 @@ Header headerNew(void) h->blob = NULL; h->indexAlloced = INDEX_MALLOC_SIZE; h->indexUsed = 0; + h->instance = 0; h->flags |= HEADERFLAG_SORTED; h->index = (h->indexAlloced @@ -861,6 +862,7 @@ Header headerLoad(void * uh) h->blob = uh; h->indexAlloced = il + 1; h->indexUsed = il; + h->instance = 0; h->index = xcalloc(h->indexAlloced, sizeof(*h->index)); h->flags |= HEADERFLAG_SORTED; h->nrefs = 0; @@ -1953,3 +1955,7 @@ void headerCopyTags(Header headerFrom, Header headerTo, } } +unsigned int headerGetInstance(Header h) +{ + return h ? h->instance : 0; +} |