root/src/json-lib/json_object_private.h

Revision f632f7d9a1b4222c469abf2fc43923fe4868fe37, 1.2 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 years ago)

provide overflow detection and recover for json_objects and leverage that in the lua stuff

  • Property mode set to 100644
Line 
1 /*
2  * $Id: json_object_private.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
3  *
4  * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
5  * Michael Clark <michael@metaparadigm.com>
6  *
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.
9  *
10  */
11
12 #ifndef _json_object_private_h_
13 #define _json_object_private_h_
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #include <stdint.h>
20
21 typedef void (json_object_delete_fn)(struct json_object *o);
22 typedef int (json_object_to_json_string_fn)(struct json_object *o,
23                                             struct printbuf *pb);
24
25 struct json_object
26 {
27   enum json_type o_type;
28   enum json_int_overflow o_ioverflow;
29   json_object_delete_fn *_delete;
30   json_object_to_json_string_fn *_to_json_string;
31   int _ref_count;
32   struct printbuf *_pb;
33   union data {
34     boolean c_boolean;
35     double c_double;
36     int c_int;
37     struct lh_table *c_object;
38     struct array_list *c_array;
39     char *c_string;
40   } o;
41   union {
42     u_int64_t c_uint64;
43     int64_t c_int64;
44   } overflow;
45 };
46
47 /* CAW: added for ANSI C iteration correctness */
48 struct json_object_iter
49 {
50         char *key;
51         struct json_object *val;
52         struct lh_entry *entry;
53 };
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59 #endif
Note: See TracBrowser for help on using the browser.