From 3074a867e052af594f1c7252c9cb967ff0747f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Mon, 29 Jun 2020 21:09:16 +0800 Subject: Remove unnecessary cURL handler parameter variables --- client.c | 40 ++++++++++++++++++---------------------- icclient/client.h | 15 +++++---------- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/client.c b/client.c index f24f968..442109a 100644 --- a/client.c +++ b/client.c @@ -40,8 +40,7 @@ bool icclient_init(const char *url, const char *certificate) } void icclient_results(const char *prodgroup, - size_t (*handler)(void *contents, size_t size, - size_t nmemb, void *userdata), + size_t (*handler)(void *, size_t, size_t, void *), struct icclient_catalog **catalogptr) { char nonspaced[strlen(prodgroup) + 1]; @@ -52,8 +51,8 @@ void icclient_results(const char *prodgroup, request(handler, (void *)catalogptr, NULL, "%s", nonspaced); } -void icclient_allproducts(size_t (*handler)(void *, size_t, size_t, void *) - , icclient_catalog **catalogptr) +void icclient_allproducts(size_t (*handler)(void *, size_t, size_t, void *), + icclient_catalog **catalogptr) { request(handler, (void *)catalogptr, NULL, "%s", "All-Products"); } @@ -131,26 +130,22 @@ void icclient_order(const char *sku, const icclient_catalog *catalog, request(NULL, NULL, NULL, "%s%s", "order?mv_arg=", sku); } -void icclient_newaccount(size_t (*handler)(void *contents, size_t size - , size_t nmemb, void *userdata) - , struct icclient_user *user - , const char *username, const char *password - , const char *verify, const char *successpage, const char *nextpage - , const char *failpage) +void icclient_newaccount(size_t (*handler)(void *, size_t, size_t, void *), + struct icclient_user *user, + const char *username, const char *password, const char *verify, + const char *successpage, const char *nextpage, const char *failpage) { - login(handler, user, username, password, verify, "NewAccount", successpage - , nextpage, failpage); + login(handler, user, username, password, verify, + "NewAccount", successpage, nextpage, failpage); } -void icclient_login(size_t (*handler)(void *contents, size_t size - , size_t nmemb, void *userdata) - , struct icclient_user *user - , const char *username, const char *password - , const char *successpage, const char *nextpage - , const char *failpage) +void icclient_login(size_t (*handler)(void *, size_t, size_t, void *), + struct icclient_user *user, + const char *username, const char *password, + const char *successpage, const char *nextpage, const char *failpage) { - login(handler, user, username, password, NULL, "Login", successpage - , nextpage, failpage); + login(handler, user, username, password, NULL, "Login", + successpage, nextpage, failpage); } void icclient_logout() @@ -158,8 +153,9 @@ void icclient_logout() request(NULL, NULL, NULL, "%s", "logout"); } -void icclient_page(const char *path, size_t (*handler)(void *, size_t, size_t - , void *), void **dataptr) +void icclient_page(const char *path, + size_t (*handler)(void *, size_t, size_t, void *), + void **dataptr) { request(handler, (void *)dataptr, NULL, "%s", path); } diff --git a/icclient/client.h b/icclient/client.h index af3cc24..7b7306d 100644 --- a/icclient/client.h +++ b/icclient/client.h @@ -25,8 +25,7 @@ extern "C" { * \param catalogptr A pointer to pointer to the catalog to store the data. */ void icclient_results(const char *prodgroup, - size_t (*handler)(void *contents, size_t size, - size_t nmemb, void *userdata), + size_t (*handler)(void *, size_t, size_t, void *), struct icclient_catalog **catalogptr); /*! @@ -34,8 +33,7 @@ extern "C" { * \param handler A pointer to a cURL write function callback. * \param catalogptr A pointer to pointer to the catalog to store the data. */ - void icclient_allproducts(size_t (*handler)(void *contents, size_t size, - size_t nmemb, void *userdata), + void icclient_allproducts(size_t (*handler)(void *, size_t, size_t, void *), struct icclient_catalog **catalogptr); /*! @@ -56,22 +54,19 @@ extern "C" { */ void icclient_order(const char *sku, const struct icclient_catalog *catalog, struct icclient_ord_order **orderptr); - void icclient_newaccount(size_t (*handler)(void *contents, size_t size, - size_t nmemb, void *userdata), + void icclient_newaccount(size_t (*handler)(void *, size_t, size_t, void *), struct icclient_user *user, const char *username, const char *password, const char *verify, const char *successpage, const char *nextpage, const char *failpage); - void icclient_login(size_t (*handler)(void *contents, size_t size - , size_t nmemb, void *userdata), + void icclient_login(size_t (*handler)(void *, size_t, size_t, void *), struct icclient_user *user, const char *username, const char *password, const char *successpage, const char *nextpage, const char *failpage); void icclient_logout(); void icclient_page(const char *path, - size_t (*handler)(void *contents, size_t size, - size_t nmemb, void *userdata), + size_t (*handler)(void *, size_t, size_t, void *), void **dataptr); void icclient_cleanup(); -- cgit v1.2.3