From 65a334cf2fe2d7d524c129f0df765463a91f542c 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: Sun, 27 Jun 2021 23:41:31 +0800 Subject: Shipping API client framework with 1 module so far. --- handler.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 handler.c (limited to 'handler.c') diff --git a/handler.c b/handler.c new file mode 100644 index 0000000..581001e --- /dev/null +++ b/handler.c @@ -0,0 +1,13 @@ +#include "handler.h" + +extern inline void handle(const char *, size_t, struct container *); + +void recurse(struct json_object *outer, const char *keys[], struct json_object **services) +{ + struct json_object *inner = NULL; + json_object_object_get_ex(outer, *keys, &inner); + if (*++keys) + recurse(inner, keys, services); + else + *services = inner; +} -- cgit v1.2.3