summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-28 17:04:01 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-06-28 17:04:01 +0800
commit137ad27bed36437159ff9a29574a7ed840d4d96d (patch)
tree9041bf22119cde7928c4ce8598dea45ca518782e
parent63b109ca1c1c54319d164ddcfa5760aa66558ccd (diff)
Product init function
-rw-r--r--icclient/product.h1
-rw-r--r--product.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/icclient/product.h b/icclient/product.h
index ba999b3..0affebc 100644
--- a/icclient/product.h
+++ b/icclient/product.h
@@ -23,6 +23,7 @@ struct icclient_product {
extern "C" {
#endif
+ void icclient_product_init(struct icclient_product *product);
void icclient_product_free(struct icclient_product *product);
#ifdef __cplusplus
diff --git a/product.c b/product.c
index c38ce3f..39a4e59 100644
--- a/product.c
+++ b/product.c
@@ -1,6 +1,20 @@
#include <stdlib.h>
#include "icclient/product.h"
+void icclient_product_init(struct icclient_product *product)
+{
+ product->sku = NULL;
+ product->description = NULL;
+ product->comment = NULL;
+ product->thumb = NULL;
+ product->image = NULL;
+ product->price = .0;
+ product->prodgroup = NULL;
+ product->weight = .0;
+ product->author = NULL;
+ product->crosssell = NULL;
+}
+
void icclient_product_free(struct icclient_product *product)
{
if (product->crosssell)