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 | |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame] | 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 19 | typedef void (json_object_delete_fn)(struct json_object *o); |
| 20 | typedef int (json_object_to_json_string_fn)(struct json_object *o, |
| 21 | struct printbuf *pb); |
| 22 | |
| 23 | struct 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 Clark | c4dceae | 2010-10-06 16:39:20 +0000 | [diff] [blame] | 33 | int64_t c_int64; |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 34 | struct lh_table *c_object; |
| 35 | struct array_list *c_array; |
Jehiah Czebotar | ac601b5 | 2011-01-14 17:23:06 +0000 | [diff] [blame^] | 36 | struct { |
| 37 | char *str; |
| 38 | int len; |
| 39 | } c_string; |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 40 | } o; |
| 41 | }; |
| 42 | |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 43 | /* CAW: added for ANSI C iteration correctness */ |
| 44 | struct json_object_iter |
| 45 | { |
| 46 | char *key; |
| 47 | struct json_object *val; |
| 48 | struct lh_entry *entry; |
| 49 | }; |
| 50 | |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame] | 51 | #ifdef __cplusplus |
| 52 | } |
| 53 | #endif |
| 54 | |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 55 | #endif |