blob: 45481442317d655107a70d692283ea13136da193 [file] [log] [blame]
Michael Clark4504df72007-03-13 08:26:20 +00001/*
2 * $Id: json_object_private.h,v 1.3 2005/06/14 22:41:51 mclark Exp $
3 *
4 * Copyright Metaparadigm Pte. Ltd. 2004.
5 * Michael Clark <michael@metaparadigm.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public (LGPL)
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details: http://www.gnu.org/
16 *
17 */
18
Michael Clarkf0d08882007-03-13 08:26:18 +000019#ifndef _json_object_private_h_
20#define _json_object_private_h_
21
22typedef void (json_object_delete_fn)(struct json_object *o);
23typedef int (json_object_to_json_string_fn)(struct json_object *o,
24 struct printbuf *pb);
25
26struct json_object
27{
28 enum json_type o_type;
29 json_object_delete_fn *_delete;
30 json_object_to_json_string_fn *_to_json_string;
31 int _ref_count;
32 struct printbuf *_pb;
33 union data {
34 boolean c_boolean;
35 double c_double;
36 int c_int;
37 struct lh_table *c_object;
38 struct array_list *c_array;
39 char *c_string;
40 } o;
41};
42
Michael Clark4504df72007-03-13 08:26:20 +000043/* CAW: added for ANSI C iteration correctness */
44struct json_object_iter
45{
46 char *key;
47 struct json_object *val;
48 struct lh_entry *entry;
49};
50
Michael Clarkf0d08882007-03-13 08:26:18 +000051#endif