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; |
| 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 Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 40 | /* CAW: added for ANSI C iteration correctness */ |
| 41 | struct json_object_iter |
| 42 | { |
| 43 | char *key; |
| 44 | struct json_object *val; |
| 45 | struct lh_entry *entry; |
| 46 | }; |
| 47 | |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame^] | 48 | #ifdef __cplusplus |
| 49 | } |
| 50 | #endif |
| 51 | |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 52 | #endif |