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:
Enno Boland
2014-03-04 14:19:52 +01:00
parent f20694a5bf
commit 59ee6b6733
2 changed files with 31 additions and 10 deletions

View File

@ -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().
*