Data Structures | |
struct | rpmtd_s |
Container for rpm tag data (from headers or extensions). More... | |
Functions | |
rpmtd | rpmtdNew (void) |
Create new tag data container. | |
rpmtd | rpmtdFree (rpmtd td) |
Destroy tag data container. | |
void | rpmtdReset (rpmtd td) |
(Re-)initialize tag data container. | |
void | rpmtdFreeData (rpmtd td) |
Free contained data. | |
rpm_count_t | rpmtdCount (rpmtd td) |
Retrieve array size of the container. | |
rpmTag | rpmtdTag (rpmtd td) |
Retrieve tag of the container. | |
rpmTagType | rpmtdType (rpmtd td) |
Retrieve type of the container. | |
rpmTagClass | rpmtdClass (rpmtd td) |
Retrieve class of the container. | |
int | rpmtdGetIndex (rpmtd td) |
Retrieve current iteration index of the container. | |
int | rpmtdSetIndex (rpmtd td, int index) |
Set iteration index of the container. | |
int | rpmtdInit (rpmtd td) |
Initialize tag container for iteration. | |
int | rpmtdNext (rpmtd td) |
Iterate over tag data container. | |
uint32_t * | rpmtdNextUint32 (rpmtd td) |
Iterate over uint32_t type tag data container. | |
uint64_t * | rpmtdNextUint64 (rpmtd td) |
Iterate over uint64_t type tag data container. | |
const char * | rpmtdNextString (rpmtd td) |
Iterate over string / string array type tag data container. | |
char * | rpmtdGetChar (rpmtd td) |
Return char data from tag container. | |
uint16_t * | rpmtdGetUint16 (rpmtd td) |
Return uint16_t data from tag container. | |
uint32_t * | rpmtdGetUint32 (rpmtd td) |
Return uint32_t data from tag container. | |
uint64_t * | rpmtdGetUint64 (rpmtd td) |
Return uint64_t data from tag container. | |
const char * | rpmtdGetString (rpmtd td) |
Return string data from tag container. | |
uint64_t | rpmtdGetNumber (rpmtd td) |
Return numeric value from tag container. | |
char * | rpmtdFormat (rpmtd td, rpmtdFormats fmt, const char *errmsg) |
Format data from tag container to string presentation of given format. | |
int | rpmtdSetTag (rpmtd td, rpmTag tag) |
Set container tag and type. | |
int | rpmtdFromUint8 (rpmtd td, rpmTag tag, uint8_t *data, rpm_count_t count) |
Construct tag container from uint8_t pointer. | |
int | rpmtdFromUint16 (rpmtd td, rpmTag tag, uint16_t *data, rpm_count_t count) |
Construct tag container from uint16_t pointer. | |
int | rpmtdFromUint32 (rpmtd td, rpmTag tag, uint32_t *data, rpm_count_t count) |
Construct tag container from uint32_t pointer. | |
int | rpmtdFromUint64 (rpmtd td, rpmTag tag, uint64_t *data, rpm_count_t count) |
Construct tag container from uint64_t pointer. | |
int | rpmtdFromString (rpmtd td, rpmTag tag, const char *data) |
Construct tag container from a string. | |
int | rpmtdFromStringArray (rpmtd td, rpmTag tag, const char **data, rpm_count_t count) |
Construct tag container from a string array. | |
int | rpmtdFromArgv (rpmtd td, rpmTag tag, ARGV_t argv) |
Construct tag container from ARGV_t array. | |
int | rpmtdFromArgi (rpmtd td, rpmTag tag, ARGI_t argi) |
Construct tag container from ARGI_t array. |
rpmTagClass rpmtdClass | ( | rpmtd | td | ) |
Retrieve class of the container.
td | Tag data container |
rpm_count_t rpmtdCount | ( | rpmtd | td | ) |
Retrieve array size of the container.
For non-array types this is always 1.
td | Tag data container |
char* rpmtdFormat | ( | rpmtd | td, | |
rpmtdFormats | fmt, | |||
const char * | errmsg | |||
) |
Format data from tag container to string presentation of given format.
Return malloced string presentation of current data in container, converting from integers etc as necessary. On array types, data from current iteration index is used for formatting.
td | Tag data container | |
fmt | Format to apply | |
errmsg | Error message from conversion (or NULL) |
Destroy tag data container.
td | Tag data container |
void rpmtdFreeData | ( | rpmtd | td | ) |
Free contained data.
This is always safe to call as the container knows if data was malloc'ed or not. Container is reinitialized.
td | Tag data container |
Construct tag container from ARGI_t array.
Tag type is checked to be of integer array type and array is checked to be non-empty.
td | Tag data container | |
tag | Rpm tag to construct | |
argi | ARGI array |
Construct tag container from ARGV_t array.
Tag type is checked to be of string array type and array is checked to be non-empty.
td | Tag data container | |
tag | Rpm tag to construct | |
argv | ARGV array |
Construct tag container from a string.
Tag type is checked to be of string type.
td | Tag data container | |
tag | Rpm tag to construct | |
data | String to use |
int rpmtdFromStringArray | ( | rpmtd | td, | |
rpmTag | tag, | |||
const char ** | data, | |||
rpm_count_t | count | |||
) |
Construct tag container from a string array.
Tag type is checked to be of string or string array type. For non-array types count must be exactly 1.
td | Tag data container | |
tag | Rpm tag to construct | |
data | Pointer to string array | |
count | Number of entries |
int rpmtdFromUint16 | ( | rpmtd | td, | |
rpmTag | tag, | |||
uint16_t * | data, | |||
rpm_count_t | count | |||
) |
Construct tag container from uint16_t pointer.
Tag type is checked to be of INT16 type. For non-array types count must be exactly 1.
td | Tag data container | |
tag | Rpm tag to construct | |
data | Pointer to uint16_t (value or array) | |
count | Number of entries |
int rpmtdFromUint32 | ( | rpmtd | td, | |
rpmTag | tag, | |||
uint32_t * | data, | |||
rpm_count_t | count | |||
) |
Construct tag container from uint32_t pointer.
Tag type is checked to be of INT32 type. For non-array types count must be exactly 1.
td | Tag data container | |
tag | Rpm tag to construct | |
data | Pointer to uint32_t (value or array) | |
count | Number of entries |
int rpmtdFromUint64 | ( | rpmtd | td, | |
rpmTag | tag, | |||
uint64_t * | data, | |||
rpm_count_t | count | |||
) |
Construct tag container from uint64_t pointer.
Tag type is checked to be of INT64 type. For non-array types count must be exactly 1.
td | Tag data container | |
tag | Rpm tag to construct | |
data | Pointer to uint64_t (value or array) | |
count | Number of entries |
int rpmtdFromUint8 | ( | rpmtd | td, | |
rpmTag | tag, | |||
uint8_t * | data, | |||
rpm_count_t | count | |||
) |
Construct tag container from uint8_t pointer.
Tag type is checked to be of compatible type (CHAR, INT8 or BIN). For non-array types (BIN is a special case of INT8 array) count must be exactly 1.
td | Tag data container | |
tag | Rpm tag to construct | |
data | Pointer to uint8_t (value or array) | |
count | Number of entries |
char* rpmtdGetChar | ( | rpmtd | td | ) |
Return char data from tag container.
For scalar return type, just return pointer to the integer. On array types, return pointer to current iteration index. If the tag container is not for char type, NULL is returned.
td | Tag data container |
int rpmtdGetIndex | ( | rpmtd | td | ) |
Retrieve current iteration index of the container.
td | Tag data container |
uint64_t rpmtdGetNumber | ( | rpmtd | td | ) |
Return numeric value from tag container.
Returns the value of numeric container (RPM_NUMERIC_CLASS) from current iteration index as uint64_t regardless of its internal presentation (8/16/32/64-bit integer).
td | Tag data container |
const char* rpmtdGetString | ( | rpmtd | td | ) |
Return string data from tag container.
For string types, just return the string. On string array types, return the string from current iteration index. If the tag container is not for a string type, NULL is returned.
td | Tag data container |
uint16_t* rpmtdGetUint16 | ( | rpmtd | td | ) |
Return uint16_t data from tag container.
For scalar return type, just return pointer to the integer. On array types, return pointer to current iteration index. If the tag container is not for int16 type, NULL is returned.
td | Tag data container |
uint32_t* rpmtdGetUint32 | ( | rpmtd | td | ) |
Return uint32_t data from tag container.
For scalar return type, just return pointer to the integer. On array types, return pointer to current iteration index. If the tag container is not for int32 type, NULL is returned.
td | Tag data container |
uint64_t* rpmtdGetUint64 | ( | rpmtd | td | ) |
Return uint64_t data from tag container.
For scalar return type, just return pointer to the integer. On array types, return pointer to current iteration index. If the tag container is not for int64 type, NULL is returned.
td | Tag data container |
int rpmtdInit | ( | rpmtd | td | ) |
Initialize tag container for iteration.
td | Tag data container |
rpmtd rpmtdNew | ( | void | ) |
Create new tag data container.
int rpmtdNext | ( | rpmtd | td | ) |
Iterate over tag data container.
td | Tag data container |
const char* rpmtdNextString | ( | rpmtd | td | ) |
Iterate over string / string array type tag data container.
td | Tag data container |
uint32_t* rpmtdNextUint32 | ( | rpmtd | td | ) |
Iterate over uint32_t type tag data container.
td | Tag data container |
uint64_t* rpmtdNextUint64 | ( | rpmtd | td | ) |
Iterate over uint64_t type tag data container.
td | Tag data container |
void rpmtdReset | ( | rpmtd | td | ) |
(Re-)initialize tag data container.
Contents will be zeroed out and iteration index reset.
td | Tag data container |
int rpmtdSetIndex | ( | rpmtd | td, | |
int | index | |||
) |
Set iteration index of the container.
If new index is out of bounds for the container, -1 is returned and iteration index is left untouched.
td | Tag data container | |
index | New index |
Set container tag and type.
For empty container, any valid tag can be set. If the container has data, changing is only permitted to tag of same type.
td | Tag data container | |
tag | New tag |
Retrieve tag of the container.
td | Tag data container |
rpmTagType rpmtdType | ( | rpmtd | td | ) |
Retrieve type of the container.
td | Tag data container |