Librepo library  1.7.7
C library for downloading linux repository metadata and packages
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules
util.h
1 /* librepo - A library providing (libcURL like) API to downloading repository
2  * Copyright (C) 2012 Tomas Mlcoch
3  *
4  * Licensed under the GNU Lesser General Public License Version 2.1
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef LR_UTIL_H
22 #define LR_UTIL_H
23 
24 #include <glib.h>
25 #include <stdlib.h>
26 #include <stdarg.h>
27 
28 #include "checksum.h"
29 #include "xmlparser.h"
30 
31 G_BEGIN_DECLS
32 
42 void lr_global_init();
43 
51 void lr_out_of_memory();
52 
57 void *lr_malloc(size_t len);
58 
63 void *lr_malloc0(size_t len);
64 
70 void *lr_realloc(void *ptr, size_t len);
71 
75 void lr_free(void *mem);
76 
80 int lr_gettmpfile();
81 
85 char *lr_gettmpdir();
86 
93 char *lr_pathconcat(const char *str, ...);
94 
99 int lr_remove_dir(const char *path);
100 
106 int lr_copy_content(int source, int dest);
107 
114 char *lr_prepend_url_protocol(const char *path);
115 
122 gchar *
123 lr_string_chunk_insert(GStringChunk *chunk, const gchar *string);
124 
128 int
130  char *msg,
131  void *cbdata,
132  GError **err G_GNUC_UNUSED) G_GNUC_UNUSED;
133 
134 
143 gboolean
144 lr_best_checksum(GSList *list, LrChecksumType *type, gchar **value);
145 
150 gchar *
151 lr_url_without_path(const char *url);
152 
155 G_END_DECLS
156 
157 #endif
gchar * lr_url_without_path(const char *url)
LrChecksumType
Definition: checksum.h:36
char * lr_pathconcat(const char *str,...)
int lr_gettmpfile()
void lr_free(void *mem)
char * lr_gettmpdir()
int lr_remove_dir(const char *path)
void * lr_realloc(void *ptr, size_t len)
int lr_copy_content(int source, int dest)
int lr_xml_parser_warning_logger(LrXmlParserWarningType type G_GNUC_UNUSED, char *msg, void *cbdata, GError **err G_GNUC_UNUSED) G_GNUC_UNUSED
void lr_global_init()
gchar * lr_string_chunk_insert(GStringChunk *chunk, const gchar *string)
gboolean lr_best_checksum(GSList *list, LrChecksumType *type, gchar **value)
LrXmlParserWarningType
Definition: xmlparser.h:38
void * lr_malloc0(size_t len)
char * lr_prepend_url_protocol(const char *path)
void * lr_malloc(size_t len)
void lr_out_of_memory()