annotate libaudacious/configfile.h @ 905:e5727eb096a6 trunk

[svn] - more output-stopping fun!
author nhjm449
date Thu, 30 Mar 2006 21:10:03 -0800
parents cb178e5ad177
children 13281963f56f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /* XMMS - Cross-platform multimedia player
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 #ifndef XMMS_CONFIGFILE_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 #define XMMS_CONFIGFILE_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 typedef enum {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 XMMS_CFG_INT,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 XMMS_CFG_FLOAT,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 XMMS_CFG_BOOLEAN,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 XMMS_CFG_STRING
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 } XmmsCfgValueType;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 struct _ConfigLine {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 gchar *key;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 gchar *value;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 struct _ConfigSection {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 gchar *name;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 GList *lines;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 struct _ConfigFile {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 GList *sections;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 typedef struct _ConfigLine ConfigLine;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 typedef struct _ConfigSection ConfigSection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 typedef struct _ConfigFile ConfigFile;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 #ifdef __cplusplus
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 extern "C" {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 ConfigFile *xmms_cfg_new(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 ConfigFile *xmms_cfg_open_file(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 gboolean xmms_cfg_write_file(ConfigFile * cfg, const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 void xmms_cfg_free(ConfigFile * cfg);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 ConfigFile *xmms_cfg_open_default_file(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 gboolean xmms_cfg_write_default_file(ConfigFile * cfg);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 gboolean xmms_cfg_read_value(ConfigFile * config_file,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 const gchar * section, const gchar * key,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 XmmsCfgValueType value_type,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 gpointer * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 void xmms_cfg_write_value(ConfigFile * config_file,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 const gchar * section, const gchar * key,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 XmmsCfgValueType value_type,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 gpointer * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 gboolean xmms_cfg_read_string(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 const gchar * key, gchar ** value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 gboolean xmms_cfg_read_int(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 const gchar * key, gint * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 gboolean xmms_cfg_read_boolean(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 const gchar * key, gboolean * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 gboolean xmms_cfg_read_float(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 const gchar * key, gfloat * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 gboolean xmms_cfg_read_double(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 const gchar * key, gdouble * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 void xmms_cfg_write_string(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 const gchar * key, gchar * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 void xmms_cfg_write_int(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 const gchar * key, gint value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 void xmms_cfg_write_boolean(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 const gchar * key, gboolean value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 void xmms_cfg_write_float(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 const gchar * key, gfloat value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 void xmms_cfg_write_double(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 const gchar * key, gdouble value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 void xmms_cfg_remove_key(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 const gchar * key);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 #ifdef __cplusplus
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 #endif