rpm  4.16.1.2
Typedefs | Enumerations | Functions | Variables
header.h File Reference

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

#include <rpm/rpmio.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmtd.h>
#include <rpm/rpmutil.h>
Include dependency graph for header.h:

Go to the source code of this file.

Typedefs

typedef rpmFlags headerImportFlags
 
typedef rpmFlags headerGetFlags
 
typedef rpmFlags headerPutFlags
 
typedef enum headerConvOps_e headerConvOps
 

Enumerations

enum  hMagic { HEADER_MAGIC_NO = 0, HEADER_MAGIC_YES = 1 }
 Include calculation for 8 bytes of (magic, 0)? More...
 
enum  headerImportFlags_e { HEADERIMPORT_COPY = (1 << 0), HEADERIMPORT_FAST = (1 << 1) }
 
enum  headerGetFlags_e {
  HEADERGET_DEFAULT = 0, HEADERGET_MINMEM = (1 << 0), HEADERGET_EXT = (1 << 1), HEADERGET_RAW = (1 << 2),
  HEADERGET_ALLOC = (1 << 3), HEADERGET_ARGV = (1 << 4)
}
 Modifier flags for headerGet() operation. More...
 
enum  headerPutFlags_e { HEADERPUT_DEFAULT = 0, HEADERPUT_APPEND = (1 << 0) }
 
enum  headerConvOps_e { HEADERCONV_EXPANDFILELIST = 0, HEADERCONV_COMPRESSFILELIST = 1, HEADERCONV_RETROFIT_V3 = 2 }
 

Functions

Header headerNew (void)
 Create new (empty) header instance. More...
 
Header headerFree (Header h)
 Dereference a header instance. More...
 
Header headerLink (Header h)
 Reference a header instance. More...
 
unsigned int headerSizeof (Header h, int magicp)
 Return size of on-disk header representation in bytes. More...
 
void * headerUnload (Header h)
 Convert header to on-disk representation. More...
 
void * headerExport (Header h, unsigned int *bsize)
 Export header to on-disk representation. More...
 
Header headerReload (Header h, rpmTagVal tag)
 Convert header to on-disk representation, and then reload. More...
 
Header headerCopy (Header h)
 Duplicate a header. More...
 
Header headerLoad (void *uh)
 Convert header to in-memory representation. More...
 
Header headerCopyLoad (const void *uh)
 Make a copy and convert header to in-memory representation. More...
 
Header headerImport (void *blob, unsigned int bsize, headerImportFlags flags)
 Import header to in-memory representation. More...
 
Header headerRead (FD_t fd, int magicp)
 Read (and load) header from file handle. More...
 
int headerWrite (FD_t fd, Header h, int magicp)
 Write (with unload) header to file handle. More...
 
int headerIsEntry (Header h, rpmTagVal tag)
 Check if tag is in header. More...
 
int headerGet (Header h, rpmTagVal tag, rpmtd td, headerGetFlags flags)
 Retrieve tag value. More...
 
int headerPut (Header h, rpmtd td, headerPutFlags flags)
 Add or append tag to header. More...
 
int headerAddI18NString (Header h, rpmTagVal tag, const char *string, const char *lang)
 Add locale specific tag to header. More...
 
int headerMod (Header h, rpmtd td)
 Modify tag in header. More...
 
int headerDel (Header h, rpmTagVal tag)
 Delete tag in header. More...
 
char * headerFormat (Header h, const char *fmt, errmsg_t *errmsg)
 Return formatted output string from header tags. More...
 
void headerCopyTags (Header headerFrom, Header headerTo, const rpmTagVal *tagstocopy)
 Duplicate tag values from one header into another. More...
 
HeaderIterator headerFreeIterator (HeaderIterator hi)
 Destroy header tag iterator. More...
 
HeaderIterator headerInitIterator (Header h)
 Create header tag iterator. More...
 
int headerNext (HeaderIterator hi, rpmtd td)
 Return next tag contents from header. More...
 
rpmTagVal headerNextTag (HeaderIterator hi)
 Return next tag number from header. More...
 
char * headerGetAsString (Header h, rpmTagVal tag)
 Return any non-array tag from header, converted to string. More...
 
const char * headerGetString (Header h, rpmTagVal tag)
 Return a simple string tag from header. More...
 
uint64_t headerGetNumber (Header h, rpmTagVal tag)
 Return a simple number tag (or extension) from header. More...
 
int headerIsSource (Header h)
 Check if header is a source or binary package header. More...
 
unsigned int headerGetInstance (Header h)
 Return header instance, ie is the header from rpmdb. More...
 
int headerConvert (Header h, int op)
 Convert header to/from (legacy) data presentation. More...
 
int headerPutBin (Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size)
 Type-safe methods for inserting tag data to header. More...
 
int headerPutString (Header h, rpmTagVal tag, const char *val)
 
int headerPutStringArray (Header h, rpmTagVal tag, const char **val, rpm_count_t size)
 
int headerPutChar (Header h, rpmTagVal tag, const char *val, rpm_count_t size)
 
int headerPutUint8 (Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size)
 
int headerPutUint16 (Header h, rpmTagVal tag, const uint16_t *val, rpm_count_t size)
 
int headerPutUint32 (Header h, rpmTagVal tag, const uint32_t *val, rpm_count_t size)
 
int headerPutUint64 (Header h, rpmTagVal tag, const uint64_t *val, rpm_count_t size)
 

Variables

const unsigned char rpm_header_magic [8]
 Header magic value. More...
 

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.

Definition in file header.h.

Typedef Documentation

◆ headerConvOps

◆ headerGetFlags

Definition at line 172 of file header.h.

◆ headerImportFlags

Definition at line 118 of file header.h.

◆ headerPutFlags

Definition at line 190 of file header.h.

Enumeration Type Documentation

◆ headerConvOps_e

Enumerator
HEADERCONV_EXPANDFILELIST 
HEADERCONV_COMPRESSFILELIST 
HEADERCONV_RETROFIT_V3 

Definition at line 365 of file header.h.

◆ headerImportFlags_e

Enumerator
HEADERIMPORT_COPY 
HEADERIMPORT_FAST 

Definition at line 113 of file header.h.

◆ headerPutFlags_e

Enumerator
HEADERPUT_DEFAULT 
HEADERPUT_APPEND 

Definition at line 185 of file header.h.