libalpm
Arch Linux Package Manager Library
Defines | Enumerations | Functions
dload.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <curl/curl.h>
#include "dload.h"
#include "alpm_list.h"
#include "alpm.h"
#include "log.h"
#include "util.h"
#include "handle.h"
Include dependency graph for dload.c:

Go to the source code of this file.

Defines

#define HOSTNAME_SIZE   256

Enumerations

enum  { ABORT_SIGINT = 1, ABORT_OVER_MAXFILESIZE }

Functions

int _alpm_download (struct dload_payload *payload, const char *localpath, char **final_file)
 Download a file given by a URL to a local directory.
char * alpm_fetch_pkgurl (alpm_handle_t *handle, const char *url)
 Fetch a remote pkg.
void _alpm_dload_payload_reset (struct dload_payload *payload)

Define Documentation

#define HOSTNAME_SIZE   256

Definition at line 323 of file dload.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
ABORT_SIGINT 
ABORT_OVER_MAXFILESIZE 

Definition at line 74 of file dload.c.


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: