Merge branch 'test-ip_mreq_source-android-only' into 'master'
[glib.git] / gio / gvdb / gvdb-reader.h
blob449241eaa47896249ebe30bfe1f8c7956576f3f3
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.1 of the License, 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, see <http://www.gnu.org/licenses/>.
17 * Author: Ryan Lortie <desrt@desrt.ca>
20 #ifndef __gvdb_reader_h__
21 #define __gvdb_reader_h__
23 #include <glib.h>
25 typedef struct _GvdbTable GvdbTable;
27 typedef gpointer (*GvdbRefFunc) (gpointer data);
29 G_BEGIN_DECLS
31 G_GNUC_INTERNAL
32 GvdbTable * gvdb_table_new (const gchar *filename,
33 gboolean trusted,
34 GError **error);
35 G_GNUC_INTERNAL
36 GvdbTable * gvdb_table_new_from_data (const void *data,
37 gsize data_len,
38 gboolean trusted,
39 gpointer user_data,
40 GvdbRefFunc ref,
41 GDestroyNotify unref,
42 GError **error);
43 G_GNUC_INTERNAL
44 GvdbTable * gvdb_table_ref (GvdbTable *table);
45 G_GNUC_INTERNAL
46 void gvdb_table_unref (GvdbTable *table);
48 G_GNUC_INTERNAL
49 gchar ** gvdb_table_list (GvdbTable *table,
50 const gchar *key);
51 G_GNUC_INTERNAL
52 GvdbTable * gvdb_table_get_table (GvdbTable *table,
53 const gchar *key);
54 G_GNUC_INTERNAL
55 GVariant * gvdb_table_get_raw_value (GvdbTable *table,
56 const gchar *key);
57 G_GNUC_INTERNAL
58 GVariant * gvdb_table_get_value (GvdbTable *table,
59 const gchar *key);
61 G_GNUC_INTERNAL
62 gboolean gvdb_table_has_value (GvdbTable *table,
63 const gchar *key);
65 G_GNUC_INTERNAL
66 gboolean gvdb_table_is_valid (GvdbTable *table);
68 typedef void (*GvdbWalkValueFunc) (const gchar *name,
69 gsize name_len,
70 GVariant *value,
71 gpointer user_data);
72 typedef gboolean (*GvdbWalkOpenFunc) (const gchar *name,
73 gsize name_len,
74 gpointer user_data);
75 typedef void (*GvdbWalkCloseFunc) (gsize name_len,
76 gpointer user_data);
78 G_GNUC_INTERNAL
79 void gvdb_table_walk (GvdbTable *table,
80 const gchar *key,
81 GvdbWalkOpenFunc open_func,
82 GvdbWalkValueFunc value_func,
83 GvdbWalkCloseFunc close_func,
84 gpointer user_data);
86 G_END_DECLS
88 #endif /* __gvdb_reader_h__ */