libalpm
Arch Linux Package Manager Library
lib
libalpm
dload.h
Go to the documentation of this file.
1
/*
2
* dload.h
3
*
4
* Copyright (c) 2006-2024 Pacman Development Team <pacman-dev@lists.archlinux.org>
5
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
#ifndef ALPM_DLOAD_H
21
#define ALPM_DLOAD_H
22
23
#include "
alpm_list.h
"
24
#include "
alpm.h
"
25
26
struct
dload_payload
{
27
alpm_handle_t *
handle
;
28
const
char
*
tempfile_openmode
;
29
/* name of the remote file */
30
char
*
remote_name
;
31
/* temporary file name, to which the payload is downloaded */
32
char
*
tempfile_name
;
33
/* name to which the downloaded file will be renamed */
34
char
*
destfile_name
;
35
/* client has to provide either
36
* 1) fileurl - full URL to the file
37
* 2) pair of (servers, filepath), in this case ALPM iterates over the
38
* server list and tries to download "$server/$filepath"
39
*/
40
char
*
fileurl
;
41
char
*
filepath
;
/* download URL path */
42
alpm_list_t
*
cache_servers
;
43
alpm_list_t
*
servers
;
44
long
respcode
;
45
/* the mtime of the existing version of this file, if there is one */
46
long
mtime_existing_file
;
47
off_t
initial_size
;
48
off_t
max_size
;
49
off_t
prevprogress
;
50
int
force
;
51
int
allow_resume
;
52
int
errors_ok
;
53
int
unlink_on_fail
;
54
int
download_signature
;
/* specifies if an accompanion *.sig file need to be downloaded*/
55
int
signature_optional
;
/* *.sig file is optional */
56
#ifdef HAVE_LIBCURL
57
CURL *
curl
;
58
char
error_buffer
[CURL_ERROR_SIZE];
59
int
signature
;
/* specifies if this payload is for a signature file */
60
int
request_errors_ok
;
/* per-request errors-ok */
61
#endif
62
FILE *
localf
;
/* temp download file */
63
};
64
65
void
_alpm_dload_payload_reset(
struct
dload_payload
*payload);
66
67
int
_alpm_download(alpm_handle_t *handle,
68
alpm_list_t
*payloads
/* struct dload_payload */
,
69
const
char
*localpath,
70
const
char
*temporary_localpath);
71
72
#endif
/* ALPM_DLOAD_H */
alpm.h
alpm_list.h
dload_payload::initial_size
off_t initial_size
Definition
dload.h:47
dload_payload::request_errors_ok
int request_errors_ok
Definition
dload.h:60
dload_payload::unlink_on_fail
int unlink_on_fail
Definition
dload.h:53
dload_payload::max_size
off_t max_size
Definition
dload.h:48
dload_payload::prevprogress
off_t prevprogress
Definition
dload.h:49
dload_payload::curl
CURL * curl
Definition
dload.h:57
dload_payload::error_buffer
char error_buffer[CURL_ERROR_SIZE]
Definition
dload.h:58
dload_payload::handle
alpm_handle_t * handle
Definition
dload.h:27
dload_payload::destfile_name
char * destfile_name
Definition
dload.h:34
dload_payload::respcode
long respcode
Definition
dload.h:44
dload_payload::errors_ok
int errors_ok
Definition
dload.h:52
dload_payload::tempfile_name
char * tempfile_name
Definition
dload.h:32
dload_payload::mtime_existing_file
long mtime_existing_file
Definition
dload.h:46
dload_payload::force
int force
Definition
dload.h:50
dload_payload::signature_optional
int signature_optional
Definition
dload.h:55
dload_payload::tempfile_openmode
const char * tempfile_openmode
Definition
dload.h:28
dload_payload::remote_name
char * remote_name
Definition
dload.h:30
dload_payload::cache_servers
alpm_list_t * cache_servers
Definition
dload.h:42
dload_payload::signature
int signature
Definition
dload.h:59
dload_payload::servers
alpm_list_t * servers
Definition
dload.h:43
dload_payload::fileurl
char * fileurl
Definition
dload.h:40
dload_payload::localf
FILE * localf
Definition
dload.h:62
dload_payload::download_signature
int download_signature
Definition
dload.h:54
dload_payload::filepath
char * filepath
Definition
dload.h:41
dload_payload::allow_resume
int allow_resume
Definition
dload.h:51
dload_payload
Definition
dload.h:26
alpm_list_t
A doubly linked list.
Definition
alpm_list.h:51
Generated by
1.11.0