rpm 4.19.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
17enum rpmtdFlags_e {
18 RPMTD_NONE = 0,
19 RPMTD_ALLOCED = (1 << 0), /* was memory allocated? */
20 RPMTD_PTR_ALLOCED = (1 << 1), /* were array pointers allocated? */
21 RPMTD_IMMUTABLE = (1 << 2), /* header data or modifiable? */
22 RPMTD_ARGV = (1 << 3), /* string array is NULL-terminated? */
23 RPMTD_INVALID = (1 << 4), /* invalid data (in header) */
24};
25
26typedef rpmFlags rpmtdFlags;
27
32struct rpmtd_s {
33 rpm_tag_t tag; /* rpm tag of this data entry*/
34 rpm_tagtype_t type; /* data type */
35 rpm_count_t count; /* number of entries */
36 rpm_data_t data; /* pointer to actual data */
37 rpmtdFlags flags; /* flags on memory allocation etc */
38 int ix; /* iteration index */
39 rpm_count_t size; /* size of data (only works for RPMTD_IMMUTABLE atm) */
40};
41
47
54
61
68
74rpm_count_t rpmtdCount(rpmtd td);
75
82rpm_count_t rpmtdSize(rpmtd td);
83
89rpmTagVal rpmtdTag(rpmtd td);
90
97
104
110rpmtdFlags rpmtdGetFlags(rpmtd td);
111
118
127int rpmtdSetIndex(rpmtd td, int index);
128
135
142
148uint32_t *rpmtdNextUint32(rpmtd td);
149
155uint64_t *rpmtdNextUint64(rpmtd td);
156
162const char *rpmtdNextString(rpmtd td);
163
173
182uint16_t * rpmtdGetUint16(rpmtd td);
183
192uint32_t * rpmtdGetUint32(rpmtd td);
193
202uint64_t * rpmtdGetUint64(rpmtd td);
203
212const char * rpmtdGetString(rpmtd td);
213
224
225typedef enum rpmtdFormats_e {
226 RPMTD_FORMAT_STRING = 0, /* plain string (any type) */
227 RPMTD_FORMAT_ARMOR = 1, /* ascii armor format (bin types) */
228 RPMTD_FORMAT_BASE64 = 2, /* base64 encoding (bin types) */
229 RPMTD_FORMAT_PGPSIG = 3, /* pgp/gpg signature (bin types) */
230 RPMTD_FORMAT_DEPFLAGS = 4, /* dependency flags (int types) */
231 RPMTD_FORMAT_FFLAGS = 5, /* file flags (int types) */
232 RPMTD_FORMAT_PERMS = 6, /* permission string (int types) */
233 RPMTD_FORMAT_TRIGGERTYPE = 7, /* trigger types (int types) */
234 RPMTD_FORMAT_XML = 8, /* xml format (any type) */
235 RPMTD_FORMAT_OCTAL = 9, /* octal format (int types) */
236 RPMTD_FORMAT_HEX = 10, /* hex format (int types) */
237 RPMTD_FORMAT_DATE = 11, /* date format (int types) */
238 RPMTD_FORMAT_DAY = 12, /* day format (int types) */
239 RPMTD_FORMAT_SHESCAPE = 13, /* shell escaped (any type) */
240 RPMTD_FORMAT_ARRAYSIZE = 14, /* size of contained array (any type) */
241 RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int types) */
242 RPMTD_FORMAT_FSTATE = 16, /* file states (int types) */
243 RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
244 RPMTD_FORMAT_EXPAND = 18, /* macro expansion (string types) */
245 RPMTD_FORMAT_FSTATUS = 19, /* file verify status (int types) */
246 RPMTD_FORMAT_HUMANSI = 20, /* human readable value, K = 1000 (int types) */
247 RPMTD_FORMAT_HUMANIEC = 21, /* human readable value, K = 1024 (int types) */
248 RPMTD_FORMAT_TAGNAME = 22, /* tag name (any type) */
249 RPMTD_FORMAT_TAGNUM = 23, /* tag number (any type) */
250} rpmtdFormats;
251
263char *rpmtdFormat(rpmtd td, rpmtdFormats fmt, const char *errmsg);
264
273int rpmtdSetTag(rpmtd td, rpmTagVal tag);
274
286int rpmtdFromUint8(rpmtd td, rpmTagVal tag, uint8_t *data, rpm_count_t count);
287
298int rpmtdFromUint16(rpmtd td, rpmTagVal tag, uint16_t *data, rpm_count_t count);
299
310int rpmtdFromUint32(rpmtd td, rpmTagVal tag, uint32_t *data, rpm_count_t count);
311
322int rpmtdFromUint64(rpmtd td, rpmTagVal tag, uint64_t *data, rpm_count_t count);
323
332int rpmtdFromString(rpmtd td, rpmTagVal tag, const char *data);
333
344int rpmtdFromStringArray(rpmtd td, rpmTagVal tag, const char **data, rpm_count_t count);
345
355int rpmtdFromArgv(rpmtd td, rpmTagVal tag, ARGV_t argv);
356
366int rpmtdFromArgi(rpmtd td, rpmTagVal tag, ARGI_t argi);
367
377
384rpmsid * rpmtdToPool(rpmtd td, rpmstrPool pool);
385
386#ifdef __cplusplus
387}
388#endif
389
390#endif /* _RPMTD_H */
enum rpmTagType_e rpmTagType
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)
Definition: argv.h:21
Definition: rpmtd.h:32