2008-01-22 21:36:11 -06:00
|
|
|
/*
|
|
|
|
* dload.h
|
|
|
|
*
|
2020-02-10 10:46:03 +10:00
|
|
|
* Copyright (c) 2006-2020 Pacman Development Team <pacman-dev@archlinux.org>
|
2009-07-01 02:08:33 -05:00
|
|
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
2008-01-22 21:36:11 -06:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-09-03 22:14:49 -05:00
|
|
|
#ifndef ALPM_DLOAD_H
|
|
|
|
#define ALPM_DLOAD_H
|
2008-01-22 21:36:11 -06:00
|
|
|
|
|
|
|
#include "alpm_list.h"
|
|
|
|
#include "alpm.h"
|
|
|
|
|
2011-06-30 22:00:07 -04:00
|
|
|
struct dload_payload {
|
2011-06-28 14:04:00 +10:00
|
|
|
alpm_handle_t *handle;
|
2011-08-19 13:42:53 -04:00
|
|
|
const char *tempfile_openmode;
|
2011-09-28 02:56:36 -05:00
|
|
|
char *remote_name;
|
2011-08-19 11:56:37 -04:00
|
|
|
char *tempfile_name;
|
|
|
|
char *destfile_name;
|
2011-08-19 11:58:45 -04:00
|
|
|
char *content_disp_name;
|
2011-06-24 00:18:01 -04:00
|
|
|
char *fileurl;
|
2020-03-26 13:19:59 -07:00
|
|
|
char *filepath; /* download URL path */
|
2014-01-02 12:37:08 -06:00
|
|
|
alpm_list_t *servers;
|
|
|
|
long respcode;
|
2011-08-24 19:48:03 -05:00
|
|
|
off_t initial_size;
|
|
|
|
off_t max_size;
|
2011-09-29 12:17:16 -04:00
|
|
|
off_t prevprogress;
|
2011-06-30 21:19:25 -04:00
|
|
|
int force;
|
|
|
|
int allow_resume;
|
|
|
|
int errors_ok;
|
2011-08-18 14:17:30 -04:00
|
|
|
int unlink_on_fail;
|
2013-09-05 16:08:23 +02:00
|
|
|
int trust_remote_name;
|
2017-12-16 12:41:11 -05:00
|
|
|
int cb_initialized;
|
2011-10-14 07:38:58 -05:00
|
|
|
#ifdef HAVE_LIBCURL
|
2011-09-28 12:06:36 -05:00
|
|
|
CURLcode curlerr; /* last error produced by curl */
|
2011-10-14 07:38:58 -05:00
|
|
|
#endif
|
2011-06-24 00:18:01 -04:00
|
|
|
};
|
|
|
|
|
2011-09-28 12:58:43 -05:00
|
|
|
void _alpm_dload_payload_reset(struct dload_payload *payload);
|
2016-10-17 16:40:37 +02:00
|
|
|
void _alpm_dload_payload_reset_for_retry(struct dload_payload *payload);
|
2011-06-24 00:18:01 -04:00
|
|
|
|
2011-06-30 21:19:25 -04:00
|
|
|
int _alpm_download(struct dload_payload *payload, const char *localpath,
|
2014-10-16 15:36:55 +02:00
|
|
|
char **final_file, const char **final_url);
|
2008-01-22 21:36:11 -06:00
|
|
|
|
2020-03-26 13:19:59 -07:00
|
|
|
int _alpm_multi_download(alpm_handle_t *handle,
|
|
|
|
alpm_list_t *payloads /* struct dload_payload */,
|
|
|
|
const char *localpath);
|
|
|
|
|
2016-09-03 22:14:49 -05:00
|
|
|
#endif /* ALPM_DLOAD_H */
|