From 1be551eb39df7240b661b2c7e661d31dd242476e 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: Thu, 9 Mar 2023 12:04:11 +0800 Subject: Handler parameter to order --- ord.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ord.c') diff --git a/ord.c b/ord.c index 8d4e0ae..664d18c 100644 --- a/ord.c +++ b/ord.c @@ -17,8 +17,10 @@ static int itemcmp(const void *item1, const void *item2) (*(struct interchange_ord_item * const *)item2)->product->sku); } -void interchange_ord_order(const char *sku, const struct interchange_catalog *catalog, - struct interchange_ord_order **order) +void interchange_ord_order(const char *sku, + const struct interchange_catalog *catalog, + struct interchange_ord_order **order, + void (*handler)(interchange_response *)) { struct interchange_product **products = ((struct interchange_catalog *)catalog)->products; qsort(products, catalog->length, sizeof(struct interchange_product *), prodcmp); @@ -58,7 +60,7 @@ void interchange_ord_order(const char *sku, const struct interchange_catalog *ca } (*order)->subtotal += item->product->price; (*order)->total_cost += item->product->price; - request(NULL, NULL, NULL, "%s%s", "order?mv_arg=", sku); + request(handler, NULL, NULL, "%s%s", "order?mv_arg=", sku); } void interchange_ord_checkout(const struct interchange_ord_order *order, -- cgit v1.2.3