Loading...
Searching...
No Matches
rpmtd.h
Go to the documentation of this file.
#ifndef _RPMTD_H
#define _RPMTD_H
#include <rpm/rpmtag.h>
#include <rpm/argv.h>
#ifdef __cplusplus
extern "C" {
#endif
enum rpmtdFlags_e {
RPMTD_NONE = 0,
RPMTD_ALLOCED = (1 << 0), /* was memory allocated? */
RPMTD_PTR_ALLOCED = (1 << 1), /* were array pointers allocated? */
RPMTD_IMMUTABLE = (1 << 2), /* header data or modifiable? */
RPMTD_ARGV = (1 << 3), /* string array is NULL-terminated? */
RPMTD_INVALID = (1 << 4), /* invalid data (in header) */
};
typedef rpmFlags rpmtdFlags;
struct rpmtd_s {
rpm_tag_t tag;
rpm_tagtype_t type;
rpm_count_t count;
rpm_data_t data;
rpmtdFlags flags;
int ix;
rpm_count_t size;
};
rpmtd rpmtdNew(void);
rpmtd rpmtdFree(rpmtd td);
void rpmtdReset(rpmtd td);
void rpmtdFreeData(rpmtd td);
rpm_count_t rpmtdCount(rpmtd td);
rpm_count_t rpmtdSize(rpmtd td);
rpmTagVal rpmtdTag(rpmtd td);
rpmTagType rpmtdType(rpmtd td);
rpmTagClass rpmtdClass(rpmtd td);
rpmtdFlags rpmtdGetFlags(rpmtd td);
int rpmtdGetIndex(rpmtd td);
int rpmtdSetIndex(rpmtd td, int index);
int rpmtdInit(rpmtd td);
int rpmtdNext(rpmtd td);
uint32_t *rpmtdNextUint32(rpmtd td);
uint64_t *rpmtdNextUint64(rpmtd td);
const char *rpmtdNextString(rpmtd td);
char *rpmtdGetChar(rpmtd td);
uint16_t * rpmtdGetUint16(rpmtd td);
uint32_t * rpmtdGetUint32(rpmtd td);
uint64_t * rpmtdGetUint64(rpmtd td);
const char * rpmtdGetString(rpmtd td);
uint64_t rpmtdGetNumber(rpmtd td);
typedef enum rpmtdFormats_e {
RPMTD_FORMAT_STRING = 0, /* plain string (any type) */
RPMTD_FORMAT_ARMOR = 1, /* ascii armor format (bin types) */
RPMTD_FORMAT_BASE64 = 2, /* base64 encoding (bin types) */
RPMTD_FORMAT_PGPSIG = 3, /* pgp/gpg signature (bin types) */
RPMTD_FORMAT_DEPFLAGS = 4, /* dependency flags (int types) */
RPMTD_FORMAT_FFLAGS = 5, /* file flags (int types) */
RPMTD_FORMAT_PERMS = 6, /* permission string (int types) */
RPMTD_FORMAT_TRIGGERTYPE = 7, /* trigger types (int types) */
RPMTD_FORMAT_XML = 8, /* xml format (any type) */
RPMTD_FORMAT_OCTAL = 9, /* octal format (int types) */
RPMTD_FORMAT_HEX = 10, /* hex format (int types) */
RPMTD_FORMAT_DATE = 11, /* date format (int types) */
RPMTD_FORMAT_DAY = 12, /* day format (int types) */
RPMTD_FORMAT_SHESCAPE = 13, /* shell escaped (any type) */
RPMTD_FORMAT_ARRAYSIZE = 14, /* size of contained array (any type) */
RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int types) */
RPMTD_FORMAT_FSTATE = 16, /* file states (int types) */
RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
RPMTD_FORMAT_EXPAND = 18, /* macro expansion (string types) */
RPMTD_FORMAT_FSTATUS = 19, /* file verify status (int types) */
RPMTD_FORMAT_HUMANSI = 20, /* human readable value, K = 1000 (int types) */
RPMTD_FORMAT_HUMANIEC = 21, /* human readable value, K = 1024 (int types) */
RPMTD_FORMAT_TAGNAME = 22, /* tag name (any type) */
RPMTD_FORMAT_TAGNUM = 23, /* tag number (any type) */
RPMTD_FORMAT_JSON = 24, /* json format (any type) */
} rpmtdFormats;
char *rpmtdFormat(rpmtd td, rpmtdFormats fmt, const char *errmsg);
int rpmtdSetTag(rpmtd td, rpmTagVal tag);
int rpmtdFromUint8(rpmtd td, rpmTagVal tag, uint8_t *data, rpm_count_t count);
int rpmtdFromUint16(rpmtd td, rpmTagVal tag, uint16_t *data, rpm_count_t count);
int rpmtdFromUint32(rpmtd td, rpmTagVal tag, uint32_t *data, rpm_count_t count);
int rpmtdFromUint64(rpmtd td, rpmTagVal tag, uint64_t *data, rpm_count_t count);
int rpmtdFromString(rpmtd td, rpmTagVal tag, const char *data);
int rpmtdFromStringArray(rpmtd td, rpmTagVal tag, const char **data, rpm_count_t count);
int rpmtdFromArgv(rpmtd td, rpmTagVal tag, ARGV_t argv);
int rpmtdFromArgi(rpmtd td, rpmTagVal tag, ARGI_t argi);
rpmtd rpmtdDup(rpmtd td);
rpmsid * rpmtdToPool(rpmtd td, rpmstrPool pool);
#ifdef __cplusplus
}
#endif
#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