Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 1 | /* |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame^] | 2 | * $Id: json_object_private.h,v 1.4 2006/01/26 02:16:28 mclark Exp $ |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 3 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame^] | 4 | * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 5 | * Michael Clark <michael@metaparadigm.com> |
| 6 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame^] | 7 | * 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 Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 9 | * |
| 10 | */ |
| 11 | |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 12 | #ifndef _json_object_private_h_ |
| 13 | #define _json_object_private_h_ |
| 14 | |
| 15 | typedef void (json_object_delete_fn)(struct json_object *o); |
| 16 | typedef int (json_object_to_json_string_fn)(struct json_object *o, |
| 17 | struct printbuf *pb); |
| 18 | |
| 19 | struct json_object |
| 20 | { |
| 21 | enum json_type o_type; |
| 22 | json_object_delete_fn *_delete; |
| 23 | json_object_to_json_string_fn *_to_json_string; |
| 24 | int _ref_count; |
| 25 | struct printbuf *_pb; |
| 26 | union data { |
| 27 | boolean c_boolean; |
| 28 | double c_double; |
| 29 | int c_int; |
| 30 | struct lh_table *c_object; |
| 31 | struct array_list *c_array; |
| 32 | char *c_string; |
| 33 | } o; |
| 34 | }; |
| 35 | |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 36 | /* CAW: added for ANSI C iteration correctness */ |
| 37 | struct json_object_iter |
| 38 | { |
| 39 | char *key; |
| 40 | struct json_object *val; |
| 41 | struct lh_entry *entry; |
| 42 | }; |
| 43 | |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 44 | #endif |