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, see <http://www.gnu.org/licenses/>.
17 * Author: Ryan Lortie <desrt@desrt.ca>
20 #ifndef __gvdb_reader_h__
21 #define __gvdb_reader_h__
25 typedef struct _GvdbTable GvdbTable
;
27 typedef gpointer (*GvdbRefFunc
) (gpointer data
);
32 GvdbTable
* gvdb_table_new (const gchar
*filename
,
36 GvdbTable
* gvdb_table_new_from_data (const void *data
,
44 GvdbTable
* gvdb_table_ref (GvdbTable
*table
);
46 void gvdb_table_unref (GvdbTable
*table
);
49 gchar
** gvdb_table_list (GvdbTable
*table
,
52 GvdbTable
* gvdb_table_get_table (GvdbTable
*table
,
55 GVariant
* gvdb_table_get_raw_value (GvdbTable
*table
,
58 GVariant
* gvdb_table_get_value (GvdbTable
*table
,
62 gboolean
gvdb_table_has_value (GvdbTable
*table
,
66 gboolean
gvdb_table_is_valid (GvdbTable
*table
);
68 typedef void (*GvdbWalkValueFunc
) (const gchar
*name
,
72 typedef gboolean (*GvdbWalkOpenFunc
) (const gchar
*name
,
75 typedef void (*GvdbWalkCloseFunc
) (gsize name_len
,
79 void gvdb_table_walk (GvdbTable
*table
,
81 GvdbWalkOpenFunc open_func
,
82 GvdbWalkValueFunc value_func
,
83 GvdbWalkCloseFunc close_func
,
88 #endif /* __gvdb_reader_h__ */