rpm 4.20.1 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
21 extern "C" {
22#endif
23
27 extern const unsigned char rpm_header_magic[8];
28
32 enum hMagic {
33 HEADER_MAGIC_NO = 0,
34 HEADER_MAGIC_YES = 1
35};
36
41 Header headerNew(void);
42
48 Header headerFree( Header h);
49
55 Header headerLink(Header h);
56
63 unsigned int headerSizeof(Header h, int magicp);
64
71 void * headerExport(Header h, unsigned int * bsize);
72
80 Header headerReload(Header h, rpmTagVal tag);
81
87 Header headerCopy(Header h);
88
89 enum headerImportFlags_e {
90 HEADERIMPORT_COPY = (1 << 0), /* Make copy of blob on import? */
91 HEADERIMPORT_FAST = (1 << 1), /* Faster but less safe? */
92};
93
94 typedef rpmFlags headerImportFlags;
95
103 Header headerImport(void *blob, unsigned int bsize, headerImportFlags flags);
104
111 Header headerRead(FD_t fd, int magicp);
112
120 int headerWrite(FD_t fd, Header h, int magicp);
121
128 int headerIsEntry(Header h, rpmTagVal tag);
129
139 enum headerGetFlags_e {
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
148 typedef rpmFlags headerGetFlags;
149
158 int headerGet(Header h, rpmTagVal tag, rpmtd td, headerGetFlags flags);
159
160
161 enum headerPutFlags_e {
162 HEADERPUT_DEFAULT = 0,
163 HEADERPUT_APPEND = (1 << 0),
164};
165
166 typedef rpmFlags headerPutFlags;
167
176 int headerPut(Header h, rpmtd td, headerPutFlags flags);
177
201 int headerPutBin(Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size);
202 int headerPutString(Header h, rpmTagVal tag, const char *val);
203 int headerPutStringArray(Header h, rpmTagVal tag, const char **val, rpm_count_t size);
204 int headerPutChar(Header h, rpmTagVal tag, const char *val, rpm_count_t size);
205 int headerPutUint8(Header h, rpmTagVal tag, const uint8_t *val, rpm_count_t size);
206 int headerPutUint16(Header h, rpmTagVal tag, const uint16_t *val, rpm_count_t size);
207 int headerPutUint32(Header h, rpmTagVal tag, const uint32_t *val, rpm_count_t size);
208 int headerPutUint64(Header h, rpmTagVal tag, const uint64_t *val, rpm_count_t size);
231 int headerAddI18NString(Header h, rpmTagVal tag, const char * string,
232 const char * lang);
233
241 int headerMod(Header h, rpmtd td);
242
252 int headerDel(Header h, rpmTagVal tag);
253
263 char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg);
264
271 void headerCopyTags(Header headerFrom, Header headerTo,
272 const rpmTagVal * tagstocopy);
273
279HeaderIterator headerFreeIterator(HeaderIterator hi);
280
286HeaderIterator headerInitIterator(Header h);
287
294 int headerNext(HeaderIterator hi, rpmtd td);
295
301rpmTagVal headerNextTag(HeaderIterator hi);
302
309 char * headerGetAsString(Header h, rpmTagVal tag);
310
317 const char * headerGetString(Header h, rpmTagVal tag);
318
325uint64_t headerGetNumber(Header h, rpmTagVal tag);
326
332 int headerIsSource(Header h);
333
339 unsigned int headerGetInstance(Header h);
340
341 typedef enum headerConvOps_e {
342 HEADERCONV_EXPANDFILELIST = 0,
343 HEADERCONV_COMPRESSFILELIST = 1,
344 HEADERCONV_RETROFIT_V3 = 2,
345} headerConvOps;
346
353 int headerConvert(Header h, int op);
354
355#ifdef __cplusplus
356}
357#endif
358
359#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