Librepo library 1.22.1
C library for downloading linux repository metadata and packages
Loading...
Searching...
No Matches
package_downloader.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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef __LR_PACKAGE_DOWNLOADER_H__
21#define __LR_PACKAGE_DOWNLOADER_H__
22
23#include <glib.h>
24
25#include <librepo/rcodes.h>
26#include <librepo/handle.h>
27#include <librepo/checksum.h>
28
29G_BEGIN_DECLS
30
35
42#define lr_download_simple(handle, relative_url, err) \
43 lr_download_package((handle), (relative_url), NULL, 0, \
44 NULL, 0, NULL, 0, (err))
45
65gboolean
67 const char *relative_url,
68 const char *dest,
69 LrChecksumType checksum_type,
70 const char *checksum,
71 gint64 expectedsize,
72 const char *base_url,
73 gboolean resume,
74 GError **err);
75
77typedef struct {
78
81
84
85 char *dest;
87
88 char *base_url;
90
93
94 char *checksum;
96
97 gint64 expectedsize;
99
100 gboolean resume;
102
105
106 void *cbdata;
108
112
115
118
121
122 // Will be filled by ::lr_download_packages()
123
126
127 char *err;
129
130 GStringChunk *chunk;
132
134
161 const char *relative_url,
162 const char *dest,
163 LrChecksumType checksum_type,
164 const char *checksum,
165 gint64 expectedsize,
166 const char *base_url,
167 gboolean resume,
168 LrProgressCb progresscb,
169 void *cbdata,
170 GError **err);
171
203 const char *relative_url,
204 const char *dest,
205 LrChecksumType checksum_type,
206 const char *checksum,
207 gint64 expectedsize,
208 const char *base_url,
209 gboolean resume,
210 LrProgressCb progresscb,
211 void *cbdata,
212 LrEndCb endcb,
213 LrMirrorFailureCb mirrorfailurecb,
214 GError **err);
215
232 const char *relative_url,
233 const char *dest,
234 LrChecksumType checksum_type,
235 const char *checksum,
236 gint64 expectedsize,
237 const char *base_url,
238 gboolean resume,
239 LrProgressCb progresscb,
240 void *cbdata,
241 LrEndCb endcb,
242 LrMirrorFailureCb mirrorfailurecb,
243 gint64 byterangestart,
244 gint64 byterangeend,
245 GError **err);
246
250void
252
271
279gboolean
280lr_download_packages(GSList *targets,
282 GError **err);
283
295
301gboolean
302lr_check_packages(GSList *targets,
303 LrPackageCheckFlag flags,
304 GError **err);
305
307
308G_END_DECLS
309
310#endif
LrChecksumType
Definition checksum.h:35
struct _LrHandle LrHandle
Definition handle.h:38
gboolean lr_check_packages(GSList *targets, LrPackageCheckFlag flags, GError **err)
LrPackageCheckFlag
void lr_packagetarget_free(LrPackageTarget *target)
LrPackageTarget * lr_packagetarget_new(LrHandle *handle, const char *relative_url, const char *dest, LrChecksumType checksum_type, const char *checksum, gint64 expectedsize, const char *base_url, gboolean resume, LrProgressCb progresscb, void *cbdata, GError **err)
LrPackageTarget * lr_packagetarget_new_v2(LrHandle *handle, const char *relative_url, const char *dest, LrChecksumType checksum_type, const char *checksum, gint64 expectedsize, const char *base_url, gboolean resume, LrProgressCb progresscb, void *cbdata, LrEndCb endcb, LrMirrorFailureCb mirrorfailurecb, GError **err)
gboolean lr_download_packages(GSList *targets, LrPackageDownloadFlag flags, GError **err)
LrPackageDownloadFlag
gboolean lr_download_package(LrHandle *handle, const char *relative_url, const char *dest, LrChecksumType checksum_type, const char *checksum, gint64 expectedsize, const char *base_url, gboolean resume, GError **err)
LrPackageTarget * lr_packagetarget_new_v3(LrHandle *handle, const char *relative_url, const char *dest, LrChecksumType checksum_type, const char *checksum, gint64 expectedsize, const char *base_url, gboolean resume, LrProgressCb progresscb, void *cbdata, LrEndCb endcb, LrMirrorFailureCb mirrorfailurecb, gint64 byterangestart, gint64 byterangeend, GError **err)
@ LR_PACKAGECHECK_FAILFAST
@ LR_PACKAGEDOWNLOAD_TRANSIENT
@ LR_PACKAGEDOWNLOAD_FAILFAST
int(* LrEndCb)(void *clientp, LrTransferStatus status, const char *msg)
Definition types.h:143
int(* LrMirrorFailureCb)(void *clientp, const char *msg, const char *url)
Definition types.h:153
int(* LrProgressCb)(void *clientp, double total_to_download, double now_downloaded)
Definition types.h:124
GStringChunk * chunk
LrMirrorFailureCb mirrorfailurecb
LrChecksumType checksum_type
LrProgressCb progresscb