ELinks 0.18.0
download.h File Reference
#include "main/object.h"
#include "network/state.h"
#include "util/lists.h"
#include "util/time.h"
Include dependency graph for download.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  download
struct  type_query
 The user has navigated to a resource that ELinks does not display automatically because of its MIME type, and ELinks is asking what to do. More...
struct  file_download
struct  exec_dgi

Typedefs

typedef void download_callback_T(struct download *, void *)
typedef unsigned char download_flags_T

Enumerations

enum  download_flags {
  DOWNLOAD_RESUME_DISABLED = 0 , DOWNLOAD_RESUME_ALLOWED = 1 , DOWNLOAD_RESUME_SELECTED = 2 , DOWNLOAD_EXTERNAL = 4 ,
  DOWNLOAD_OVERWRITE = 8
}
 Flags controlling how to download a file. More...

Functions

static int is_in_downloads_list (struct file_download *file_download)
int download_is_progressing (struct download *download)
int are_there_downloads (void)
void start_download (void *, char *)
void resume_download (void *, char *)
void create_download_file (struct terminal *, char *, char **, download_flags_T, cdf_callback_T *, void *)
void abort_all_downloads (void)
void destroy_downloads (struct session *)
void detach_downloads_from_terminal (struct terminal *)
int setup_download_handler (struct session *, struct download *, struct cache_entry *, int)
void abort_download (struct file_download *file_download)
void done_type_query (struct type_query *type_query)
void tp_display (struct type_query *type_query)
void tp_save (struct type_query *type_query)
void tp_cancel (void *data)
struct file_downloadinit_file_download (struct uri *uri, struct session *ses, char *file, int fd)
void clear_uri_tempfiles (void)

Variables

struct file_download list downloads
 Stack of all running downloads.

Typedef Documentation

◆ download_callback_T

typedef void download_callback_T(struct download *, void *)

◆ download_flags_T

typedef unsigned char download_flags_T

Enumeration Type Documentation

◆ download_flags

Flags controlling how to download a file.

This is a bit mask. Unrecognized bits should be preserved and ignored.

Enumerator
DOWNLOAD_RESUME_DISABLED 

Downloading cannot be resumed; do not offer such an option to the user.

All bits clear.

DOWNLOAD_RESUME_ALLOWED 

Downloading can be resumed.

This is the usual value.

DOWNLOAD_RESUME_SELECTED 

The user wants to resume downloading.

This must not occur without DOWNLOAD_RESUME_ALLOWED.

DOWNLOAD_EXTERNAL 

The file will be opened in an external handler.

DOWNLOAD_OVERWRITE 

File overwriting is allowed.

This is for temp names, since the file is created by the same function that chooses its name.

Function Documentation

◆ abort_all_downloads()

void abort_all_downloads ( void )

◆ abort_download()

void abort_download ( struct file_download * file_download)

◆ are_there_downloads()

int are_there_downloads ( void )

◆ clear_uri_tempfiles()

void clear_uri_tempfiles ( void )

◆ create_download_file()

void create_download_file ( struct terminal * ,
char * ,
char ** ,
download_flags_T ,
cdf_callback_T * ,
void *  )
related

◆ destroy_downloads()

void destroy_downloads ( struct session * ses)

◆ detach_downloads_from_terminal()

void detach_downloads_from_terminal ( struct terminal * term)

◆ done_type_query()

void done_type_query ( struct type_query * type_query)
related

◆ download_is_progressing()

int download_is_progressing ( struct download * download)

◆ init_file_download()

struct file_download * init_file_download ( struct uri * uri,
struct session * ses,
char * file,
int fd )
Note
If this fails, the caller is responsible of freeing file and closing fd.

◆ is_in_downloads_list()

int is_in_downloads_list ( struct file_download * file_download)
inlinestatic

◆ resume_download()

void resume_download ( void * ,
char *  )
related

◆ setup_download_handler()

int setup_download_handler ( struct session * ,
struct download * ,
struct cache_entry * ,
int  )
related

◆ start_download()

void start_download ( void * ,
char *  )
related

◆ tp_cancel()

void tp_cancel ( void * data)
related

◆ tp_display()

void tp_display ( struct type_query * type_query)
related

◆ tp_save()

void tp_save ( struct type_query * type_query)
related

Variable Documentation

◆ downloads

struct file_download list downloads
extern

Stack of all running downloads.