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 /icclient | |
parent | 4cd6fdb93eca409a76b0af860d9a0599b2f95f53 (diff) |
Fix the way libcurl has been used
Diffstat (limited to 'icclient')
-rw-r--r-- | icclient/admin.h | 2 | ||||
-rw-r--r-- | icclient/member.h | 4 | ||||
-rw-r--r-- | icclient/typedefs.h | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/icclient/admin.h b/icclient/admin.h index 36ec0d6..cfc89da 100644 --- a/icclient/admin.h +++ b/icclient/admin.h @@ -15,7 +15,7 @@ extern "C" { struct icclient_admin *icclient_admin_login(const char *username, const char *password, const char *successpage, const char *nextpage, const char *failpage, - icclient_handler handler); + void (*handler)(icclient_fetch_t *)); void icclient_admin_newitem(const char *description, const char *comment, const char *price, const char *image_path); void icclient_admin_logout(struct icclient_admin *admin); diff --git a/icclient/member.h b/icclient/member.h index 1c0943a..feee6c3 100644 --- a/icclient/member.h +++ b/icclient/member.h @@ -62,10 +62,10 @@ extern "C" { struct icclient_member *icclient_member_newaccount(const char *username, const char *password, const char *verify, const char *successpage, - const char *nextpage, const char *failpage, icclient_handler handler); + const char *nextpage, const char *failpage, void (*handler)(icclient_fetch_t *)); struct icclient_member *icclient_member_login(const char *username, const char *password, const char *successpage, - const char *nextpage, const char *failpage, icclient_handler handler); + const char *nextpage, const char *failpage, void (*handler)(icclient_fetch_t *)); void icclient_member_account(const char *fname, const char *lname, const char *address1, const char *address2, const char *city, const char *state, const char *zip, const char *email, diff --git a/icclient/typedefs.h b/icclient/typedefs.h index 1b2f176..c45e260 100644 --- a/icclient/typedefs.h +++ b/icclient/typedefs.h @@ -3,9 +3,13 @@ #ifdef __EMSCRIPTEN__ #include <emscripten/fetch.h> -typedef void (*icclient_handler)(emscripten_fetch_t *); +typedef emscripten_fetch_t icclient_fetch_t; #else -typedef size_t (*icclient_handler)(void *, size_t, size_t, void *); +typedef struct { + void *userData; + char *data; + size_t numBytes; +} icclient_fetch_t; #endif #endif |