summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-12 20:07:47 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-12 20:07:47 +0800
commitee87c46227c838961250bb8d50edca57ac154462 (patch)
tree99a522cb793b29e2e9e2253b2a7fae843ff61a2e /client.c
parentb94e7d2e3e33490d5b94da3c5406d4fe2e143edd (diff)
Further simplify icclient_results function
Diffstat (limited to 'client.c')
-rw-r--r--client.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/client.c b/client.c
index 04368c8..d693996 100644
--- a/client.c
+++ b/client.c
@@ -13,22 +13,17 @@ extern size_t icclient_catalog_results(void *, size_t, size_t, void *);
bool icclient_init(const char *url, const char *certificate)
{
- icclient_catalog_init();
return icclient_request_init(url, certificate);
}
-void icclient_results(const char *prod_group,
- void (*callback)(struct icclient_catalog *), struct icclient_catalog **catalog, icclient_handler handler)
+void icclient_results(const char *prod_group, void (*callback)(struct icclient_catalog *), icclient_handler handler)
{
char nonspaced[strlen(prod_group) + 1];
strcpy(nonspaced, prod_group);
char *space = NULL;
while ((space = strchr(nonspaced, ' ')))
*space = '-';
- struct icclient_catalog_callback *catalog_callback = malloc(sizeof(struct icclient_catalog_callback));
- catalog_callback->catalog = catalog;
- catalog_callback->callback = callback;
- request(handler ? handler : icclient_catalog_results, (void *)catalog_callback, 0, "%s", nonspaced);
+ request(handler ? handler : icclient_catalog_results, (void *)callback, 0, "%s", nonspaced);
}
void icclient_flypage(const char *sku, icclient_handler handler, struct icclient_product **productptr)