2 * Copyright (c) 2009, 2010 Petri Lehtinen <petri@digip.org>
4 * Jansson is free software; you can redistribute it and/or modify
5 * it under the terms of the MIT license. See LICENSE for details.
8 #ifndef JANSSON_PRIVATE_H
9 #define JANSSON_PRIVATE_H
12 #include "hashtable.h"
14 #define container_of(ptr_, type_, member_) \
15 ((type_ *)((char *)ptr_ - (size_t)&((type_ *)0)->member_))
19 hashtable_t hashtable;
47 #define json_to_object(json_) container_of(json_, json_object_t, json)
48 #define json_to_array(json_) container_of(json_, json_array_t, json)
49 #define json_to_string(json_) container_of(json_, json_string_t, json)
50 #define json_to_real(json_) container_of(json_, json_real_t, json)
51 #define json_to_integer(json_) container_of(json_, json_integer_t, json)
58 const object_key_t *jsonp_object_iter_fullkey(void *iter);