blob: 9fb4011c8c8a33d9d4b58649cb3c55a1c717c80c [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;
33 int c_int;
34 struct lh_table *c_object;
35 struct array_list *c_array;
36 char *c_string;
37 } o;
38};
39
Michael Clark4504df72007-03-13 08:26:20 +000040/* CAW: added for ANSI C iteration correctness */
41struct json_object_iter
42{
43 char *key;
44 struct json_object *val;
45 struct lh_entry *entry;
46};
47
Michael Clarkaaec1ef2009-02-25 02:31:32 +000048#ifdef __cplusplus
49}
50#endif
51
Michael Clarkf0d08882007-03-13 08:26:18 +000052#endif