diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2020-06-14 17:00:04 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2020-06-14 17:00:04 +0800 |
commit | 66225020d3ef1e3825adfc9d4f9e38420f68546c (patch) | |
tree | e5c6b453d20642a0beaca18f21a6d36302614bcc | |
parent | 9d45ab471766dac122617330bce6e817ec72add9 (diff) |
Flypage function
-rw-r--r-- | client.c | 6 | ||||
-rw-r--r-- | icclient/client.h | 10 |
2 files changed, 16 insertions, 0 deletions
@@ -45,6 +45,12 @@ void icclient_allproducts(size_t (*handler)(void *, size_t, size_t, void *) request(handler, (void *)catalogptr, NULL, "%s", "All-Products"); } +void icclient_flypage(size_t (*handler)(void *, size_t, size_t, void *), + icclient_product **productptr, const char *sku) +{ + request(handler, (void *)productptr, NULL, "%s", sku); +} + static int prodcmp(const void *product1, const void *product2) { return strcmp((*(icclient_product * const *)product1)->sku diff --git a/icclient/client.h b/icclient/client.h index 600686a..f35b9a2 100644 --- a/icclient/client.h +++ b/icclient/client.h @@ -28,6 +28,16 @@ extern "C" { , struct icclient_catalog **catalogptr); /*! + * \brief For fetching data about a specific product. + * \param handler A pointer to a cURL write function callback. + * \param productptr A pointer to pointer to the product to store the data. + * \param sku The SKU of the item to order. + */ + void icclient_flypage(size_t (*handler)(void *contents, size_t size, + size_t nmemb, void *userdata), + struct icclient_product **productptr, const char *sku); + + /*! * \brief For putting an item to a cart. * \param orderptr A pointer to pointer to the order. * \param sku The SKU of the item to order. |