improve bloom filter on send
[platform/upstream/glib.git] / gio / gvdb / gvdb-reader.h
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 of the licence, 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 typedef struct _GvdbTable GvdbTable;
26
27 typedef gpointer (*GvdbRefFunc) (gpointer data);
28
29 G_BEGIN_DECLS
30
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);
47
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);
60
61 G_GNUC_INTERNAL
62 gboolean                gvdb_table_has_value                            (GvdbTable    *table,
63                                                                          const gchar  *key);
64
65 G_GNUC_INTERNAL
66 gboolean                gvdb_table_is_valid                             (GvdbTable    *table);
67
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);
77
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);
85
86 G_END_DECLS
87
88 #endif /* __gvdb_reader_h__ */