rpm 4.19.92
The RPM Package Manager
Loading...
Searching...
No Matches
header.h
Go to the documentation of this file.
1#ifndef H_HEADER
2#define H_HEADER
3
13/* RPM - Copyright (C) 1995-2001 Red Hat Software */
14
15#include <rpm/rpmio.h>
16#include <rpm/rpmtypes.h>
17#include <rpm/rpmtd.h>
18#include <rpm/rpmutil.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
27extern const unsigned char rpm_header_magic[8];
28
32enum hMagic {
33 HEADER_MAGIC_NO = 0,
34 HEADER_MAGIC_YES = 1
35};
36
42
49
56
63unsigned int headerSizeof(Header h, int magicp);
64
71void * headerExport(Header h, unsigned int * bsize);
72
80Header headerReload(Header h, rpmTagVal tag);
81
88
89enum headerImportFlags_e {
90 HEADERIMPORT_COPY = (1 << 0), /* Make copy of blob on import? */
91 HEADERIMPORT_FAST = (1 << 1), /* Faster but less safe? */
92};
93
94typedef rpmFlags headerImportFlags;
95
103Header headerImport(void *blob, unsigned int bsize, headerImportFlags flags);
104
111Header headerRead(FD_t fd, int magicp);
112
120int headerWrite(FD_t fd, Header h, int magicp);
121
128int headerIsEntry(Header h, rpmTagVal tag);
129
140 HEADERGET_DEFAULT = 0, /* legacy headerGetEntry() behavior */
141 HEADERGET_MINMEM = (1 << 0), /* pointers can refer to header memory */
142 HEADERGET_EXT = (1 << 1), /* lookup extension types too */
143 HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */
144 HEADERGET_ALLOC = (1 << 3), /* always allocate memory for all data */
145 HEADERGET_ARGV = (1 << 4), /* return string arrays NULL-terminated */
146};
147
148typedef rpmFlags headerGetFlags;
149
158int headerGet(Header h, rpmTagVal tag, rpmtd td, headerGetFlags flags);
159
160
161enum headerPutFlags_e {
162 HEADERPUT_DEFAULT = 0,
163 HEADERPUT_APPEND = (1 << 0),
164};
165
166typedef rpmFlags headerPutFlags;
167
176int headerPut(Header h, rpmtd td, headerPutFlags flags);
177
201int headerPutBin(Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size);
202int headerPutString(Header h, rpmTagVal tag, const char *val);
203int headerPutStringArray(Header h, rpmTagVal tag, const char **val, rpm_count_t size);
204int headerPutChar(Header h, rpmTagVal tag, const char *val, rpm_count_t size);
205int headerPutUint8(Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size);
206int headerPutUint16(Header h, rpmTagVal tag, const uint16_t *val, rpm_count_t size);
207int headerPutUint32(Header h, rpmTagVal tag, const uint32_t *val, rpm_count_t size);
208int headerPutUint64(Header h, rpmTagVal tag, const uint64_t *val, rpm_count_t size);
231int headerAddI18NString(Header h, rpmTagVal tag, const char * string,
232 const char * lang);
233
242
252int headerDel(Header h, rpmTagVal tag);
253
263char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
264
271void headerCopyTags(Header headerFrom, Header headerTo,
272 const rpmTagVal * tagstocopy);
273
279HeaderIterator headerFreeIterator(HeaderIterator hi);
280
286HeaderIterator headerInitIterator(Header h);
287
294int headerNext(HeaderIterator hi, rpmtd td);
295
301rpmTagVal headerNextTag(HeaderIterator hi);
302
309char * headerGetAsString(Header h, rpmTagVal tag);
310
317const char * headerGetString(Header h, rpmTagVal tag);
318
325uint64_t headerGetNumber(Header h, rpmTagVal tag);
326
333
339unsigned int headerGetInstance(Header h);
340
341typedef enum headerConvOps_e {
342 HEADERCONV_EXPANDFILELIST = 0,
343 HEADERCONV_COMPRESSFILELIST = 1,
344 HEADERCONV_RETROFIT_V3 = 2,
345} headerConvOps;
346
353int headerConvert(Header h, int op);
354
355#ifdef __cplusplus
356}
357#endif
358
359#endif /* H_HEADER */
char * headerFormat(Header h, const char *fmt, errmsg_t *errmsg)
Header headerFree(Header h)
int headerAddI18NString(Header h, rpmTagVal tag, const char *string, const char *lang)
int headerMod(Header h, rpmtd td)
int headerPut(Header h, rpmtd td, headerPutFlags flags)
hMagic
Definition header.h:32
Header headerRead(FD_t fd, int magicp)
void headerCopyTags(Header headerFrom, Header headerTo, const rpmTagVal *tagstocopy)
int headerIsSource(Header h)
void * headerExport(Header h, unsigned int *bsize)
int headerDel(Header h, rpmTagVal tag)
const unsigned char rpm_header_magic[8]
const char * headerGetString(Header h, rpmTagVal tag)
int headerGet(Header h, rpmTagVal tag, rpmtd td, headerGetFlags flags)
char * headerGetAsString(Header h, rpmTagVal tag)
uint64_t headerGetNumber(Header h, rpmTagVal tag)
HeaderIterator headerFreeIterator(HeaderIterator hi)
int headerNext(HeaderIterator hi, rpmtd td)
int headerPutBin(Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size)
unsigned int headerGetInstance(Header h)
int headerConvert(Header h, int op)
Header headerLink(Header h)
Header headerNew(void)
int headerWrite(FD_t fd, Header h, int magicp)
unsigned int headerSizeof(Header h, int magicp)
Header headerCopy(Header h)
headerGetFlags_e
Definition header.h:139
HeaderIterator headerInitIterator(Header h)
Header headerReload(Header h, rpmTagVal tag)
Header headerImport(void *blob, unsigned int bsize, headerImportFlags flags)
rpmTagVal headerNextTag(HeaderIterator hi)
int headerIsEntry(Header h, rpmTagVal tag)
struct _FD_s * FD_t
Definition rpmtypes.h:99
struct headerToken_s * Header
Definition rpmtypes.h:24
Definition rpmtd.h:35