XBPS Library API 20240111
The X Binary Package System
|
Functions | |
int | xbps_fetch_file (struct xbps_handle *xhp, const char *uri, const char *flags) |
int | xbps_fetch_file_sha256 (struct xbps_handle *xhp, const char *uri, const char *flags, unsigned char *digest, size_t digestlen) |
int | xbps_fetch_file_dest (struct xbps_handle *xhp, const char *uri, const char *filename, const char *flags) |
int | xbps_fetch_file_dest_sha256 (struct xbps_handle *xhp, const char *uri, const char *filename, const char *flags, unsigned char *digest, size_t digestlen) |
const char * | xbps_fetch_error_string (void) |
XBPS download related functions, frontend for NetBSD's libfetch.
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.
[in] | xhp | Pointer to an xbps_handle struct. |
[in] | uri | Remote URI string. |
[in] | flags | Flags passed to libfetch's fetchXget(). |
Definition at line 362 of file download.c.
References xbps_fetch_file_sha256().
int xbps_fetch_file_sha256 | ( | struct xbps_handle * | xhp, |
const char * | uri, | ||
const char * | flags, | ||
unsigned char * | digest, | ||
size_t | digestlen | ||
) |
Download and digest a file from a remote URL to current working directory.
[in] | xhp | Pointer to an xbps_handle struct. |
[in] | uri | Remote URI string. |
[in] | flags | Flags passed to libfetch's fetchXget(). |
[out] | digest | SHA256 digest buffer for the downloaded file or NULL. |
[in] | digestlen | Size of digest if specified; must be at least XBPS_SHA256_DIGEST_SIZE. |
Definition at line 346 of file download.c.
References xbps_fetch_file_dest_sha256().
Referenced by xbps_fetch_file().
int xbps_fetch_file_dest | ( | struct xbps_handle * | xhp, |
const char * | uri, | ||
const char * | filename, | ||
const char * | flags | ||
) |
Download a file from a remote URL to current working directory, and writing file to filename.
[in] | xhp | Pointer to an xbps_handle struct. |
[in] | uri | Remote URI string. |
[in] | filename | Local filename to safe the file |
[in] | flags | Flags passed to libfetch's fetchXget(). |
Definition at line 339 of file download.c.
References xbps_fetch_file_dest_sha256().
int xbps_fetch_file_dest_sha256 | ( | struct xbps_handle * | xhp, |
const char * | uri, | ||
const char * | filename, | ||
const char * | flags, | ||
unsigned char * | digest, | ||
size_t | digestlen | ||
) |
Download and digest a file from a remote URL to current working directory, and writing file to filename.
[in] | xhp | Pointer to an xbps_handle struct. |
[in] | uri | Remote URI string. |
[in] | filename | Local filename to safe the file |
[in] | flags | Flags passed to libfetch's fetchXget(). |
[out] | digest | SHA256 digest buffer of the downloaded file or NULL. |
[in] | digestlen | Size of digest if specified; must be at least XBPS_SHA256_DIGEST_SIZE. |
Definition at line 98 of file download.c.
References xbps_strlcat(), xbps_strlcpy(), and xbps_xasprintf().
Referenced by xbps_fetch_file_dest(), and xbps_fetch_file_sha256().
const char * xbps_fetch_error_string | ( | void | ) |
Returns last error string reported by xbps_fetch_file().
Definition at line 89 of file download.c.