]> git.street.me.uk Git - andy/viking.git/blobdiff - src/curl_download.h
[DOC] Mention map tilesize configuration.
[andy/viking.git] / src / curl_download.h
index 26b0db61ace38794976fa6923d1e5d479f196b01..0696f13bc013f2cb4f8c3773a0aa10a1ac3ed4aa 100644 (file)
 
 #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, DownloadOptions *options, gboolean ftp, time_t time_condition, void *handle );
-int curl_download_uri ( const char *uri, FILE *f, DownloadOptions *options, time_t time_condition, 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