libalpm
Arch Linux Package Manager Library
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
27 alpm_handle_t *handle;
28 const char *tempfile_openmode;
29 /* name of the remote file */
31 /* temporary file name, to which the payload is downloaded */
33 /* name to which the downloaded file will be renamed */
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 */
45 /* the mtime of the existing version of this file, if there is one */
48 off_t max_size;
50 int force;
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
65void _alpm_dload_payload_reset(struct dload_payload *payload);
66
67int _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 */
off_t initial_size
Definition dload.h:47
int request_errors_ok
Definition dload.h:60
int unlink_on_fail
Definition dload.h:53
off_t max_size
Definition dload.h:48
off_t prevprogress
Definition dload.h:49
CURL * curl
Definition dload.h:57
char error_buffer[CURL_ERROR_SIZE]
Definition dload.h:58
alpm_handle_t * handle
Definition dload.h:27
char * destfile_name
Definition dload.h:34
long respcode
Definition dload.h:44
int errors_ok
Definition dload.h:52
char * tempfile_name
Definition dload.h:32
long mtime_existing_file
Definition dload.h:46
int force
Definition dload.h:50
int signature_optional
Definition dload.h:55
const char * tempfile_openmode
Definition dload.h:28
char * remote_name
Definition dload.h:30
alpm_list_t * cache_servers
Definition dload.h:42
int signature
Definition dload.h:59
alpm_list_t * servers
Definition dload.h:43
char * fileurl
Definition dload.h:40
FILE * localf
Definition dload.h:62
int download_signature
Definition dload.h:54
char * filepath
Definition dload.h:41
int allow_resume
Definition dload.h:51
Definition dload.h:26
A doubly linked list.
Definition alpm_list.h:51