Initial Import
[profile/ivi/json-glib.git] / json-glib / json-types-private.h
1 /* json-types-private.h - JSON data types private header
2  * 
3  * This file is part of JSON-GLib
4  * Copyright (C) 2007  OpenedHand Ltd
5  * Copyright (C) 2009  Intel Corp.
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
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.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Author:
21  *   Emmanuele Bassi  <ebassi@linux.intel.com>
22  */
23
24 #ifndef __JSON_TYPES_PRIVATE_H__
25 #define __JSON_TYPES_PRIVATE_H__
26
27 #include "json-types.h"
28
29 G_BEGIN_DECLS
30
31 struct _JsonNode
32 {
33   /*< private >*/
34   JsonNodeType type;
35
36   union {
37     JsonObject *object;
38     JsonArray *array;
39     GValue value;
40   } data;
41
42   JsonNode *parent;
43 };
44
45 struct _JsonArray
46 {
47   GPtrArray *elements;
48
49   volatile gint ref_count;
50 };
51
52 struct _JsonObject
53 {
54   GHashTable *members;
55
56   /* the members of the object, ordered in reverse */
57   GList *members_ordered;
58
59   volatile gint ref_count;
60 };
61
62 const gchar *json_node_type_get_name (JsonNodeType node_type);
63
64 G_END_DECLS
65
66 #endif /* __JSON_TYPES_PRIVATE_H__ */