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 40 typedef struct _GvdbTable GvdbTable; 41 42 G_BEGIN_DECLS 43 44 G_GNUC_INTERNAL GVDB_GNUC_WEAK 45 GvdbTable * gvdb_table_new_from_bytes (GBytes *bytes, 46 gboolean trusted, 47 GError **error); 48 G_GNUC_INTERNAL GVDB_GNUC_WEAK 49 GvdbTable * gvdb_table_new (const gchar *filename, 50 gboolean trusted, 51 GError **error); 52 G_GNUC_INTERNAL GVDB_GNUC_WEAK 53 void gvdb_table_free (GvdbTable *table); 54 G_GNUC_INTERNAL GVDB_GNUC_WEAK 55 gchar ** gvdb_table_get_names (GvdbTable *table, 56 gsize *length); 57 G_GNUC_INTERNAL GVDB_GNUC_WEAK 58 gchar ** gvdb_table_list (GvdbTable *table, 59 const gchar *key); 60 G_GNUC_INTERNAL GVDB_GNUC_WEAK 61 GvdbTable * gvdb_table_get_table (GvdbTable *table, 62 const gchar *key); 63 G_GNUC_INTERNAL GVDB_GNUC_WEAK 64 GVariant * gvdb_table_get_raw_value (GvdbTable *table, 65 const gchar *key); 66 G_GNUC_INTERNAL GVDB_GNUC_WEAK 67 GVariant * gvdb_table_get_value (GvdbTable *table, 68 const gchar *key); 69 70 G_GNUC_INTERNAL GVDB_GNUC_WEAK 71 gboolean gvdb_table_has_value (GvdbTable *table, 72 const gchar *key); 73 G_GNUC_INTERNAL GVDB_GNUC_WEAK 74 gboolean gvdb_table_is_valid (GvdbTable *table); 75 76 G_END_DECLS 77 78 #endif /* __gvdb_reader_h__ */ 79