rpmdb/header.c File Reference

#include "system.h"
#include <header_internal.h>
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  headerIterator_s
 Header tag iterator data structure. More...
struct  headerSprintfArgs_s

Defines

#define __HEADER_PROTOTYPES__
#define PARSER_BEGIN   0
#define PARSER_IN_ARRAY   1
#define PARSER_IN_EXPR   2
#define hdrchkTags(_ntags)   ((_ntags) & 0xffff0000)
 Sanity check on no.
#define hdrchkType(_type)   ((_type) < RPM_MIN_TYPE || (_type) > RPM_MAX_TYPE)
 Sanity check on type values.
#define hdrchkData(_nbytes)   ((_nbytes) & 0xff000000)
 Sanity check on data size and/or offset and/or count.
#define hdrchkAlign(_type, _off)   ((_off) & (typeAlign[_type]-1))
 Sanity check on alignment for data type.
#define hdrchkRange(_dl, _off)   ((_off) < 0 || (_off) > (_dl))
 Sanity check on range of data offset.

Typedefs

typedef headerSprintfArgs_sheaderSprintfArgs

Functions

static void * _free (const void *p)
 Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
static Header headerLink (Header h)
 Reference a header instance.
static Header headerUnlink (Header h)
 Dereference a header instance.
static Header headerFree (Header h)
 Dereference a header instance.
static Header headerNew (void)
 Create new (empty) header instance.
static int indexCmp (const void *avp, const void *bvp)
static void headerSort (Header h)
 Sort tags in header.
static int offsetCmp (const void *avp, const void *bvp)
static void headerUnsort (Header h)
 Restore tags in header to original ordering.
static unsigned int headerSizeof (Header h, enum hMagic magicp)
 Return size of on-disk header representation in bytes.
static int dataLength (int_32 type, hPTR_t p, int_32 count, int onDisk, hPTR_t pend)
 Return length of entry data.
static int regionSwab (indexEntry entry, int il, int dl, entryInfo pe, unsigned char *dataStart, const unsigned char *dataEnd, int regionid)
 Swap int_32 and int_16 arrays within header region.
static void * doHeaderUnload (Header h, int *lengthPtr)
 
Parameters:
h header

static void * headerUnload (Header h)
 Convert header to on-disk representation.
static indexEntry findEntry (Header h, int_32 tag, int_32 type)
 Find matching (tag,type) entry in header.
static int headerRemoveEntry (Header h, int_32 tag)
 Delete tag in header.
static Header headerLoad (void *uh)
 Convert header to in-memory representation.
static Header headerReload (Header h, int tag)
 Convert header to on-disk representation, and then reload.
static Header headerCopyLoad (const void *uh)
 Make a copy and convert header to in-memory representation.
static Header headerRead (FD_t fd, enum hMagic magicp)
 Read (and load) header from file handle.
static int headerWrite (FD_t fd, Header h, enum hMagic magicp)
 Write (with unload) header to file handle.
static int headerIsEntry (Header h, int_32 tag)
 Check if tag is in header.
static int copyEntry (const indexEntry entry, hTYP_t type, hPTR_t *p, hCNT_t c, int minMem)
 Retrieve data from header entry.
static int headerMatchLocale (const char *td, const char *l, const char *le)
 Does locale match entry in header i18n table?
static char * headerFindI18NString (Header h, indexEntry entry)
 Return i18n string from header that matches locale.
static int intGetEntry (Header h, int_32 tag, hTAG_t type, hPTR_t *p, hCNT_t c, int minMem)
 Retrieve tag data from header.
static void * headerFreeTag (Header h, const void *data, rpmTagType type)
 Free data allocated when retrieved from header.
static int headerGetEntry (Header h, int_32 tag, hTYP_t type, void **p, hCNT_t c)
 Retrieve tag value.
static int headerGetEntryMinMemory (Header h, int_32 tag, hTYP_t type, hPTR_t *p, hCNT_t c)
 Retrieve tag value using header internal array.
int headerGetRawEntry (Header h, int_32 tag, int_32 *type, hPTR_t *p, int_32 *c)
static void copyData (int_32 type, void *dstPtr, const void *srcPtr, int_32 cnt, int dataLength)
static void * grabData (int_32 type, hPTR_t p, int_32 c, int *lengthPtr)
 Return (malloc'ed) copy of entry data.
static int headerAddEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Add tag to header.
static int headerAppendEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Append element to tag array in header.
static int headerAddOrAppendEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Add or append element to tag array in header.
static int headerAddI18NString (Header h, int_32 tag, const char *string, const char *lang)
 Add locale specific tag to header.
static int headerModifyEntry (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Modify tag in header.
static char escapedChar (const char ch)
static sprintfToken freeFormat (sprintfToken format, int num)
 Destroy headerSprintf format array.
static HeaderIterator headerFreeIterator (HeaderIterator hi)
 Destroy header tag iterator.
static HeaderIterator headerInitIterator (Header h)
 Create header tag iterator.
static int headerNextIterator (HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t *p, hCNT_t c)
 Return next tag from header.
static Header headerCopy (Header h)
 Duplicate a header.
static headerSprintfArgs hsaInit (headerSprintfArgs hsa)
 Initialize an hsa iteration.
static sprintfToken hsaNext (headerSprintfArgs hsa)
 Return next hsa iteration item.
static headerSprintfArgs hsaFini (headerSprintfArgs hsa)
 Finish an hsa iteration.
static char * hsaReserve (headerSprintfArgs hsa, size_t need)
 Reserve sufficient buffer space for next output value.
static const char * myTagName (headerTagTableEntry tbl, int val)
 Return tag name from value.
static int myTagValue (headerTagTableEntry tbl, const char *name)
 Return tag value from name.
static int findTag (headerSprintfArgs hsa, sprintfToken token, const char *name)
 
Parameters:
hsa headerSprintf args

static int parseExpression (headerSprintfArgs hsa, sprintfToken token, char *str, char **endPtr)
 
Parameters:
hsa headerSprintf args

static int parseFormat (headerSprintfArgs hsa, char *str, sprintfToken *formatPtr, int *numTokensPtr, char **endPtr, int state)
 
Parameters:
hsa headerSprintf args

static int getExtension (headerSprintfArgs hsa, headerTagTagFunction fn, hTYP_t typeptr, hPTR_t *data, hCNT_t countptr, rpmec ec)
 Call a header extension only once, saving results.
static char * formatValue (headerSprintfArgs hsa, sprintfTag tag, int element)
 
Parameters:
hsa headerSprintf args

static char * singleSprintf (headerSprintfArgs hsa, sprintfToken token, int element)
 
Parameters:
hsa headerSprintf args

static rpmec rpmecNew (const headerSprintfExtension exts)
 Create an extension cache.
static rpmec rpmecFree (const headerSprintfExtension exts, rpmec ec)
 Destroy an extension cache.
static char * headerSprintf (Header h, const char *fmt, const struct headerTagTableEntry_s *tbltags, const struct headerSprintfExtension_s *extensions, errmsg_t *errmsg)
 Return formatted output string from header tags.
static char * octalFormat (int_32 type, hPTR_t data, char *formatPrefix, int padding, int element)
 
Parameters:
type tag type

static char * hexFormat (int_32 type, hPTR_t data, char *formatPrefix, int padding, int element)
 
Parameters:
type tag type

static char * realDateFormat (int_32 type, hPTR_t data, char *formatPrefix, int padding, int element, const char *strftimeFormat)
static char * dateFormat (int_32 type, hPTR_t data, char *formatPrefix, int padding, int element)
 
Parameters:
type tag type

static char * dayFormat (int_32 type, hPTR_t data, char *formatPrefix, int padding, int element)
 
Parameters:
type tag type

static char * shescapeFormat (int_32 type, hPTR_t data, char *formatPrefix, int padding, int element)
 
Parameters:
type tag type

static void headerCopyTags (Header headerFrom, Header headerTo, hTAG_t tagstocopy)
 Duplicate tag values from one header into another.

Variables

int _hdr_debug = 0
static unsigned char header_magic [8]
static int typeAlign [16]
 Alignment needed for header data types.
static int typeSizes [16]
 Size of header data types.
static size_t headerMaxbytes = (32*1024*1024)
 Maximum no.
HV_t hdrVec
 Header methods for rpm headers.
headerSprintfExtension_s headerDefaultFormats []
 Supported default header tag output formats.
static struct HV_s hdrVec1
HV_t hdrVec = &hdrVec1
 Header methods for rpm headers.


Detailed Description

Definition in file header.c.


Define Documentation

#define __HEADER_PROTOTYPES__

Definition at line 13 of file header.c.

#define hdrchkAlign ( _type,
_off   )     ((_off) & (typeAlign[_type]-1))

Sanity check on alignment for data type.

Definition at line 113 of file header.c.

#define hdrchkData ( _nbytes   )     ((_nbytes) & 0xff000000)

Sanity check on data size and/or offset and/or count.

This check imposes a limit of 16Mb, more than enough.

Definition at line 108 of file header.c.

#define hdrchkRange ( _dl,
_off   )     ((_off) < 0 || (_off) > (_dl))

Sanity check on range of data offset.

Definition at line 118 of file header.c.

#define hdrchkTags ( _ntags   )     ((_ntags) & 0xffff0000)

Sanity check on no.

of tags. This check imposes a limit of 65K tags, more than enough.

Definition at line 97 of file header.c.

#define hdrchkType ( _type   )     ((_type) < RPM_MIN_TYPE || (_type) > RPM_MAX_TYPE)

Sanity check on type values.

Definition at line 102 of file header.c.

#define PARSER_BEGIN   0

Definition at line 30 of file header.c.

#define PARSER_IN_ARRAY   1

Definition at line 31 of file header.c.

Referenced by parseFormat().

#define PARSER_IN_EXPR   2

Definition at line 32 of file header.c.

Referenced by parseExpression(), and parseFormat().


Typedef Documentation

typedef struct headerSprintfArgs_s * headerSprintfArgs


Function Documentation

static void* _free ( const void *  p  )  [inline, static]

Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.

Parameters:
p memory to free
Returns:
NULL always

Definition at line 129 of file header.c.

static void copyData ( int_32  type,
void *  dstPtr,
const void *  srcPtr,
int_32  cnt,
int  dataLength 
) [static]

Definition at line 1797 of file header.c.

References RPM_I18NSTRING_TYPE, and RPM_STRING_ARRAY_TYPE.

Referenced by grabData().

static int dataLength ( int_32  type,
hPTR_t  p,
int_32  count,
int  onDisk,
hPTR_t  pend 
) [static]

Return length of entry data.

Parameters:
type entry data type
p entry data
count entry item count
onDisk data is concatenated strings (with NUL's))?
pend pointer to end of data (or NULL)
Returns:
no. bytes in data, -1 on failure

Definition at line 384 of file header.c.

References RPM_I18NSTRING_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, and typeSizes.

Referenced by grabData(), and regionSwab().

static char* dateFormat ( int_32  type,
hPTR_t  data,
char *  formatPrefix,
int  padding,
int  element 
) [static]

Parameters:
type tag type

Parameters:
data tag value
formatPrefix sprintf format string
padding no. additional bytes needed by format string
element (unused)
Returns:
formatted string

Definition at line 3615 of file header.c.

References _, and realDateFormat().

static char* dayFormat ( int_32  type,
hPTR_t  data,
char *  formatPrefix,
int  padding,
int  element 
) [static]

Parameters:
type tag type

Parameters:
data tag value
formatPrefix sprintf format string
padding no. additional bytes needed by format string
element (unused)
Returns:
formatted string

Definition at line 3631 of file header.c.

References _, and realDateFormat().

static char escapedChar ( const char  ch  )  [static]

Definition at line 2204 of file header.c.

Referenced by parseFormat().

static indexEntry findEntry ( Header  h,
int_32  tag,
int_32  type 
) [static]

Find matching (tag,type) entry in header.

Parameters:
h header
tag entry tag
type entry type
Returns:
header entry

Definition at line 894 of file header.c.

References headerToken_s::flags, HEADERFLAG_SORTED, headerSort(), indexCmp(), indexEntry_s::info, RPM_NULL_TYPE, entryInfo_s::tag, and entryInfo_s::type.

Referenced by addMacro(), delMacro(), expandMacro(), headerFindI18NString(), headerGetRawEntry(), htGetEntry(), htHasEntry(), and intGetEntry().

static int findTag ( headerSprintfArgs  hsa,
sprintfToken  token,
const char *  name 
) [static]

Parameters:
hsa headerSprintf args

Parameters:
token parsed fields
name name to find
Returns:
0 on success, 1 on not found

Definition at line 2555 of file header.c.

References alloca(), sprintfToken_s::cond, sprintfTag_s::ext, ext, sprintfTag_s::extNum, headerSprintfArgs_s::exts, sprintfTag_s::fmt, HEADER_EXT_FORMAT, HEADER_EXT_LAST, HEADER_EXT_MORE, HEADER_EXT_TAG, myTagValue(), stpcpy(), sprintfTag_s::tag, sprintfToken_s::tag, headerSprintfArgs_s::tags, sprintfTag_s::type, sprintfToken_s::type, sprintfToken_s::u, and xstrcasecmp().

Referenced by parseExpression(), and parseFormat().

static char* formatValue ( headerSprintfArgs  hsa,
sprintfTag  tag,
int  element 
) [static]

Parameters:
hsa headerSprintf args

Parameters:
tag 
element 
Returns:
end of formatted string (NULL on error)

Definition at line 3030 of file header.c.

References _, _free(), sprintfTag_s::arrayCount, bin2hex(), headerSprintfArgs_s::ec, headerSprintfArgs_s::errmsg, sprintfTag_s::ext, sprintfTag_s::extNum, sprintfTag_s::fmt, sprintfTag_s::format, getExtension(), headerSprintfArgs_s::h, headerFreeData(), headerGetEntry(), hsaReserve(), sprintfTag_s::pad, RPM_BIN_TYPE, RPM_CHAR_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_INT8_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, stpcpy(), sprintfTag_s::tag, headerSprintfArgs_s::val, headerSprintfArgs_s::vallen, xmalloc(), and xstrdup().

Referenced by singleSprintf().

static sprintfToken freeFormat ( sprintfToken  format,
int  num 
) [static]

Destroy headerSprintf format array.

Parameters:
format sprintf format array
num number of elements
Returns:
NULL always

Definition at line 2225 of file header.c.

References _free(), sprintfToken_s::array, sprintfToken_s::cond, and sprintfToken_s::u.

Referenced by parseExpression(), and parseFormat().

static int getExtension ( headerSprintfArgs  hsa,
headerTagTagFunction  fn,
hTYP_t  typeptr,
hPTR_t data,
hCNT_t  countptr,
rpmec  ec 
) [static]

Call a header extension only once, saving results.

Parameters:
hsa headerSprintf args
fn 
Return values:
*typeptr 
*data 
*countptr 
ec extension cache
Returns:
0 on success, 1 on failure

Definition at line 3001 of file header.c.

References rpmec_s::avail, rpmec_s::count, rpmec_s::data, rpmec_s::freeit, headerSprintfArgs_s::h, and rpmec_s::type.

Referenced by formatValue(), and singleSprintf().

static void* grabData ( int_32  type,
hPTR_t  p,
int_32  c,
int *  lengthPtr 
) [static]

Return (malloc'ed) copy of entry data.

Parameters:
type entry data type
p entry data
c entry item count
Return values:
lengthPtr no. bytes in returned data
Returns:
(malloc'ed) copy of entry data, NULL on error

Definition at line 1837 of file header.c.

References copyData(), dataLength(), and xmalloc().

static char* headerFindI18NString ( Header  h,
indexEntry  entry 
) [static]

Return i18n string from header that matches locale.

Parameters:
h header
entry i18n string data
Returns:
matching i18n string (or 1st string if no match)

Definition at line 1605 of file header.c.

References indexEntry_s::data, findEntry(), getenv(), HEADER_I18NTABLE, headerMatchLocale(), lang, and RPM_STRING_ARRAY_TYPE.

Referenced by intGetEntry().

int headerGetRawEntry ( Header  h,
int_32  tag,
int_32 type,
hPTR_t p,
int_32 c 
)

Definition at line 1771 of file header.c.

References copyEntry(), findEntry(), headerIsEntry(), and RPM_NULL_TYPE.

Referenced by headerGetLangs().

static int headerMatchLocale ( const char *  td,
const char *  l,
const char *  le 
) [static]

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.
 * 

Parameters:
td header i18n table data, NUL terminated
l start of locale to match
le end of locale to match
Returns:
1 on match, 0 on no match

Definition at line 1532 of file header.c.

References alloca().

Referenced by headerFindI18NString().

static char* hexFormat ( int_32  type,
hPTR_t  data,
char *  formatPrefix,
int  padding,
int  element 
) [static]

Parameters:
type tag type

Parameters:
data tag value
formatPrefix sprintf format string
padding no. additional bytes needed by format string
element (unused)
Returns:
formatted string

Definition at line 3551 of file header.c.

References _, RPM_INT32_TYPE, xmalloc(), and xstrdup().

static headerSprintfArgs hsaFini ( headerSprintfArgs  hsa  )  [static]

Finish an hsa iteration.

Parameters:
hsa headerSprintf args
Returns:
headerSprintf args

Definition at line 2471 of file header.c.

References headerFreeIterator(), headerSprintfArgs_s::hi, and headerSprintfArgs_s::i.

static headerSprintfArgs hsaInit ( headerSprintfArgs  hsa  )  [static]

Initialize an hsa iteration.

Parameters:
hsa headerSprintf args
Returns:
headerSprintf args

Definition at line 2407 of file header.c.

References sprintfToken_s::array, headerSprintfArgs_s::format, headerSprintfArgs_s::h, headerInitIterator(), headerSprintfArgs_s::hi, headerSprintfArgs_s::i, sprintfTag_s::tag, sprintfToken_s::tag, sprintfToken_s::type, and sprintfToken_s::u.

static sprintfToken hsaNext ( headerSprintfArgs  hsa  )  [static]

Return next hsa iteration item.

Parameters:
hsa headerSprintf args
Returns:
next sprintfToken (or NULL)

Definition at line 2433 of file header.c.

References sprintfToken_s::array, headerSprintfArgs_s::format, headerNextIterator(), headerSprintfArgs_s::hi, headerSprintfArgs_s::i, headerSprintfArgs_s::numTokens, sprintfTag_s::tag, sprintfToken_s::tag, sprintfToken_s::type, and sprintfToken_s::u.

static char* hsaReserve ( headerSprintfArgs  hsa,
size_t  need 
) [static]

Reserve sufficient buffer space for next output value.

Parameters:
hsa headerSprintf args
need no. of bytes to reserve
Returns:
pointer to reserved space

Definition at line 2490 of file header.c.

References headerSprintfArgs_s::alloced, headerSprintfArgs_s::val, headerSprintfArgs_s::vallen, and xrealloc().

Referenced by formatValue(), and singleSprintf().

static int indexCmp ( const void *  avp,
const void *  bvp 
) [static]

Definition at line 247 of file header.c.

References indexEntry_s::info, and entryInfo_s::tag.

Referenced by findEntry().

static int intGetEntry ( Header  h,
int_32  tag,
hTAG_t  type,
hPTR_t p,
hCNT_t  c,
int  minMem 
) [static]

Retrieve tag data from header.

Parameters:
h header
tag tag to retrieve
Return values:
type address of type (or NULL)
p address of data (or NULL)
c address of count (or NULL)
Parameters:
minMem string pointers reference header memory?
Returns:
1 on success, 0 on not found

Definition at line 1661 of file header.c.

References copyEntry(), findEntry(), headerFindI18NString(), indexEntry_s::info, RPM_I18NSTRING_TYPE, RPM_NULL_TYPE, RPM_STRING_TYPE, and entryInfo_s::type.

static const char* myTagName ( headerTagTableEntry  tbl,
int  val 
) [static]

Return tag name from value.

Todo:
bsearch on sorted value table.
Parameters:
tbl tag table
val tag value to find
Returns:
tag name, NULL on not found

Definition at line 2510 of file header.c.

References headerTagTableEntry_s::name, headerTagTableEntry_s::val, and xtolower().

Referenced by singleSprintf().

static int myTagValue ( headerTagTableEntry  tbl,
const char *  name 
) [static]

Return tag value from name.

Todo:
bsearch on sorted name table.
Parameters:
tbl tag table
name tag name to find
Returns:
tag value, 0 on not found

Definition at line 2539 of file header.c.

References headerTagTableEntry_s::name, headerTagTableEntry_s::val, and xstrcasecmp().

Referenced by findTag().

static char* octalFormat ( int_32  type,
hPTR_t  data,
char *  formatPrefix,
int  padding,
int  element 
) [static]

Parameters:
type tag type

Parameters:
data tag value
formatPrefix sprintf format string
padding no. additional bytes needed by format string
element (unused)
Returns:
formatted string

Definition at line 3522 of file header.c.

References _, RPM_INT32_TYPE, xmalloc(), and xstrdup().

static int offsetCmp ( const void *  avp,
const void *  bvp 
) [static]

Definition at line 274 of file header.c.

References indexEntry_s::data, indexEntry_s::info, entryInfo_s::offset, and entryInfo_s::tag.

static int parseExpression ( headerSprintfArgs  hsa,
sprintfToken  token,
char *  str,
char **  endPtr 
) [static]

Parameters:
hsa headerSprintf args

Parameters:
token 
str 
Return values:
*endPtr 
Returns:
0 on success

Definition at line 2892 of file header.c.

References _, sprintfToken_s::cond, headerSprintfArgs_s::errmsg, findTag(), freeFormat(), parseFormat(), PARSER_IN_EXPR, sprintfToken_s::type, and sprintfToken_s::u.

Referenced by parseFormat().

static int parseFormat ( headerSprintfArgs  hsa,
char *  str,
sprintfToken formatPtr,
int *  numTokensPtr,
char **  endPtr,
int  state 
) [static]

Parameters:
hsa headerSprintf args

Parameters:
str 
Return values:
*formatPtr 
*numTokensPtr 
*endPtr 
Parameters:
state 
Returns:
0 on success

Definition at line 2640 of file header.c.

References _, sprintfToken_s::array, sprintfTag_s::arrayCount, headerSprintfArgs_s::errmsg, escapedChar(), findTag(), sprintfTag_s::format, freeFormat(), sprintfTag_s::justOne, next, sprintfTag_s::pad, parseExpression(), PARSER_IN_ARRAY, PARSER_IN_EXPR, sprintfToken_s::string, strtoul, sprintfToken_s::tag, sprintfTag_s::type, sprintfToken_s::type, sprintfToken_s::u, xcalloc(), and xisdigit().

Referenced by parseExpression().

static char* realDateFormat ( int_32  type,
hPTR_t  data,
char *  formatPrefix,
int  padding,
int  element,
const char *  strftimeFormat 
) [static]

Definition at line 3574 of file header.c.

References _, RPM_INT32_TYPE, xmalloc(), and xstrdup().

Referenced by dateFormat(), and dayFormat().

static rpmec rpmecFree ( const headerSprintfExtension  exts,
rpmec  ec 
) [static]

Destroy an extension cache.

Parameters:
exts headerSprintf extensions
ec extension cache
Returns:
NULL always

Definition at line 3401 of file header.c.

References _free(), rpmec_s::data, ext, HEADER_EXT_LAST, and HEADER_EXT_MORE.

static rpmec rpmecNew ( const headerSprintfExtension  exts  )  [static]

Create an extension cache.

Parameters:
exts headerSprintf extensions
Returns:
new extension cache

Definition at line 3377 of file header.c.

References ext, HEADER_EXT_LAST, HEADER_EXT_MORE, and xcalloc().

static char* shescapeFormat ( int_32  type,
hPTR_t  data,
char *  formatPrefix,
int  padding,
int  element 
) [static]

Parameters:
type tag type

Parameters:
data tag value
formatPrefix sprintf format string
padding no. additional bytes needed by format string
element (unused)
Returns:
formatted string

Definition at line 3647 of file header.c.

References alloca(), RPM_INT32_TYPE, and xmalloc().

static char* singleSprintf ( headerSprintfArgs  hsa,
sprintfToken  token,
int  element 
) [static]

Parameters:
hsa headerSprintf args

Parameters:
token 
element 
Returns:
end of formatted string (NULL on error)

Definition at line 3215 of file header.c.

References _, sprintfToken_s::array, sprintfTag_s::arrayCount, sprintfToken_s::cond, headerSprintfArgs_s::errmsg, sprintfTag_s::ext, sprintfTag_s::extNum, formatValue(), getExtension(), headerSprintfArgs_s::h, headerGetEntry(), headerIsEntry(), hsaReserve(), sprintfTag_s::justOne, myTagName(), RPM_BIN_TYPE, RPM_STRING_TYPE, stpcpy(), sprintfToken_s::string, sprintfTag_s::tag, sprintfToken_s::tag, headerSprintfArgs_s::tags, sprintfTag_s::type, sprintfToken_s::type, sprintfToken_s::u, headerSprintfArgs_s::val, and headerSprintfArgs_s::vallen.


Variable Documentation

int _hdr_debug = 0

Definition at line 20 of file header.c.

struct HV_s hdrVec1 [static]

Definition at line 3735 of file header.c.


Generated on Fri Oct 12 08:44:56 2007 for rpm by  doxygen 1.5.2