Loading...
Searching...
No Matches
header.h
Go to the documentation of this file.
#ifndef H_HEADER
#define H_HEADER
/* RPM - Copyright (C) 1995-2001 Red Hat Software */
#include <rpm/rpmio.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmtd.h>
#include <rpm/rpmutil.h>
#ifdef __cplusplus
extern "C" {
#endif
extern const unsigned char rpm_header_magic[8];
enum hMagic {
HEADER_MAGIC_NO = 0,
HEADER_MAGIC_YES = 1
};
Header headerNew(void);
Header headerFree( Header h);
Header headerLink(Header h);
unsigned int headerSizeof(Header h, int magicp);
void * headerExport(Header h, unsigned int * bsize);
Header headerReload(Header h, rpmTagVal tag);
Header headerCopy(Header h);
enum headerImportFlags_e {
HEADERIMPORT_COPY = (1 << 0), /* Make copy of blob on import? */
HEADERIMPORT_FAST = (1 << 1), /* Faster but less safe? */
};
typedef rpmFlags headerImportFlags;
Header headerImport(void *blob, unsigned int bsize, headerImportFlags flags);
Header headerRead(FD_t fd, int magicp);
int headerWrite(FD_t fd, Header h, int magicp);
int headerIsEntry(Header h, rpmTagVal tag);
enum headerGetFlags_e {
HEADERGET_DEFAULT = 0, /* legacy headerGetEntry() behavior */
HEADERGET_MINMEM = (1 << 0), /* pointers can refer to header memory */
HEADERGET_EXT = (1 << 1), /* lookup extension types too */
HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */
HEADERGET_ALLOC = (1 << 3), /* always allocate memory for all data */
HEADERGET_ARGV = (1 << 4), /* return string arrays NULL-terminated */
};
typedef rpmFlags headerGetFlags;
int headerGet(Header h, rpmTagVal tag, rpmtd td, headerGetFlags flags);
enum headerPutFlags_e {
HEADERPUT_DEFAULT = 0,
HEADERPUT_APPEND = (1 << 0),
};
typedef rpmFlags headerPutFlags;
int headerPut(Header h, rpmtd td, headerPutFlags flags);
int headerPutBin(Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size);
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);
int headerAddI18NString(Header h, rpmTagVal tag, const char * string,
const char * lang);
int headerMod(Header h, rpmtd td);
int headerDel(Header h, rpmTagVal tag);
char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
void headerCopyTags(Header headerFrom, Header headerTo,
const rpmTagVal * tagstocopy);
HeaderIterator headerFreeIterator(HeaderIterator hi);
HeaderIterator headerInitIterator(Header h);
int headerNext(HeaderIterator hi, rpmtd td);
rpmTagVal headerNextTag(HeaderIterator hi);
char * headerGetAsString(Header h, rpmTagVal tag);
const char * headerGetString(Header h, rpmTagVal tag);
uint64_t headerGetNumber(Header h, rpmTagVal tag);
int headerIsSource(Header h);
unsigned int headerGetInstance(Header h);
typedef enum headerConvOps_e {
HEADERCONV_EXPANDFILELIST = 0,
HEADERCONV_COMPRESSFILELIST = 1,
HEADERCONV_RETROFIT_V3 = 2,
} headerConvOps;
int headerConvert(Header h, int op);
#ifdef __cplusplus
}
#endif
#endif /* H_HEADER */
headerFormat
char * headerFormat(Header h, const char *fmt, errmsg_t *errmsg)
headerFree
Header headerFree(Header h)
headerAddI18NString
int headerAddI18NString(Header h, rpmTagVal tag, const char *string, const char *lang)
headerMod
int headerMod(Header h, rpmtd td)
headerPut
int headerPut(Header h, rpmtd td, headerPutFlags flags)
hMagic
hMagic
Definition header.h:32
headerRead
Header headerRead(FD_t fd, int magicp)
headerCopyTags
void headerCopyTags(Header headerFrom, Header headerTo, const rpmTagVal *tagstocopy)
headerIsSource
int headerIsSource(Header h)
headerExport
void * headerExport(Header h, unsigned int *bsize)
headerDel
int headerDel(Header h, rpmTagVal tag)
rpm_header_magic
const unsigned char rpm_header_magic[8]
headerGetString
const char * headerGetString(Header h, rpmTagVal tag)
headerGet
int headerGet(Header h, rpmTagVal tag, rpmtd td, headerGetFlags flags)
headerGetAsString
char * headerGetAsString(Header h, rpmTagVal tag)
headerGetNumber
uint64_t headerGetNumber(Header h, rpmTagVal tag)
headerFreeIterator
HeaderIterator headerFreeIterator(HeaderIterator hi)
headerNext
int headerNext(HeaderIterator hi, rpmtd td)
headerPutBin
int headerPutBin(Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size)
headerGetInstance
unsigned int headerGetInstance(Header h)
headerConvert
int headerConvert(Header h, int op)
headerLink
Header headerLink(Header h)
headerNew
Header headerNew(void)
headerWrite
int headerWrite(FD_t fd, Header h, int magicp)
headerSizeof
unsigned int headerSizeof(Header h, int magicp)
headerCopy
Header headerCopy(Header h)
headerGetFlags_e
headerGetFlags_e
Definition header.h:139
headerInitIterator
HeaderIterator headerInitIterator(Header h)
headerReload
Header headerReload(Header h, rpmTagVal tag)
headerImport
Header headerImport(void *blob, unsigned int bsize, headerImportFlags flags)
headerNextTag
rpmTagVal headerNextTag(HeaderIterator hi)
headerIsEntry
int headerIsEntry(Header h, rpmTagVal tag)
FD_t
struct _FD_s * FD_t
Definition rpmtypes.h:99
Header
struct headerToken_s * Header
Definition rpmtypes.h:24
rpmio.h
rpmtd.h
rpmtypes.h
rpmutil.h
rpmtd_s
Definition rpmtd.h:35