blob: a0f98456c9496ad8a5696fa0055db5dcb2898ec1 [file] [log] [blame]
Michael Clark4504df72007-03-13 08:26:20 +00001/*
Michael Clarkf6a6e482007-03-13 08:26:23 +00002 * $Id: json_object_private.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
Michael Clark4504df72007-03-13 08:26:20 +00003 *
Michael Clarkf6a6e482007-03-13 08:26:23 +00004 * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
Michael Clark4504df72007-03-13 08:26:20 +00005 * Michael Clark <michael@metaparadigm.com>
6 *
Michael Clarkf6a6e482007-03-13 08:26:23 +00007 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the MIT license. See COPYING for details.
Michael Clark4504df72007-03-13 08:26:20 +00009 *
10 */
11
Michael Clarkf0d08882007-03-13 08:26:18 +000012#ifndef _json_object_private_h_
13#define _json_object_private_h_
14
Michael Clarkaaec1ef2009-02-25 02:31:32 +000015#ifdef __cplusplus
16extern "C" {
17#endif
18
Michael Clarkf0d08882007-03-13 08:26:18 +000019typedef void (json_object_delete_fn)(struct json_object *o);
20typedef int (json_object_to_json_string_fn)(struct json_object *o,
21 struct printbuf *pb);
22
23struct json_object
24{
25 enum json_type o_type;
26 json_object_delete_fn *_delete;
27 json_object_to_json_string_fn *_to_json_string;
28 int _ref_count;
29 struct printbuf *_pb;
30 union data {
31 boolean c_boolean;
32 double c_double;
Michael Clarkc4dceae2010-10-06 16:39:20 +000033 int32_t c_int;
34 int64_t c_int64;
Michael Clarkf0d08882007-03-13 08:26:18 +000035 struct lh_table *c_object;
36 struct array_list *c_array;
37 char *c_string;
38 } o;
39};
40
Michael Clark4504df72007-03-13 08:26:20 +000041/* CAW: added for ANSI C iteration correctness */
42struct json_object_iter
43{
44 char *key;
45 struct json_object *val;
46 struct lh_entry *entry;
47};
48
Michael Clarkaaec1ef2009-02-25 02:31:32 +000049#ifdef __cplusplus
50}
51#endif
52
Michael Clarkf0d08882007-03-13 08:26:18 +000053#endif