From 802e1a0b2f6fbdd244f66fe2bffe26ff2e2566d7 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: Mon, 13 Mar 2023 23:16:47 +0800 Subject: Document _page and reorder it up --- interchange.c | 10 +++++----- interchange.h | 10 ++++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/interchange.c b/interchange.c index 2e50fba..d2a3217 100644 --- a/interchange.c +++ b/interchange.c @@ -43,6 +43,11 @@ void interchange_init(const char *url, const char *dir, const char *cookie, #endif } +void interchange_page(const char *path, void (*handler)(interchange_response *)) +{ + request(handler, NULL, NULL, "%s", path); +} + void interchange_catalog(const char *prod_group, void (*handler)(interchange_response *), void (*callback)(struct interchange_catalog *)) { char nonspaced[strlen(prod_group) + 1]; @@ -62,11 +67,6 @@ void interchange_product(const char *sku, void (*handler)(interchange_response * request(handler, (void (*)(void *))callback, NULL, "%s", sku); } -void interchange_page(const char *path, void (*handler)(interchange_response *)) -{ - request(handler, NULL, NULL, "%s", path); -} - void interchange_clear_product(struct interchange_product *product) { if (product->crosssell) diff --git a/interchange.h b/interchange.h index d4d1152..c14c508 100644 --- a/interchange.h +++ b/interchange.h @@ -47,6 +47,14 @@ extern "C" { void interchange_init(const char *sampleurl, const char *image_dir, const char *cookie, const char *certificate); +/*! + * \brief For fetching data from a specific path. + * \param path The path. + * \param handler Function for handling the response data. + */ +void interchange_page(const char *path, + void (*handler)(interchange_response *)); + /*! * \brief For fetching data about products that belong a specific group. * \param prod_group The name of the product group. @@ -63,8 +71,6 @@ void interchange_catalog(const char *prod_group, void (*handler)(interchange_res */ void interchange_product(const char *sku, void (*handler)(interchange_response *), void (*callback)(struct interchange_product *)); -void interchange_page(const char *path, void (*handler)(interchange_response *)); - void interchange_clear_product(struct interchange_product *product); void interchange_free_catalog(struct interchange_catalog *catalog); -- cgit v1.2.3