Datové struktry | |
struct | cr_EVR |
struct | cr_Version |
struct | cr_HeaderRangeStruct |
Definice maker | |
#define | CR_UNUSED(x) (void)(x) |
#define | cr_cmp_nvrea(A, B) |
Funkce | |
const char * | cr_flag_to_str (gint64 flags) |
struct cr_EVR | cr_str_to_evr (const char *string, GStringChunk *chunk) |
char * | cr_compute_file_checksum (const char *filename, cr_ChecksumType type) |
struct cr_HeaderRangeStruct | cr_get_header_byte_range (const char *filename) |
const char * | cr_checksum_name_str (cr_ChecksumType type) |
char * | cr_get_filename (const char *filepath) |
void | cr_download (CURL *handle, const char *url, const char *destination, char **error) |
int | cr_copy_file (const char *src, const char *dst) |
int | cr_compress_file (const char *src, const char *dst, cr_CompressionType compression) |
int | cr_better_copy_file (const char *src, const char *dst) |
int | cr_remove_dir (const char *path) |
char * | cr_normalize_dir_path (const char *path) |
struct cr_Version | cr_str_to_version (const char *str) |
int | cr_cmp_version_str (const char *str1, const char *str2) |
void | cr_null_log_fn (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) |
void | cr_log_fn (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) |
void | cr_slist_free_full (GSList *list, GDestroyNotify free_f) |
int | cr_cmp_evr (const char *e1, const char *v1, const char *r1, const char *e2, const char *v2, const char *r2) |
#define cr_cmp_nvrea | ( | A, | |||
B | ) |
(cr_cmp_evr((A)->epoch, (A)->version, (A)->release,\ (B)->epoch, (B)->version, (B)->release))
Compare evr of two cr_NVREA. Name and arch are ignored.
#define CR_UNUSED | ( | x | ) | (void)(x) |
int cr_better_copy_file | ( | const char * | src, | |
const char * | dst | |||
) |
const char* cr_checksum_name_str | ( | cr_ChecksumType | type | ) |
Return checksum name.
type | checksum type |
int cr_cmp_evr | ( | const char * | e1, | |
const char * | v1, | |||
const char * | r1, | |||
const char * | e2, | |||
const char * | v2, | |||
const char * | r2 | |||
) |
Compare two version strings splited into evr chunks. param e1 1. epoch param v1 1. version param r1 1. release param e2 2. epoch param v2 2. version param r2 2. release return 0 = same, 1 = first is newer, -1 = second is newer
int cr_cmp_version_str | ( | const char * | str1, | |
const char * | str2 | |||
) |
Compare two version string.
str1 | first version string | |
str2 | second version string |
int cr_compress_file | ( | const char * | src, | |
const char * | dst, | |||
cr_CompressionType | compression | |||
) |
Compress file.
src | source filename | |
dst | destination (If dst is dir, filename of src + compression suffix is used. If dst is NULL, src + compression suffix is used) | |
compression | type of compression |
char* cr_compute_file_checksum | ( | const char * | filename, | |
cr_ChecksumType | type | |||
) |
Compute file checksum.
filename | filename | |
type | type of checksum |
int cr_copy_file | ( | const char * | src, | |
const char * | dst | |||
) |
Copy file.
src | source filename | |
dst | destination (if dst is dir, filename of src is used) |
void cr_download | ( | CURL * | handle, | |
const char * | url, | |||
const char * | destination, | |||
char ** | error | |||
) |
Download a file from the URL into the in_dst via curl handle. If *error == NULL then download was successfull.
handle | CURL handle | |
url | source url | |
destination | destination (if destination is dir, filename from the url is used) | |
error | pointer to string pointer for error message (mandatory argument!) |
const char* cr_flag_to_str | ( | gint64 | flags | ) |
Convert flags from RPM header to a string representation.
flags | flags |
char* cr_get_filename | ( | const char * | filepath | ) |
Return pointer to the rest of string after last '/'. (e.g. for "/foo/bar" returns "bar")
filepath | path |
struct cr_HeaderRangeStruct cr_get_header_byte_range | ( | const char * | filename | ) | [read] |
Return header byte range.
filename | filename |
void cr_log_fn | ( | const gchar * | log_domain, | |
GLogLevelFlags | log_level, | |||
const gchar * | message, | |||
gpointer | user_data | |||
) |
Createrepo_c library standard logging function.
log_domain | logging domain | |
log_level | logging level | |
message | message | |
user_data | user data |
char* cr_normalize_dir_path | ( | const char * | path | ) |
Normalize path (Path with exactly one trailing '/').
path | path |
void cr_null_log_fn | ( | const gchar * | log_domain, | |
GLogLevelFlags | log_level, | |||
const gchar * | message, | |||
gpointer | user_data | |||
) |
Logging function with no output.
log_domain | logging domain | |
log_level | logging level | |
message | message | |
user_data | user data |
int cr_remove_dir | ( | const char * | path | ) |
Recursively remove directory.
path | filepath |
void cr_slist_free_full | ( | GSList * | list, | |
GDestroyNotify | free_f | |||
) |
Frees all the memory used by a GSList, and calls the specified destroy function on every element's data. This is the same function as g_slist_free_full(). The original function is implemented in glib since 2.28 but we need to support the older glib too.
list | pointer to GSList | |
free_f | the function to be called to free each element's data |
struct cr_EVR cr_str_to_evr | ( | const char * | string, | |
GStringChunk * | chunk | |||
) | [read] |
Convert epoch-version-release string into cr_EVR structure. If no GStringChunk passed, all non NULL items in returned structure are malloced and in that case, you have to free all non-NULL element yourself.
string | NULL terminated n-v-r string | |
chunk | string chunk for strings (optional - could be NULL) |
struct cr_Version cr_str_to_version | ( | const char * | str | ) | [read] |
Convert version string into cr_Version struct.
str | version string |