From ac40a2ae4e9ca7a386caba1505b454a15c3dce7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Thu, 17 Jun 2021 18:48:45 +0800 Subject: Swapped handler and callback parameter positions --- icclient.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'icclient.h') diff --git a/icclient.h b/icclient.h index 38fdb6e..6a1c365 100644 --- a/icclient.h +++ b/icclient.h @@ -3,8 +3,6 @@ #include "icclient/typedefs.h" -#define icclient_allproducts(callback, handler) icclient_results("All-Products", callback, handler) - struct icclient_product { char *sku; char *description; @@ -27,6 +25,13 @@ struct icclient_catalog { struct icclient_product *products[]; }; +/*! + * \brief For fetching data about all of the products that are active. + * \param handler A pointer to the function when a custom handler is needed to arrange the data into the catalog. + * \param callback A pointer to the function that needs to be called after the catalog is ready. + */ +#define icclient_allproducts(handler, callback) icclient_results("All-Products", handler, callback) + #ifdef __cplusplus extern "C" { #endif @@ -36,17 +41,16 @@ extern "C" { * \param sampleurl The value of the SAMPLEURL setting in products/variable.txt. * \param image_dir The value of the IMAGE_DIR setting in products/variable.txt. * \param certificate Path to the CA certificate file. - * \return True if the initialisation works, false otherwise. */ void icclient_init(const char *sampleurl, const char *image_dir, const char *certificate); /*! * \brief For fetching data about products that belong a specific group. * \param prod_group The name of the product group. - * \param callback A pointer to the function that needs to be called after the catalog is ready. * \param handler A pointer to the function when a custom handler is needed to arrange the data into the catalog. + * \param callback A pointer to the function that needs to be called after the catalog is ready. */ -void icclient_results(const char *prod_group, void (*callback)(struct icclient_catalog *), void (*handler)(icclient_fetch_t *)); +void icclient_results(const char *prod_group, void (*handler)(icclient_fetch_t *), void (*callback)(struct icclient_catalog *)); /*! * \brief For fetching data about a specific product. -- cgit v1.2.3