Mercurial > audlegacy
annotate src/audacious/rcfile.h @ 3112:4c758281fe8f trunk
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Thu, 19 Jul 2007 19:59:04 -0500 |
parents | d226b83fa329 |
children | 3b6d316f8b09 |
rev | line source |
---|---|
3112
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
1 /* Audacious - Cross-platform multimedia player |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
2 * Copyright (C) 2005-2007 Audacious development team |
2537 | 3 * |
3112
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
4 * Based on XMMS: |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
5 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies |
2537 | 6 * |
3112
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
9 * the Free Software Foundation; under version 2 of the License. |
2537 | 10 * |
3112
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
14 * GNU General Public License for more details. |
2537 | 15 * |
3112
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
4c758281fe8f
Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents:
2865
diff
changeset
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
2537 | 19 */ |
20 #ifndef RCFILE_H | |
21 #define RCFILE_H | |
22 | |
23 #include <glib.h> | |
24 | |
25 /** | |
26 * RcLine: | |
27 * @key: A key for the key->value mapping. | |
28 * @value: A value for the key->value mapping. | |
29 * | |
30 * RcLine objects contain key->value mappings. | |
31 **/ | |
32 typedef struct { | |
33 gchar *key; | |
34 gchar *value; | |
35 } RcLine; | |
36 | |
37 /** | |
38 * RcSection: | |
39 * @name: The name for the #RcSection. | |
40 * @lines: A list of key->value mappings for the #RcSection. | |
41 * | |
42 * RcSection objects contain collections of key->value mappings. | |
43 **/ | |
44 typedef struct { | |
45 gchar *name; | |
46 GList *lines; | |
47 } RcSection; | |
48 | |
49 /** | |
50 * RcFile: | |
51 * @sections: A list of sections. | |
52 * | |
53 * An RcFile object contains a collection of key->value mappings organized by section. | |
54 **/ | |
55 typedef struct { | |
56 GList *sections; | |
57 } RcFile; | |
58 | |
59 G_BEGIN_DECLS | |
60 | |
61 RcFile *bmp_rcfile_new(void); | |
62 void bmp_rcfile_free(RcFile * file); | |
63 | |
64 RcFile *bmp_rcfile_open(const gchar * filename); | |
65 gboolean bmp_rcfile_write(RcFile * file, const gchar * filename); | |
66 | |
67 gboolean bmp_rcfile_read_string(RcFile * file, const gchar * section, | |
68 const gchar * key, gchar ** value); | |
69 gboolean bmp_rcfile_read_int(RcFile * file, const gchar * section, | |
70 const gchar * key, gint * value); | |
71 gboolean bmp_rcfile_read_bool(RcFile * file, const gchar * section, | |
72 const gchar * key, gboolean * value); | |
73 gboolean bmp_rcfile_read_float(RcFile * file, const gchar * section, | |
74 const gchar * key, gfloat * value); | |
75 gboolean bmp_rcfile_read_double(RcFile * file, const gchar * section, | |
76 const gchar * key, gdouble * value); | |
77 | |
78 void bmp_rcfile_write_string(RcFile * file, const gchar * section, | |
79 const gchar * key, const gchar * value); | |
80 void bmp_rcfile_write_int(RcFile * file, const gchar * section, | |
81 const gchar * key, gint value); | |
82 void bmp_rcfile_write_boolean(RcFile * file, const gchar * section, | |
83 const gchar * key, gboolean value); | |
84 void bmp_rcfile_write_float(RcFile * file, const gchar * section, | |
85 const gchar * key, gfloat value); | |
86 void bmp_rcfile_write_double(RcFile * file, const gchar * section, | |
87 const gchar * key, gdouble value); | |
88 | |
89 void bmp_rcfile_remove_key(RcFile * file, const gchar * section, | |
90 const gchar * key); | |
91 | |
92 G_END_DECLS | |
93 | |
94 #endif // RCFILE_H |