From 6f78942176d5909349305db37b5424a1c6ceccef 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: Fri, 16 Jul 2021 11:02:02 +0800 Subject: Order functionality draft Not tested yet. Now the item object is still flattened as an array, initially to hurry the interfacing with the Perl module. But we were stuck with having to typemap char *** anyway, so we switch to SWIG because of the potential of ease. Still, we need to typemap char ***, but now that we're at SWIG, we might as well typemap a custom item struct. --- handler.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'handler.h') diff --git a/handler.h b/handler.h index 065820c..e940d91 100644 --- a/handler.h +++ b/handler.h @@ -71,6 +71,14 @@ inline void handle(enum type type, const char *contents, size_t num_bytes, const } } break; + case ORDER: + ; + struct json_object *string = NULL; + recurse(response, trail, &string); + char **waybill = (char **)data; + *waybill = malloc(json_object_get_string_len(string) + 1); + strcpy(*waybill, json_object_get_string(string)); + break; default: break; } -- cgit v1.2.3