mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Bug 770: Document session.download_uri
This commit is contained in:
parent
266d4df2d2
commit
38d7bffced
@ -1068,7 +1068,13 @@ finish:
|
||||
if (fd != -1) close(fd);
|
||||
}
|
||||
|
||||
/*! @relates cmdw_hop */
|
||||
/** Begin or resume downloading from session.download_uri to the
|
||||
* @a file specified by the user.
|
||||
*
|
||||
* This function contains the code shared between start_download() and
|
||||
* resume_download().
|
||||
*
|
||||
* @relates cmdw_hop */
|
||||
static void
|
||||
common_download(struct session *ses, unsigned char *file,
|
||||
enum download_resume resume)
|
||||
@ -1088,7 +1094,14 @@ common_download(struct session *ses, unsigned char *file,
|
||||
resume, common_download_do, cmdw_hop);
|
||||
}
|
||||
|
||||
/*! @relates cmdw_hop */
|
||||
/** Begin downloading from session.download_uri to the @a file
|
||||
* specified by the user.
|
||||
*
|
||||
* The ::ACT_MAIN_SAVE_AS, ::ACT_MAIN_SAVE_URL_AS,
|
||||
* ::ACT_MAIN_LINK_DOWNLOAD, and ::ACT_MAIN_LINK_DOWNLOAD_IMAGE
|
||||
* actions pass this function as the @c std callback to query_file().
|
||||
*
|
||||
* @relates cmdw_hop */
|
||||
void
|
||||
start_download(void *ses, unsigned char *file)
|
||||
{
|
||||
@ -1097,7 +1110,13 @@ start_download(void *ses, unsigned char *file)
|
||||
}
|
||||
|
||||
|
||||
/*! @relates cmdw_hop */
|
||||
/** Resume downloading from session.download_uri to the @a file
|
||||
* specified by the user.
|
||||
*
|
||||
* The ::ACT_MAIN_LINK_DOWNLOAD_RESUME action passes this function as
|
||||
* the @c std callback to query_file().
|
||||
*
|
||||
* @relates cmdw_hop */
|
||||
void
|
||||
resume_download(void *ses, unsigned char *file)
|
||||
{
|
||||
|
@ -159,6 +159,17 @@ struct session {
|
||||
struct document_view *doc_view;
|
||||
LIST_OF(struct document_view) scrn_frames;
|
||||
|
||||
/** The URI from which start_download() or resume_download()
|
||||
* should download.
|
||||
*
|
||||
* When the user requests a download, one of those functions
|
||||
* is given as a callback to query_file(), which asks the user
|
||||
* where to save the downloaded file. The URI cannot be given
|
||||
* to the callback as a parameter because query_file()
|
||||
* supports only one void * parameter for the callback and
|
||||
* that one is already used for the struct session *.
|
||||
* Instead, the URI is saved here before the query_file()
|
||||
* call. */
|
||||
struct uri *download_uri;
|
||||
|
||||
/** The URI which is the referrer to the current loaded document
|
||||
|
Loading…
Reference in New Issue
Block a user