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);
{
HeaderIterator hi = malloc(sizeof(struct headerIteratorS));
- indexSort(h);
+ headerSort(h);
hi->h = h;
hi->next_index = 0;
}
}
-static void indexSort(Header h) {
+void headerSort(Header h) {
if (!h->sorted) {
qsort(h->index, h->indexUsed, sizeof(struct indexEntry), indexCmp);
h->sorted = 1;
/* 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)) {
char * chptr, * src, * dataStart;
int count;
- indexSort(h);
+ headerSort(h);
*lengthPtr = headerSizeof(h, 0);
pi = p = malloc(*lengthPtr);
struct indexEntry * entry, * entry2, * last;
struct indexEntry key;
- if (!h->sorted) indexSort(h);
+ if (!h->sorted) headerSort(h);
key.info.tag = tag;
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 */