rpm: /home/mdomonko/code/rpm/rpm-4.20.x/include/rpm/rpmtd.h Source File

rpm 4.20.0 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
20 enum rpmtdFlags_e {
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
35 struct 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
49 rpmtd rpmtdNew(void);
50
56 rpmtd rpmtdFree(rpmtd td);
57
63 void rpmtdReset(rpmtd td);
64
70 void rpmtdFreeData(rpmtd td);
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
106 rpmTagClass rpmtdClass(rpmtd td);
107
113rpmtdFlags rpmtdGetFlags(rpmtd td);
114
120 int rpmtdGetIndex(rpmtd td);
121
130 int rpmtdSetIndex(rpmtd td, int index);
131
137 int rpmtdInit(rpmtd td);
138
144 int rpmtdNext(rpmtd td);
145
151uint32_t *rpmtdNextUint32(rpmtd td);
152
158uint64_t *rpmtdNextUint64(rpmtd td);
159
165 const char *rpmtdNextString(rpmtd td);
166
175 char *rpmtdGetChar(rpmtd td);
176
185uint16_t * rpmtdGetUint16(rpmtd td);
186
195uint32_t * rpmtdGetUint32(rpmtd td);
196
205uint64_t * rpmtdGetUint64(rpmtd td);
206
215 const char * rpmtdGetString(rpmtd td);
216
226uint64_t rpmtdGetNumber(rpmtd td);
227
231 typedef 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) */
257} rpmtdFormats;
258
270 char *rpmtdFormat(rpmtd td, rpmtdFormats fmt, const char *errmsg);
271
280 int rpmtdSetTag(rpmtd td, rpmTagVal tag);
281
293 int rpmtdFromUint8(rpmtd td, rpmTagVal tag, uint8_t *data, rpm_count_t count);
294
305 int rpmtdFromUint16(rpmtd td, rpmTagVal tag, uint16_t *data, rpm_count_t count);
306
317 int rpmtdFromUint32(rpmtd td, rpmTagVal tag, uint32_t *data, rpm_count_t count);
318
329 int rpmtdFromUint64(rpmtd td, rpmTagVal tag, uint64_t *data, rpm_count_t count);
330
339 int rpmtdFromString(rpmtd td, rpmTagVal tag, const char *data);
340
351 int rpmtdFromStringArray(rpmtd td, rpmTagVal tag, const char **data, rpm_count_t count);
352
362 int rpmtdFromArgv(rpmtd td, rpmTagVal tag, ARGV_t argv);
363
373 int rpmtdFromArgi(rpmtd td, rpmTagVal tag, ARGI_t argi);
374
383 rpmtd rpmtdDup(rpmtd td);
384
391rpmsid * rpmtdToPool(rpmtd td, rpmstrPool pool);
392
393#ifdef __cplusplus
394}
395#endif
396
397#endif /* _RPMTD_H */
argv.h
rpmTagClass
enum rpmTagClass_e rpmTagClass
rpmtdGetUint64
uint64_t * rpmtdGetUint64(rpmtd td)
rpmtdGetString
const char * rpmtdGetString(rpmtd td)
rpmtdTag
rpmTagVal rpmtdTag(rpmtd td)
rpmtdFromUint32
int rpmtdFromUint32(rpmtd td, rpmTagVal tag, uint32_t *data, rpm_count_t count)
rpmtdFree
rpmtd rpmtdFree(rpmtd td)
rpmtdFromStringArray
int rpmtdFromStringArray(rpmtd td, rpmTagVal tag, const char **data, rpm_count_t count)
rpmtdSetIndex
int rpmtdSetIndex(rpmtd td, int index)
rpmtdGetNumber
uint64_t rpmtdGetNumber(rpmtd td)
rpmtdFreeData
void rpmtdFreeData(rpmtd td)
rpmtdNew
rpmtd rpmtdNew(void)
rpmtdClass
rpmTagClass rpmtdClass(rpmtd td)
rpmtdNext
int rpmtdNext(rpmtd td)
rpmtdSetTag
int rpmtdSetTag(rpmtd td, rpmTagVal tag)
rpmtdCount
rpm_count_t rpmtdCount(rpmtd td)
rpmtdToPool
rpmsid * rpmtdToPool(rpmtd td, rpmstrPool pool)
rpmtdNextString
const char * rpmtdNextString(rpmtd td)
rpmtdGetIndex
int rpmtdGetIndex(rpmtd td)
rpmtdInit
int rpmtdInit(rpmtd td)
rpmtdGetUint16
uint16_t * rpmtdGetUint16(rpmtd td)
rpmtdFromUint8
int rpmtdFromUint8(rpmtd td, rpmTagVal tag, uint8_t *data, rpm_count_t count)
rpmtdFromArgi
int rpmtdFromArgi(rpmtd td, rpmTagVal tag, ARGI_t argi)
rpmtdDup
rpmtd rpmtdDup(rpmtd td)
rpmtdGetUint32
uint32_t * rpmtdGetUint32(rpmtd td)
rpmtdFromArgv
int rpmtdFromArgv(rpmtd td, rpmTagVal tag, ARGV_t argv)
rpmtdSize
rpm_count_t rpmtdSize(rpmtd td)
rpmtdGetChar
char * rpmtdGetChar(rpmtd td)
rpmtdReset
void rpmtdReset(rpmtd td)
rpmtdFromUint64
int rpmtdFromUint64(rpmtd td, rpmTagVal tag, uint64_t *data, rpm_count_t count)
rpmtdFromUint16
int rpmtdFromUint16(rpmtd td, rpmTagVal tag, uint16_t *data, rpm_count_t count)
rpmtdFormat
char * rpmtdFormat(rpmtd td, rpmtdFormats fmt, const char *errmsg)
rpmtdNextUint32
uint32_t * rpmtdNextUint32(rpmtd td)
rpmtdFromString
int rpmtdFromString(rpmtd td, rpmTagVal tag, const char *data)
rpmtdNextUint64
uint64_t * rpmtdNextUint64(rpmtd td)
rpmtdGetFlags
rpmtdFlags rpmtdGetFlags(rpmtd td)
rpmtdType
rpmTagType rpmtdType(rpmtd td)
rpmtag.h
rpmtdFormats_e
rpmtdFormats_e
Definition rpmtd.h:231
rpmtdFormats
enum rpmtdFormats_e rpmtdFormats
rpmtdFlags_e
rpmtdFlags_e
Definition rpmtd.h:20
ARGI_s
Definition argv.h:21
rpmtd_s
Definition rpmtd.h:35
rpmtd_s::ix
int ix
Definition rpmtd.h:41
rpmtd_s::data
rpm_data_t data
Definition rpmtd.h:39
rpmtd_s::size
rpm_count_t size
Definition rpmtd.h:42
rpmtd_s::type
rpm_tagtype_t type
Definition rpmtd.h:37
rpmtd_s::count
rpm_count_t count
Definition rpmtd.h:38
rpmtd_s::tag
rpm_tag_t tag
Definition rpmtd.h:36
rpmtd_s::flags
rpmtdFlags flags
Definition rpmtd.h:40