#include "system.h"
#include <netinet/in.h>
#include <header.h>
#include "debug.h"
Go to the source code of this file.
Data Structures | |
| struct | entryInfo |
| Description of tag data. More... | |
| struct | extensionCache |
| struct | headerIteratorS |
| Header tag iterator data structure. More... | |
| struct | headerToken |
| The Header data structure. More... | |
| struct | indexEntry |
| A single tag from a Header. More... | |
| struct | sprintfTag |
| struct | sprintfToken |
Defines | |
| #define | _DEBUG_SWAB 1 |
| #define | _DEBUG_INDEX 1 |
| #define | HEADER_OLDFILENAMES 1027 |
| #define | HEADER_BASENAMES 1117 |
| #define | INDEX_MALLOC_SIZE 8 |
| #define | PARSER_BEGIN 0 |
| #define | PARSER_IN_ARRAY 1 |
| #define | PARSER_IN_EXPR 2 |
| #define | REGION_TAG_TYPE RPM_BIN_TYPE |
| #define | REGION_TAG_COUNT sizeof(struct entryInfo) |
| #define | ENTRY_IS_REGION(_e) ((_e)->info.tag < HEADER_I18NTABLE) |
| #define | ENTRY_IN_REGION(_e) ((_e)->info.offset < 0) |
Functions | |
| const char* const | tagName (int tag) |
| Return name of tag from value. More... | |
| int | dataLength (int_32 type, const void *p, int_32 count, int onDisk) |
| Return length of entry data. More... | |
| int | regionSwab (struct indexEntry *entry, int il, int dl, const struct entryInfo *pe, char *dataStart, int regionid) |
| Swap int_32 and int_16 arrays within header region. More... | |
| void | copyEntry (const struct indexEntry *entry, int_32 *type, const void **p, int_32 *c, int minMem) |
| Retrieve data from header entry. More... | |
| HeaderIterator | headerInitIterator (Header h) |
| void | headerFreeIterator (HeaderIterator iter) |
| int | headerNextIterator (HeaderIterator hi, int_32 *tag, int_32 *type, const void **p, int_32 *c) |
| int | indexCmp (const void *avp, const void *bvp) |
| void | headerSort (Header h) |
| int | offsetCmp (const void *avp, const void *bvp) |
| void | headerUnsort (Header h) |
| Header | headerCopy (Header h) |
| Header | headerLoad (void *uh) |
| Header | headerCopyLoad (void *uh) |
| void* | doHeaderUnload (Header h, int *lengthPtr) |
| void* | headerUnload (Header h) |
| Header | headerReload (Header h, int tag) |
| int | headerWrite (FD_t fd, Header h, enum hMagic magicp) |
| Header | headerRead (FD_t fd, enum hMagic magicp) |
| void | headerDump (Header h, FILE *f, int flags, const struct headerTagTableEntry *tags) |
| struct indexEntry* | findEntry (Header h, int_32 tag, int_32 type) |
| Find matching (tag,type) entry in header. More... | |
| int | headerIsEntry (Header h, int_32 tag) |
| int | headerGetRawEntry (Header h, int_32 tag, int_32 *type, const void **p, int_32 *c) |
| int | headerMatchLocale (const char *td, const char *l, const char *le) |
| Does locale match entry in header i18n table? More... | |
| char* | headerFindI18NString (Header h, struct indexEntry *entry) |
| Return i18n string from header that matches locale. More... | |
| int | intGetEntry (Header h, int_32 tag, int_32 *type, const void **p, int_32 *c, int minMem) |
| Retrieve tag data from header. More... | |
| int | headerGetEntryMinMemory (Header h, int_32 tag, int_32 *type, const void **p, int_32 *c) |
| int | headerGetEntry (Header h, int_32 tag, int_32 *type, void **p, int_32 *c) |
| Header | headerNew () |
| void | headerFree (Header h) |
| Header | headerLink (Header h) |
| int | headerUsageCount (Header h) |
| unsigned int | headerSizeof (Header h, enum hMagic magicp) |
| void | copyData (int_32 type, void *dstPtr, const void *srcPtr, int_32 c, int dataLength) |
| void* | grabData (int_32 type, const void *p, int_32 c, int *lengthPtr) |
| Return (malloc'ed) copy of entry data. More... | |
| int | headerAddEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
| char** | headerGetLangs (Header h) |
| int | headerAddI18NString (Header h, int_32 tag, const char *string, const char *lang) |
| int | headerModifyEntry (Header h, int_32 tag, int_32 type, void *p, int_32 c) |
| int | headerAddOrAppendEntry (Header h, int_32 tag, int_32 type, void *p, int_32 c) |
| int | headerAppendEntry (Header h, int_32 tag, int_32 type, void *p, int_32 c) |
| int | headerRemoveEntry (Header h, int_32 tag) |
| char | escapedChar (const char ch) |
| void | freeFormat (struct sprintfToken *format, int num) |
| void | findTag (char *name, const struct headerTagTableEntry *tags, const struct headerSprintfExtension *extensions, const struct headerTagTableEntry **tagMatch, const struct headerSprintfExtension **extMatch) |
| int | parseExpression (struct sprintfToken *token, char *str, const struct headerTagTableEntry *tags, const struct headerSprintfExtension *extensions, char **endPtr, const char **errmsg) |
| int | parseFormat (char *str, const struct headerTagTableEntry *tags, const struct headerSprintfExtension *extensions, struct sprintfToken **formatPtr, int *numTokensPtr, char **endPtr, int state, const char **errmsg) |
| int | getExtension (Header h, headerTagTagFunction fn, int_32 *typeptr, const void **data, int_32 *countptr, struct extensionCache *ext) |
| char* | formatValue (struct sprintfTag *tag, Header h, const struct headerSprintfExtension *extensions, struct extensionCache *extCache, int element) |
| const char* | singleSprintf (Header h, struct sprintfToken *token, const struct headerSprintfExtension *extensions, struct extensionCache *extCache, int element) |
| struct extensionCache* | allocateExtensionCache (const struct headerSprintfExtension *extensions) |
| void | freeExtensionCache (const struct headerSprintfExtension *extensions, struct extensionCache *cache) |
| char* | headerSprintf (Header h, const char *origFmt, const struct headerTagTableEntry *tags, const struct headerSprintfExtension *extensions, const char **errmsg) |
| char* | octalFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
| char* | hexFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
| char* | realDateFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element, char *strftimeFormat) |
| char* | dateFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
| char* | dayFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
| char* | shescapeFormat (int_32 type, const void *data, char *formatPrefix, int padding, int element) |
| void | headerCopyTags (Header headerFrom, Header headerTo, int *tagstocopy) |
Variables | |
| unsigned char | header_magic [8] |
| int | typeSizes [] |
| const struct headerSprintfExtension | headerDefaultFormats [] |
Definition in file header.c.
|
|
Definition at line 74 of file header.c. Referenced by headerAddI18NString(), headerAppendEntry(), headerFree(), headerModifyEntry(), and headerRemoveEntry().
|
|
|
Definition at line 73 of file header.c. Referenced by copyEntry(), doHeaderUnload(), headerFree(), headerNextIterator(), headerReload(), and headerSizeof().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 2525 of file header.c. Referenced by headerSprintf().
|
|
|
Definition at line 1477 of file header.c. Referenced by grabData(), and headerAppendEntry().
|
|
|
Retrieve data from header entry.
Definition at line 317 of file header.c. Referenced by headerGetRawEntry(), headerNextIterator(), and intGetEntry().
|
|
|
Return length of entry data.
Definition at line 160 of file header.c. Referenced by grabData(), headerAppendEntry(), and regionSwab().
|
|
|
|
|
|
|
|
|
Definition at line 662 of file header.c. Referenced by headerReload(), headerUnload(), and headerWrite().
|
|
|
Definition at line 1813 of file header.c. Referenced by parseFormat().
|
|
|
Find matching (tag,type) entry in header.
|
|
|
Definition at line 1852 of file header.c. Referenced by parseExpression(), and parseFormat().
|
|
|
Definition at line 2283 of file header.c. Referenced by singleSprintf().
|
|
|
Definition at line 2543 of file header.c. Referenced by headerSprintf().
|
|
|
Definition at line 1827 of file header.c. Referenced by parseExpression(), and parseFormat().
|
|
|
Definition at line 2265 of file header.c. Referenced by formatValue(), and singleSprintf().
|
|
|
Return (malloc'ed) copy of entry data.
Definition at line 1514 of file header.c. Referenced by headerAddEntry(), and headerModifyEntry().
|
|
|
|
|
|
Return i18n string from header that matches locale.
Definition at line 1277 of file header.c. Referenced by intGetEntry().
|
|
|
Does locale match entry in header i18n table?
* The range [l,le) contains the next locale to match: * ll[_CC][.EEEEE][@dddd] * where * ll ISO language code (in lowercase). * CC (optional) ISO coutnry code (in uppercase). * EEEEE (optional) encoding (not really standardized). * dddd (optional) dialect. *
Definition at line 1204 of file header.c. Referenced by headerFindI18NString().
|
|
|
|
|
|
|
|
|
|
|
|
Retrieve tag data from header.
Definition at line 1328 of file header.c. Referenced by headerGetEntry(), and headerGetEntryMinMemory().
|
|
|
|
|
|
|
|
|
Definition at line 2144 of file header.c. Referenced by parseFormat().
|
|
|
Definition at line 1907 of file header.c. Referenced by headerSprintf(), and parseExpression().
|
|
|
Definition at line 2652 of file header.c. Referenced by dateFormat(), and dayFormat().
|
|
|
Swap int_32 and int_16 arrays within header region. This code is way more twisty than I would like. A bug with RPM_I18NSTRING_TYPE in rpm-2.5.x (fixed in August 1998) causes the offset and length of elements in a header region to disagree regarding the total length of the region data. The "fix" is to compute the size using both offset and length and return the larger of the two numbers as the size of the region. Kinda like computing left and right Riemann sums of the data elements to determine the size of a data structure, go figger :-). There's one other twist if a header region tag is in the set to be swabbed, as the data for a header region is located after all other tag data.
Definition at line 240 of file header.c. Referenced by copyEntry(), doHeaderUnload(), and headerLoad().
|
|
|
|
|
|
Definition at line 2411 of file header.c. Referenced by headerSprintf().
|
|
|
Return name of tag from value.
|
|
|
Initial value: {
0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00
} |
1.2.6-20010408 written by Dimitri van Heesch,
© 1997-2001