X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/c017be3c0b41865d049c8f09d09b7026fd848f13..2ba4dc06631b9c0c953ceb3859e1c3ef54384899:/src/curl_download.h diff --git a/src/curl_download.h b/src/curl_download.h index 67e73965..0696f13b 100644 --- a/src/curl_download.h +++ b/src/curl_download.h @@ -26,10 +26,38 @@ #include "download.h" +G_BEGIN_DECLS + +/* Error messages returned by download functions */ +typedef enum { + CURL_DOWNLOAD_NO_ERROR = 0, + CURL_DOWNLOAD_NO_NEWER_FILE, + CURL_DOWNLOAD_ERROR +} CURL_download_t; + +typedef struct { + /** + * Time sent to server on header If-Modified-Since + */ + time_t time_condition; + /** + * Etag sent by server on previous download + */ + char *etag; + /** + * Etag sent by server on this download + */ + char *new_etag; + +} CurlDownloadOptions; + void curl_download_init (); -int curl_download_get_url ( const char *hostname, const char *uri, FILE *f, DownloadMapOptions *options, gboolean ftp, DownloadFileOptions *file_options, void *handle ); -int curl_download_uri ( const char *uri, FILE *f, DownloadMapOptions *options, DownloadFileOptions *file_options, void *handle ); +void curl_download_uninit (); +CURL_download_t curl_download_get_url ( const char *hostname, const char *uri, FILE *f, DownloadFileOptions *options, gboolean ftp, CurlDownloadOptions *curl_options, void *handle ); +CURL_download_t curl_download_uri ( const char *uri, FILE *f, DownloadFileOptions *options, CurlDownloadOptions *curl_options, void *handle ); void * curl_download_handle_init (); void curl_download_handle_cleanup ( void * handle ); +G_END_DECLS + #endif