summaryrefslogtreecommitdiff
path: root/interchange.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-25 13:07:49 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-25 13:07:49 +0800
commita264c280b95ead5d1a7ae52823381157a1f1d58b (patch)
tree261742cabb96d0185807215a63af1f4c95162062 /interchange.c
parentd7d98333fe9ec332e3761460af9011527290fe5a (diff)
handle_results is used only when strap is enabled
Diffstat (limited to 'interchange.c')
-rw-r--r--interchange.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/interchange.c b/interchange.c
index 66497b8..a8ba970 100644
--- a/interchange.c
+++ b/interchange.c
@@ -11,7 +11,9 @@ char *sampleurl;
char *cainfo = NULL;
#endif
+#ifdef ENABLE_STRAP
extern void handle_results(interchange_response *);
+#endif
void interchange_init(const char *url, const char *dir, const char *certificate)
{
@@ -42,7 +44,11 @@ void interchange_catalog(const char *prod_group, void (*handler)(interchange_res
char *space = NULL;
while ((space = strchr(nonspaced, ' ')))
*space = '-';
+#ifdef ENABLE_STRAP
request(handler ? handler : handle_results, (void (*)(void *))callback, NULL, "%s", nonspaced);
+#else
+ request(handler, (void (*)(void *))callback, NULL, "%s", nonspaced);
+#endif
}
void interchange_product(const char *sku, void (*handler)(interchange_response *), void (*callback)(struct interchange_product *))