Files | |
file | formats.c |
file | hdrinline.h |
file | hdrproto.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 headerToken * | Header |
typedef headerIteratorS * | HeaderIterator |
typedef 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 headerSprintfExtension_s * | headerSprintfExtension |
typedef enum rpmTagType_e | rpmTagType |
typedef enum rpmSubTagType_e | rpmSubTagType |
typedef Header(* | HDRnew )(void) |
typedef Header(* | HDRfree )(Header h) |
typedef Header(* | HDRlink )(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 HV_s * | HV_t |
typedef entryInfo * | entryInfo |
typedef indexEntry * | indexEntry |
typedef sprintfTag * | sprintfTag |
typedef extensionCache * | extensionCache |
typedef 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 } |
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) |
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 *tags, 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 | |
HV_s * | hdrVec = &hdrVec1 |
unsigned char | header_magic [8] |
size_t | headerMaxbytes = (32*1024*1024) |
int | typeSizes [] |
const struct headerSprintfExtension_s | headerDefaultFormats [] |
|
Description of tag data. Definition at line 25 of file header_internal.h. |
|
Definition at line 110 of file header.h. Referenced by headerSizeof, headerSprintf, parseExpression, and parseFormat. |
|
Definition at line 83 of file header_internal.h. |
|
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.
|
|
Convert header to on-disk representation.
|
|
Restore tags in header to original ordering.
|
|
|
|
|
|
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.
Definition at line 157 of file header.h. Referenced by formatValue. |
|
Associate tag names with numeric values. |
|
HEADER_EXT_FORMAT format function prototype. This is allowed to fail, which indicates the tag doesn't exist.
Definition at line 171 of file header.h. Referenced by getExtension. |
|
Definition at line 114 of file header.h. Referenced by headerCopyTags, headerNextIterator, headerSizeof, and intGetEntry. |
|
Header method vectors. |
|
A single tag from a Header. Definition at line 43 of file header_internal.h. |
|
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. Referenced by addReqProv, alAddPackage, checkPackageDeps, compressFilelist, descriptionTag, doBuildFileList, filenamesTag, fpLookupHeader, fssizesTag, groupTag, handlePreambleTag, headerFreeTag, i18nTag, IDTXglob, IDTXload, instprefixTag, isMemberInEntry, mireSkip, printDeps, providePackageNVR, rangeMatchesDepFlags, rpmdbAdd, rpmdbFindByFile, rpmdbFindFpList, rpmdbRemove, rpmdepCheck, rpmtransAddPackage, showQueryPackage, summaryTag, timeCheck, triggercondsTag, and triggertypeTag. |
|
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)? Definition at line 202 of file header.h. Referenced by headerFree, headerRead, headerSizeof, and headerWrite. |
|
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 1083 of file header.c. References ENTRY_IS_REGION, hCNT_t, hPTR_t, hTYP_t, int_32, REGION_TAG_COUNT, regionSwab, RPM_BIN_TYPE, RPM_I18NSTRING_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, and xmalloc. Referenced by headerGetRawEntry, headerNextIterator, and intGetEntry. |
|
Definition at line 450 of file header.c. References _free, entryInfo::count, indexEntry::data, ENTRY_IS_REGION, hdrchkData, hdrchkTags, HEADERFLAG_LEGACY, HEADERFLAG_SORTED, headerSort, headerUnsort, indexEntry::info, int_16, int_32, indexEntry::length, entryInfo::offset, indexEntry::rdlen, regionSwab, RPM_INT16_TYPE, RPM_INT32_TYPE, entryInfo::tag, entryInfo::type, typeSizes, and xmalloc. Referenced by headerReload, headerUnload, and headerWrite. |
|
Definition at line 20 of file hdrinline.h. Referenced by headerAddEntry, headerAddI18NString, headerAddOrAppendEntry, headerAppendEntry, headerCopy, headerFree, headerFreeTag, headerGetEntry, headerGetEntryMinMemory, headerIsEntry, headerLink, headerModifyEntry, headerReload, headerRemoveEntry, headerSizeof, headerSort, headerSprintf, 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 293 of file hdrinline.h. References h2hv, HV_s::hdradd, and int_32. |
|
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 360 of file hdrinline.h. References h2hv, HV_s::hdraddi18n, and int_32. |
|
Add or append element to tag array in header.
Definition at line 332 of file hdrinline.h. References h2hv, HV_s::hdraddorappend, and int_32. |
|
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 314 of file hdrinline.h. References h2hv, HV_s::hdrappend, and int_32. |
|
Duplicate a header.
Definition at line 141 of file hdrinline.h. References h2hv, and HV_s::hdrcopy. |
|
Make a copy and convert header to in-memory representation.
Definition at line 165 of file hdrinline.h. References HV_s::hdrcopyload. |
|
Duplicate tag values from one header into another.
Definition at line 429 of file hdrinline.h. References HV_s::hdrcopytags, and hTAG_t. |
|
Dump a header in human readable format (for debugging).
Definition at line 30 of file header_internal.c. References entryInfo::count, and int_32. Referenced by main. |
|
Dereference a header instance.
Definition at line 44 of file hdrinline.h. References h2hv, and HV_s::hdrfree. |
|
Free data allocated when retrieved from header.
Definition at line 682 of file header.h. Referenced by formatValue, headerCopy, headerCopyTags, initSourceHeader, rhnUnload, rpmCheckSig, rpmInstall, rpmMergeHeaders, rpmReSign, and singleSprintf. |
|
Destroy header tag iterator.
Definition at line 442 of file hdrinline.h. References HV_s::hdrfreeiter. |
|
Free data allocated when retrieved from header.
Definition at line 225 of file hdrinline.h. References h2hv, HV_s::hdrfreetag, and rpmTagType. |
|
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 246 of file hdrinline.h. References h2hv, hCNT_t, HV_s::hdrget, hTYP_t, and int_32. |
|
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 268 of file hdrinline.h. References h2hv, hCNT_t, HV_s::hdrgetmin, hPTR_t, hTYP_t, and int_32. |
|
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 454 of file hdrinline.h. References HV_s::hdrinititer. |
|
Check if tag is in header.
Definition at line 208 of file hdrinline.h. References h2hv, HV_s::hdrisentry, and int_32. |
|
Reference a header instance.
Definition at line 59 of file hdrinline.h. References h2hv, and HV_s::hdrlink. |
|
Convert header to in-memory representation.
Definition at line 153 of file hdrinline.h. References HV_s::hdrload. |
|
Translate and merge legacy signature tags into header. Definition at line 23 of file package.c. References RPMRC_BADMAGIC, RPMRC_BADSIZE, RPMRC_FAIL, RPMRC_OK, and RPMRC_SHORTREAD. 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 378 of file hdrinline.h. References h2hv, HV_s::hdrmodify, and int_32. |
|
Create new (empty) header instance.
Definition at line 32 of file hdrinline.h. References HV_s::hdrnew. Referenced by headerCopy, headerCopyWithConvert, initSourceHeader, newPackage, newSpec, rpmNewSignature, and rpmReadSignature. |
|
Return next tag from header.
Definition at line 470 of file hdrinline.h. References hCNT_t, HV_s::hdrnextiter, hPTR_t, hTAG_t, and hTYP_t. |
|
Return name, version, release strings from header.
Definition at line 30 of file depends.c. Referenced by alAddPackage, checkPackageDeps, doSetupMacro, genSourceRpmName, headerMatchesDepFlags, i18nTag, lookupPackage, packageBinaries, parseForSimple, parsePreamble, parseSpec, printNewSpecfile, processBinaryFiles, providePackageNVR, rpmdbAdd, rpmdbNextIterator, rpmdbRebuild, rpmdbRemove, rpmdepCheck, rpmInstall, rpmtransAddPackage, showQueryPackage, and writeRPM. |
|
Read (and load) header from file handle.
Definition at line 178 of file hdrinline.h. References HV_s::hdrread, and hMagic. |
|
Regenerate signature header.
|
|
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 127 of file hdrinline.h. References h2hv, and HV_s::hdrreload. |
|
Delete tag in header. Removes all entries of type tag from the header, returns 1 if none were found.
Definition at line 395 of file hdrinline.h. References h2hv, HV_s::hdrremove, and int_32. |
|
Return size of on-disk header representation in bytes.
Definition at line 98 of file hdrinline.h. References h2hv, HV_s::hdrsizeof, and hMagic. |
|
Sort tags in header.
Definition at line 71 of file hdrinline.h. References h2hv, and HV_s::hdrsort. |
|
Return formatted output string from header tags. The returned string must be free()d.
Definition at line 413 of file hdrinline.h. References errmsg_t, h2hv, and HV_s::hdrsprintf. |
|
Convert header to on-disk representation.
Definition at line 113 of file hdrinline.h. References h2hv, and HV_s::hdrunload. |
|
Restore tags in header to original ordering.
Definition at line 83 of file hdrinline.h. References h2hv, and HV_s::hdrunsort. |
|
Return header reference count.
Definition at line 164 of file header_internal.h. |
|
Write (with unload) header to file handle.
Definition at line 192 of file hdrinline.h. References h2hv, HV_s::hdrwrite, and hMagic. |
|
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 329 of file header.c. References entryInfo::count, indexEntry::data, dataLength, HEADER_I18NTABLE, HEADER_IMMUTABLE, indexEntry::info, int_16, int_32, indexEntry::length, entryInfo::offset, indexEntry::rdlen, REGION_TAG_COUNT, RPM_I18NSTRING_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, entryInfo::tag, entryInfo::type, and typeSizes. Referenced by copyEntry, doHeaderUnload, and headerLoad. |
|
Header methods for rpm headers. |
|
Initial value: { 0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00 } Definition at line 37 of file header.c. Referenced by headerRead, and headerWrite. |
|
Supported default header tag output formats. |
|
Maximum no. of bytes permitted in a header. Definition at line 44 of file header.c. Referenced by headerCopyLoad, and headerRead. |
|
Initial value: { 0, 1, 1, 2, 4, -1, -1, 1, -1, -1 } Definition at line 61 of file header.c. Referenced by dataLength, doHeaderUnload, headerSizeof, and regionSwab. |