aboutsummaryrefslogtreecommitdiffstats
path: root/src/downloadpool.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/downloadpool.h')
-rw-r--r--src/downloadpool.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/downloadpool.h b/src/downloadpool.h
new file mode 100644
index 0000000..480fc4f
--- /dev/null
+++ b/src/downloadpool.h
@@ -0,0 +1,23 @@
+#ifndef L2SU_DOWNLOADPOOL_H_INCLUDED
+#define L2SU_DOWNLOADPOOL_H_INCLUDED
+
+#include <curl/curl.h>
+
+typedef struct l2_dlpool__pool_tag l2_dlpool_t;
+
+/* returns <0 for "error" (this handle is not used)
+ * returns 0 for "ok I have made my changes" */
+typedef int (l2_dlpool_download_init_proc_t)(CURL * /*easy*/, void * /*user*/);
+
+/* returns <0 for "give up on downloading everything (error)"
+ * returns anything else for "download succeeded (proceed)" */
+typedef int (l2_dlpool_one_downloaded_proc_t)(CURL * /*easy*/, CURLcode /*code*/, void * /*user*/);
+
+l2_dlpool_t *l2_dlpool_init(l2_dlpool_download_init_proc_t *init, l2_dlpool_one_downloaded_proc_t *dlproc);
+
+/* returns >0 for a successful addition, 0 for aborted (init proc returned <0), <0 for error */
+int l2_dlpool_add(l2_dlpool_t *pool, void *user);
+int l2_dlpool_perform(l2_dlpool_t *pool);
+void l2_dlpool_cleanup(l2_dlpool_t *pool);
+
+#endif /* include guard */