diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-13 08:40:26 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-13 08:40:26 +0800 |
| commit | daf858c02db1a5a12151d142ce55dfe9fbb2b715 (patch) | |
| tree | d6343c4f8b7ef9bad9e3a17264b201f6b8012791 /icclient/client.h | |
| parent | 0a6e2943843ca894abc562ba98bcbf3399769481 (diff) | |
Merge catalog and product to client
Diffstat (limited to 'icclient/client.h')
| -rw-r--r-- | icclient/client.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/icclient/client.h b/icclient/client.h index ae2a766..bcf8170 100644 --- a/icclient/client.h +++ b/icclient/client.h @@ -3,8 +3,24 @@ #define icclient_allproducts(callback, handler) icclient_results("All-Products", callback, handler) -struct icclient_product; -struct icclient_catalog; +struct icclient_catalog { + size_t length; + struct icclient_product { + char *sku; + char *description; + char *comment; + char *thumb; + char *image; + double price; + char *prod_group; + double weight; + char *author; + struct icclient_product_crosssell { + size_t length; + char *skus[]; + } *crosssell; + } *products[]; +}; #ifdef __cplusplus extern "C" { @@ -16,7 +32,7 @@ extern "C" { * \param certificate Path to the CA certificate file. * \return True if the initialisation works, false otherwise. */ -bool icclient_init(const char *url, const char *certificate); +void icclient_init(const char *url, const char *certificate); /*! * \brief For fetching data about products that belong a specific group. @@ -35,6 +51,11 @@ void icclient_results(const char *prod_group, void (*callback)(struct icclient_c void icclient_flypage(const char *sku, icclient_handler handler, struct icclient_product **productptr); void icclient_page(const char *path, icclient_handler handler, void **dataptr); + +void icclient_free_product(struct icclient_product *product); + +void icclient_free_catalog(struct icclient_catalog *catalog); + void icclient_cleanup(); #ifdef __cplusplus |