annotate libaudacious/configfile.h @ 1017:dc9aaf5eba90 trunk

[svn] - bypass poisoning on configfile.c
author nenolod
date Tue, 09 May 2006 10:05:03 -0700
parents 9b26df736b62
children f12d7e208b43
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
1013
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
50 /*
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
51 * Poison all of the xmms ConfigFile interfaces as we are to
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
52 * no longer use these anymore. They have been deprecated since 0.2,
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
53 * and will be REMOVED in 1.2.
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
54 *
1014
9b26df736b62 [svn] (a quick way to reenable configfile):
nenolod
parents: 1013
diff changeset
55 * If you are a third party developer and you need a quick fix, add
9b26df736b62 [svn] (a quick way to reenable configfile):
nenolod
parents: 1013
diff changeset
56 * #define I_AM_A_THIRD_PARTY_DEVELOPER_WHO_NEEDS_TO_BE_KICKED_IN_THE_HEAD_BY_CHUCK_NORRIS
9b26df736b62 [svn] (a quick way to reenable configfile):
nenolod
parents: 1013
diff changeset
57 * to your code.
9b26df736b62 [svn] (a quick way to reenable configfile):
nenolod
parents: 1013
diff changeset
58 *
1013
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
59 * - nenolod, 05/09/2006
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
60 */
1014
9b26df736b62 [svn] (a quick way to reenable configfile):
nenolod
parents: 1013
diff changeset
61 #ifndef I_AM_A_THIRD_PARTY_DEVELOPER_WHO_NEEDS_TO_BE_KICKED_IN_THE_HEAD_BY_CHUCK_NORRIS
1013
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
62 #pragma GCC poison xmms_cfg_new
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
63 #pragma GCC poison xmms_cfg_open_file
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
64 #pragma GCC poison xmms_cfg_write_file
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
65 #pragma GCC poison xmms_cfg_open_default_file
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
66 #pragma GCC poison xmms_cfg_write_default_file
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
67 #pragma GCC poison xmms_cfg_read_value
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
68 #pragma GCC poison xmms_cfg_write_value
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
69 #pragma GCC poison xmms_cfg_read_string
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
70 #pragma GCC poison xmms_cfg_read_int
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
71 #pragma GCC poison xmms_cfg_read_boolean
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
72 #pragma GCC poison xmms_cfg_read_float
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
73 #pragma GCC poison xmms_cfg_read_double
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
74 #pragma GCC poison xmms_cfg_write_string
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
75 #pragma GCC poison xmms_cfg_write_int
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
76 #pragma GCC poison xmms_cfg_write_boolean
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
77 #pragma GCC poison xmms_cfg_write_float
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
78 #pragma GCC poison xmms_cfg_write_double
13281963f56f [svn] Poison the XMMS ConfigFile routines. The rationale for this decision,
nenolod
parents: 0
diff changeset
79 #pragma GCC poison xmms_cfg_remove_key
1014
9b26df736b62 [svn] (a quick way to reenable configfile):
nenolod
parents: 1013
diff changeset
80 #endif
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 #ifdef __cplusplus
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 extern "C" {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 ConfigFile *xmms_cfg_new(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 ConfigFile *xmms_cfg_open_file(const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 gboolean xmms_cfg_write_file(ConfigFile * cfg, const gchar * filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 void xmms_cfg_free(ConfigFile * cfg);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 ConfigFile *xmms_cfg_open_default_file(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 gboolean xmms_cfg_write_default_file(ConfigFile * cfg);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 gboolean xmms_cfg_read_value(ConfigFile * config_file,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 const gchar * section, const gchar * key,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 XmmsCfgValueType value_type,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 gpointer * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 void xmms_cfg_write_value(ConfigFile * config_file,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 const gchar * section, const gchar * key,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 XmmsCfgValueType value_type,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 gpointer * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 gboolean xmms_cfg_read_string(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 const gchar * key, gchar ** value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 gboolean xmms_cfg_read_int(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 const gchar * key, gint * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 gboolean xmms_cfg_read_boolean(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 const gchar * key, gboolean * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 gboolean xmms_cfg_read_float(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 const gchar * key, gfloat * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 gboolean xmms_cfg_read_double(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 const gchar * key, gdouble * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 void xmms_cfg_write_string(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 const gchar * key, gchar * value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 void xmms_cfg_write_int(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117 const gchar * key, gint value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 void xmms_cfg_write_boolean(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 const gchar * key, gboolean value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 void xmms_cfg_write_float(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 const gchar * key, gfloat value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 void xmms_cfg_write_double(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 const gchar * key, gdouble value);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 void xmms_cfg_remove_key(ConfigFile * cfg, const gchar * section,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 const gchar * key);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 #ifdef __cplusplus
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 #endif