1 /*
2  * Copyright © 2007, 2008 Ryan Lortie
3  * Copyright © 2009, 2010 Codethink Limited
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17  *
18  * Author: Ryan Lortie <desrt@desrt.ca>
19  */
20 
21 
22 /* The purpose of this header is to allow certain internal symbols of
23  * GVariant to be put under test cases.
24  */
25 
26 #ifndef __G_VARIANT_INTERNAL_H__
27 #define __G_VARIANT_INTERNAL_H__
28 
29 /* Hack */
30 #define __GLIB_H_INSIDE__
31 
32 #include <glib/gvarianttype.h>
33 #include <glib/gtypes.h>
34 
35 #include "gvariant-serialiser.h"
36 #include "gvarianttypeinfo.h"
37 
38 #undef __GLIB_H_INSIDE__
39 
40 GLIB_AVAILABLE_IN_ALL
41 gboolean                        g_variant_format_string_scan            (const gchar          *string,
42                                                                          const gchar          *limit,
43                                                                          const gchar         **endptr);
44 
45 GLIB_AVAILABLE_IN_ALL
46 GVariantType *                  g_variant_format_string_scan_type       (const gchar          *string,
47                                                                          const gchar          *limit,
48                                                                          const gchar         **endptr);
49 
50 /* The maximum number of levels of nested container which this implementation
51  * of #GVariant will handle.
52  *
53  * The limit must be at least 64 + 1, to allow D-Bus messages to be wrapped in
54  * a top-level #GVariant. This comes from the D-Bus specification (§(Valid
55  * Signatures)), but also seems generally reasonable. #GDBusMessage wraps its
56  * payload in a top-level tuple.
57  *
58  * The limit is actually set to be a lot greater than 64, to allow much greater
59  * nesting of values off D-Bus. It cannot be set over around 80000, or the risk
60  * of overflowing the stack when parsing type strings becomes too great.
61  *
62  * Aside from those constraints, the choice of this value is arbitrary. The
63  * only restrictions on it from the API are that it has to be greater than 64
64  * (due to D-Bus).
65 */
66 #define G_VARIANT_MAX_RECURSION_DEPTH ((gsize) 128)
67 
68 #endif /* __G_VARIANT_INTERNAL_H__ */
69