|
Librepo library 1.20.0
C library for downloading linux repository metadata and packages
|
Macros | |
| #define | LR_CURL_VERSION_CHECK(major, minor, patch) |
Functions | |
| void | lr_global_init (void) |
| void | lr_log_librepo_summary (void) |
| void | lr_out_of_memory (void) |
| void * | lr_malloc (size_t len) |
| void * | lr_malloc0 (size_t len) |
| void * | lr_realloc (void *ptr, size_t len) |
| void | lr_free (void *mem) |
| int | lr_gettmpfile (void) |
| char * | lr_gettmpdir (void) |
| char * | lr_pathconcat (const char *str,...) G_GNUC_NULL_TERMINATED |
| int | lr_remove_dir (const char *path) |
| int | lr_copy_content (int source, int dest) |
| char * | lr_prepend_url_protocol (const char *path) |
| gchar * | lr_string_chunk_insert (GStringChunk *chunk, const gchar *string) |
| int | lr_xml_parser_warning_logger (LrXmlParserWarningType type G_GNUC_UNUSED, char *msg, void *cbdata, GError **err G_GNUC_UNUSED) G_GNUC_UNUSED |
| gboolean | lr_best_checksum (GSList *list, LrChecksumType *type, gchar **value) |
| gchar * | lr_url_without_path (const char *url) |
| gchar ** | lr_strv_dup (gchar **array) |
| gboolean | lr_is_local_path (const gchar *path) |
| gboolean | lr_key_file_save_to_file (GKeyFile *key_file, const gchar *filename, GError **error) |
| GSList * | lr_get_recursive_files (char *path, char *extension, GError **err) |
| #define LR_CURL_VERSION_CHECK | ( | major, | |
| minor, | |||
| patch ) |
Macro for curl version check.
| major | Major version |
| minor | Minor version |
| patch | Patch version |
| gboolean lr_best_checksum | ( | GSList * | list, |
| LrChecksumType * | type, | ||
| gchar ** | value ) |
From the GSList of pointers to LrMetalinkHash objects, select the strongest one which librepo could calculate.
| list | List of LrMetalinkHash* |
| type | Variable to store checksum type. |
| value | Variable to store pointer to value (pointer to original value from the list, NOT A COPY). |
| int lr_copy_content | ( | int | source, |
| int | dest ) |
Copy content from source file descriptor to the dest file descriptor.
| source | Source opened file descriptor |
| dest | Destination opened file descriptor |
| void lr_free | ( | void * | mem | ) |
Free the memory block.
| mem | Pointer to block of memory. |
| char * lr_gettmpdir | ( | void | ) |
Create temporary directory in /tmp directory.
| int lr_gettmpfile | ( | void | ) |
Create temporary librepo file in /tmp directory.
| void lr_global_init | ( | void | ) |
Initialize librepo library. This is called automatically to initialize librepo. You normally don't have to call this function manually.
| gboolean lr_is_local_path | ( | const gchar * | path | ) |
Check if string looks like a local path. (This function doesn't do realpath resolving and existence checking) If a path is empty, NULL or has protocol other then file:// specified then the path is considered as remote, otherwise TRUE is returned.
| path | A string path |
| gboolean lr_key_file_save_to_file | ( | GKeyFile * | key_file, |
| const gchar * | filename, | ||
| GError ** | error ) |
Re-implementatio of g_key_file_save_to_file, because the function is available since 2.40 but we need to support older glib
| key_file | key file |
| filename | filename |
| error | GError ** |
| void lr_log_librepo_summary | ( | void | ) |
Clean up librepo library. void lr_global_cleanup(); Log a debug message with Librepo version and current time.
| void * lr_malloc | ( | size_t | len | ) |
Allocate len bytes of memory.
| len | Number of bytes to be allocated. |
| void * lr_malloc0 | ( | size_t | len | ) |
Allocate len bytes of memory. The allocated memory is set to zero.
| len | Number of bytes to be allocated. |
| void lr_out_of_memory | ( | void | ) |
Print "Out of memory" message to stderr and abort program execution. This function is used when malloc call fails.
| char * lr_pathconcat | ( | const char * | str, |
| ... ) |
Concatenate all of given part of path. If last chunk is "" then separator will be appended to the result.
| str | First part of the path. |
| ... | NULL terminated list of strings. |
| char * lr_prepend_url_protocol | ( | const char * | path | ) |
If protocol is specified ("http://foo") return copy of path. If path is absolute ("/foo/bar/") return path with "file://" prefix. If path is relative ("bar/") return absolute path with "file://" prefix.
| path |
| void * lr_realloc | ( | void * | ptr, |
| size_t | len ) |
Change size of block memory pointed by ptr to the new len.
| ptr | Pointer to block of memory or NULL. |
| len | New len of the block. |
| int lr_remove_dir | ( | const char * | path | ) |
Recursively remove directory.
| path | Path to the directory. |
| gchar * lr_string_chunk_insert | ( | GStringChunk * | chunk, |
| const gchar * | string ) |
Same as g_string_chunk_insert, but allows NULL as string. If the string is NULL, then returns NULL and do nothing.
| chunk | String chunk |
| string | String or NULL |
| gchar ** lr_strv_dup | ( | gchar ** | array | ) |
Create a copy of NULL-terminated array of strings. All strings in the copy are malloced - returned array must be freed by g_strfreev()
| array | NULL-terminated array of strings or NULL |
| gchar * lr_url_without_path | ( | const char * | url | ) |
Return malloced string with host part of url (protocol prefix + hostname)
| url | URL |
| int lr_xml_parser_warning_logger | ( | LrXmlParserWarningType type | G_GNUC_UNUSED, |
| char * | msg, | ||
| void * | cbdata, | ||
| GError **err | G_GNUC_UNUSED ) |
Warning callback to print warnings via GLib logger For more info take a look at LrXmlParserWarningCb