docs: Add GIOModuleScope and GIOModuleScopeFlags
[glib.git] / gio / gvdb / gvdb-reader.h
blobe6878c3f0d4af2a57ab6678020cc0e5ae35dec54
1 /*
2 * Copyright © 2010 Codethink Limited
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 of the licence, or (at your option) any later version.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Author: Ryan Lortie <desrt@desrt.ca>
22 #ifndef __gvdb_reader_h__
23 #define __gvdb_reader_h__
25 #include <glib.h>
27 typedef struct _GvdbTable GvdbTable;
29 typedef gpointer (*GvdbRefFunc) (gpointer data);
31 G_BEGIN_DECLS
33 G_GNUC_INTERNAL
34 GvdbTable * gvdb_table_new (const gchar *filename,
35 gboolean trusted,
36 GError **error);
37 G_GNUC_INTERNAL
38 GvdbTable * gvdb_table_new_from_data (const void *data,
39 gsize data_len,
40 gboolean trusted,
41 gpointer user_data,
42 GvdbRefFunc ref,
43 GDestroyNotify unref,
44 GError **error);
45 G_GNUC_INTERNAL
46 GvdbTable * gvdb_table_ref (GvdbTable *table);
47 G_GNUC_INTERNAL
48 void gvdb_table_unref (GvdbTable *table);
50 G_GNUC_INTERNAL
51 gchar ** gvdb_table_list (GvdbTable *table,
52 const gchar *key);
53 G_GNUC_INTERNAL
54 GvdbTable * gvdb_table_get_table (GvdbTable *table,
55 const gchar *key);
56 G_GNUC_INTERNAL
57 GVariant * gvdb_table_get_raw_value (GvdbTable *table,
58 const gchar *key);
59 G_GNUC_INTERNAL
60 GVariant * gvdb_table_get_value (GvdbTable *table,
61 const gchar *key);
63 G_GNUC_INTERNAL
64 gboolean gvdb_table_has_value (GvdbTable *table,
65 const gchar *key);
67 G_GNUC_INTERNAL
68 gboolean gvdb_table_is_valid (GvdbTable *table);
70 typedef void (*GvdbWalkValueFunc) (const gchar *name,
71 gsize name_len,
72 GVariant *value,
73 gpointer user_data);
74 typedef gboolean (*GvdbWalkOpenFunc) (const gchar *name,
75 gsize name_len,
76 gpointer user_data);
77 typedef void (*GvdbWalkCloseFunc) (gsize name_len,
78 gpointer user_data);
80 G_GNUC_INTERNAL
81 void gvdb_table_walk (GvdbTable *table,
82 const gchar *key,
83 GvdbWalkOpenFunc open_func,
84 GvdbWalkValueFunc value_func,
85 GvdbWalkCloseFunc close_func,
86 gpointer user_data);
88 G_END_DECLS
90 #endif /* __gvdb_reader_h__ */