Data saved by create_download_file() for the create_download_file_do() callback.
More...
|
char ** | real_file |
| Where to save the name of the file that was actually opened.
|
cdf_callback_T * | callback |
| This function will be called when the file has been opened, or when it is known that the file will not be opened.
|
void * | data |
| A pointer to be passed to callback.
|
|
(Note that these are not member symbols.)
|
typedef void | cdf_callback_T(struct terminal *term, int fd, void *data, download_flags_T flags) |
| Type of the callback function that will be called when the file has been opened, or when it is known that the file will not be opened.
|
static void | create_download_file_do (struct terminal *term, char *file, void *data, download_flags_T flags) |
| Now that the final name of the download file has been chosen, open the file and call the cdf_callback_T that was originally given to create_download_file().
|
void | create_download_file (struct terminal *term, char *fi, char **real_file, download_flags_T flags, cdf_callback_T *callback, void *data) |
| Create a file to which data can be downloaded.
|
◆ cdf_callback_T
Type of the callback function that will be called when the file has been opened, or when it is known that the file will not be opened.
- Parameters
-
term | The terminal on which the callback should display any windows. Comes directly from the term argument of create_download_file(). |
fd | A file descriptor to the opened file, or -1 if the file will not be opened. If the real_file argument of create_download_file() was not NULL, the callback may read the name of this file from *real_file. |
data | A pointer to any data that the callback cares about. Comes directly from the data argument of create_download_file(). |
flags | The same as the flags argument of create_download_file(), except the DOWNLOAD_RESUME_SELECTED bit will be changed to match what the user chose. |
◆ create_download_file()
Create a file to which data can be downloaded.
This function constructs a struct cdf_hop that will be freed when callback returns.
- Parameters
-
term | If any dialog boxes are needed, show them in this terminal. |
fi | A proposed name for the local file to which the data would be downloaded. "~" here refers to the home directory. create_download_file() treats this original string as read-only. |
real_file | If non-NULL, prepare to save in *real_file the name of the local file that was eventually opened. callback must then arrange for this string to be freed with mem_free(). |
flags | Flags controlling how to download the file. DOWNLOAD_RESUME_ALLOWED adds a "Resume" button to the dialog. DOWNLOAD_RESUME_SELECTED skips the dialog entirely. DOWNLOAD_EXTERNAL causes the file to be created with settings suitable for a temporary file: give only the user herself access to the file (even if the umask is looser), and create the file with O_EXCL unless resuming. |
callback | This function will be called when the file has been opened, or when it is known that the file will not be opened. |
data | A pointer to be passed to callback. |
◆ create_download_file_do()
◆ callback
This function will be called when the file has been opened, or when it is known that the file will not be opened.
◆ data
◆ real_file
char** cdf_hop::real_file |
Where to save the name of the file that was actually opened.
One of the arguments of callback is a file descriptor for this file. real_file
can be NULL if callback does not care about the name.
The documentation for this struct was generated from the following files: