diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-01-11 11:27:08 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-01-11 11:27:08 +0800 |
commit | 64ea94aad7253df25798263d6bd1c8c49ceb393d (patch) | |
tree | fe52659a09601112e10a2f0998f55419b391f9b6 /registration.c | |
parent | ebaf4cf23f8ccdbf020309eacc2f9d9129c05f83 (diff) |
Diffstat (limited to 'registration.c')
-rw-r--r-- | registration.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/registration.c b/registration.c index 5f21f74..d63f087 100644 --- a/registration.c +++ b/registration.c @@ -1,6 +1,6 @@ #include <stdlib.h> #include <string.h> -#include <icclient.h> +#include <interchange.h> #ifdef DEBUG #ifdef __ANDROID__ @@ -19,11 +19,11 @@ struct container { CURL *curl; - void (*handler)(icclient_response *); - icclient_response *response; + void (*handler)(interchange_response *); + interchange_response *response; }; -static size_t append(char *data, size_t size, size_t nmemb, icclient_response *response) +static size_t append(char *data, size_t size, size_t nmemb, interchange_response *response) { size_t realsize = size * nmemb; response->data = realloc(response->data, response->numBytes + realsize + 1); @@ -58,7 +58,7 @@ static int async(void *arg) } #endif -void sign_up(const char *brand, const char *certificate, void (*handler)(icclient_response *)) +void sign_up(const char *brand, const char *certificate, void (*handler)(interchange_response *)) { char *data = malloc(strlen(brand) + 1); strcpy(data, brand); @@ -72,7 +72,7 @@ void sign_up(const char *brand, const char *certificate, void (*handler)(icclien attr.requestData = data; attr.requestDataSize = strlen(data); attr.onsuccess = handler; - attr.onerror = icclient_free_response; + attr.onerror = interchange_free_response; emscripten_fetch(&attr, "registration"); #else curl_global_init(CURL_GLOBAL_SSL); @@ -85,7 +85,7 @@ void sign_up(const char *brand, const char *certificate, void (*handler)(icclien #endif curl_easy_setopt(curl, CURLOPT_URL, SECURE_SERVER"/registration"); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, append); - icclient_response *response = malloc(sizeof(icclient_response)); + interchange_response *response = malloc(sizeof(interchange_response)); response->data = malloc(1); response->numBytes = 0; response->userData = data; |