lib/download.c: add basic support for vcdiffs

This commit is contained in:
Enno Boland
2014-08-11 18:40:44 +02:00
parent c301cc32e5
commit 040e114ad4
3 changed files with 131 additions and 18 deletions

View File

@@ -713,6 +713,22 @@ int xbps_fetch_file(struct xbps_handle *xhp, const char *uri,
int xbps_fetch_file_dest(struct xbps_handle *xhp, const char *uri,
const char *filename, const char *flags);
/**
* Download a vcdiff from a remote URL to current working directory. And apply
* it to a given file
*
* @param[in] xhp Pointer to an xbps_handle struct.
* @param[in] uri Remote URI string.
* @param[in] basefile Local basefile to apply the delta to.
* @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_delta(struct xbps_handle *xhp, const char *basefile,
const char *uri, const char *filename, const char *flags);
/**
* Returns last error string reported by xbps_fetch_file().
*