1/*
2 * Copyright © 2010 Codethink Limited
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16 *
17 * Author: Ryan Lortie <desrt@desrt.ca>
18 */
19
20#ifndef __gvdb_reader_h__
21#define __gvdb_reader_h__
22
23#include <glib.h>
24
25/* We cannot enable the weak attribute unconditionally here because both
26 * gvdb/gvdb-reader.c and tests/dconf-mock-gvdb.c include this file. The
27 * intention of using weak symbols here is to allow the latter to override
28 * functions defined in the former, so functions in tests/dconf-mock-gvdb.c
29 * must have strong bindings. */
30#ifdef GVDB_USE_WEAK_SYMBOLS
31# ifdef __GNUC__
32# define GVDB_GNUC_WEAK __attribute__((weak))
33# else
34# define GVDB_GNUC_WEAK
35# endif
36#else
37# define GVDB_GNUC_WEAK
38#endif
39
40typedef struct _GvdbTable GvdbTable;
41
42G_BEGIN_DECLS
43
44G_GNUC_INTERNAL GVDB_GNUC_WEAK
45GvdbTable * gvdb_table_new_from_bytes (GBytes *bytes,
46 gboolean trusted,
47 GError **error);
48G_GNUC_INTERNAL GVDB_GNUC_WEAK
49GvdbTable * gvdb_table_new (const gchar *filename,
50 gboolean trusted,
51 GError **error);
52G_GNUC_INTERNAL GVDB_GNUC_WEAK
53void gvdb_table_free (GvdbTable *table);
54G_GNUC_INTERNAL GVDB_GNUC_WEAK
55gchar ** gvdb_table_get_names (GvdbTable *table,
56 gsize *length);
57G_GNUC_INTERNAL GVDB_GNUC_WEAK
58gchar ** gvdb_table_list (GvdbTable *table,
59 const gchar *key);
60G_GNUC_INTERNAL GVDB_GNUC_WEAK
61GvdbTable * gvdb_table_get_table (GvdbTable *table,
62 const gchar *key);
63G_GNUC_INTERNAL GVDB_GNUC_WEAK
64GVariant * gvdb_table_get_raw_value (GvdbTable *table,
65 const gchar *key);
66G_GNUC_INTERNAL GVDB_GNUC_WEAK
67GVariant * gvdb_table_get_value (GvdbTable *table,
68 const gchar *key);
69
70G_GNUC_INTERNAL GVDB_GNUC_WEAK
71gboolean gvdb_table_has_value (GvdbTable *table,
72 const gchar *key);
73G_GNUC_INTERNAL GVDB_GNUC_WEAK
74gboolean gvdb_table_is_valid (GvdbTable *table);
75
76G_END_DECLS
77
78#endif /* __gvdb_reader_h__ */
79

source code of gtk/subprojects/glib/gio/gvdb/gvdb-reader.h