1 |
Just Modeste a écrit : |
2 |
|
3 |
> Salut |
4 |
> |
5 |
>>charset.c:170: error: syntax error before '*' token |
6 |
> |
7 |
> Il semble y avoir une erreur de syntaxe dans le fichier charset.c a la |
8 |
> ligne 170. |
9 |
> |
10 |
> Le reste peut decouler de ca. |
11 |
> |
12 |
> Tu peux joindre ce fichier ??? |
13 |
> |
14 |
|
15 |
Bonjour |
16 |
|
17 |
En fait, dans charset.c il est détecté tout un tas |
18 |
d'erreurs de syntaxe du genre : |
19 |
|
20 |
charset.h:33: error: syntax error before "gchar" |
21 |
charset.h:35: error: syntax error before '}' token |
22 |
charset.h:38: error: syntax error before |
23 |
"charset_trans_array" |
24 |
etc... |
25 |
|
26 |
|
27 |
|
28 |
Voilà le fichier en question : |
29 |
|
30 |
/* libxmms-flac - XMMS FLAC input plugin |
31 |
* Copyright (C) 2002 Daisuke Shimamura |
32 |
* |
33 |
* Almost from charset.c |
34 |
* EasyTAG - Tag editor for MP3 and OGG files |
35 |
* Copyright (C) 1999-2001 Håvard Kvålen |
36 |
<havardk@××××.org> |
37 |
* |
38 |
* This program is free software; you can |
39 |
redistribute it and/or |
40 |
* modify it under the terms of the GNU General |
41 |
Public License |
42 |
* as published by the Free Software Foundation; |
43 |
either version 2 |
44 |
* of the License, or (at your option) any later |
45 |
version. |
46 |
* |
47 |
* This program is distributed in the hope that |
48 |
it will be useful, |
49 |
* but WITHOUT ANY WARRANTY; without even the |
50 |
implied warranty of |
51 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR |
52 |
PURPOSE. See the |
53 |
* GNU General Public License for more details. |
54 |
* |
55 |
* You should have received a copy of the GNU |
56 |
General Public License |
57 |
* along with this program; if not, write to the |
58 |
Free Software |
59 |
* Foundation, Inc., 59 Temple Place - Suite 330, |
60 |
Boston, MA 02111-1307, USA. |
61 |
*/ |
62 |
|
63 |
#include <stdlib.h> |
64 |
#include <glib.h> |
65 |
#include <string.h> |
66 |
#include <errno.h> |
67 |
|
68 |
#include "plugin_common/charset.h" |
69 |
#include "plugin_common/locale_hack.h" |
70 |
#include "charset.h" |
71 |
#include "configure.h" |
72 |
|
73 |
|
74 |
/**************** |
75 |
* Declarations * |
76 |
****************/ |
77 |
|
78 |
#define CHARSET_TRANS_ARRAY_LEN ( |
79 |
sizeof(charset_trans_array) / |
80 |
sizeof((charset_trans_array)[0]) ) |
81 |
const CharsetInfo charset_trans_array[] = { |
82 |
{N_("Arabic (IBM-864)"), |
83 |
"IBM864" }, |
84 |
{N_("Arabic (ISO-8859-6)"), |
85 |
"ISO-8859-6" }, |
86 |
{N_("Arabic (Windows-1256)"), |
87 |
"windows-1256" }, |
88 |
{N_("Baltic (ISO-8859-13)"), |
89 |
"ISO-8859-13" }, |
90 |
{N_("Baltic (ISO-8859-4)"), |
91 |
"ISO-8859-4" }, |
92 |
{N_("Baltic (Windows-1257)"), |
93 |
"windows-1257" }, |
94 |
{N_("Celtic (ISO-8859-14)"), |
95 |
"ISO-8859-14" }, |
96 |
{N_("Central European (IBM-852)"), |
97 |
"IBM852" }, |
98 |
{N_("Central European (ISO-8859-2)"), |
99 |
"ISO-8859-2" }, |
100 |
{N_("Central European (Windows-1250)"), |
101 |
"windows-1250" }, |
102 |
{N_("Chinese Simplified (GB18030)"), |
103 |
"gb18030" }, |
104 |
{N_("Chinese Simplified (GB2312)"), |
105 |
"GB2312" }, |
106 |
{N_("Chinese Traditional (Big5)"), "Big5" |
107 |
}, |
108 |
{N_("Chinese Traditional (Big5-HKSCS)"), |
109 |
"Big5-HKSCS" }, |
110 |
{N_("Cyrillic (IBM-855)"), |
111 |
"IBM855" }, |
112 |
{N_("Cyrillic (ISO-8859-5)"), |
113 |
"ISO-8859-5" }, |
114 |
{N_("Cyrillic (ISO-IR-111)"), |
115 |
"ISO-IR-111" }, |
116 |
{N_("Cyrillic (KOI8-R)"), |
117 |
"KOI8-R" }, |
118 |
{N_("Cyrillic (Windows-1251)"), |
119 |
"windows-1251" }, |
120 |
{N_("Cyrillic/Russian (CP-866)"), |
121 |
"IBM866" }, |
122 |
{N_("Cyrillic/Ukrainian (KOI8-U)"), |
123 |
"KOI8-U" }, |
124 |
{N_("English (US-ASCII)"), |
125 |
"us-ascii" }, |
126 |
{N_("Greek (ISO-8859-7)"), |
127 |
"ISO-8859-7" }, |
128 |
{N_("Greek (Windows-1253)"), |
129 |
"windows-1253" }, |
130 |
{N_("Hebrew (IBM-862)"), |
131 |
"IBM862" }, |
132 |
{N_("Hebrew (Windows-1255)"), |
133 |
"windows-1255" }, |
134 |
{N_("Japanese (EUC-JP)"), |
135 |
"EUC-JP" }, |
136 |
{N_("Japanese (ISO-2022-JP)"), |
137 |
"ISO-2022-JP" }, |
138 |
{N_("Japanese (Shift_JIS)"), |
139 |
"Shift_JIS" }, |
140 |
{N_("Korean (EUC-KR)"), |
141 |
"EUC-KR" }, |
142 |
{N_("Nordic (ISO-8859-10)"), |
143 |
"ISO-8859-10" }, |
144 |
{N_("South European (ISO-8859-3)"), |
145 |
"ISO-8859-3" }, |
146 |
{N_("Thai (TIS-620)"), |
147 |
"TIS-620" }, |
148 |
{N_("Turkish (IBM-857)"), |
149 |
"IBM857" }, |
150 |
{N_("Turkish (ISO-8859-9)"), |
151 |
"ISO-8859-9" }, |
152 |
{N_("Turkish (Windows-1254)"), |
153 |
"windows-1254" }, |
154 |
{N_("Unicode (UTF-7)"), "UTF-7" |
155 |
}, |
156 |
{N_("Unicode (UTF-8)"), "UTF-8" |
157 |
}, |
158 |
{N_("Unicode (UTF-16BE)"), |
159 |
"UTF-16BE" }, |
160 |
{N_("Unicode (UTF-16LE)"), |
161 |
"UTF-16LE" }, |
162 |
{N_("Unicode (UTF-32BE)"), |
163 |
"UTF-32BE" }, |
164 |
{N_("Unicode (UTF-32LE)"), |
165 |
"UTF-32LE" }, |
166 |
{N_("Vietnamese (VISCII)"), |
167 |
"VISCII" }, |
168 |
{N_("Vietnamese (Windows-1258)"), |
169 |
"windows-1258" }, |
170 |
{N_("Visual Hebrew (ISO-8859-8)"), |
171 |
"ISO-8859-8" }, |
172 |
{N_("Western (IBM-850)"), |
173 |
"IBM850" }, |
174 |
{N_("Western (ISO-8859-1)"), |
175 |
"ISO-8859-1" }, |
176 |
{N_("Western (ISO-8859-15)"), |
177 |
"ISO-8859-15" }, |
178 |
{N_("Western (Windows-1252)"), |
179 |
"windows-1252" } |
180 |
|
181 |
/* |
182 |
* From this point, character sets aren't |
183 |
supported by iconv |
184 |
*/ |
185 |
#if 0 |
186 |
{N_("Arabic (IBM-864-I)"), |
187 |
"IBM864i" }, |
188 |
{N_("Arabic (ISO-8859-6-E)"), |
189 |
"ISO-8859-6-E" }, |
190 |
{N_("Arabic (ISO-8859-6-I)"), |
191 |
"ISO-8859-6-I" }, |
192 |
{N_("Arabic (MacArabic)"), |
193 |
"x-mac-arabic" }, |
194 |
{N_("Armenian (ARMSCII-8)"), |
195 |
"armscii-8" }, |
196 |
{N_("Central European (MacCE)"), |
197 |
"x-mac-ce" }, |
198 |
{N_("Chinese Simplified (GBK)"), "x-gbk" |
199 |
}, |
200 |
{N_("Chinese Simplified (HZ)"), |
201 |
"HZ-GB-2312" }, |
202 |
{N_("Chinese Traditional (EUC-TW)"), |
203 |
"x-euc-tw" }, |
204 |
{N_("Croatian (MacCroatian)"), |
205 |
"x-mac-croatian" }, |
206 |
{N_("Cyrillic (MacCyrillic)"), |
207 |
"x-mac-cyrillic" }, |
208 |
{N_("Cyrillic/Ukrainian (MacUkrainian)"), |
209 |
"x-mac-ukrainian" }, |
210 |
{N_("Farsi (MacFarsi)"), |
211 |
"x-mac-farsi"}, |
212 |
{N_("Greek (MacGreek)"), |
213 |
"x-mac-greek" }, |
214 |
{N_("Gujarati (MacGujarati)"), |
215 |
"x-mac-gujarati" }, |
216 |
{N_("Gurmukhi (MacGurmukhi)"), |
217 |
"x-mac-gurmukhi" }, |
218 |
{N_("Hebrew (ISO-8859-8-E)"), |
219 |
"ISO-8859-8-E" }, |
220 |
{N_("Hebrew (ISO-8859-8-I)"), |
221 |
"ISO-8859-8-I" }, |
222 |
{N_("Hebrew (MacHebrew)"), |
223 |
"x-mac-hebrew" }, |
224 |
{N_("Hindi (MacDevanagari)"), |
225 |
"x-mac-devanagari" }, |
226 |
{N_("Icelandic (MacIcelandic)"), |
227 |
"x-mac-icelandic" }, |
228 |
{N_("Korean (JOHAB)"), |
229 |
"x-johab" }, |
230 |
{N_("Korean (UHC)"), |
231 |
"x-windows-949" }, |
232 |
{N_("Romanian (MacRomanian)"), |
233 |
"x-mac-romanian" }, |
234 |
{N_("Turkish (MacTurkish)"), |
235 |
"x-mac-turkish" }, |
236 |
{N_("User Defined"), |
237 |
"x-user-defined" }, |
238 |
{N_("Vietnamese (TCVN)"), |
239 |
"x-viet-tcvn5712" }, |
240 |
{N_("Vietnamese (VPS)"), |
241 |
"x-viet-vps" }, |
242 |
{N_("Western (MacRoman)"), |
243 |
"x-mac-roman" }, |
244 |
/* charsets whithout posibly translatable names */ |
245 |
{"T61.8bit", |
246 |
"T61.8bit" }, |
247 |
{"x-imap4-modified-utf7", |
248 |
"x-imap4-modified-utf7"}, |
249 |
{"x-u-escaped", |
250 |
"x-u-escaped" }, |
251 |
{"windows-936", |
252 |
"windows-936" } |
253 |
#endif |
254 |
}; |
255 |
|
256 |
/************* |
257 |
* Functions * |
258 |
*************/ |
259 |
|
260 |
/* |
261 |
* Commons conversion functions |
262 |
*/ |
263 |
char *convert_from_file_to_user(const char *string) |
264 |
{ |
265 |
return |
266 |
FLAC_plugin__charset_convert_string(string, |
267 |
flac_cfg.title.file_char_set, |
268 |
flac_cfg.title.user_char_set); |
269 |
} |
270 |
|
271 |
char *convert_from_user_to_file(const char *string) |
272 |
{ |
273 |
return |
274 |
FLAC_plugin__charset_convert_string(string, |
275 |
flac_cfg.title.user_char_set, |
276 |
flac_cfg.title.file_char_set); |
277 |
} |
278 |
|
279 |
void convert_from_file_to_user_in_place(char **string) |
280 |
{ |
281 |
if(0 != *string) { |
282 |
char *tmp; |
283 |
|
284 |
tmp = convert_from_file_to_user(*string); |
285 |
free(*string); |
286 |
*string = tmp; |
287 |
} |
288 |
} |
289 |
|
290 |
void convert_from_user_to_file_in_place(char **string) |
291 |
{ |
292 |
if(0 != *string) { |
293 |
char *tmp; |
294 |
|
295 |
tmp = convert_from_user_to_file(*string); |
296 |
free(*string); |
297 |
*string = tmp; |
298 |
} |
299 |
} |
300 |
|
301 |
GList *Charset_Create_List (void) |
302 |
{ |
303 |
GList *list = NULL; |
304 |
guint i; |
305 |
|
306 |
for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++) |
307 |
list = |
308 |
g_list_append(list,_(charset_trans_array[i].charset_title)); |
309 |
return list; |
310 |
} |
311 |
|
312 |
|
313 |
/* |
314 |
* Return charset_name from charset_title |
315 |
*/ |
316 |
gchar *Charset_Get_Name_From_Title (gchar |
317 |
*charset_title) |
318 |
{ |
319 |
guint i; |
320 |
|
321 |
if (charset_title) |
322 |
for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++) |
323 |
if ( |
324 |
strcasecmp(_(charset_title),_(charset_trans_array[i].charset_title)) |
325 |
== 0 ) |
326 |
return charset_trans_array[i].charset_name; |
327 |
return ""; |
328 |
} |
329 |
|
330 |
|
331 |
/* |
332 |
* Return charset_title from charset_name |
333 |
*/ |
334 |
gchar *Charset_Get_Title_From_Name (gchar |
335 |
*charset_name) |
336 |
{ |
337 |
guint i; |
338 |
|
339 |
if (charset_name) |
340 |
for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++) |
341 |
if ( |
342 |
strcasecmp(charset_name,charset_trans_array[i].charset_name) |
343 |
== 0 ) |
344 |
return _(charset_trans_array[i].charset_title); |
345 |
return ""; |
346 |
} |
347 |
|
348 |
|
349 |
Merci de ton aide. |
350 |
|
351 |
Jacques |
352 |
|
353 |
-- |
354 |
gentoo-user-fr@g.o mailing list |