summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-29 14:48:07 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-29 14:48:07 +0800
commitf9ccf11dab8e7ffef363c774c94c660c144f8efb (patch)
tree371268fbd61a2964188605a0f46d792f0de95ea9
parent3dd44e9bd785d14bd867fa9ca9f17365238578c7 (diff)
Reorder the order function parameters
-rw-r--r--client.c6
-rw-r--r--icclient/client.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/client.c b/client.c
index 61b4f4c..20859ed 100644
--- a/client.c
+++ b/client.c
@@ -75,10 +75,10 @@ static int itemcmp(const void *item1, const void *item2)
, (*(icclient_ord_item * const *)item2)->product->sku);
}
-void icclient_order(icclient_ord_order **orderptr, const char *sku
- , icclient_catalog *catalog)
+void icclient_order(const char *sku, const icclient_catalog *catalog,
+ icclient_ord_order **orderptr)
{
- icclient_product **products = catalog->products;
+ icclient_product **products = ((icclient_catalog *)catalog)->products;
qsort(products, catalog->length, sizeof(icclient_product *), prodcmp);
icclient_product *key_product = malloc(sizeof(icclient_product));
icclient_product_init(key_product);
diff --git a/icclient/client.h b/icclient/client.h
index 02804bb..f81f567 100644
--- a/icclient/client.h
+++ b/icclient/client.h
@@ -50,12 +50,12 @@ extern "C" {
/*!
* \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.
* \param catalog A pointer to the catalog from which the item is.
+ * \param orderptr A pointer to pointer to the order.
*/
- void icclient_order(struct icclient_ord_order **orderptr, const char *sku,
- struct icclient_catalog *catalog);
+ void icclient_order(const char *sku, const struct icclient_catalog *catalog,
+ struct icclient_ord_order **orderptr);
void icclient_newaccount(size_t (*handler)(void *contents, size_t size,
size_t nmemb, void *userdata),
struct icclient_user *user,