summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <devnull@localhost>1997-03-03 23:20:18 +0000
committerroot <devnull@localhost>1997-03-03 23:20:18 +0000
commit1874a35403f88f592f31d07a243102d94ab10827 (patch)
tree81f8d37daa074c6e1ed1c32a3b2c7fdf6c2caf49
parent440a29281285bfca633515861763357598bef387 (diff)
downloadlibrpm-tizen-1874a35403f88f592f31d07a243102d94ab10827.tar.gz
librpm-tizen-1874a35403f88f592f31d07a243102d94ab10827.tar.bz2
librpm-tizen-1874a35403f88f592f31d07a243102d94ab10827.zip
export headerSort()
CVS patchset: 1465 CVS date: 1997/03/03 23:20:18
-rw-r--r--lib/header.c13
-rw-r--r--lib/header.h1
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/header.c b/lib/header.c
index ea3da6642..628a57376 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -56,7 +56,6 @@ struct indexEntry {
int length; /* Computable, but why bother */
};
-static void indexSort(Header h);
static int indexCmp(const void *ap, const void *bp);
static void *doHeaderUnload(Header h, int * lengthPtr);
static struct indexEntry *findEntry(Header h, int_32 tag, int_32 type);
@@ -80,7 +79,7 @@ HeaderIterator headerInitIterator(Header h)
{
HeaderIterator hi = malloc(sizeof(struct headerIteratorS));
- indexSort(h);
+ headerSort(h);
hi->h = h;
hi->next_index = 0;
@@ -125,7 +124,7 @@ static int indexCmp(const void *ap, const void *bp)
}
}
-static void indexSort(Header h) {
+void headerSort(Header h) {
if (!h->sorted) {
qsort(h->index, h->indexUsed, sizeof(struct indexEntry), indexCmp);
h->sorted = 1;
@@ -141,7 +140,7 @@ Header headerCopy(Header h)
/* Sort the index -- not really necessary but some old apps may depend
on this and it certainly won't hurt anything */
- indexSort(h);
+ headerSort(h);
headerIter = headerInitIterator(h);
while (headerNextIterator(headerIter, &tag, &type, &ptr, &count)) {
@@ -317,7 +316,7 @@ static void *doHeaderUnload(Header h, int * lengthPtr)
char * chptr, * src, * dataStart;
int count;
- indexSort(h);
+ headerSort(h);
*lengthPtr = headerSizeof(h, 0);
pi = p = malloc(*lengthPtr);
@@ -517,7 +516,7 @@ static struct indexEntry *findEntry(Header h, int_32 tag, int_32 type)
struct indexEntry * entry, * entry2, * last;
struct indexEntry key;
- if (!h->sorted) indexSort(h);
+ if (!h->sorted) headerSort(h);
key.info.tag = tag;
@@ -652,7 +651,7 @@ unsigned int headerSizeof(Header h, int magicp)
int i, diff;
int_32 type;
- indexSort(h);
+ headerSort(h);
size = sizeof(int_32); /* count of index entries */
size += sizeof(int_32); /* length of data */
diff --git a/lib/header.h b/lib/header.h
index feb2d62f7..17fff4f03 100644
--- a/lib/header.h
+++ b/lib/header.h
@@ -89,6 +89,7 @@ int headerNextIterator(HeaderIterator iter,
void headerFreeIterator(HeaderIterator iter);
Header headerCopy(Header h);
+void headerSort(Header h);
/* Entry Types */