rpm 4.19.92
The RPM Package Manager
Loading...
Searching...
No Matches
rpmtd.h
Go to the documentation of this file.
1#ifndef _RPMTD_H
2#define _RPMTD_H
3
10#include <rpm/rpmtag.h>
11#include <rpm/argv.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
21 RPMTD_NONE = 0,
22 RPMTD_ALLOCED = (1 << 0), /* was memory allocated? */
23 RPMTD_PTR_ALLOCED = (1 << 1), /* were array pointers allocated? */
24 RPMTD_IMMUTABLE = (1 << 2), /* header data or modifiable? */
25 RPMTD_ARGV = (1 << 3), /* string array is NULL-terminated? */
26 RPMTD_INVALID = (1 << 4), /* invalid data (in header) */
27};
28
29typedef rpmFlags rpmtdFlags;
30
35struct rpmtd_s {
36 rpm_tag_t tag;
37 rpm_tagtype_t type;
38 rpm_count_t count;
39 rpm_data_t data;
40 rpmtdFlags flags;
41 int ix;
42 rpm_count_t size;
43};
44
50
57
64
71
77rpm_count_t rpmtdCount(rpmtd td);
78
85rpm_count_t rpmtdSize(rpmtd td);
86
92rpmTagVal rpmtdTag(rpmtd td);
93
99rpmTagType rpmtdType(rpmtd td);
100
107
113rpmtdFlags rpmtdGetFlags(rpmtd td);
114
121
130int rpmtdSetIndex(rpmtd td, int index);
131
138
145
151uint32_t *rpmtdNextUint32(rpmtd td);
152
158uint64_t *rpmtdNextUint64(rpmtd td);
159
165const char *rpmtdNextString(rpmtd td);
166
176
185uint16_t * rpmtdGetUint16(rpmtd td);
186
195uint32_t * rpmtdGetUint32(rpmtd td);
196
205uint64_t * rpmtdGetUint64(rpmtd td);
206
215const char * rpmtdGetString(rpmtd td);
216
227
231typedef enum rpmtdFormats_e {
232 RPMTD_FORMAT_STRING = 0, /* plain string (any type) */
233 RPMTD_FORMAT_ARMOR = 1, /* ascii armor format (bin types) */
234 RPMTD_FORMAT_BASE64 = 2, /* base64 encoding (bin types) */
235 RPMTD_FORMAT_PGPSIG = 3, /* pgp/gpg signature (bin types) */
236 RPMTD_FORMAT_DEPFLAGS = 4, /* dependency flags (int types) */
237 RPMTD_FORMAT_FFLAGS = 5, /* file flags (int types) */
238 RPMTD_FORMAT_PERMS = 6, /* permission string (int types) */
239 RPMTD_FORMAT_TRIGGERTYPE = 7, /* trigger types (int types) */
240 RPMTD_FORMAT_XML = 8, /* xml format (any type) */
241 RPMTD_FORMAT_OCTAL = 9, /* octal format (int types) */
242 RPMTD_FORMAT_HEX = 10, /* hex format (int types) */
243 RPMTD_FORMAT_DATE = 11, /* date format (int types) */
244 RPMTD_FORMAT_DAY = 12, /* day format (int types) */
245 RPMTD_FORMAT_SHESCAPE = 13, /* shell escaped (any type) */
246 RPMTD_FORMAT_ARRAYSIZE = 14, /* size of contained array (any type) */
247 RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int types) */
248 RPMTD_FORMAT_FSTATE = 16, /* file states (int types) */
249 RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
250 RPMTD_FORMAT_EXPAND = 18, /* macro expansion (string types) */
251 RPMTD_FORMAT_FSTATUS = 19, /* file verify status (int types) */
252 RPMTD_FORMAT_HUMANSI = 20, /* human readable value, K = 1000 (int types) */
253 RPMTD_FORMAT_HUMANIEC = 21, /* human readable value, K = 1024 (int types) */
254 RPMTD_FORMAT_TAGNAME = 22, /* tag name (any type) */
255 RPMTD_FORMAT_TAGNUM = 23, /* tag number (any type) */
256 RPMTD_FORMAT_JSON = 24, /* json format (any type) */
258
270char *rpmtdFormat(rpmtd td, rpmtdFormats fmt, const char *errmsg);
271
280int rpmtdSetTag(rpmtd td, rpmTagVal tag);
281
293int rpmtdFromUint8(rpmtd td, rpmTagVal tag, uint8_t *data, rpm_count_t count);
294
305int rpmtdFromUint16(rpmtd td, rpmTagVal tag, uint16_t *data, rpm_count_t count);
306
317int rpmtdFromUint32(rpmtd td, rpmTagVal tag, uint32_t *data, rpm_count_t count);
318
329int rpmtdFromUint64(rpmtd td, rpmTagVal tag, uint64_t *data, rpm_count_t count);
330
339int rpmtdFromString(rpmtd td, rpmTagVal tag, const char *data);
340
351int rpmtdFromStringArray(rpmtd td, rpmTagVal tag, const char **data, rpm_count_t count);
352
362int rpmtdFromArgv(rpmtd td, rpmTagVal tag, ARGV_t argv);
363
373int rpmtdFromArgi(rpmtd td, rpmTagVal tag, ARGI_t argi);
374
384
391rpmsid * rpmtdToPool(rpmtd td, rpmstrPool pool);
392
393#ifdef __cplusplus
394}
395#endif
396
397#endif /* _RPMTD_H */
enum rpmTagClass_e rpmTagClass
uint64_t * rpmtdGetUint64(rpmtd td)
const char * rpmtdGetString(rpmtd td)
rpmTagVal rpmtdTag(rpmtd td)
int rpmtdFromUint32(rpmtd td, rpmTagVal tag, uint32_t *data, rpm_count_t count)
rpmtd rpmtdFree(rpmtd td)
int rpmtdFromStringArray(rpmtd td, rpmTagVal tag, const char **data, rpm_count_t count)
int rpmtdSetIndex(rpmtd td, int index)
uint64_t rpmtdGetNumber(rpmtd td)
void rpmtdFreeData(rpmtd td)
rpmtd rpmtdNew(void)
rpmTagClass rpmtdClass(rpmtd td)
int rpmtdNext(rpmtd td)
int rpmtdSetTag(rpmtd td, rpmTagVal tag)
rpm_count_t rpmtdCount(rpmtd td)
rpmsid * rpmtdToPool(rpmtd td, rpmstrPool pool)
const char * rpmtdNextString(rpmtd td)
int rpmtdGetIndex(rpmtd td)
int rpmtdInit(rpmtd td)
uint16_t * rpmtdGetUint16(rpmtd td)
int rpmtdFromUint8(rpmtd td, rpmTagVal tag, uint8_t *data, rpm_count_t count)
int rpmtdFromArgi(rpmtd td, rpmTagVal tag, ARGI_t argi)
rpmtd rpmtdDup(rpmtd td)
uint32_t * rpmtdGetUint32(rpmtd td)
int rpmtdFromArgv(rpmtd td, rpmTagVal tag, ARGV_t argv)
rpm_count_t rpmtdSize(rpmtd td)
char * rpmtdGetChar(rpmtd td)
void rpmtdReset(rpmtd td)
int rpmtdFromUint64(rpmtd td, rpmTagVal tag, uint64_t *data, rpm_count_t count)
int rpmtdFromUint16(rpmtd td, rpmTagVal tag, uint16_t *data, rpm_count_t count)
char * rpmtdFormat(rpmtd td, rpmtdFormats fmt, const char *errmsg)
uint32_t * rpmtdNextUint32(rpmtd td)
int rpmtdFromString(rpmtd td, rpmTagVal tag, const char *data)
uint64_t * rpmtdNextUint64(rpmtd td)
rpmtdFlags rpmtdGetFlags(rpmtd td)
rpmTagType rpmtdType(rpmtd td)
rpmtdFormats_e
Definition rpmtd.h:231
enum rpmtdFormats_e rpmtdFormats
rpmtdFlags_e
Definition rpmtd.h:20
Definition argv.h:21
Definition rpmtd.h:35
int ix
Definition rpmtd.h:41
rpm_data_t data
Definition rpmtd.h:39
rpm_count_t size
Definition rpmtd.h:42
rpm_tagtype_t type
Definition rpmtd.h:37
rpm_count_t count
Definition rpmtd.h:38
rpm_tag_t tag
Definition rpmtd.h:36
rpmtdFlags flags
Definition rpmtd.h:40