2 * Copyright © 2007, 2008 Ryan Lortie
3 * Copyright © 2010 Codethink Limited
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 of the License, or (at your option) any later version.
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.
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/>.
18 * Author: Ryan Lortie <desrt@desrt.ca>
21 #ifndef __G_VARIANT_SERIALISER_H__
22 #define __G_VARIANT_SERIALISER_H__
24 #include "gvarianttypeinfo.h"
25 #include "gvariant-vectors.h"
29 GVariantTypeInfo *type_info;
36 GVariantTypeInfo *type_info;
43 gsize g_variant_serialised_n_children (GVariantSerialised container);
45 GVariantSerialised g_variant_serialised_get_child (GVariantSerialised container,
48 gboolean g_variant_serialiser_unpack_all (GVariantTypeInfo *type_info,
49 const guchar *end_pointer,
52 GArray *unpacked_children);
55 typedef void (*GVariantSerialisedFiller) (GVariantSerialised *serialised,
59 gsize g_variant_serialiser_needed_size (GVariantTypeInfo *info,
60 GVariantSerialisedFiller gsv_filler,
61 const gpointer *children,
65 void g_variant_serialiser_serialise (GVariantSerialised container,
66 GVariantSerialisedFiller gsv_filler,
67 const gpointer *children,
72 gboolean g_variant_serialised_is_normal (GVariantSerialised value);
74 void g_variant_serialised_byteswap (GVariantSerialised value);
76 /* validation of strings */
78 gboolean g_variant_serialiser_is_string (gconstpointer data,
81 gboolean g_variant_serialiser_is_object_path (gconstpointer data,
84 gboolean g_variant_serialiser_is_signature (gconstpointer data,
88 gsize g_variant_callback_write_to_vectors (GVariantVectors *vectors,
90 GVariantTypeInfo **type_info);
91 void g_variant_serialiser_write_to_vectors (GVariantVectors *items,
92 GVariantTypeInfo *type_info,
94 const gpointer *children,
97 #endif /* __G_VARIANT_SERIALISER_H__ */