diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-13 15:41:54 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-13 15:41:54 +0800 |
| commit | 143f5b64f187497af728a6d921c599dcc99ed807 (patch) | |
| tree | ba7264b8748c53c57697f9a1c9bf34db279ed468 /client.c | |
| parent | 4cd6fdb93eca409a76b0af860d9a0599b2f95f53 (diff) | |
Fix the way libcurl has been used
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -2,18 +2,12 @@ #include "request.h" #include "icclient.h" -#ifdef __EMSCRIPTEN__ -extern void icclient_catalog_results(emscripten_fetch_t *); -#else -extern size_t icclient_catalog_results(void *, size_t, size_t, void *); -#endif - void icclient_init(const char *url, const char *certificate) { - icclient_request_init(url, certificate); + init(url, certificate); } -void icclient_results(const char *prod_group, void (*callback)(struct icclient_catalog *), icclient_handler handler) +void icclient_results(const char *prod_group, void (*callback)(struct icclient_catalog *), void (*handler)(icclient_fetch_t *)) { char nonspaced[strlen(prod_group) + 1]; strcpy(nonspaced, prod_group); @@ -23,12 +17,12 @@ void icclient_results(const char *prod_group, void (*callback)(struct icclient_c request(handler, (void *)callback, 0, "%s", nonspaced); } -void icclient_flypage(const char *sku, icclient_handler handler, struct icclient_product **productptr) +void icclient_flypage(const char *sku, void (*handler)(icclient_fetch_t *), struct icclient_product **productptr) { request(handler, (void *)productptr, 0, "%s", sku); } -void icclient_page(const char *path, icclient_handler handler, void **dataptr) +void icclient_page(const char *path, void (*handler)(icclient_fetch_t *), void **dataptr) { request(handler, (void *)dataptr, 0, "%s", path); } @@ -63,5 +57,7 @@ void icclient_free_catalog(struct icclient_catalog *catalog) void icclient_cleanup() { - icclient_request_cleanup(); +#ifndef __EMSCRIPTEN__ + cleanup(); +#endif } |