summaryrefslogtreecommitdiff
path: root/handler.h
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-16 11:02:02 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-16 11:02:02 +0800
commit6f78942176d5909349305db37b5424a1c6ceccef (patch)
tree215a441aaca7856ef2000d6f40a838d0c02f89ee /handler.h
parentd1b9c27a403fb2ac9e69e82ebea32722c6795daf (diff)
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.
Diffstat (limited to 'handler.h')
-rw-r--r--handler.h8
1 files changed, 8 insertions, 0 deletions
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;
}