summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-13 23:16:47 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-13 23:16:47 +0800
commit802e1a0b2f6fbdd244f66fe2bffe26ff2e2566d7 (patch)
tree1ed1fb191f43510c6b29630169a64146282faa3e
parentb3735f9f230dbd808d7952822694c3ef19e235f3 (diff)
Document _page and reorder it up
-rw-r--r--interchange.c10
-rw-r--r--interchange.h10
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
@@ -48,6 +48,14 @@ 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.
* \param handler A pointer to the function when a custom handler is needed to arrange the data into the catalog.
@@ -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);