libalpm
Arch Linux Package Manager Library
Data Structures | Functions
dload.h File Reference
#include "alpm_list.h"
#include "alpm.h"
Include dependency graph for dload.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dload_payload

Functions

void _alpm_dload_payload_reset (struct dload_payload *payload)
int _alpm_download (struct dload_payload *payload, const char *localpath, char **final_file)
 Download a file given by a URL to a local directory.

Function Documentation

void _alpm_dload_payload_reset ( struct dload_payload payload)
int _alpm_download ( struct dload_payload payload,
const char *  localpath,
char **  final_file 
)

Download a file given by a URL to a local directory.

Does not overwrite an existing file if the download fails.

Parameters:
payloadthe payload context
localpaththe directory to save the file in
final_filethe real name of the downloaded file (may be NULL)
Returns:
0 on success, -1 on error (pm_errno is set accordingly if errors_ok == 0)

Definition at line 541 of file dload.c.

References ALPM_ERR_EXTERNAL_DOWNLOAD, dload_payload::errors_ok, __alpm_handle_t::fetchcb, dload_payload::fileurl, dload_payload::force, dload_payload::handle, and RET_ERR.

Referenced by alpm_db_update(), and alpm_fetch_pkgurl().

Here is the caller graph for this function: