Files | |
file | formats.c |
file | hdrinline.h |
file | header.c |
file | header.h |
An rpm header carries all information about a package. | |
file | header_internal.c |
file | header_internal.h |
file | package.c |
file | rpmlib.h |
Data Structures | |
struct | headerToken |
Typedefs | |
typedef const char* | errmsg_t |
typedef int_32* | hTAG_t |
typedef struct headerToken* | Header |
typedef struct headerIteratorS* | HeaderIterator |
typedef struct headerTagTableEntry_s* | headerTagTableEntry |
typedef char* (* | headerTagFormatFunction )(int_32 type, const void *data, char *formatPrefix, int padding, int element) |
typedef int (* | headerTagTagFunction )(Header h, hTYP_t type, hPTR_t *data, hCNT_t count, int *freeData) |
typedef struct headerSprintfExtension_s* | headerSprintfExtension |
typedef Header (* | HDRnew )(void) |
typedef Header (* | HDRfree )(Header h) |
typedef Header (* | HDRlink )(Header h) |
typedef Header (* | HDRunlink )(Header h) |
typedef void (* | HDRsort )(Header h) |
typedef void (* | HDRunsort )(Header h) |
typedef unsigned int (* | HDRsizeof )(Header h, enum hMagic magicp) |
typedef void* (* | HDRunload )(Header h) |
typedef Header (* | HDRreload )(Header h, int tag) |
typedef Header (* | HDRcopy )(Header h) |
typedef Header (* | HDRload )(void *uh) |
typedef Header (* | HDRcopyload )(const void *uh) |
typedef Header (* | HDRhdrread )(FD_t fd, enum hMagic magicp) |
typedef int (* | HDRhdrwrite )(FD_t fd, Header h, enum hMagic magicp) |
typedef int (* | HDRisentry )(Header h, int_32 tag) |
typedef void* (* | HDRfreetag )(Header h, const void *data, rpmTagType type) |
typedef int (* | HDRget )(Header h, int_32 tag, hTYP_t type, void **p, hCNT_t c) |
typedef int (* | HDRgetmin )(Header h, int_32 tag, hTYP_t type, hPTR_t *p, hCNT_t c) |
typedef int (* | HDRadd )(Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
typedef int (* | HDRappend )(Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
typedef int (* | HDRaddorappend )(Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
typedef int (* | HDRaddi18n )(Header h, int_32 tag, const char *string, const char *lang) |
typedef int (* | HDRmodify )(Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
typedef int (* | HDRremove )(Header h, int_32 tag) |
typedef char* (* | HDRhdrsprintf )(Header h, const char *fmt, const struct headerTagTableEntry_s *tags, const struct headerSprintfExtension_s *extensions, errmsg_t *errmsg) |
typedef void (* | HDRcopytags )(Header headerFrom, Header headerTo, hTAG_t tagstocopy) |
typedef HeaderIterator (* | HDRfreeiter )(HeaderIterator hi) |
typedef HeaderIterator (* | HDRinititer )(Header h) |
typedef int (* | HDRnextiter )(HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t *p, hCNT_t c) |
typedef struct HV_s* | HV_t |
typedef struct entryInfo* | entryInfo |
typedef struct indexEntry* | indexEntry |
typedef struct sprintfTag* | sprintfTag |
typedef struct extensionCache* | extensionCache |
typedef struct sprintfToken* | sprintfToken |
Enumerations | |
enum | headerSprintfExtenstionType { HEADER_EXT_LAST = 0, HEADER_EXT_FORMAT, HEADER_EXT_MORE, HEADER_EXT_TAG } |
enum | hMagic { HEADER_MAGIC_NO = 0, HEADER_MAGIC_YES = 1 } |
enum | rpmTagType_e { RPM_NULL_TYPE = 0, RPM_CHAR_TYPE = 1, RPM_INT8_TYPE = 2, RPM_INT16_TYPE = 3, RPM_INT32_TYPE = 4, RPM_STRING_TYPE = 6, RPM_BIN_TYPE = 7, RPM_STRING_ARRAY_TYPE = 8, RPM_I18NSTRING_TYPE = 9#define RPM_MAX_TYPE } |
enum | rpmSubTagType_e { RPM_REGION_TYPE = -10, RPM_BIN_ARRAY_TYPE = -11, RPM_XREF_TYPE = -12 } |
Functions | |
HV_t | h2hv (Header h) |
Header | headerNew (void) |
Header | headerFree (Header h) |
Header | headerLink (Header h) |
Header | headerUnlink (Header h) |
void | headerSort (Header h) |
void | headerUnsort (Header h) |
unsigned int | headerSizeof (Header h, enum hMagic magicp) |
void* | headerUnload (Header h) |
Header | headerReload (Header h, int tag) |
Header | headerCopy (Header h) |
Header | headerLoad (void *uh) |
Header | headerCopyLoad (const void *uh) |
Header | headerRead (FD_t fd, enum hMagic magicp) |
int | headerWrite (FD_t fd, Header h, enum hMagic magicp) |
int | headerIsEntry (Header h, int_32 tag) |
void* | headerFreeTag (Header h, const void *data, rpmTagType type) |
int | headerGetEntry (Header h, int_32 tag, hTYP_t type, void **p, hCNT_t c) |
int | headerGetEntryMinMemory (Header h, int_32 tag, hTYP_t type, hPTR_t *p, hCNT_t c) |
int | headerAddEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
int | headerAppendEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
int | headerAddOrAppendEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
int | headerAddI18NString (Header h, int_32 tag, const char *string, const char *lang) |
int | headerModifyEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c) |
int | headerRemoveEntry (Header h, int_32 tag) |
char* | headerSprintf (Header h, const char *fmt, const struct headerTagTableEntry_s *tbltags, const struct headerSprintfExtension_s *extensions, errmsg_t *errmsg) |
void | headerCopyTags (Header headerFrom, Header headerTo, hTAG_t tagstocopy) |
HeaderIterator | headerFreeIterator (HeaderIterator hi) |
HeaderIterator | headerInitIterator (Header h) |
int | headerNextIterator (HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t *p, hCNT_t c) |
int | regionSwab (indexEntry entry, int il, int dl, entryInfo pe, char *dataStart, int regionid) |
void* | doHeaderUnload (Header h, int *lengthPtr) |
int | copyEntry (const indexEntry entry, hTYP_t type, hPTR_t *p, hCNT_t c, int minMem) |
void* | headerFreeData (const void *data, rpmTagType type) |
char** | headerGetLangs (Header h) |
int | headerGetRawEntry (Header h, int_32 tag, hTYP_t type, hPTR_t *p, hCNT_t c) |
int | headerUsageCount (Header h) |
void | headerDump (Header h, FILE *f, int flags, const struct headerTagTableEntry_s *tags) |
int | headerNVR (Header h, const char **np, const char **vp, const char **rp) |
void | headerMergeLegacySigs (Header h, const Header sig) |
Header | headerRegenSigHeader (const Header h) |
Variables | |
struct HV_s* | hdrVec |
|
Add tag to header. Duplicate tags are okay, but only defined for iteration (with the exceptions noted below). While you are allowed to add i18n string arrays through this function, you probably don't mean to. See headerAddI18NString() instead.
|
|
Add locale specific tag to header. A NULL lang is interpreted as the C locale. Here are the rules: * - If the tag isn't in the header, it's added with the passed string * as new value. * - If the tag occurs multiple times in entry, which tag is affected * by the operation is undefined. * - If the tag is in the header w/ this language, the entry is * *replaced* (like headerModifyEntry()). *
|
|
Add or append element to tag array in header.
|
|
Append element to tag array in header. Appends item p to entry w/ tag and type as passed. Won't work on RPM_STRING_TYPE. Any pointers into header memory returned from headerGetEntryMinMemory() for this entry are invalid after this call has been made!
|
|
Duplicate a header.
|
|
Make a copy and convert header to in-memory representation.
|
|
Duplicate tag values from one header into another. |
|
Dereference a header instance.
|
|
Destroy header tag iterator.
|
|
Free data allocated when retrieved from header.
|
|
Retrieve tag value. Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE entry is present).
|
|
Retrieve tag value using header internal array. Get an entry using as little extra RAM as possible to return the tag value. This is only an issue for RPM_STRING_ARRAY_TYPE.
|
|
Read (and load) header from file handle.
|
|
Return formatted output string from header tags. The returned string must be free()d.
|
|
Write (with unload) header to file handle.
|
|
Create header tag iterator.
|
|
Check if tag is in header.
|
|
Reference a header instance.
|
|
Convert header to in-memory representation.
|
|
Modify tag in header. If there are multiple entries with this tag, the first one gets replaced.
|
|
Create new (empty) header instance.
|
|
Return next tag from header.
|
|
Convert header to on-disk representation, and then reload. This is used to insure that all header data is in one chunk.
|
|
Delete tag in header. Removes all entries of type tag from the header, returns 1 if none were found.
|
|
Return size of on-disk header representation in bytes.
|
|
Sort tags in header.
|
|
Dereference a header instance.
|
|
Convert header to on-disk representation.
|
|
Restore tags in header to original ordering.
|
|
Header method vectors. |
|
|
|
|
|
Description of tag data. Definition at line 25 of file header_internal.h. |
|
|
|
Definition at line 83 of file header_internal.h. |
|
|
|
Define header tag output formats. |
|
HEADER_EXT_TAG format function prototype. This will only ever be passed RPM_INT32_TYPE or RPM_STRING_TYPE to help keep things simple.
|
|
Associate tag names with numeric values. |
|
HEADER_EXT_FORMAT format function prototype. This is allowed to fail, which indicates the tag doesn't exist.
|
|
A single tag from a Header. Definition at line 43 of file header_internal.h. |
|
Definition at line 69 of file header_internal.h. |
|
Definition at line 95 of file header_internal.h. |
|
Include calculation for 8 bytes of (magic, 0)? |
|
|
|
New rpm data types under consideration/development. These data types may (or may not) be added to rpm at some point. In order to avoid incompatibility with legacy versions of rpm, these data (sub-)types are introduced into the header by overloading RPM_BIN_TYPE, with the binary value of the tag a 16 byte image of what should/will be in the header index, followed by per-tag private data. |
|
The basic types of data in tags from headers. |
|
Retrieve data from header entry.
Definition at line 1249 of file header.c. Referenced by headerGetRawEntry(), headerNextIterator(), and intGetEntry(). |
|
Definition at line 501 of file header.c. Referenced by headerReload(), headerUnload(), and headerWrite(). |
|
Definition at line 22 of file hdrinline.h. Referenced by headerAddEntry(), headerAddI18NString(), headerAddOrAppendEntry(), headerAppendEntry(), headerCopy(), headerFree(), headerFreeTag(), headerGetEntry(), headerGetEntryMinMemory(), headerIsEntry(), headerLink(), headerModifyEntry(), headerReload(), headerRemoveEntry(), headerSizeof(), headerSort(), headerSprintf(), headerUnlink(), headerUnload(), headerUnsort(), and headerWrite(). |
|
Add tag to header. Duplicate tags are okay, but only defined for iteration (with the exceptions noted below). While you are allowed to add i18n string arrays through this function, you probably don't mean to. See headerAddI18NString() instead.
Definition at line 315 of file hdrinline.h. |
|
Add locale specific tag to header. A NULL lang is interpreted as the C locale. Here are the rules: * - If the tag isn't in the header, it's added with the passed string * as new value. * - If the tag occurs multiple times in entry, which tag is affected * by the operation is undefined. * - If the tag is in the header w/ this language, the entry is * *replaced* (like headerModifyEntry()). *
Definition at line 382 of file hdrinline.h. |
|
Add or append element to tag array in header.
Definition at line 354 of file hdrinline.h. |
|
Append element to tag array in header. Appends item p to entry w/ tag and type as passed. Won't work on RPM_STRING_TYPE. Any pointers into header memory returned from headerGetEntryMinMemory() for this entry are invalid after this call has been made!
Definition at line 336 of file hdrinline.h. |
|
Duplicate a header.
Definition at line 163 of file hdrinline.h. |
|
Make a copy and convert header to in-memory representation.
Definition at line 187 of file hdrinline.h. |
|
Duplicate tag values from one header into another.
Definition at line 451 of file hdrinline.h. |
|
Dump a header in human readable format (for debugging).
Definition at line 30 of file header_internal.c. Referenced by main(). |
|
Dereference a header instance.
Definition at line 47 of file hdrinline.h. |
|
Free data allocated when retrieved from header.
Definition at line 700 of file header.h. Referenced by formatValue(), headerCopy(), headerCopyTags(), initSourceHeader(), psmStage(), rpmCheckSig(), rpmInstall(), rpmReSign(), and singleSprintf(). |
|
Destroy header tag iterator.
Definition at line 466 of file hdrinline.h. |
|
Free data allocated when retrieved from header.
Definition at line 247 of file hdrinline.h. |
|
Retrieve tag value. Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE entry is present).
Definition at line 268 of file hdrinline.h. |
|
Retrieve tag value using header internal array. Get an entry using as little extra RAM as possible to return the tag value. This is only an issue for RPM_STRING_ARRAY_TYPE.
Definition at line 290 of file hdrinline.h. |
|
Return array of locales found in header. The array is terminated with a NULL sentinel.
Definition at line 11 of file header_internal.c. |
|
Retrieve tag value with type match. If *type is RPM_NULL_TYPE any type will match, otherwise only *type will match.
Referenced by headerGetLangs(). |
|
Create header tag iterator.
Definition at line 478 of file hdrinline.h. |
|
Check if tag is in header.
Definition at line 230 of file hdrinline.h. |
|
Reference a header instance.
Definition at line 62 of file hdrinline.h. |
|
Convert header to in-memory representation.
Definition at line 175 of file hdrinline.h. |
|
Translate and merge legacy signature tags into header. Definition at line 20 of file package.c. Referenced by rpmReadPackageHeader(), rpmReadPackageInfo(), and writeRPM(). |
|
Modify tag in header. If there are multiple entries with this tag, the first one gets replaced.
Definition at line 400 of file hdrinline.h. |
|
Return name, version, release strings from header.
Definition at line 31 of file depends.c. Referenced by IDTXglob(), IDTXload(), alAddPackage(), checkPackageDeps(), doSetupMacro(), genSourceRpmName(), handleOneTrigger(), headerMatchesDepFlags(), i18nTag(), lookupPackage(), packageBinaries(), parseForSimple(), parsePreamble(), parseSpec(), printNewSpecfile(), processBinaryFiles(), providePackageNVR(), psAppend(), rpmInstall(), rpmdbAdd(), rpmdbNextIterator(), rpmdbRebuild(), rpmdbRemove(), rpmdepCheck(), rpmtransAddPackage(), runScript(), showQueryPackage(), showVerifyPackage(), verifyDependencies(), and writeRPM(). |
|
Create new (empty) header instance.
Definition at line 35 of file hdrinline.h. Referenced by headerCopy(), headerCopyWithConvert(), initSourceHeader(), newPackage(), newSpec(), psmStage(), rpmNewSignature(), rpmReSign(), and rpmReadSignature(). |
|
Return next tag from header.
Definition at line 494 of file hdrinline.h. |
|
Read (and load) header from file handle.
Definition at line 200 of file hdrinline.h. |
|
Regenerate signature header.
Definition at line 75 of file package.c. Referenced by psmStage(). |
|
Convert header to on-disk representation, and then reload. This is used to insure that all header data is in one chunk.
Definition at line 149 of file hdrinline.h. |
|
Delete tag in header. Removes all entries of type tag from the header, returns 1 if none were found.
Definition at line 417 of file hdrinline.h. |
|
Return size of on-disk header representation in bytes.
Definition at line 120 of file hdrinline.h. |
|
Sort tags in header.
Definition at line 89 of file hdrinline.h. |
|
Return formatted output string from header tags. The returned string must be free()d.
Definition at line 435 of file hdrinline.h. |
|
Dereference a header instance.
Definition at line 74 of file hdrinline.h. |
|
Convert header to on-disk representation.
Definition at line 135 of file hdrinline.h. |
|
Restore tags in header to original ordering.
Definition at line 103 of file hdrinline.h. |
|
Return header reference count.
Definition at line 164 of file header_internal.h. |
|
Write (with unload) header to file handle.
Definition at line 214 of file hdrinline.h. |
|
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 403 of file header.c. Referenced by copyEntry(), doHeaderUnload(), and headerLoad(). |
|
Header methods for rpm headers. Definition at line 18 of file hdrinline.h. |