blob: 112ce76f1df51bc24c796242a5b7faab81f5c47b [file] [log] [blame]
Michael Clark4504df72007-03-13 08:26:20 +00001/*
Michael Clarkf6a6e482007-03-13 08:26:23 +00002 * $Id: json_object_private.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
Michael Clark4504df72007-03-13 08:26:20 +00003 *
Michael Clarkf6a6e482007-03-13 08:26:23 +00004 * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
Michael Clark4504df72007-03-13 08:26:20 +00005 * Michael Clark <michael@metaparadigm.com>
6 *
Michael Clarkf6a6e482007-03-13 08:26:23 +00007 * 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 Clark4504df72007-03-13 08:26:20 +00009 *
10 */
11
Michael Clarkf0d08882007-03-13 08:26:18 +000012#ifndef _json_object_private_h_
13#define _json_object_private_h_
14
Michael Clarkaaec1ef2009-02-25 02:31:32 +000015#ifdef __cplusplus
16extern "C" {
17#endif
18
Michael Clarkf0d08882007-03-13 08:26:18 +000019typedef void (json_object_delete_fn)(struct json_object *o);
20typedef int (json_object_to_json_string_fn)(struct json_object *o,
21 struct printbuf *pb);
22
23struct 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 {
Keith Derrick37e74672012-03-26 14:29:31 -070031 json_bool c_boolean;
Michael Clarkf0d08882007-03-13 08:26:18 +000032 double c_double;
Michael Clarkc4dceae2010-10-06 16:39:20 +000033 int64_t c_int64;
Michael Clarkf0d08882007-03-13 08:26:18 +000034 struct lh_table *c_object;
35 struct array_list *c_array;
Jehiah Czebotarac601b52011-01-14 17:23:06 +000036 struct {
37 char *str;
38 int len;
39 } c_string;
Michael Clarkf0d08882007-03-13 08:26:18 +000040 } o;
41};
42
Michael Clarkaaec1ef2009-02-25 02:31:32 +000043#ifdef __cplusplus
44}
45#endif
46
Michael Clarkf0d08882007-03-13 08:26:18 +000047#endif