blob: 5ed791b58b3776ed00cedf760f8bf9a579bc79e5 [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
Eric Haszlakiewicz38f421a2012-09-02 15:21:56 -050019typedef void (json_object_private_delete_fn)(struct json_object *o);
Michael Clarkf0d08882007-03-13 08:26:18 +000020
21struct json_object
22{
23 enum json_type o_type;
Eric Haszlakiewicz38f421a2012-09-02 15:21:56 -050024 json_object_private_delete_fn *_delete;
Michael Clarkf0d08882007-03-13 08:26:18 +000025 json_object_to_json_string_fn *_to_json_string;
26 int _ref_count;
27 struct printbuf *_pb;
28 union data {
Keith Derrick37e74672012-03-26 14:29:31 -070029 json_bool c_boolean;
Michael Clarkf0d08882007-03-13 08:26:18 +000030 double c_double;
Michael Clarkc4dceae2010-10-06 16:39:20 +000031 int64_t c_int64;
Michael Clarkf0d08882007-03-13 08:26:18 +000032 struct lh_table *c_object;
33 struct array_list *c_array;
Jehiah Czebotarac601b52011-01-14 17:23:06 +000034 struct {
35 char *str;
36 int len;
37 } c_string;
Michael Clarkf0d08882007-03-13 08:26:18 +000038 } o;
Eric Haszlakiewicz38f421a2012-09-02 15:21:56 -050039 json_object_delete_fn *_user_delete;
40 void *_userdata;
Michael Clarkf0d08882007-03-13 08:26:18 +000041};
42
Michael Clarkaaec1ef2009-02-25 02:31:32 +000043#ifdef __cplusplus
44}
45#endif
46
Michael Clarkf0d08882007-03-13 08:26:18 +000047#endif