summaryrefslogtreecommitdiff
path: root/pikul.c
diff options
context:
space:
mode:
Diffstat (limited to 'pikul.c')
-rw-r--r--pikul.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pikul.c b/pikul.c
index f078449..08c37ec 100644
--- a/pikul.c
+++ b/pikul.c
@@ -1,12 +1,14 @@
#include <string.h>
-#include <json.h>
#include "shipping.h"
+#include "handler.h"
CURL *curl;
json_tokener *tokener;
static struct shipping shipping;
extern inline void headers(struct shipping *shipping, const char *fields[], char *provisions[]);
+extern inline void handle(const char *, size_t, struct container *);
+
extern void anteraja_init(char *[], struct shipping *);
extern void anteraja_services_request(const char *, const char *, double,
struct shipping *, char **, char **);
@@ -101,3 +103,13 @@ void pikul_cleanup()
curl_easy_cleanup(curl);
curl_global_cleanup();
}
+
+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;
+}