diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-17 18:48:45 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-17 18:48:45 +0800 |
| commit | ac40a2ae4e9ca7a386caba1505b454a15c3dce7a (patch) | |
| tree | 484031cba8cc4f2932851d2c9cb8817be64e9dfc /icclient.h | |
| parent | a9667989e8bb66035585320c402b589328c14f23 (diff) | |
Swapped handler and callback parameter positions
Diffstat (limited to 'icclient.h')
| -rw-r--r-- | icclient.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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. |