comparison libaudacious/rcfile.h @ 0:cb178e5ad177 trunk

[svn] Import audacious source.
author nenolod
date Mon, 24 Oct 2005 03:06:47 -0700
parents
children f12d7e208b43
comparison
equal deleted inserted replaced
-1:000000000000 0:cb178e5ad177
1 /* XMMS - Cross-platform multimedia player
2 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program 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
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18 #ifndef RCFILE_H
19 #define RCFILE_H
20
21 #include <glib.h>
22
23 typedef struct {
24 gchar *key;
25 gchar *value;
26 } RcLine;
27
28 typedef struct {
29 gchar *name;
30 GList *lines;
31 } RcSection;
32
33 typedef struct {
34 GList *sections;
35 } RcFile;
36
37 G_BEGIN_DECLS
38
39 RcFile *bmp_rcfile_new(void);
40 void bmp_rcfile_free(RcFile * file);
41
42 RcFile *bmp_rcfile_open(const gchar * filename);
43 gboolean bmp_rcfile_write(RcFile * file, const gchar * filename);
44
45 gboolean bmp_rcfile_read_string(RcFile * file, const gchar * section,
46 const gchar * key, gchar ** value);
47 gboolean bmp_rcfile_read_int(RcFile * file, const gchar * section,
48 const gchar * key, gint * value);
49 gboolean bmp_rcfile_read_bool(RcFile * file, const gchar * section,
50 const gchar * key, gboolean * value);
51 gboolean bmp_rcfile_read_float(RcFile * file, const gchar * section,
52 const gchar * key, gfloat * value);
53 gboolean bmp_rcfile_read_double(RcFile * file, const gchar * section,
54 const gchar * key, gdouble * value);
55
56 void bmp_rcfile_write_string(RcFile * file, const gchar * section,
57 const gchar * key, const gchar * value);
58 void bmp_rcfile_write_int(RcFile * file, const gchar * section,
59 const gchar * key, gint value);
60 void bmp_rcfile_write_boolean(RcFile * file, const gchar * section,
61 const gchar * key, gboolean value);
62 void bmp_rcfile_write_float(RcFile * file, const gchar * section,
63 const gchar * key, gfloat value);
64 void bmp_rcfile_write_double(RcFile * file, const gchar * section,
65 const gchar * key, gdouble value);
66
67 void bmp_rcfile_remove_key(RcFile * file, const gchar * section,
68 const gchar * key);
69
70 G_END_DECLS
71
72 #endif // RCFILE_H