Adding xbps_fetch_file_dest().
This function is similiar to xbps_fetch_file(). In contrast to xbps_fetch_file() xbps_fetch_file_dest has an extra paramenter which allow to define an output file for the request.
This commit is contained in:
@ -670,6 +670,20 @@ int xbps_configure_packages(struct xbps_handle *xhp, bool flush);
|
||||
int xbps_fetch_file(struct xbps_handle *xhp, const char *uri,
|
||||
const char *flags);
|
||||
|
||||
/**
|
||||
* Download a file from a remote URL to current working directory.
|
||||
*
|
||||
* @param[in] xhp Pointer to an xbps_handle struct.
|
||||
* @param[in] uri Remote URI string.
|
||||
* @param[in] filename Local filename to safe the file
|
||||
* @param[in] flags Flags passed to libfetch's fetchXget().
|
||||
*
|
||||
* @return -1 on error, 0 if not downloaded (because local/remote size/mtime
|
||||
* do not match) and 1 if downloaded successfully.
|
||||
**/
|
||||
int xbps_fetch_file_dest(struct xbps_handle *xhp, const char *uri,
|
||||
const char *filename, const char *flags);
|
||||
|
||||
/**
|
||||
* Returns last error string reported by xbps_fetch_file().
|
||||
*
|
||||
|
Reference in New Issue
Block a user