rpmdb/header.h File Reference

An rpm header carries all information about a package. More...

#include <stdio.h>
#include "rpmio.h"
#include "hdrinline.h"

Go to the source code of this file.

Data Structures

struct  headerTagTableEntry_s
struct  headerSprintfExtension_s
union  hRET_s
struct  HE_s
struct  HV_s

Defines

#define RPM_MIN_TYPE   0
#define RPM_MAX_TYPE   9
#define HEADER_IMAGE   61
 Header private tags.
#define HEADER_SIGNATURES   62
#define HEADER_IMMUTABLE   63
#define HEADER_REGIONS   64
#define HEADER_I18NTABLE   100
#define HEADER_SIGBASE   256
#define HEADER_TAGBASE   1000

Typedefs

typedef int int_32
typedef short int int_16
typedef char int_8
typedef unsigned int uint_32
typedef unsigned short uint_16
typedef unsigned char uint_8
typedef const char * errmsg_t
typedef int_32hTAG_t
typedef int_32hTYP_t
typedef const void * hPTR_t
typedef int_32hCNT_t
typedef headerToken_sHeader
typedef headerIterator_sHeaderIterator
typedef headerTagTableEntry_sheaderTagTableEntry
 Associate tag names with numeric values.
typedef char *(*) headerTagFormatFunction (int_32 type, const void *data, char *formatPrefix, int padding, int element)
 HEADER_EXT_TAG format function prototype.
typedef int(*) headerTagTagFunction (Header h, hTYP_t type, hPTR_t *data, hCNT_t count, int *freeData)
 HEADER_EXT_FORMAT format function prototype.
typedef headerSprintfExtension_sheaderSprintfExtension
 Define header tag output formats.
typedef enum rpmTagType_e rpmTagType
 The basic types of data in tags from headers.
typedef enum rpmSubTagType_e rpmSubTagType
 New rpm data types under consideration/development.
typedef hRET_shRET_t
typedef HE_sHE_t
typedef Header(*) HDRnew (void)
 Create new (empty) header instance.
typedef Header(*) HDRfree (Header h)
 Dereference a header instance.
typedef Header(*) HDRlink (Header h)
 Reference a header instance.
typedef Header(*) HDRunlink (Header h)
 Dereference a header instance.
typedef void(*) HDRsort (Header h)
 Sort tags in header.
typedef void(*) HDRunsort (Header h)
 Restore tags in header to original ordering.
typedef unsigned int(*) HDRsizeof (Header h, enum hMagic magicp)
 Return size of on-disk header representation in bytes.
typedef void *(*) HDRunload (Header h)
 Convert header to on-disk representation.
typedef Header(*) HDRreload (Header h, int tag)
 Convert header to on-disk representation, and then reload.
typedef Header(*) HDRcopy (Header h)
 Duplicate a header.
typedef Header(*) HDRload (void *uh)
 Convert header to in-memory representation.
typedef Header(*) HDRcopyload (const void *uh)
 Make a copy and convert header to in-memory representation.
typedef Header(*) HDRread (FD_t fd, enum hMagic magicp)
 Read (and load) header from file handle.
typedef int(*) HDRwrite (FD_t fd, Header h, enum hMagic magicp)
 Write (with unload) header to file handle.
typedef int(*) HDRisentry (Header h, int_32 tag)
 Check if tag is in header.
typedef void *(*) HDRfreetag (Header h, const void *data, rpmTagType type)
 Free data allocated when retrieved from header.
typedef int(*) HDRget (Header h, int_32 tag, hTYP_t type, void **p, hCNT_t c)
 Retrieve tag value.
typedef int(*) HDRgetmin (Header h, int_32 tag, hTYP_t type, hPTR_t *p, hCNT_t c)
 Retrieve tag value using header internal array.
typedef int(*) HDRadd (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Add tag to header.
typedef int(*) HDRappend (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Append element to tag array in header.
typedef int(*) HDRaddorappend (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Add or append element to tag array in header.
typedef int(*) HDRaddi18n (Header h, int_32 tag, const char *string, const char *lang)
 Add locale specific tag to header.
typedef int(*) HDRmodify (Header h, int_32 tag, int_32 type, const void *p, int_32 c)
 Modify tag in header.
typedef int(*) HDRremove (Header h, int_32 tag)
 Delete tag in header.
typedef char *(*) HDRsprintf (Header h, const char *fmt, const struct headerTagTableEntry_s *tags, const struct headerSprintfExtension_s *extensions, errmsg_t *errmsg)
 Return formatted output string from header tags.
typedef void(*) HDRcopytags (Header headerFrom, Header headerTo, hTAG_t tagstocopy)
 Duplicate tag values from one header into another.
typedef HeaderIterator(*) HDRfreeiter (HeaderIterator hi)
 Destroy header tag iterator.
typedef HeaderIterator(*) HDRinititer (Header h)
 Create header tag iterator.
typedef int(*) HDRnextiter (HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t *p, hCNT_t c)
 Return next tag from header.
typedef HV_sHV_t
 Header method vectors.

Enumerations

enum  headerSprintfExtensionType { HEADER_EXT_LAST = 0, HEADER_EXT_FORMAT, HEADER_EXT_MORE, HEADER_EXT_TAG }
enum  hMagic { HEADER_MAGIC_NO = 0, HEADER_MAGIC_YES = 1 }
 Include calculation for 8 bytes of (magic, 0)? More...
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
}
 The basic types of data in tags from headers. More...
enum  rpmSubTagType_e { RPM_REGION_TYPE = -10, RPM_BIN_ARRAY_TYPE = -11, RPM_XREF_TYPE = -12 }
 New rpm data types under consideration/development. More...

Functions

static void * headerFreeData (const void *data, rpmTagType type)
 Free data allocated when retrieved from header.

Variables

headerSprintfExtension_s headerDefaultFormats []
 Supported default header tag output formats.


Detailed Description

An rpm header carries all information about a package.

A header is a collection of data elements called tags. Each tag has a data type, and includes 1 or more values.

Historical Issues
Here's a brief description of features/incompatibilities that have been added to headers and tags.

Development Issues
Here's a brief description of future features/incompatibilities that will be added to headers.

Definition in file header.h.


Define Documentation

#define HEADER_I18NTABLE   100

Definition at line 258 of file header.h.

Referenced by getTagString(), getTagVal(), hdrKeyList(), headerFindI18NString(), headerGetLangs(), initSourceHeader(), and regionSwab().

#define HEADER_IMAGE   61

Header private tags.

Note:
General use tags should start at 1000 (RPM's tag space starts there).

Definition at line 254 of file header.h.

Referenced by copyEntry(), and regionSwab().

#define HEADER_IMMUTABLE   63

Definition at line 256 of file header.h.

#define HEADER_REGIONS   64

Definition at line 257 of file header.h.

#define HEADER_SIGBASE   256

Definition at line 259 of file header.h.

Referenced by headerMergeLegacySigs(), and headerRegenSigHeader().

#define HEADER_SIGNATURES   62

Definition at line 255 of file header.h.

#define HEADER_TAGBASE   1000

Definition at line 260 of file header.h.

Referenced by headerMergeLegacySigs(), and headerRegenSigHeader().

#define RPM_MAX_TYPE   9

#define RPM_MIN_TYPE   0


Typedef Documentation

typedef int_32* hCNT_t

Definition at line 113 of file header.h.

typedef struct HE_s * HE_t

typedef const void* hPTR_t

Definition at line 112 of file header.h.

typedef union hRET_s * hRET_t

typedef int_32* hTYP_t

Definition at line 111 of file header.h.

typedef short int int_16

Definition at line 93 of file header.h.

typedef int int_32

Definition at line 92 of file header.h.

typedef char int_8

Definition at line 94 of file header.h.

typedef unsigned short uint_16

Definition at line 100 of file header.h.

typedef unsigned int uint_32

Definition at line 99 of file header.h.

typedef unsigned char uint_8

Definition at line 101 of file header.h.


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