drpm
A library for making, reading and applying deltarpm packages
|
Tools for extracting information from DeltaRPM files. More...
Typedefs | |
typedef struct drpm | drpm |
DeltaRPM package info. | |
Functions | |
int | drpm_destroy (drpm **delta) |
Frees memory allocated by drpm_read(). More... | |
int | drpm_get_string (drpm *delta, int tag, char **target) |
Fetches information representable as a string. More... | |
int | drpm_get_uint (drpm *delta, int tag, unsigned *target) |
Fetches information representable as an unsigned integer. More... | |
int | drpm_get_ullong (drpm *delta, int tag, unsigned long long *target) |
Fetches information representable as an unsigned long long integer. More... | |
int | drpm_get_ulong (drpm *delta, int tag, unsigned long *target) |
Fetches information representable as an unsigned long integer. More... | |
int | drpm_get_ulong_array (drpm *delta, int tag, unsigned long **target, unsigned long *size) |
Fetches information representable as an array of unsigned long integers. More... | |
int | drpm_read (drpm **delta, const char *filename) |
Reads information from a DeltaRPM. More... | |
Tools for extracting information from DeltaRPM files.
Limits memory usage.
As drpm_make() normally needs about three to four times the size of the rpm's uncompressed payload, this option may be used to enable a sliding block algorithm that needs mbytes
megabytes of memory. This trades memory usage with the size of the created DeltaRPM.
[out] | opts | Structure specifying options for drpm_make(). |
[in] | mbytes | Permitted memory usage in megabytes. |
int drpm_read | ( | drpm ** | delta, |
const char * | filename | ||
) |
Reads information from a DeltaRPM.
Reads information from DeltaRPM package filename
into *delta
. Example of usage:
[out] | delta | DeltaRPM to be filled with info. |
[in] | filename | Name of DeltaRPM file whose data is to be read. |
int drpm_get_uint | ( | drpm * | delta, |
int | tag, | ||
unsigned * | target | ||
) |
Fetches information representable as an unsigned integer.
Fetches information identified by tag
from delta
and copies it to address pointed to by target
.
Example of usage:
[in] | delta | DeltaRPM containing required info. |
[in] | tag | Identifies which info is required. |
[out] | target | Tagged info will be copied here. |
delta
should have been previously initialized with drpm_read(), otherwise behaviour is undefined. int drpm_get_ulong | ( | drpm * | delta, |
int | tag, | ||
unsigned long * | target | ||
) |
Fetches information representable as an unsigned long integer.
Fetches information identified by tag
from delta
and copies it to address pointed to by target
.
Example of usage:
[in] | delta | Deltarpm containing required info. |
[in] | tag | Identifies which info is required. |
[out] | target | Tagged info will be copied here. |
delta
should have been previously initialized with drpm_read(), otherwise behaviour is undefined. int drpm_get_ullong | ( | drpm * | delta, |
int | tag, | ||
unsigned long long * | target | ||
) |
Fetches information representable as an unsigned long long integer.
Fetches information identified by tag
from delta
and copies it to address pointed to by target
.
Example of usage:
[in] | delta | Deltarpm containing required info. |
[in] | tag | Identifies which info is required. |
[out] | target | Tagged info will be copied here. |
delta
should have been previously initialized with drpm_read(), otherwise behaviour is undefined. int drpm_get_string | ( | drpm * | delta, |
int | tag, | ||
char ** | target | ||
) |
Fetches information representable as a string.
Fetches string-type information identified by tag
from delta
, copies it to space previously allocated by the function itself and saves the address to *target
.
Example of usage:
[in] | delta | Deltarpm containing required info. |
[in] | tag | Identifies which info is required. |
[out] | target | Tagged info will be copied here. |
*target
should be freed manually by the user when no longer needed. delta
should have been previously initialized with drpm_read(), otherwise behaviour is undefined. int drpm_get_ulong_array | ( | drpm * | delta, |
int | tag, | ||
unsigned long ** | target, | ||
unsigned long * | size | ||
) |
Fetches information representable as an array of unsigned long integers.
Fetches information identified by tag
from delta
, copies it to space previously allocated by the function itself, saves the address to *target
and stores size in *size
.
Example of usage:
[in] | delta | Deltarpm containing required info. |
[in] | tag | Identifies which info is required. |
[out] | target | Tagged info will be copied here. |
[out] | size | Size of array will be copied here. |
*target
should be freed manually by the user when no longer needed. delta
should have been previously initialized with drpm_read(), otherwise behaviour is undefined. int drpm_destroy | ( | drpm ** | delta | ) |
Frees memory allocated by drpm_read().
Frees memory pointed to by *delta
and sets *delta
to NULL
.
Example of usage:
[out] | delta | Deltarpm that is to be freed. |
delta
should have been previously initialized with drpm_read(), otherwise behaviour is undefined.