Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 713442 | Differences between
and this patch

Collapse All | Expand All

(-)a/ABOUT-NLS (-1101 / +1 lines)
Lines 1-1101 Link Here
1
1 Notes on the Free Translation Project
1
<https://www.gnu.org/software/gettext/manual/html_node/Users.html>
2
***************************************
3
4
Free software is going international!  The Free Translation Project is
5
a way to get maintainers of free software, translators, and users all
6
together, so that free software will gradually become able to speak many
7
languages.  A few packages already provide translations for their
8
messages.
9
10
   If you found this `ABOUT-NLS' file inside a distribution, you may
11
assume that the distributed package does use GNU `gettext' internally,
12
itself available at your nearest GNU archive site.  But you do _not_
13
need to install GNU `gettext' prior to configuring, installing or using
14
this package with messages translated.
15
16
   Installers will find here some useful hints.  These notes also
17
explain how users should proceed for getting the programs to use the
18
available translations.  They tell how people wanting to contribute and
19
work on translations can contact the appropriate team.
20
21
   When reporting bugs in the `intl/' directory or bugs which may be
22
related to internationalization, you should tell about the version of
23
`gettext' which is used.  The information can be found in the
24
`intl/VERSION' file, in internationalized packages.
25
26
1.1 Quick configuration advice
27
==============================
28
29
If you want to exploit the full power of internationalization, you
30
should configure it using
31
32
     ./configure --with-included-gettext
33
34
to force usage of internationalizing routines provided within this
35
package, despite the existence of internationalizing capabilities in the
36
operating system where this package is being installed.  So far, only
37
the `gettext' implementation in the GNU C library version 2 provides as
38
many features (such as locale alias, message inheritance, automatic
39
charset conversion or plural form handling) as the implementation here.
40
It is also not possible to offer this additional functionality on top
41
of a `catgets' implementation.  Future versions of GNU `gettext' will
42
very likely convey even more functionality.  So it might be a good idea
43
to change to GNU `gettext' as soon as possible.
44
45
   So you need _not_ provide this option if you are using GNU libc 2 or
46
you have installed a recent copy of the GNU gettext package with the
47
included `libintl'.
48
49
1.2 INSTALL Matters
50
===================
51
52
Some packages are "localizable" when properly installed; the programs
53
they contain can be made to speak your own native language.  Most such
54
packages use GNU `gettext'.  Other packages have their own ways to
55
internationalization, predating GNU `gettext'.
56
57
   By default, this package will be installed to allow translation of
58
messages.  It will automatically detect whether the system already
59
provides the GNU `gettext' functions.  If not, the included GNU
60
`gettext' library will be used.  This library is wholly contained
61
within this package, usually in the `intl/' subdirectory, so prior
62
installation of the GNU `gettext' package is _not_ required.
63
Installers may use special options at configuration time for changing
64
the default behaviour.  The commands:
65
66
     ./configure --with-included-gettext
67
     ./configure --disable-nls
68
69
will, respectively, bypass any pre-existing `gettext' to use the
70
internationalizing routines provided within this package, or else,
71
_totally_ disable translation of messages.
72
73
   When you already have GNU `gettext' installed on your system and run
74
configure without an option for your new package, `configure' will
75
probably detect the previously built and installed `libintl.a' file and
76
will decide to use this.  This might not be desirable.  You should use
77
the more recent version of the GNU `gettext' library.  I.e. if the file
78
`intl/VERSION' shows that the library which comes with this package is
79
more recent, you should use
80
81
     ./configure --with-included-gettext
82
83
to prevent auto-detection.
84
85
   The configuration process will not test for the `catgets' function
86
and therefore it will not be used.  The reason is that even an
87
emulation of `gettext' on top of `catgets' could not provide all the
88
extensions of the GNU `gettext' library.
89
90
   Internationalized packages usually have many `po/LL.po' files, where
91
LL gives an ISO 639 two-letter code identifying the language.  Unless
92
translations have been forbidden at `configure' time by using the
93
`--disable-nls' switch, all available translations are installed
94
together with the package.  However, the environment variable `LINGUAS'
95
may be set, prior to configuration, to limit the installed set.
96
`LINGUAS' should then contain a space separated list of two-letter
97
codes, stating which languages are allowed.
98
99
1.3 Using This Package
100
======================
101
102
As a user, if your language has been installed for this package, you
103
only have to set the `LANG' environment variable to the appropriate
104
`LL_CC' combination.  Here `LL' is an ISO 639 two-letter language code,
105
and `CC' is an ISO 3166 two-letter country code.  For example, let's
106
suppose that you speak German and live in Germany.  At the shell
107
prompt, merely execute `setenv LANG de_DE' (in `csh'),
108
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
109
This can be done from your `.login' or `.profile' file, once and for
110
all.
111
112
   You might think that the country code specification is redundant.
113
But in fact, some languages have dialects in different countries.  For
114
example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
115
country code serves to distinguish the dialects.
116
117
   The locale naming convention of `LL_CC', with `LL' denoting the
118
language and `CC' denoting the country, is the one use on systems based
119
on GNU libc.  On other systems, some variations of this scheme are
120
used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
121
locales supported by your system for your language by running the
122
command `locale -a | grep '^LL''.
123
124
   Not all programs have translations for all languages.  By default, an
125
English message is shown in place of a nonexistent translation.  If you
126
understand other languages, you can set up a priority list of languages.
127
This is done through a different environment variable, called
128
`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
129
for the purpose of message handling, but you still need to have `LANG'
130
set to the primary language; this is required by other parts of the
131
system libraries.  For example, some Swedish users who would rather
132
read translations in German than English for when Swedish is not
133
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
134
135
   Special advice for Norwegian users: The language code for Norwegian
136
bokma*l changed from `no' to `nb' recently (in 2003).  During the
137
transition period, while some message catalogs for this language are
138
installed under `nb' and some older ones under `no', it's recommended
139
for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
140
older translations are used.
141
142
   In the `LANGUAGE' environment variable, but not in the `LANG'
143
environment variable, `LL_CC' combinations can be abbreviated as `LL'
144
to denote the language's main dialect.  For example, `de' is equivalent
145
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
146
(Portuguese as spoken in Portugal) in this context.
147
148
1.4 Translating Teams
149
=====================
150
151
For the Free Translation Project to be a success, we need interested
152
people who like their own language and write it well, and who are also
153
able to synergize with other translators speaking the same language.
154
Each translation team has its own mailing list.  The up-to-date list of
155
teams can be found at the Free Translation Project's homepage,
156
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
157
area.
158
159
   If you'd like to volunteer to _work_ at translating messages, you
160
should become a member of the translating team for your own language.
161
The subscribing address is _not_ the same as the list itself, it has
162
`-request' appended.  For example, speakers of Swedish can send a
163
message to `sv-request@li.org', having this message body:
164
165
     subscribe
166
167
   Keep in mind that team members are expected to participate
168
_actively_ in translations, or at solving translational difficulties,
169
rather than merely lurking around.  If your team does not exist yet and
170
you want to start one, or if you are unsure about what to do or how to
171
get started, please write to `translation@iro.umontreal.ca' to reach the
172
coordinator for all translator teams.
173
174
   The English team is special.  It works at improving and uniformizing
175
the terminology in use.  Proven linguistic skills are praised more than
176
programming skills, here.
177
178
1.5 Available Packages
179
======================
180
181
Languages are not equally supported in all packages.  The following
182
matrix shows the current state of internationalization, as of October
183
2006.  The matrix shows, in regard of each package, for which languages
184
PO files have been submitted to translation coordination, with a
185
translation percentage of at least 50%.
186
187
     Ready PO files       af am ar az be bg bs ca cs cy da de el en en_GB eo
188
                        +----------------------------------------------------+
189
     GNUnet             |                                  []                |
190
     a2ps               |             []                [] [] []     []      |
191
     aegis              |                                  ()                |
192
     ant-phone          |                                  ()                |
193
     anubis             |                                  []                |
194
     ap-utils           |                                                    |
195
     aspell             |                      [] []    [] []        []      |
196
     bash               |                      []          []             [] |
197
     batchelor          |                                  []                |
198
     bfd                |                                                    |
199
     bibshelf           |                                  []                |
200
     binutils           |                               []                   |
201
     bison              |                               [] []                |
202
     bison-runtime      |                                                    |
203
     bluez-pin          | []                      []       [] []          [] |
204
     cflow              |                               []                   |
205
     clisp              |                                  []    []          |
206
     console-tools      |                         []       []                |
207
     coreutils          |                []    []          []                |
208
     cpio               |                                                    |
209
     cpplib             |                      []       [] []                |
210
     cryptonit          |                                  []                |
211
     darkstat           |                []             () []                |
212
     dialog             |                      [] [] [] [] [] []             |
213
     diffutils          |                      [] []    [] [] []          [] |
214
     doodle             |                                  []                |
215
     e2fsprogs          |                         []       []                |
216
     enscript           |                      []       [] []        []      |
217
     error              |                      []       [] []        []      |
218
     fetchmail          |                      []       [] () []             |
219
     fileutils          |                               [] []                |
220
     findutils          |                []    []       []                   |
221
     flex               |                      []       [] []                |
222
     fslint             |                                  []                |
223
     gas                |                                                    |
224
     gawk               |                      []       [] []                |
225
     gbiff              |                                  []                |
226
     gcal               |                      []                            |
227
     gcc                |                                  []                |
228
     gettext-examples   | []                   []          [] []          [] |
229
     gettext-runtime    |             []       []       [] []             [] |
230
     gettext-tools      |                      []          []                |
231
     gimp-print         |                         []    [] []        []      |
232
     gip                |                []                                  |
233
     gliv               |                                  []                |
234
     glunarclock        |                []                                  |
235
     gmult              | []                               []                |
236
     gnubiff            |                                  ()                |
237
     gnucash            |                                  () ()     []      |
238
     gnucash-glossary   |                               [] ()                |
239
     gnuedu             |                                                    |
240
     gnulib             | []          [] []    []       [] []                |
241
     gnunet-gtk         |                                                    |
242
     gnutls             |                                                    |
243
     gpe-aerial         |                         []       []                |
244
     gpe-beam           |                         []       []                |
245
     gpe-calendar       |                                                    |
246
     gpe-clock          |                         []       []                |
247
     gpe-conf           |                         []       []                |
248
     gpe-contacts       |                                                    |
249
     gpe-edit           |                         []                         |
250
     gpe-filemanager    |                                                    |
251
     gpe-go             |                         []                         |
252
     gpe-login          |                         []       []                |
253
     gpe-ownerinfo      |                         []       []                |
254
     gpe-package        |                                                    |
255
     gpe-sketchbook     |                         []       []                |
256
     gpe-su             |                         []       []                |
257
     gpe-taskmanager    |                         []       []                |
258
     gpe-timesheet      |                         []                         |
259
     gpe-today          |                         []       []                |
260
     gpe-todo           |                                                    |
261
     gphoto2            |                         []    [] []        []      |
262
     gprof              |                               [] []                |
263
     gpsdrive           |                                  ()    ()          |
264
     gramadoir          | []                               []                |
265
     grep               | []          [] []    []          [] []             |
266
     gretl              |                                                    |
267
     gsasl              |                                                    |
268
     gss                |                                                    |
269
     gst-plugins        | []                   [] []    []                   |
270
     gst-plugins-base   |                []    []       []                   |
271
     gst-plugins-good   | []       []    []    [] []    []           []      |
272
     gstreamer          | []             []    [] []    [] []        []      |
273
     gtick              |                                  ()                |
274
     gtkam              |                         []    [] []                |
275
     gtkorphan          |                []                []                |
276
     gtkspell           |             []                   [] []          [] |
277
     gutenprint         |                               []                   |
278
     hello              |                []    []       [] []             [] |
279
     id-utils           |                               [] []                |
280
     impost             |                                                    |
281
     indent             |                      []          []             [] |
282
     iso_3166           |                                  []             [] |
283
     iso_3166_2         |                                                    |
284
     iso_4217           |                                  []                |
285
     iso_639            |                                  []             [] |
286
     jpilot             |                         []                         |
287
     jtag               |                                                    |
288
     jwhois             |                                                    |
289
     kbd                |                         []    [] [] []             |
290
     keytouch           |                                                    |
291
     keytouch-editor    |                                                    |
292
     keytouch-keyboa... |                                                    |
293
     latrine            |                                  ()                |
294
     ld                 |                               []                   |
295
     leafpad            |                []    [] []       [] []             |
296
     libc               |                      [] []    [] [] []             |
297
     libexif            |                                  []                |
298
     libextractor       |                                  []                |
299
     libgpewidget       |                         []    [] []                |
300
     libgpg-error       |                                  []                |
301
     libgphoto2         |                               [] []                |
302
     libgphoto2_port    |                               [] []                |
303
     libgsasl           |                                                    |
304
     libiconv           |                                  []             [] |
305
     libidn             |                               []                [] |
306
     lifelines          |                               [] ()                |
307
     lilypond           |                                  []                |
308
     lingoteach         |                                                    |
309
     lynx               |                      [] []    [] []                |
310
     m4                 |                         []    [] [] []             |
311
     mailutils          |                      []                            |
312
     make               |                               [] []                |
313
     man-db             |                      [] ()    [] []                |
314
     minicom            |                         []    [] []                |
315
     mysecretdiary      |                               [] []                |
316
     nano               |                []    []          []                |
317
     nano_1_0           |                      [] ()    [] []                |
318
     opcodes            |                                  []                |
319
     parted             |                                                    |
320
     pilot-qof          |                                            []      |
321
     psmisc             |                []                                  |
322
     pwdutils           |                                                    |
323
     python             |                                                    |
324
     qof                |                                                    |
325
     radius             |                      []                            |
326
     recode             |             []       []       [] [] []          [] |
327
     rpm                |                         []    []                   |
328
     screem             |                                                    |
329
     scrollkeeper       |          [] []       [] [] [] [] []        []      |
330
     sed                |                      []          []             [] |
331
     sh-utils           |                               [] []                |
332
     shared-mime-info   |                []       []                 []   [] |
333
     sharutils          |                []    [] []    [] [] []             |
334
     shishi             |                                                    |
335
     silky              |                                                    |
336
     skencil            |                               [] ()                |
337
     sketch             |                               [] ()                |
338
     solfege            |                                                    |
339
     soundtracker       |                               [] []                |
340
     sp                 |                                  []                |
341
     stardict           |                         []                         |
342
     system-tools-ba... |       []       [] [] [] []    [] [] []     []      |
343
     tar                |                []                                  |
344
     texinfo            |                               [] []             [] |
345
     textutils          |                      []       [] []                |
346
     tin                |                                  ()        ()      |
347
     tp-robot           |                                  []                |
348
     tuxpaint           | []             []             [] []        []      |
349
     unicode-han-tra... |                                                    |
350
     unicode-transla... |                                                    |
351
     util-linux         |                      [] []    [] []                |
352
     vorbis-tools       |             []          []    []           []      |
353
     wastesedge         |                                  ()                |
354
     wdiff              |                      []       [] []        []      |
355
     wget               |                      []          []                |
356
     xchat              |             [] []    []          [] []     []      |
357
     xkeyboard-config   |                                                    |
358
     xpad               |                []             []                   |
359
                        +----------------------------------------------------+
360
                          af am ar az be bg bs ca cs cy da de el en en_GB eo
361
                          10  0  1  2  9 22  1 42 41  2 60 95 16  1  17   16
362
363
                          es et eu fa fi fr  ga gl gu he hi hr hu id is it
364
                        +--------------------------------------------------+
365
     GNUnet             |                                                  |
366
     a2ps               |    []       [] []                             () |
367
     aegis              |                                                  |
368
     ant-phone          |                []                                |
369
     anubis             |                []                                |
370
     ap-utils           |             [] []                                |
371
     aspell             |                []  []                         [] |
372
     bash               | []             []                    []          |
373
     batchelor          |                []  []                            |
374
     bfd                | []                                               |
375
     bibshelf           | []                 []                         [] |
376
     binutils           | []          [] []                                |
377
     bison              | [] []          []  []                   []    [] |
378
     bison-runtime      |    []          []  []                   []    [] |
379
     bluez-pin          |             [] []  []                [] []       |
380
     cflow              |                    []                            |
381
     clisp              | []             []                                |
382
     console-tools      |                                                  |
383
     coreutils          | [] []       [] []  []                []          |
384
     cpio               | []             []  []                            |
385
     cpplib             | []             []                                |
386
     cryptonit          |                []                                |
387
     darkstat           | []             ()  []                [] []       |
388
     dialog             | [] [] []    [] []  []                []       [] |
389
     diffutils          | []          [] []  [] []    []       [] []    [] |
390
     doodle             |                    []                         [] |
391
     e2fsprogs          | []             []                             [] |
392
     enscript           |                []  []             []             |
393
     error              | []          [] []  []                []          |
394
     fetchmail          | []                                               |
395
     fileutils          | [] []          []  []                []       [] |
396
     findutils          |    []          []  []                []          |
397
     flex               | []             []  []                            |
398
     fslint             |                []                                |
399
     gas                | []             []                                |
400
     gawk               | []             []  []       []                   |
401
     gbiff              |                []                                |
402
     gcal               | []             []                                |
403
     gcc                | []                                               |
404
     gettext-examples   | []             []  []                [] []    [] |
405
     gettext-runtime    | []          [] []  []                   []    [] |
406
     gettext-tools      | []             []                             [] |
407
     gimp-print         | []             []                                |
408
     gip                | []    []       []                                |
409
     gliv               |                ()                                |
410
     glunarclock        |             []     []                []          |
411
     gmult              |       []       []                             [] |
412
     gnubiff            |                ()                             () |
413
     gnucash            | ()             ()                    ()          |
414
     gnucash-glossary   | []                                            [] |
415
     gnuedu             | []                                               |
416
     gnulib             | [] [] []    [] []  [] []             []          |
417
     gnunet-gtk         |                                                  |
418
     gnutls             |                                                  |
419
     gpe-aerial         | []             []                                |
420
     gpe-beam           | []             []                                |
421
     gpe-calendar       |                                                  |
422
     gpe-clock          | []          [] []                    []          |
423
     gpe-conf           |                []                                |
424
     gpe-contacts       | []             []                                |
425
     gpe-edit           | []             []                    [] []       |
426
     gpe-filemanager    | []                                               |
427
     gpe-go             | []             []                    []          |
428
     gpe-login          | []             []                    []          |
429
     gpe-ownerinfo      | []          [] []                    [] []       |
430
     gpe-package        | []                                               |
431
     gpe-sketchbook     | []             []                                |
432
     gpe-su             | []          [] []                    []          |
433
     gpe-taskmanager    | []          [] []                                |
434
     gpe-timesheet      | []             []  []                   []       |
435
     gpe-today          | []          [] []  []                            |
436
     gpe-todo           | []                                               |
437
     gphoto2            | []          [] []                    []       [] |
438
     gprof              | []             []  []                   []       |
439
     gpsdrive           | ()             ()                    []       () |
440
     gramadoir          |                []  []                            |
441
     grep               | [] [] []    [] []  [] []    []    [] [] []    [] |
442
     gretl              | []             []                             [] |
443
     gsasl              |                    []                   []       |
444
     gss                |                []                                |
445
     gst-plugins        |                []                    []       [] |
446
     gst-plugins-base   |                                      []       [] |
447
     gst-plugins-good   |       []                             []       [] |
448
     gstreamer          |             []                       []       [] |
449
     gtick              |                    []                            |
450
     gtkam              | []             []                    []       [] |
451
     gtkorphan          |                []                             [] |
452
     gtkspell           | []    []    [] []  []                         [] |
453
     gutenprint         |                                      []          |
454
     hello              | [] [] [] [] [] []  [] []    []    [] [] []    [] |
455
     id-utils           |                []  []                [] []    [] |
456
     impost             |                []  []                            |
457
     indent             | [] [] []    [] []  [] []             [] []    [] |
458
     iso_3166           |             [] []                    []          |
459
     iso_3166_2         |                []                                |
460
     iso_4217           |    []       []        []             []          |
461
     iso_639            |          [] [] []  []                []          |
462
     jpilot             | []             []                                |
463
     jtag               |                []                                |
464
     jwhois             | []             []                    [] []    [] |
465
     kbd                | []             []                                |
466
     keytouch           |                    []                            |
467
     keytouch-editor    |                    []                            |
468
     keytouch-keyboa... |                    []                            |
469
     latrine            |                []  []                         [] |
470
     ld                 | []             []                                |
471
     leafpad            | []             []  []       []       []       [] |
472
     libc               | []          [] []     []             []          |
473
     libexif            | []                                               |
474
     libextractor       |                    []                            |
475
     libgpewidget       | []             []  []                [] []       |
476
     libgpg-error       |                                                  |
477
     libgphoto2         | []             []                             [] |
478
     libgphoto2_port    |                []                             [] |
479
     libgsasl           |                []  []                            |
480
     libiconv           |    []              []                            |
481
     libidn             |                []                             [] |
482
     lifelines          |                ()                                |
483
     lilypond           |                []                                |
484
     lingoteach         |                []                       []    [] |
485
     lynx               |    []                                []       [] |
486
     m4                 |                []  [] []                []       |
487
     mailutils          | []             []                                |
488
     make               | []          [] []  [] []    []    []    []       |
489
     man-db             | ()                                               |
490
     minicom            | []          [] []                    []          |
491
     mysecretdiary      | []             []                       []       |
492
     nano               | []    []       []  []                []       [] |
493
     nano_1_0           | []             []     []                []    [] |
494
     opcodes            | []          [] []  []                            |
495
     parted             | []             []                       []    [] |
496
     pilot-qof          |                                                  |
497
     psmisc             |       []                             []       [] |
498
     pwdutils           |                                                  |
499
     python             |                                                  |
500
     qof                |                                         []       |
501
     radius             | []             []                                |
502
     recode             | []             []  [] []    []       [] []    [] |
503
     rpm                |                []                       []       |
504
     screem             |                                                  |
505
     scrollkeeper       | []          []                       []          |
506
     sed                | [] []          []  []                []          |
507
     sh-utils           | [] []       [] []  []                []       [] |
508
     shared-mime-info   | []    []    [] []                    []       [] |
509
     sharutils          | [] []       [] []  [] []             []       [] |
510
     shishi             |                                                  |
511
     silky              |                []                                |
512
     skencil            | []             []                                |
513
     sketch             | []             []                                |
514
     solfege            |                                               [] |
515
     soundtracker       | []             []                             [] |
516
     sp                 |                []                                |
517
     stardict           |                                      []          |
518
     system-tools-ba... | []    []    [] []                 [] [] []    [] |
519
     tar                | [] []       [] []  []                []       [] |
520
     texinfo            |                []           []                   |
521
     textutils          | []             []  [] []             []          |
522
     tin                |    []          ()                                |
523
     tp-robot           |             [] []  []                []          |
524
     tuxpaint           |                    []                []          |
525
     unicode-han-tra... |                                                  |
526
     unicode-transla... |                []  []                            |
527
     util-linux         | [] []       [] []                    [] []    [] |
528
     vorbis-tools       | []             []                                |
529
     wastesedge         |                ()                                |
530
     wdiff              | [] []          []  [] []             [] []    [] |
531
     wget               |    []       [] []  []             [] [] []    [] |
532
     xchat              | []    []    [] []        []    []    []       [] |
533
     xkeyboard-config   |             [] []                    []       [] |
534
     xpad               | []                 []                []          |
535
                        +--------------------------------------------------+
536
                          es et eu fa fi fr  ga gl gu he hi hr hu id is it
537
                          88 22 14  2 40 115 61 14  1  8  1  6 59 31  0 52
538
539
                          ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
540
                        +-------------------------------------------------+
541
     GNUnet             |                                                 |
542
     a2ps               |    ()                      []          []    () |
543
     aegis              |                                        ()       |
544
     ant-phone          |                                        []       |
545
     anubis             |                            []    []    []       |
546
     ap-utils           |                            []                   |
547
     aspell             |                         []             []       |
548
     bash               |                                        []       |
549
     batchelor          |                            []          []       |
550
     bfd                |                                                 |
551
     bibshelf           |                            []                   |
552
     binutils           |                                                 |
553
     bison              |                            []    []    []       |
554
     bison-runtime      |                            []    []    []       |
555
     bluez-pin          |       []                   []          []       |
556
     cflow              |                                                 |
557
     clisp              |                                        []       |
558
     console-tools      |                                                 |
559
     coreutils          |                                        []       |
560
     cpio               |                                                 |
561
     cpplib             |                                        []       |
562
     cryptonit          |                                        []       |
563
     darkstat           |                            []          []       |
564
     dialog             |                            []          []       |
565
     diffutils          | []                         []          []       |
566
     doodle             |                                                 |
567
     e2fsprogs          |                                        []       |
568
     enscript           |                                        []       |
569
     error              |                                        []       |
570
     fetchmail          | []                                     []       |
571
     fileutils          | []          []                                  |
572
     findutils          |                                        []       |
573
     flex               |    []                                  []       |
574
     fslint             |                            []          []       |
575
     gas                |                                                 |
576
     gawk               | []                                     []       |
577
     gbiff              |                                        []       |
578
     gcal               |                                                 |
579
     gcc                |                                                 |
580
     gettext-examples   | []                                     []       |
581
     gettext-runtime    | [] []                                  []       |
582
     gettext-tools      | [] []                                           |
583
     gimp-print         | []                                     []       |
584
     gip                |                            []          []       |
585
     gliv               |                                        []       |
586
     glunarclock        |                            []          []       |
587
     gmult              | []                         []                   |
588
     gnubiff            |                                                 |
589
     gnucash            | ()                               ()             |
590
     gnucash-glossary   |                                        []       |
591
     gnuedu             |                                                 |
592
     gnulib             | [] []                      []          []       |
593
     gnunet-gtk         |                                                 |
594
     gnutls             |                                                 |
595
     gpe-aerial         |                                        []       |
596
     gpe-beam           |                                        []       |
597
     gpe-calendar       | []                                              |
598
     gpe-clock          | [] []                                  []       |
599
     gpe-conf           |    []                                  []       |
600
     gpe-contacts       |    []                                           |
601
     gpe-edit           | [] []                                  []       |
602
     gpe-filemanager    | [] []                                           |
603
     gpe-go             | [] []                                  []       |
604
     gpe-login          | [] []                                  []       |
605
     gpe-ownerinfo      | []                                     []       |
606
     gpe-package        | [] []                                           |
607
     gpe-sketchbook     |    []                                  []       |
608
     gpe-su             | [] []                                  []       |
609
     gpe-taskmanager    | [] [] []                               []       |
610
     gpe-timesheet      |                                        []       |
611
     gpe-today          | []                                     []       |
612
     gpe-todo           | []                                              |
613
     gphoto2            | []                                     []       |
614
     gprof              |                                                 |
615
     gpsdrive           | ()                                     ()    () |
616
     gramadoir          |                                        ()       |
617
     grep               | []       []                      []    []       |
618
     gretl              |                                                 |
619
     gsasl              |                                        []       |
620
     gss                |                                                 |
621
     gst-plugins        |                                        []       |
622
     gst-plugins-base   |                                                 |
623
     gst-plugins-good   |                                        []       |
624
     gstreamer          |                                        []       |
625
     gtick              |                                                 |
626
     gtkam              | []                                              |
627
     gtkorphan          |                                        []       |
628
     gtkspell           |                         []             []       |
629
     gutenprint         |                                                 |
630
     hello              | [] []                      []    []    [] []    |
631
     id-utils           |                                        []       |
632
     impost             |                                                 |
633
     indent             | []                                     []       |
634
     iso_3166           |                                        []       |
635
     iso_3166_2         |                                        []       |
636
     iso_4217           | []                      []             []       |
637
     iso_639            | []                                     []       |
638
     jpilot             | ()                                     ()    () |
639
     jtag               |                                                 |
640
     jwhois             |                                        []       |
641
     kbd                |                                        []       |
642
     keytouch           |                                        []       |
643
     keytouch-editor    |                                                 |
644
     keytouch-keyboa... |                                                 |
645
     latrine            |                                        []       |
646
     ld                 |                                                 |
647
     leafpad            | []             []                               |
648
     libc               | [] []                            []    []    [] |
649
     libexif            |                                                 |
650
     libextractor       |                                                 |
651
     libgpewidget       |                                        []       |
652
     libgpg-error       |                                                 |
653
     libgphoto2         | []                                              |
654
     libgphoto2_port    | []                                              |
655
     libgsasl           |                                        []       |
656
     libiconv           |                                                 |
657
     libidn             | []                                     []       |
658
     lifelines          |                                        []       |
659
     lilypond           |                                                 |
660
     lingoteach         |                                        []       |
661
     lynx               | []                                     []       |
662
     m4                 | []                                     []       |
663
     mailutils          |                                                 |
664
     make               | [] []                                  []       |
665
     man-db             | ()                                              |
666
     minicom            | []                                              |
667
     mysecretdiary      |                                        []       |
668
     nano               |                            []    []    []       |
669
     nano_1_0           |                            []    []       []    |
670
     opcodes            |                                        []       |
671
     parted             | []                                     []       |
672
     pilot-qof          |                                                 |
673
     psmisc             | []                               []    []       |
674
     pwdutils           |                                                 |
675
     python             |                                                 |
676
     qof                |                                                 |
677
     radius             |                                                 |
678
     recode             |                                        []       |
679
     rpm                | [] []                                           |
680
     screem             | []                                              |
681
     scrollkeeper       |                                  [] [] [] []    |
682
     sed                | []                                     []       |
683
     sh-utils           | []                               []             |
684
     shared-mime-info   |    []          []                []    [] []    |
685
     sharutils          | []                                     []       |
686
     shishi             |                                                 |
687
     silky              |                                        []       |
688
     skencil            |                                                 |
689
     sketch             |                                                 |
690
     solfege            |                                                 |
691
     soundtracker       |                                                 |
692
     sp                 | ()                                              |
693
     stardict           |                      []                []       |
694
     system-tools-ba... | [] []          []                      []       |
695
     tar                | []       []                            []       |
696
     texinfo            | []                               []    []       |
697
     textutils          | [] []                            []             |
698
     tin                |                                                 |
699
     tp-robot           |                                        []       |
700
     tuxpaint           |                                           []    |
701
     unicode-han-tra... |                                                 |
702
     unicode-transla... |                                                 |
703
     util-linux         | []                                     []       |
704
     vorbis-tools       |                                        []       |
705
     wastesedge         |                                        []       |
706
     wdiff              |                            []    []             |
707
     wget               | []                                     []       |
708
     xchat              | [] []                []                []       |
709
     xkeyboard-config   |                                        []       |
710
     xpad               |    []                      []          []       |
711
                        +-------------------------------------------------+
712
                          ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
713
                          52 24  2  2  1  3  0  2  3 21  0 15  1 97  5  1
714
715
                          nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv  ta
716
                        +------------------------------------------------------+
717
     GNUnet             |                                                      |
718
     a2ps               |           ()     []      [] []       []    [] []     |
719
     aegis              |                          () ()                       |
720
     ant-phone          |                          []                   []     |
721
     anubis             |           []             [] []                       |
722
     ap-utils           |           ()                                         |
723
     aspell             |                          [] []                       |
724
     bash               |                  []      [] []                       |
725
     batchelor          |                          []                   []     |
726
     bfd                |                                                      |
727
     bibshelf           |                                               []     |
728
     binutils           |                             []                []     |
729
     bison              |           []     []      [] []                []     |
730
     bison-runtime      |           []             []          []       []     |
731
     bluez-pin          |           []     []   [] [] []    [] []    [] []     |
732
     cflow              |           []                                         |
733
     clisp              |                             []                       |
734
     console-tools      |                             []                       |
735
     coreutils          |           []                []       []       []     |
736
     cpio               |           []                []                []     |
737
     cpplib             |                                               []     |
738
     cryptonit          |                  []                           []     |
739
     darkstat           |           []     []      []       []       [] []     |
740
     dialog             |           [] []  []   [] [] [] []          [] []     |
741
     diffutils          |           []     []      [] []             [] []     |
742
     doodle             |                                         []    []     |
743
     e2fsprogs          |           []                                  []     |
744
     enscript           |                  []      [] []       []       []     |
745
     error              |                  []      []       []          []     |
746
     fetchmail          |           []                []          []           |
747
     fileutils          |           []             [] []       []       []     |
748
     findutils          |           [] []          []       [] []       []     |
749
     flex               |           []     []      [] []                []     |
750
     fslint             |                  []      []                [] []     |
751
     gas                |                                                      |
752
     gawk               |           []     []      []                   []     |
753
     gbiff              |                          []                          |
754
     gcal               |                                               []     |
755
     gcc                |                                               []     |
756
     gettext-examples   |           [] []          [] []    [] []    [] []     |
757
     gettext-runtime    |           [] []          [] []    [] []    [] []     |
758
     gettext-tools      |           []             [] []    [] []    [] []     |
759
     gimp-print         |                                   []          []     |
760
     gip                |                       []          []       [] []     |
761
     gliv               |                  []      []       []          []     |
762
     glunarclock        |                  []      [] []    []       [] []     |
763
     gmult              |                       [] []                [] []     |
764
     gnubiff            |                          ()                          |
765
     gnucash            |           ()                                  []     |
766
     gnucash-glossary   |              []                   []          []     |
767
     gnuedu             |                                                      |
768
     gnulib             |           []             [] []       []       []     |
769
     gnunet-gtk         |                                               []     |
770
     gnutls             |           []                                  []     |
771
     gpe-aerial         |              []  []      [] []       []    [] []     |
772
     gpe-beam           |              []  []      [] []       []    [] []     |
773
     gpe-calendar       |                             []                       |
774
     gpe-clock          |              []  []      [] []    [] []    [] []     |
775
     gpe-conf           |              []  []      [] []    [] []       []     |
776
     gpe-contacts       |                          [] []       []    [] []     |
777
     gpe-edit           |              []  []      [] []    [] []    [] []     |
778
     gpe-filemanager    |                                      []       []     |
779
     gpe-go             |                  []      [] []       []    [] []     |
780
     gpe-login          |              []  []      [] []    [] []    [] []     |
781
     gpe-ownerinfo      |              []  []      [] []    [] []    [] []     |
782
     gpe-package        |                                      []       []     |
783
     gpe-sketchbook     |              []  []      [] []    [] []    [] []     |
784
     gpe-su             |              []  []      [] []    [] []    [] []     |
785
     gpe-taskmanager    |              []  []      [] []    [] []    [] []     |
786
     gpe-timesheet      |              []  []      [] []    [] []    [] []     |
787
     gpe-today          |              []  []      [] []    [] []    [] []     |
788
     gpe-todo           |                             []       []    [] []     |
789
     gphoto2            |           []             []       []       [] []     |
790
     gprof              |                  []      []                   []     |
791
     gpsdrive           |        []                []                   []     |
792
     gramadoir          |                                   []          []     |
793
     grep               |           [] []  []      [] []       []    [] []     |
794
     gretl              |           []                                         |
795
     gsasl              |           []                               [] []     |
796
     gss                |           []             []                   []     |
797
     gst-plugins        |     []                                  [] [] []     |
798
     gst-plugins-base   |                                               []     |
799
     gst-plugins-good   |     []                                  [] [] []     |
800
     gstreamer          |                                         [] [] []     |
801
     gtick              |                             []                       |
802
     gtkam              |           []     []         []                []     |
803
     gtkorphan          |                                               []     |
804
     gtkspell           |                  []   [] [] []    [] []    [] []     |
805
     gutenprint         |                                               []     |
806
     hello              |           []     []      [] []    [] []    [] []     |
807
     id-utils           |                  []      [] []                []     |
808
     impost             |                                               []     |
809
     indent             |                  []      [] []    []       [] []     |
810
     iso_3166           |              []                []    [] [] [] []     |
811
     iso_3166_2         |                                                      |
812
     iso_4217           |                                []    []    [] []     |
813
     iso_639            |                                []    []    [] []     |
814
     jpilot             |                                                      |
815
     jtag               |                                   []                 |
816
     jwhois             |           []     []      []                   []     |
817
     kbd                |           []             []                   []     |
818
     keytouch           |                                               []     |
819
     keytouch-editor    |                                               []     |
820
     keytouch-keyboa... |                                               []     |
821
     latrine            |                          []                   []     |
822
     ld                 |                                               []     |
823
     leafpad            |           [] []             []    []          []  [] |
824
     libc               |           []     []         []    []          []     |
825
     libexif            |           []                                         |
826
     libextractor       |                          []                   []     |
827
     libgpewidget       |              []  []      []       [] []    [] []     |
828
     libgpg-error       |           []             []                          |
829
     libgphoto2         |           []                                         |
830
     libgphoto2_port    |           []                []                []     |
831
     libgsasl           |           []             []                [] []     |
832
     libiconv           |                                      []    []        |
833
     libidn             |           []                               [] ()     |
834
     lifelines          |           []                                  []     |
835
     lilypond           |                                                      |
836
     lingoteach         |                  []                                  |
837
     lynx               |                  []         []                []     |
838
     m4                 |           []     []      [] []                []     |
839
     mailutils          |           []             [] []                []     |
840
     make               |           []     []         []                []     |
841
     man-db             |                          []                   []     |
842
     minicom            |           []     []      [] []                []     |
843
     mysecretdiary      |                  []      [] []                []     |
844
     nano               |                  []      []                   []     |
845
     nano_1_0           |           []             [] []                []     |
846
     opcodes            |                          []                   []     |
847
     parted             |           []                                         |
848
     pilot-qof          |                                               []     |
849
     psmisc             |           []                                  []     |
850
     pwdutils           |           []                                  []     |
851
     python             |                                                      |
852
     qof                |                  []                           []     |
853
     radius             |           []                []                       |
854
     recode             |           [] []  []      [] []       []       []     |
855
     rpm                |           [] []             []                []     |
856
     screem             |                                                      |
857
     scrollkeeper       |           []             [] []    []    [] [] []     |
858
     sed                |           [] []  []      [] []    [] []    [] []     |
859
     sh-utils           |                             []       []    []        |
860
     shared-mime-info   |              []  []                     [] [] []     |
861
     sharutils          |           []                []             [] []     |
862
     shishi             |           []                                         |
863
     silky              |                                   []                 |
864
     skencil            |              []  []                           []     |
865
     sketch             |              []  []                           []     |
866
     solfege            |                                               []     |
867
     soundtracker       |                                   []          []     |
868
     sp                 |                                                      |
869
     stardict           |                             []    []          []     |
870
     system-tools-ba... |        [] [] []  []      []             [] [] []  [] |
871
     tar                |           []             [] []       []       []     |
872
     texinfo            |           []             [] []                []     |
873
     textutils          |                             []       []       []     |
874
     tin                |                             ()                       |
875
     tp-robot           |                             []                       |
876
     tuxpaint           |              []                      [] [] [] []     |
877
     unicode-han-tra... |                                                      |
878
     unicode-transla... |                                                      |
879
     util-linux         |                  []         []       []       []     |
880
     vorbis-tools       |                          [] []                       |
881
     wastesedge         |                                                      |
882
     wdiff              |           []     []      [] []    []          []     |
883
     wget               |              []             []    []          []     |
884
     xchat              |        []                   []    [] [] [] [] []     |
885
     xkeyboard-config   |                                      []       []     |
886
     xpad               |                                   [] []       []     |
887
                        +------------------------------------------------------+
888
                          nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv  ta
889
                           0   2  3 58 30  54    5 73 72  4 40 46 11 50 128  2
890
891
                          tg th tk tr uk ven vi  wa xh zh_CN zh_HK zh_TW zu
892
                        +---------------------------------------------------+
893
     GNUnet             |                    []                             |  2
894
     a2ps               |          [] []     []                             | 19
895
     aegis              |                                                   |  0
896
     ant-phone          |          []        []                             |  6
897
     anubis             |          [] []     []                             | 11
898
     ap-utils           |             ()     []                             |  4
899
     aspell             |             []     []  []                         | 15
900
     bash               |                    []                             | 11
901
     batchelor          |          []        []                             |  9
902
     bfd                |                                                   |  1
903
     bibshelf           |                    []                             |  7
904
     binutils           |          []        []                     []      |  9
905
     bison              |          []        []                     []      | 19
906
     bison-runtime      |                    []         []          []      | 15
907
     bluez-pin          |          [] []     []  []     []          []      | 28
908
     cflow              |             []     []                             |  5
909
     clisp              |                                                   |  6
910
     console-tools      |          []        []                             |  5
911
     coreutils          |          []        []                             | 16
912
     cpio               |          [] []     []                             |  9
913
     cpplib             |          []        []         []          []      | 11
914
     cryptonit          |                                                   |  5
915
     darkstat           |                    []         ()          ()      | 15
916
     dialog             |          [] []     []         []          []      | 30
917
     diffutils          |          []        []         []          []      | 28
918
     doodle             |                    []                             |  6
919
     e2fsprogs          |          []        []                             | 10
920
     enscript           |          [] []     []                             | 16
921
     error              |          []        []         []          []      | 18
922
     fetchmail          |          []        []                             | 12
923
     fileutils          |          []                   []          []      | 18
924
     findutils          |          []        []                     []      | 17
925
     flex               |          []        []                             | 15
926
     fslint             |                    []                             |  9
927
     gas                |          []                                       |  3
928
     gawk               |          []        []                             | 15
929
     gbiff              |                    []                             |  5
930
     gcal               |          []                                       |  5
931
     gcc                |          []                   []          []      |  6
932
     gettext-examples   |          [] []     []         []    []    []      | 27
933
     gettext-runtime    |          [] []     []         []    []    []      | 28
934
     gettext-tools      |          [] []     []         []          []      | 19
935
     gimp-print         |             []     []                             | 12
936
     gip                |                    []                     []      | 12
937
     gliv               |          []        []                             |  8
938
     glunarclock        |                    []  []                 []      | 15
939
     gmult              |          []        []         []          []      | 15
940
     gnubiff            |                    []                             |  1
941
     gnucash            |          ()                                       |  2
942
     gnucash-glossary   |                    []                     []      |  9
943
     gnuedu             |                    []                             |  2
944
     gnulib             |          [] []     []         []          []      | 28
945
     gnunet-gtk         |                                                   |  1
946
     gnutls             |                                                   |  2
947
     gpe-aerial         |                    []         []                  | 14
948
     gpe-beam           |                    []         []                  | 14
949
     gpe-calendar       |                    []                             |  3
950
     gpe-clock          |          []        []  []     []                  | 21
951
     gpe-conf           |                    []         []                  | 14
952
     gpe-contacts       |                    []         []                  | 10
953
     gpe-edit           |          []        []  []                 []      | 20
954
     gpe-filemanager    |                    []                             |  6
955
     gpe-go             |          []        []                             | 15
956
     gpe-login          |          []        []  []     []          []      | 21
957
     gpe-ownerinfo      |          []        []         []          []      | 21
958
     gpe-package        |                    []                             |  6
959
     gpe-sketchbook     |          []        []                             | 16
960
     gpe-su             |          []        []         []                  | 20
961
     gpe-taskmanager    |          []        []         []                  | 20
962
     gpe-timesheet      |          []        []         []          []      | 18
963
     gpe-today          |          []        []  []     []          []      | 21
964
     gpe-todo           |                    []                             |  7
965
     gphoto2            |             []     []         []          []      | 20
966
     gprof              |          []        []                             | 11
967
     gpsdrive           |                                                   |  4
968
     gramadoir          |                    []                             |  7
969
     grep               |          [] []     []                     []      | 34
970
     gretl              |                                                   |  4
971
     gsasl              |                    []         []                  |  8
972
     gss                |                    []                             |  5
973
     gst-plugins        |             []     []                     []      | 15
974
     gst-plugins-base   |             []     []         []                  |  9
975
     gst-plugins-good   |             []     []         []    []    []      | 20
976
     gstreamer          |          [] []     []                             | 17
977
     gtick              |                    []                             |  3
978
     gtkam              |                    []                             | 13
979
     gtkorphan          |                    []                             |  7
980
     gtkspell           |             []     []  []     []    []    []      | 26
981
     gutenprint         |                                                   |  3
982
     hello              |          [] []     []         []          []      | 37
983
     id-utils           |          []        []                             | 14
984
     impost             |                    []                             |  4
985
     indent             |          []        []         []          []      | 25
986
     iso_3166           |       [] []        []               []            | 16
987
     iso_3166_2         |                                                   |  2
988
     iso_4217           |          []        []                             | 14
989
     iso_639            |                    []                             | 14
990
     jpilot             |          [] []     []         []                  |  7
991
     jtag               |                    []                             |  3
992
     jwhois             |          []        []                     []      | 13
993
     kbd                |          []        []                             | 12
994
     keytouch           |                    []                             |  4
995
     keytouch-editor    |                                                   |  2
996
     keytouch-keyboa... |                    []                             |  3
997
     latrine            |          []        []                             |  8
998
     ld                 |          []        []         []          []      |  8
999
     leafpad            |          []        []         []          []      | 23
1000
     libc               |          []                   []          []      | 23
1001
     libexif            |                    []                             |  4
1002
     libextractor       |                    []                             |  5
1003
     libgpewidget       |                    []  []     []                  | 19
1004
     libgpg-error       |                    []                             |  4
1005
     libgphoto2         |             []                                    |  8
1006
     libgphoto2_port    |             []     []                     []      | 11
1007
     libgsasl           |                    []                             |  8
1008
     libiconv           |                    []                             |  7
1009
     libidn             |                    []         []                  | 10
1010
     lifelines          |                                                   |  4
1011
     lilypond           |                                                   |  2
1012
     lingoteach         |                    []                             |  6
1013
     lynx               |          [] []     []                             | 15
1014
     m4                 |                    []         []          []      | 18
1015
     mailutils          |             []                                    |  8
1016
     make               |          []        []         []                  | 20
1017
     man-db             |                    []                             |  6
1018
     minicom            |                    []                             | 14
1019
     mysecretdiary      |          []        []                             | 12
1020
     nano               |                    []                     []      | 17
1021
     nano_1_0           |          [] []     []                             | 18
1022
     opcodes            |          []        []                             | 10
1023
     parted             |          [] []                            []      | 10
1024
     pilot-qof          |                    []                             |  3
1025
     psmisc             |                    []                             | 10
1026
     pwdutils           |                    []                             |  3
1027
     python             |                                                   |  0
1028
     qof                |                    []                             |  4
1029
     radius             |             []                                    |  6
1030
     recode             |          []        []         []                  | 25
1031
     rpm                |          [] []     []                     []      | 14
1032
     screem             |                    []                             |  2
1033
     scrollkeeper       |          [] []     []                     []      | 26
1034
     sed                |          []        []                     []      | 22
1035
     sh-utils           |          []                                       | 15
1036
     shared-mime-info   |             []     []         []          []      | 24
1037
     sharutils          |          []        []                     []      | 23
1038
     shishi             |                                                   |  1
1039
     silky              |                    []                             |  4
1040
     skencil            |                    []                             |  7
1041
     sketch             |                                                   |  6
1042
     solfege            |                                                   |  2
1043
     soundtracker       |          []        []                             |  9
1044
     sp                 |          []                                       |  3
1045
     stardict           |             []     []         []          []      | 11
1046
     system-tools-ba... |    []    [] []     []     []  []          []      | 37
1047
     tar                |          [] []     []                     []      | 20
1048
     texinfo            |          []        []         []                  | 15
1049
     textutils          |          []                   []          []      | 17
1050
     tin                |                                                   |  1
1051
     tp-robot           |                    []         []          []      | 10
1052
     tuxpaint           |                    []  []                 []      | 16
1053
     unicode-han-tra... |                                                   |  0
1054
     unicode-transla... |                                                   |  2
1055
     util-linux         |          [] []     []                             | 20
1056
     vorbis-tools       |             []     []                             | 11
1057
     wastesedge         |                                                   |  1
1058
     wdiff              |          []        []                             | 22
1059
     wget               |          []        []                     []      | 19
1060
     xchat              |             []     []         []          []      | 29
1061
     xkeyboard-config   |          [] []     []                     []      | 11
1062
     xpad               |                    []         []          []      | 14
1063
                        +---------------------------------------------------+
1064
       77 teams           tg th tk tr uk ven vi  wa xh zh_CN zh_HK zh_TW zu
1065
      170 domains          0  1  1 77 39  0  136 10  1  48     5    54    0  2028
1066
1067
   Some counters in the preceding matrix are higher than the number of
1068
visible blocks let us expect.  This is because a few extra PO files are
1069
used for implementing regional variants of languages, or language
1070
dialects.
1071
1072
   For a PO file in the matrix above to be effective, the package to
1073
which it applies should also have been internationalized and
1074
distributed as such by its maintainer.  There might be an observable
1075
lag between the mere existence a PO file and its wide availability in a
1076
distribution.
1077
1078
   If October 2006 seems to be old, you may fetch a more recent copy of
1079
this `ABOUT-NLS' file on most GNU archive sites.  The most up-to-date
1080
matrix with full percentage details can be found at
1081
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
1082
1083
1.6 Using `gettext' in new packages
1084
===================================
1085
1086
If you are writing a freely available program and want to
1087
internationalize it you are welcome to use GNU `gettext' in your
1088
package.  Of course you have to respect the GNU Library General Public
1089
License which covers the use of the GNU `gettext' library.  This means
1090
in particular that even non-free programs can use `libintl' as a shared
1091
library, whereas only free software can use `libintl' as a static
1092
library or use modified versions of `libintl'.
1093
1094
   Once the sources are changed appropriately and the setup can handle
1095
the use of `gettext' the only thing missing are the translations.  The
1096
Free Translation Project is also available for packages which are not
1097
developed inside the GNU project.  Therefore the information given above
1098
applies also for every other Free Software Project.  Contact
1099
`translation@iro.umontreal.ca' to make the `.pot' files available to
1100
the translation teams.
1101
(-)a/ChangeLog (+16 lines)
Lines 1-3 Link Here
1
2020-10-12  gettextize  <bug-gnu-gettext@gnu.org>
2
3
	* m4/gettext.m4: Upgrade to gettext-0.21.
4
	* m4/host-cpu-c-abi.m4: New file, from gettext-0.21.
5
	* m4/iconv.m4: Upgrade to gettext-0.21.
6
	* m4/intlmacosx.m4: New file, from gettext-0.21.
7
	* m4/lib-ld.m4: Upgrade to gettext-0.21.
8
	* m4/lib-link.m4: Upgrade to gettext-0.21.
9
	* m4/lib-prefix.m4: Upgrade to gettext-0.21.
10
	* m4/nls.m4: Upgrade to gettext-0.21.
11
	* m4/po.m4: Upgrade to gettext-0.21.
12
	* m4/progtest.m4: Upgrade to gettext-0.21.
13
	* Makefile.am (SUBDIRS): Remove intl.
14
	* configure.ac (AC_OUTPUT): Remove intl/Makefile.
15
	(AM_GNU_GETTEXT_VERSION): Bump to 0.21.
16
1
2011-03-13 12:16  sg2
17
2011-03-13 12:16  sg2
2
18
3
	* libmpfc/id3.c, plugins/input/audiocd/cddb.c,
19
	* libmpfc/id3.c, plugins/input/audiocd/cddb.c,
(-)a/Makefile.am (-1 / +1 lines)
Lines 1-4 Link Here
1
SUBDIRS = doc intl po libmpfc libmpfcwnd src plugins 
1
SUBDIRS = doc po libmpfc libmpfcwnd src plugins 
2
2
3
ACLOCAL_AMFLAGS = -I m4
3
ACLOCAL_AMFLAGS = -I m4
4
4
(-)a/config.rpath (-80 / +150 lines)
Lines 2-8 Link Here
2
# Output a system dependent set of variables, describing how to set the
2
# Output a system dependent set of variables, describing how to set the
3
# run time search path of shared libraries in an executable.
3
# run time search path of shared libraries in an executable.
4
#
4
#
5
#   Copyright 1996-2006 Free Software Foundation, Inc.
5
#   Copyright 1996-2020 Free Software Foundation, Inc.
6
#   Taken from GNU libtool, 2001
6
#   Taken from GNU libtool, 2001
7
#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8
#
8
#
Lines 25-31 Link Here
25
#   known workaround is to choose shorter directory names for the build
25
#   known workaround is to choose shorter directory names for the build
26
#   directory and/or the installation directory.
26
#   directory and/or the installation directory.
27
27
28
# All known linkers require a `.a' archive for static linking (except MSVC,
28
# All known linkers require a '.a' archive for static linking (except MSVC,
29
# which needs '.lib').
29
# which needs '.lib').
30
libext=a
30
libext=a
31
shrext=.so
31
shrext=.so
Lines 47-53 for cc_temp in $CC""; do Link Here
47
done
47
done
48
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
48
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
49
49
50
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
50
# Code taken from libtool.m4's _LT_COMPILER_PIC.
51
51
52
wl=
52
wl=
53
if test "$GCC" = yes; then
53
if test "$GCC" = yes; then
Lines 57-70 else Link Here
57
    aix*)
57
    aix*)
58
      wl='-Wl,'
58
      wl='-Wl,'
59
      ;;
59
      ;;
60
    darwin*)
60
    mingw* | cygwin* | pw32* | os2* | cegcc*)
61
      case $cc_basename in
62
        xlc*)
63
          wl='-Wl,'
64
          ;;
65
      esac
66
      ;;
67
    mingw* | pw32* | os2*)
68
      ;;
61
      ;;
69
    hpux9* | hpux10* | hpux11*)
62
    hpux9* | hpux10* | hpux11*)
70
      wl='-Wl,'
63
      wl='-Wl,'
Lines 72-95 else Link Here
72
    irix5* | irix6* | nonstopux*)
65
    irix5* | irix6* | nonstopux*)
73
      wl='-Wl,'
66
      wl='-Wl,'
74
      ;;
67
      ;;
75
    newsos6)
68
    linux* | k*bsd*-gnu | kopensolaris*-gnu)
76
      ;;
77
    linux*)
78
      case $cc_basename in
69
      case $cc_basename in
79
        icc* | ecc*)
70
        ecc*)
71
          wl='-Wl,'
72
          ;;
73
        icc* | ifort*)
80
          wl='-Wl,'
74
          wl='-Wl,'
81
          ;;
75
          ;;
82
        pgcc | pgf77 | pgf90)
76
        lf95*)
77
          wl='-Wl,'
78
          ;;
79
        nagfor*)
80
          wl='-Wl,-Wl,,'
81
          ;;
82
        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
83
          wl='-Wl,'
83
          wl='-Wl,'
84
          ;;
84
          ;;
85
        ccc*)
85
        ccc*)
86
          wl='-Wl,'
86
          wl='-Wl,'
87
          ;;
87
          ;;
88
        xl* | bgxl* | bgf* | mpixl*)
89
          wl='-Wl,'
90
          ;;
88
        como)
91
        como)
89
          wl='-lopt='
92
          wl='-lopt='
90
          ;;
93
          ;;
91
        *)
94
        *)
92
          case `$CC -V 2>&1 | sed 5q` in
95
          case `$CC -V 2>&1 | sed 5q` in
96
            *Sun\ F* | *Sun*Fortran*)
97
              wl=
98
              ;;
93
            *Sun\ C*)
99
            *Sun\ C*)
94
              wl='-Wl,'
100
              wl='-Wl,'
95
              ;;
101
              ;;
Lines 97-118 else Link Here
97
          ;;
103
          ;;
98
      esac
104
      esac
99
      ;;
105
      ;;
106
    newsos6)
107
      ;;
108
    *nto* | *qnx*)
109
      ;;
100
    osf3* | osf4* | osf5*)
110
    osf3* | osf4* | osf5*)
101
      wl='-Wl,'
111
      wl='-Wl,'
102
      ;;
112
      ;;
103
    sco3.2v5*)
113
    rdos*)
104
      ;;
114
      ;;
105
    solaris*)
115
    solaris*)
106
      wl='-Wl,'
116
      case $cc_basename in
117
        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
118
          wl='-Qoption ld '
119
          ;;
120
        *)
121
          wl='-Wl,'
122
          ;;
123
      esac
107
      ;;
124
      ;;
108
    sunos4*)
125
    sunos4*)
109
      wl='-Qoption ld '
126
      wl='-Qoption ld '
110
      ;;
127
      ;;
111
    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
128
    sysv4 | sysv4.2uw2* | sysv4.3*)
112
      wl='-Wl,'
129
      wl='-Wl,'
113
      ;;
130
      ;;
114
    sysv4*MP*)
131
    sysv4*MP*)
115
      ;;
132
      ;;
133
    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
134
      wl='-Wl,'
135
      ;;
116
    unicos*)
136
    unicos*)
117
      wl='-Wl,'
137
      wl='-Wl,'
118
      ;;
138
      ;;
Lines 121-127 else Link Here
121
  esac
141
  esac
122
fi
142
fi
123
143
124
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
144
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
125
145
126
hardcode_libdir_flag_spec=
146
hardcode_libdir_flag_spec=
127
hardcode_libdir_separator=
147
hardcode_libdir_separator=
Lines 129-135 hardcode_direct=no Link Here
129
hardcode_minus_L=no
149
hardcode_minus_L=no
130
150
131
case "$host_os" in
151
case "$host_os" in
132
  cygwin* | mingw* | pw32*)
152
  cygwin* | mingw* | pw32* | cegcc*)
133
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
153
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
134
    # When not using gcc, we currently assume that we are using
154
    # When not using gcc, we currently assume that we are using
135
    # Microsoft Visual C++.
155
    # Microsoft Visual C++.
Lines 155-176 if test "$with_gnu_ld" = yes; then Link Here
155
  # option of GNU ld is called -rpath, not --rpath.
175
  # option of GNU ld is called -rpath, not --rpath.
156
  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
176
  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
157
  case "$host_os" in
177
  case "$host_os" in
158
    aix3* | aix4* | aix5*)
178
    aix[3-9]*)
159
      # On AIX/PPC, the GNU linker is very broken
179
      # On AIX/PPC, the GNU linker is very broken
160
      if test "$host_cpu" != ia64; then
180
      if test "$host_cpu" != ia64; then
161
        ld_shlibs=no
181
        ld_shlibs=no
162
      fi
182
      fi
163
      ;;
183
      ;;
164
    amigaos*)
184
    amigaos*)
165
      hardcode_libdir_flag_spec='-L$libdir'
185
      case "$host_cpu" in
166
      hardcode_minus_L=yes
186
        powerpc)
167
      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
187
          ;;
168
      # that the semantics of dynamic libraries on AmigaOS, at least up
188
        m68k)
169
      # to version 4, is to share data among multiple programs linked
189
          hardcode_libdir_flag_spec='-L$libdir'
170
      # with the same dynamic library.  Since this doesn't match the
190
          hardcode_minus_L=yes
171
      # behavior of shared libraries on other platforms, we cannot use
191
          ;;
172
      # them.
192
      esac
173
      ld_shlibs=no
174
      ;;
193
      ;;
175
    beos*)
194
    beos*)
176
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
195
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
Lines 179-185 if test "$with_gnu_ld" = yes; then Link Here
179
        ld_shlibs=no
198
        ld_shlibs=no
180
      fi
199
      fi
181
      ;;
200
      ;;
182
    cygwin* | mingw* | pw32*)
201
    cygwin* | mingw* | pw32* | cegcc*)
183
      # hardcode_libdir_flag_spec is actually meaningless, as there is
202
      # hardcode_libdir_flag_spec is actually meaningless, as there is
184
      # no search path for DLLs.
203
      # no search path for DLLs.
185
      hardcode_libdir_flag_spec='-L$libdir'
204
      hardcode_libdir_flag_spec='-L$libdir'
Lines 189-199 if test "$with_gnu_ld" = yes; then Link Here
189
        ld_shlibs=no
208
        ld_shlibs=no
190
      fi
209
      fi
191
      ;;
210
      ;;
192
    interix3*)
211
    haiku*)
212
      ;;
213
    interix[3-9]*)
193
      hardcode_direct=no
214
      hardcode_direct=no
194
      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
215
      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
195
      ;;
216
      ;;
196
    linux*)
217
    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
197
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
218
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
198
        :
219
        :
199
      else
220
      else
Lines 251-257 else Link Here
251
        hardcode_direct=unsupported
272
        hardcode_direct=unsupported
252
      fi
273
      fi
253
      ;;
274
      ;;
254
    aix4* | aix5*)
275
    aix[4-9]*)
255
      if test "$host_cpu" = ia64; then
276
      if test "$host_cpu" = ia64; then
256
        # On IA64, the linker does run time linking by default, so we don't
277
        # On IA64, the linker does run time linking by default, so we don't
257
        # have to do anything special.
278
        # have to do anything special.
Lines 261-267 else Link Here
261
        # Test if we are trying to use run time linking or normal
282
        # Test if we are trying to use run time linking or normal
262
        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
283
        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
263
        # need to do runtime linking.
284
        # need to do runtime linking.
264
        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
285
        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
265
          for ld_flag in $LDFLAGS; do
286
          for ld_flag in $LDFLAGS; do
266
            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
287
            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
267
              aix_use_runtimelinking=yes
288
              aix_use_runtimelinking=yes
Lines 280-286 else Link Here
280
            strings "$collect2name" | grep resolve_lib_name >/dev/null
301
            strings "$collect2name" | grep resolve_lib_name >/dev/null
281
          then
302
          then
282
            # We have reworked collect2
303
            # We have reworked collect2
283
            hardcode_direct=yes
304
            :
284
          else
305
          else
285
            # We have old collect2
306
            # We have old collect2
286
            hardcode_direct=unsupported
307
            hardcode_direct=unsupported
Lines 316-329 else Link Here
316
      fi
337
      fi
317
      ;;
338
      ;;
318
    amigaos*)
339
    amigaos*)
319
      hardcode_libdir_flag_spec='-L$libdir'
340
      case "$host_cpu" in
320
      hardcode_minus_L=yes
341
        powerpc)
321
      # see comment about different semantics on the GNU ld section
342
          ;;
322
      ld_shlibs=no
343
        m68k)
344
          hardcode_libdir_flag_spec='-L$libdir'
345
          hardcode_minus_L=yes
346
          ;;
347
      esac
323
      ;;
348
      ;;
324
    bsdi[45]*)
349
    bsdi[45]*)
325
      ;;
350
      ;;
326
    cygwin* | mingw* | pw32*)
351
    cygwin* | mingw* | pw32* | cegcc*)
327
      # When not using gcc, we currently assume that we are using
352
      # When not using gcc, we currently assume that we are using
328
      # Microsoft Visual C++.
353
      # Microsoft Visual C++.
329
      # hardcode_libdir_flag_spec is actually meaningless, as there is
354
      # hardcode_libdir_flag_spec is actually meaningless, as there is
Lines 333-365 else Link Here
333
      ;;
358
      ;;
334
    darwin* | rhapsody*)
359
    darwin* | rhapsody*)
335
      hardcode_direct=no
360
      hardcode_direct=no
336
      if test "$GCC" = yes ; then
361
      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
337
        :
362
        :
338
      else
363
      else
339
        case $cc_basename in
364
        ld_shlibs=no
340
          xlc*)
341
            ;;
342
          *)
343
            ld_shlibs=no
344
            ;;
345
        esac
346
      fi
365
      fi
347
      ;;
366
      ;;
348
    dgux*)
367
    dgux*)
349
      hardcode_libdir_flag_spec='-L$libdir'
368
      hardcode_libdir_flag_spec='-L$libdir'
350
      ;;
369
      ;;
351
    freebsd1*)
370
    freebsd2.[01]*)
352
      ld_shlibs=no
353
      ;;
354
    freebsd2.2*)
355
      hardcode_libdir_flag_spec='-R$libdir'
356
      hardcode_direct=yes
357
      ;;
358
    freebsd2*)
359
      hardcode_direct=yes
371
      hardcode_direct=yes
360
      hardcode_minus_L=yes
372
      hardcode_minus_L=yes
361
      ;;
373
      ;;
362
    freebsd* | kfreebsd*-gnu | dragonfly*)
374
    freebsd* | dragonfly*)
363
      hardcode_libdir_flag_spec='-R$libdir'
375
      hardcode_libdir_flag_spec='-R$libdir'
364
      hardcode_direct=yes
376
      hardcode_direct=yes
365
      ;;
377
      ;;
Lines 411-429 else Link Here
411
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
423
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
412
      hardcode_libdir_separator=:
424
      hardcode_libdir_separator=:
413
      ;;
425
      ;;
426
    *nto* | *qnx*)
427
      ;;
414
    openbsd*)
428
    openbsd*)
415
      hardcode_direct=yes
429
      if test -f /usr/libexec/ld.so; then
416
      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
430
        hardcode_direct=yes
417
        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
431
        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
432
          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
433
        else
434
          case "$host_os" in
435
            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
436
              hardcode_libdir_flag_spec='-R$libdir'
437
              ;;
438
            *)
439
              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
440
              ;;
441
          esac
442
        fi
418
      else
443
      else
419
        case "$host_os" in
444
        ld_shlibs=no
420
          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
421
            hardcode_libdir_flag_spec='-R$libdir'
422
            ;;
423
          *)
424
            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
425
            ;;
426
        esac
427
      fi
445
      fi
428
      ;;
446
      ;;
429
    os2*)
447
    os2*)
Lines 471-477 else Link Here
471
        ld_shlibs=yes
489
        ld_shlibs=yes
472
      fi
490
      fi
473
      ;;
491
      ;;
474
    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
492
    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
475
      ;;
493
      ;;
476
    sysv5* | sco3.2v5* | sco5v6*)
494
    sysv5* | sco3.2v5* | sco5v6*)
477
      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
495
      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
Lines 487-520 else Link Here
487
fi
505
fi
488
506
489
# Check dynamic linker characteristics
507
# Check dynamic linker characteristics
490
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
508
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
509
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
510
# only about the one the linker finds when passed -lNAME. This is the last
511
# element of library_names_spec in libtool.m4, or possibly two of them if the
512
# linker has special search rules.
513
library_names_spec=      # the last element of library_names_spec in libtool.m4
491
libname_spec='lib$name'
514
libname_spec='lib$name'
492
case "$host_os" in
515
case "$host_os" in
493
  aix3*)
516
  aix3*)
517
    library_names_spec='$libname.a'
494
    ;;
518
    ;;
495
  aix4* | aix5*)
519
  aix[4-9]*)
520
    library_names_spec='$libname$shrext'
496
    ;;
521
    ;;
497
  amigaos*)
522
  amigaos*)
523
    case "$host_cpu" in
524
      powerpc*)
525
        library_names_spec='$libname$shrext' ;;
526
      m68k)
527
        library_names_spec='$libname.a' ;;
528
    esac
498
    ;;
529
    ;;
499
  beos*)
530
  beos*)
531
    library_names_spec='$libname$shrext'
500
    ;;
532
    ;;
501
  bsdi[45]*)
533
  bsdi[45]*)
534
    library_names_spec='$libname$shrext'
502
    ;;
535
    ;;
503
  cygwin* | mingw* | pw32*)
536
  cygwin* | mingw* | pw32* | cegcc*)
504
    shrext=.dll
537
    shrext=.dll
538
    library_names_spec='$libname.dll.a $libname.lib'
505
    ;;
539
    ;;
506
  darwin* | rhapsody*)
540
  darwin* | rhapsody*)
507
    shrext=.dylib
541
    shrext=.dylib
542
    library_names_spec='$libname$shrext'
508
    ;;
543
    ;;
509
  dgux*)
544
  dgux*)
545
    library_names_spec='$libname$shrext'
510
    ;;
546
    ;;
511
  freebsd1*)
547
  freebsd[23].*)
512
    ;;
548
    library_names_spec='$libname$shrext$versuffix'
513
  kfreebsd*-gnu)
514
    ;;
549
    ;;
515
  freebsd* | dragonfly*)
550
  freebsd* | dragonfly*)
551
    library_names_spec='$libname$shrext'
516
    ;;
552
    ;;
517
  gnu*)
553
  gnu*)
554
    library_names_spec='$libname$shrext'
555
    ;;
556
  haiku*)
557
    library_names_spec='$libname$shrext'
518
    ;;
558
    ;;
519
  hpux9* | hpux10* | hpux11*)
559
  hpux9* | hpux10* | hpux11*)
520
    case $host_cpu in
560
    case $host_cpu in
Lines 528-537 case "$host_os" in Link Here
528
        shrext=.sl
568
        shrext=.sl
529
        ;;
569
        ;;
530
    esac
570
    esac
571
    library_names_spec='$libname$shrext'
531
    ;;
572
    ;;
532
  interix3*)
573
  interix[3-9]*)
574
    library_names_spec='$libname$shrext'
533
    ;;
575
    ;;
534
  irix5* | irix6* | nonstopux*)
576
  irix5* | irix6* | nonstopux*)
577
    library_names_spec='$libname$shrext'
535
    case "$host_os" in
578
    case "$host_os" in
536
      irix5* | nonstopux*)
579
      irix5* | nonstopux*)
537
        libsuff= shlibsuff=
580
        libsuff= shlibsuff=
Lines 548-588 case "$host_os" in Link Here
548
    ;;
591
    ;;
549
  linux*oldld* | linux*aout* | linux*coff*)
592
  linux*oldld* | linux*aout* | linux*coff*)
550
    ;;
593
    ;;
551
  linux*)
594
  linux* | k*bsd*-gnu | kopensolaris*-gnu)
595
    library_names_spec='$libname$shrext'
552
    ;;
596
    ;;
553
  knetbsd*-gnu)
597
  knetbsd*-gnu)
598
    library_names_spec='$libname$shrext'
554
    ;;
599
    ;;
555
  netbsd*)
600
  netbsd*)
601
    library_names_spec='$libname$shrext'
556
    ;;
602
    ;;
557
  newsos6)
603
  newsos6)
604
    library_names_spec='$libname$shrext'
558
    ;;
605
    ;;
559
  nto-qnx*)
606
  *nto* | *qnx*)
607
    library_names_spec='$libname$shrext'
560
    ;;
608
    ;;
561
  openbsd*)
609
  openbsd*)
610
    library_names_spec='$libname$shrext$versuffix'
562
    ;;
611
    ;;
563
  os2*)
612
  os2*)
564
    libname_spec='$name'
613
    libname_spec='$name'
565
    shrext=.dll
614
    shrext=.dll
615
    library_names_spec='$libname.a'
566
    ;;
616
    ;;
567
  osf3* | osf4* | osf5*)
617
  osf3* | osf4* | osf5*)
618
    library_names_spec='$libname$shrext'
619
    ;;
620
  rdos*)
568
    ;;
621
    ;;
569
  solaris*)
622
  solaris*)
623
    library_names_spec='$libname$shrext'
570
    ;;
624
    ;;
571
  sunos4*)
625
  sunos4*)
626
    library_names_spec='$libname$shrext$versuffix'
572
    ;;
627
    ;;
573
  sysv4 | sysv4.3*)
628
  sysv4 | sysv4.3*)
629
    library_names_spec='$libname$shrext'
574
    ;;
630
    ;;
575
  sysv4*MP*)
631
  sysv4*MP*)
632
    library_names_spec='$libname$shrext'
576
    ;;
633
    ;;
577
  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
634
  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
635
    library_names_spec='$libname$shrext'
636
    ;;
637
  tpf*)
638
    library_names_spec='$libname$shrext'
578
    ;;
639
    ;;
579
  uts4*)
640
  uts4*)
641
    library_names_spec='$libname$shrext'
580
    ;;
642
    ;;
581
esac
643
esac
582
644
583
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
645
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
584
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
646
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
585
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
647
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
648
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
649
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
586
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
650
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
587
651
588
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
652
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
Lines 596-601 libext="$libext" Link Here
596
# Shared library suffix (normally "so").
660
# Shared library suffix (normally "so").
597
shlibext="$shlibext"
661
shlibext="$shlibext"
598
662
663
# Format of library name prefix.
664
libname_spec="$escaped_libname_spec"
665
666
# Library names that the linker finds when passed -lNAME.
667
library_names_spec="$escaped_library_names_spec"
668
599
# Flag to hardcode \$libdir into a binary during linking.
669
# Flag to hardcode \$libdir into a binary during linking.
600
# This must work even if \$libdir does not exist.
670
# This must work even if \$libdir does not exist.
601
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
671
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
(-)a/configure.ac (-3 / +3 lines)
Lines 5-12 AC_C_BIGENDIAN Link Here
5
AC_PROG_LIBTOOL
5
AC_PROG_LIBTOOL
6
6
7
AM_CONFIG_HEADER(mpfc-config.h)
7
AM_CONFIG_HEADER(mpfc-config.h)
8
AM_GNU_GETTEXT
8
AM_GNU_GETTEXT([external])
9
AM_GNU_GETTEXT_VERSION(0.16.1)
9
AM_GNU_GETTEXT_VERSION([0.21])
10
10
11
# Set up common libraries
11
# Set up common libraries
12
#COMMON_LIBS="-ldmalloc"
12
#COMMON_LIBS="-ldmalloc"
Lines 252-258 AC_SUBST(OUTPUT_PLUGINS) Link Here
252
252
253
AC_OUTPUT(Makefile \
253
AC_OUTPUT(Makefile \
254
		  doc/Makefile \
254
		  doc/Makefile \
255
		  intl/Makefile  \
255
		   \
256
		  libmpfc/Makefile \
256
		  libmpfc/Makefile \
257
		  libmpfcwnd/Makefile \
257
		  libmpfcwnd/Makefile \
258
		  po/Makefile.in  \
258
		  po/Makefile.in  \
(-)a/intl/ChangeLog (-4 lines)
Lines 1-4 Link Here
1
2006-11-27  GNU  <bug-gnu-gettext@gnu.org>
2
3
	* Version 0.16.1 released.
4
(-)a/intl/Makefile.in (-562 lines)
Lines 1-562 Link Here
1
# Makefile for directory with message catalog handling library of GNU gettext
2
# Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
3
#
4
# This program is free software; you can redistribute it and/or modify it
5
# under the terms of the GNU Library General Public License as published
6
# by the Free Software Foundation; either version 2, or (at your option)
7
# 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 GNU
12
# Library General Public License for more details.
13
#
14
# You should have received a copy of the GNU Library General Public
15
# License along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
# USA.
18
19
PACKAGE = @PACKAGE@
20
VERSION = @VERSION@
21
22
SHELL = /bin/sh
23
24
srcdir = @srcdir@
25
top_srcdir = @top_srcdir@
26
top_builddir = ..
27
28
# The VPATH variables allows builds with $builddir != $srcdir, assuming a
29
# 'make' program that supports VPATH (such as GNU make). This line is removed
30
# by autoconf automatically when "$(srcdir)" = ".".
31
# In this directory, the VPATH handling is particular:
32
# 1. If INTL_LIBTOOL_SUFFIX_PREFIX is 'l' (indicating a build with libtool),
33
#    the .c -> .lo rules carefully use $(srcdir), so that VPATH can be omitted.
34
# 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise
35
#    'make' does the wrong thing if GNU gettext was configured with
36
#    "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
37
#    files it finds in srcdir = ../../gettext-runtime/intl.
38
VPATH = $(srcdir)
39
40
prefix = @prefix@
41
exec_prefix = @exec_prefix@
42
transform = @program_transform_name@
43
libdir = @libdir@
44
includedir = @includedir@
45
datarootdir = @datarootdir@
46
datadir = @datadir@
47
localedir = $(datadir)/locale
48
gettextsrcdir = $(datadir)/gettext/intl
49
aliaspath = $(localedir)
50
subdir = intl
51
52
INSTALL = @INSTALL@
53
INSTALL_DATA = @INSTALL_DATA@
54
55
# We use $(mkdir_p).
56
# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
57
# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
58
# @install_sh@ does not start with $(SHELL), so we add it.
59
# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
60
# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
61
# versions, $(mkinstalldirs) and $(install_sh) are unused.
62
mkinstalldirs = $(SHELL) @install_sh@ -d
63
install_sh = $(SHELL) @install_sh@
64
MKDIR_P = @MKDIR_P@
65
mkdir_p = @mkdir_p@
66
67
l = @INTL_LIBTOOL_SUFFIX_PREFIX@
68
69
AR = ar
70
CC = @CC@
71
LIBTOOL = @LIBTOOL@
72
RANLIB = @RANLIB@
73
YACC = @INTLBISON@ -y -d
74
YFLAGS = --name-prefix=__gettext
75
76
# -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro.
77
# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
78
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
79
-DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL \
80
-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
81
-Dset_relocation_prefix=libintl_set_relocation_prefix \
82
-Drelocate=libintl_relocate \
83
-DDEPENDS_ON_LIBICONV=1 @DEFS@
84
CPPFLAGS = @CPPFLAGS@
85
CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@
86
LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@)
87
LDFLAGS_yes = -Wl,--export-all-symbols
88
LDFLAGS_no =
89
LIBS = @LIBS@
90
91
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
92
93
HEADERS = \
94
  gmo.h \
95
  gettextP.h \
96
  hash-string.h \
97
  loadinfo.h \
98
  plural-exp.h \
99
  eval-plural.h \
100
  localcharset.h \
101
  lock.h \
102
  relocatable.h \
103
  xsize.h \
104
  printf-args.h printf-args.c \
105
  printf-parse.h wprintf-parse.h printf-parse.c \
106
  vasnprintf.h vasnwprintf.h vasnprintf.c \
107
  os2compat.h \
108
  libgnuintl.h.in
109
SOURCES = \
110
  bindtextdom.c \
111
  dcgettext.c \
112
  dgettext.c \
113
  gettext.c \
114
  finddomain.c \
115
  hash-string.c \
116
  loadmsgcat.c \
117
  localealias.c \
118
  textdomain.c \
119
  l10nflist.c \
120
  explodename.c \
121
  dcigettext.c \
122
  dcngettext.c \
123
  dngettext.c \
124
  ngettext.c \
125
  plural.y \
126
  plural-exp.c \
127
  localcharset.c \
128
  lock.c \
129
  relocatable.c \
130
  langprefs.c \
131
  localename.c \
132
  log.c \
133
  printf.c \
134
  version.c \
135
  osdep.c \
136
  os2compat.c \
137
  intl-exports.c \
138
  intl-compat.c
139
OBJECTS = \
140
  bindtextdom.$lo \
141
  dcgettext.$lo \
142
  dgettext.$lo \
143
  gettext.$lo \
144
  finddomain.$lo \
145
  hash-string.$lo \
146
  loadmsgcat.$lo \
147
  localealias.$lo \
148
  textdomain.$lo \
149
  l10nflist.$lo \
150
  explodename.$lo \
151
  dcigettext.$lo \
152
  dcngettext.$lo \
153
  dngettext.$lo \
154
  ngettext.$lo \
155
  plural.$lo \
156
  plural-exp.$lo \
157
  localcharset.$lo \
158
  lock.$lo \
159
  relocatable.$lo \
160
  langprefs.$lo \
161
  localename.$lo \
162
  log.$lo \
163
  printf.$lo \
164
  version.$lo \
165
  osdep.$lo \
166
  intl-compat.$lo
167
DISTFILES.common = Makefile.in \
168
config.charset locale.alias ref-add.sin ref-del.sin export.h \
169
$(HEADERS) $(SOURCES)
170
DISTFILES.generated = plural.c
171
DISTFILES.normal = VERSION
172
DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc README.woe32
173
DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
174
COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h \
175
libgnuintl.h_vms Makefile.vms libgnuintl.h.msvc-static \
176
libgnuintl.h.msvc-shared Makefile.msvc
177
178
all: all-@USE_INCLUDED_LIBINTL@
179
all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
180
all-no: all-no-@BUILD_INCLUDED_LIBINTL@
181
all-no-yes: libgnuintl.$la
182
all-no-no:
183
184
libintl.a libgnuintl.a: $(OBJECTS)
185
	rm -f $@
186
	$(AR) cru $@ $(OBJECTS)
187
	$(RANLIB) $@
188
189
libintl.la libgnuintl.la: $(OBJECTS)
190
	$(LIBTOOL) --mode=link \
191
	  $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
192
	  $(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(LIBS) @LTLIBTHREAD@ -lc \
193
	  -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
194
	  -rpath $(libdir) \
195
	  -no-undefined
196
197
# Libtool's library version information for libintl.
198
# Before making a gettext release, the gettext maintainer must change this
199
# according to the libtool documentation, section "Library interface versions".
200
# Maintainers of other packages that include the intl directory must *not*
201
# change these values.
202
LTV_CURRENT=8
203
LTV_REVISION=1
204
LTV_AGE=0
205
206
.SUFFIXES:
207
.SUFFIXES: .c .y .o .lo .sin .sed
208
209
.c.o:
210
	$(COMPILE) $<
211
212
.y.c:
213
	$(YACC) $(YFLAGS) --output $@ $<
214
	rm -f $*.h
215
216
bindtextdom.lo: $(srcdir)/bindtextdom.c
217
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
218
dcgettext.lo: $(srcdir)/dcgettext.c
219
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
220
dgettext.lo: $(srcdir)/dgettext.c
221
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
222
gettext.lo: $(srcdir)/gettext.c
223
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
224
finddomain.lo: $(srcdir)/finddomain.c
225
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
226
hash-string.lo: $(srcdir)/hash-string.c
227
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/hash-string.c
228
loadmsgcat.lo: $(srcdir)/loadmsgcat.c
229
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
230
localealias.lo: $(srcdir)/localealias.c
231
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
232
textdomain.lo: $(srcdir)/textdomain.c
233
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
234
l10nflist.lo: $(srcdir)/l10nflist.c
235
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
236
explodename.lo: $(srcdir)/explodename.c
237
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
238
dcigettext.lo: $(srcdir)/dcigettext.c
239
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
240
dcngettext.lo: $(srcdir)/dcngettext.c
241
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
242
dngettext.lo: $(srcdir)/dngettext.c
243
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
244
ngettext.lo: $(srcdir)/ngettext.c
245
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
246
plural.lo: $(srcdir)/plural.c
247
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
248
plural-exp.lo: $(srcdir)/plural-exp.c
249
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
250
localcharset.lo: $(srcdir)/localcharset.c
251
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
252
lock.lo: $(srcdir)/lock.c
253
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/lock.c
254
relocatable.lo: $(srcdir)/relocatable.c
255
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
256
langprefs.lo: $(srcdir)/langprefs.c
257
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/langprefs.c
258
localename.lo: $(srcdir)/localename.c
259
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
260
log.lo: $(srcdir)/log.c
261
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
262
printf.lo: $(srcdir)/printf.c
263
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
264
version.lo: $(srcdir)/version.c
265
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/version.c
266
osdep.lo: $(srcdir)/osdep.c
267
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
268
intl-compat.lo: $(srcdir)/intl-compat.c
269
	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
270
271
ref-add.sed: $(srcdir)/ref-add.sin
272
	sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
273
	mv t-ref-add.sed ref-add.sed
274
ref-del.sed: $(srcdir)/ref-del.sin
275
	sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
276
	mv t-ref-del.sed ref-del.sed
277
278
INCLUDES = -I. -I$(srcdir) -I..
279
280
libgnuintl.h: $(srcdir)/libgnuintl.h.in
281
	sed -e '/IN_LIBGLOCALE/d' \
282
	    -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
283
	    -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
284
	    -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
285
	    -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
286
	  < $(srcdir)/libgnuintl.h.in \
287
	| if test '@WOE32DLL@' = yes; then \
288
	    sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
289
	  else \
290
	    cat; \
291
	  fi \
292
	| sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \
293
	      -e "/#define _LIBINTL_H/r $(srcdir)/export.h" \
294
	| sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
295
	  > libgnuintl.h
296
297
libintl.h: $(srcdir)/libgnuintl.h.in
298
	sed -e '/IN_LIBGLOCALE/d' \
299
	    -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
300
	    -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
301
	    -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
302
	    -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
303
	  < $(srcdir)/libgnuintl.h.in > libintl.h
304
305
charset.alias: $(srcdir)/config.charset
306
	$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
307
	mv t-$@ $@
308
309
check: all
310
311
# We must not install the libintl.h/libintl.a files if we are on a
312
# system which has the GNU gettext() function in its C library or in a
313
# separate library.
314
# If you want to use the one which comes with this version of the
315
# package, you have to use `configure --with-included-gettext'.
316
install: install-exec install-data
317
install-exec: all
318
	if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
319
	   && test '@USE_INCLUDED_LIBINTL@' = yes; then \
320
	  $(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
321
	  $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
322
	  $(LIBTOOL) --mode=install \
323
	    $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
324
	  if test "@RELOCATABLE@" = yes; then \
325
	    dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
326
	    if test -n "$$dependencies"; then \
327
	      rm -f $(DESTDIR)$(libdir)/libintl.la; \
328
	    fi; \
329
	  fi; \
330
	else \
331
	  : ; \
332
	fi
333
	if test "$(PACKAGE)" = "gettext-tools" \
334
	   && test '@USE_INCLUDED_LIBINTL@' = no \
335
	   && test @GLIBC2@ != no; then \
336
	  $(mkdir_p) $(DESTDIR)$(libdir); \
337
	  $(LIBTOOL) --mode=install \
338
	    $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
339
	  rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
340
	  $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
341
	  $(LIBTOOL) --mode=uninstall \
342
	    rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
343
	else \
344
	  : ; \
345
	fi
346
	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
347
	  test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
348
	  temp=$(DESTDIR)$(libdir)/t-charset.alias; \
349
	  dest=$(DESTDIR)$(libdir)/charset.alias; \
350
	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
351
	    orig=$(DESTDIR)$(libdir)/charset.alias; \
352
	    sed -f ref-add.sed $$orig > $$temp; \
353
	    $(INSTALL_DATA) $$temp $$dest; \
354
	    rm -f $$temp; \
355
	  else \
356
	    if test @GLIBC21@ = no; then \
357
	      orig=charset.alias; \
358
	      sed -f ref-add.sed $$orig > $$temp; \
359
	      $(INSTALL_DATA) $$temp $$dest; \
360
	      rm -f $$temp; \
361
	    fi; \
362
	  fi; \
363
	  $(mkdir_p) $(DESTDIR)$(localedir); \
364
	  test -f $(DESTDIR)$(localedir)/locale.alias \
365
	    && orig=$(DESTDIR)$(localedir)/locale.alias \
366
	    || orig=$(srcdir)/locale.alias; \
367
	  temp=$(DESTDIR)$(localedir)/t-locale.alias; \
368
	  dest=$(DESTDIR)$(localedir)/locale.alias; \
369
	  sed -f ref-add.sed $$orig > $$temp; \
370
	  $(INSTALL_DATA) $$temp $$dest; \
371
	  rm -f $$temp; \
372
	else \
373
	  : ; \
374
	fi
375
install-data: all
376
	if test "$(PACKAGE)" = "gettext-tools"; then \
377
	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
378
	  $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
379
	  $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
380
	  dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
381
	  for file in $$dists; do \
382
	    $(INSTALL_DATA) $(srcdir)/$$file \
383
			    $(DESTDIR)$(gettextsrcdir)/$$file; \
384
	  done; \
385
	  chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
386
	  dists="$(DISTFILES.generated)"; \
387
	  for file in $$dists; do \
388
	    if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
389
	    $(INSTALL_DATA) $$dir/$$file \
390
			    $(DESTDIR)$(gettextsrcdir)/$$file; \
391
	  done; \
392
	  dists="$(DISTFILES.obsolete)"; \
393
	  for file in $$dists; do \
394
	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
395
	  done; \
396
	else \
397
	  : ; \
398
	fi
399
400
install-strip: install
401
402
installdirs:
403
	if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
404
	   && test '@USE_INCLUDED_LIBINTL@' = yes; then \
405
	  $(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
406
	else \
407
	  : ; \
408
	fi
409
	if test "$(PACKAGE)" = "gettext-tools" \
410
	   && test '@USE_INCLUDED_LIBINTL@' = no \
411
	   && test @GLIBC2@ != no; then \
412
	  $(mkdir_p) $(DESTDIR)$(libdir); \
413
	else \
414
	  : ; \
415
	fi
416
	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
417
	  test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
418
	  $(mkdir_p) $(DESTDIR)$(localedir); \
419
	else \
420
	  : ; \
421
	fi
422
	if test "$(PACKAGE)" = "gettext-tools"; then \
423
	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
424
	else \
425
	  : ; \
426
	fi
427
428
# Define this as empty until I found a useful application.
429
installcheck:
430
431
uninstall:
432
	if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
433
	   && test '@USE_INCLUDED_LIBINTL@' = yes; then \
434
	  rm -f $(DESTDIR)$(includedir)/libintl.h; \
435
	  $(LIBTOOL) --mode=uninstall \
436
	    rm -f $(DESTDIR)$(libdir)/libintl.$la; \
437
	else \
438
	  : ; \
439
	fi
440
	if test "$(PACKAGE)" = "gettext-tools" \
441
	   && test '@USE_INCLUDED_LIBINTL@' = no \
442
	   && test @GLIBC2@ != no; then \
443
	  rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
444
	else \
445
	  : ; \
446
	fi
447
	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
448
	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
449
	    temp=$(DESTDIR)$(libdir)/t-charset.alias; \
450
	    dest=$(DESTDIR)$(libdir)/charset.alias; \
451
	    sed -f ref-del.sed $$dest > $$temp; \
452
	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
453
	      rm -f $$dest; \
454
	    else \
455
	      $(INSTALL_DATA) $$temp $$dest; \
456
	    fi; \
457
	    rm -f $$temp; \
458
	  fi; \
459
	  if test -f $(DESTDIR)$(localedir)/locale.alias; then \
460
	    temp=$(DESTDIR)$(localedir)/t-locale.alias; \
461
	    dest=$(DESTDIR)$(localedir)/locale.alias; \
462
	    sed -f ref-del.sed $$dest > $$temp; \
463
	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
464
	      rm -f $$dest; \
465
	    else \
466
	      $(INSTALL_DATA) $$temp $$dest; \
467
	    fi; \
468
	    rm -f $$temp; \
469
	  fi; \
470
	else \
471
	  : ; \
472
	fi
473
	if test "$(PACKAGE)" = "gettext-tools"; then \
474
	  for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
475
	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
476
	  done; \
477
	else \
478
	  : ; \
479
	fi
480
481
info dvi ps pdf html:
482
483
$(OBJECTS): ../config.h libgnuintl.h
484
bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
485
hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
486
explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
487
dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
488
dcigettext.$lo: $(srcdir)/eval-plural.h
489
localcharset.$lo: $(srcdir)/localcharset.h
490
bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h
491
localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
492
printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
493
494
# A bison-2.1 generated plural.c includes <libintl.h> if ENABLE_NLS.
495
PLURAL_DEPS_yes = libintl.h
496
PLURAL_DEPS_no =
497
plural.$lo: $(PLURAL_DEPS_@USE_INCLUDED_LIBINTL@)
498
499
tags: TAGS
500
501
TAGS: $(HEADERS) $(SOURCES)
502
	here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
503
504
ctags: CTAGS
505
506
CTAGS: $(HEADERS) $(SOURCES)
507
	here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
508
509
id: ID
510
511
ID: $(HEADERS) $(SOURCES)
512
	here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
513
514
515
mostlyclean:
516
	rm -f *.a *.la *.o *.obj *.lo core core.*
517
	rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
518
	rm -f -r .libs _libs
519
520
clean: mostlyclean
521
522
distclean: clean
523
	rm -f Makefile ID TAGS
524
	if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
525
	  rm -f ChangeLog.inst $(DISTFILES.normal); \
526
	else \
527
	  : ; \
528
	fi
529
530
maintainer-clean: distclean
531
	@echo "This command is intended for maintainers to use;"
532
	@echo "it deletes files that may require special tools to rebuild."
533
534
535
# GNU gettext needs not contain the file `VERSION' but contains some
536
# other files which should not be distributed in other packages.
537
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
538
dist distdir: Makefile
539
	if test "$(PACKAGE)" = "gettext-tools"; then \
540
	  : ; \
541
	else \
542
	  if test "$(PACKAGE)" = "gettext-runtime"; then \
543
	    additional="$(DISTFILES.gettext)"; \
544
	  else \
545
	    additional="$(DISTFILES.normal)"; \
546
	  fi; \
547
	  $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
548
	  for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
549
	    if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
550
	    cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \
551
	  done; \
552
	fi
553
554
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
555
	cd $(top_builddir) && $(SHELL) ./config.status
556
# This would be more efficient, but doesn't work any more with autoconf-2.57,
557
# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
558
#	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
559
560
# Tell versions [3.59,3.63) of GNU make not to export all variables.
561
# Otherwise a system limit (for SysV at least) may be exceeded.
562
.NOEXPORT:
(-)a/intl/VERSION (-1 lines)
Line 1 Link Here
1
GNU gettext library from gettext-0.16.1
(-)a/intl/bindtextdom.c (-357 lines)
Lines 1-357 Link Here
1
/* Implementation of the bindtextdomain(3) function
2
   Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22
23
#include <stddef.h>
24
#include <stdlib.h>
25
#include <string.h>
26
27
#include "gettextP.h"
28
#ifdef _LIBC
29
# include <libintl.h>
30
#else
31
# include "libgnuintl.h"
32
#endif
33
34
/* Handle multi-threaded applications.  */
35
#ifdef _LIBC
36
# include <bits/libc-lock.h>
37
# define gl_rwlock_define __libc_rwlock_define
38
# define gl_rwlock_wrlock __libc_rwlock_wrlock
39
# define gl_rwlock_unlock __libc_rwlock_unlock
40
#else
41
# include "lock.h"
42
#endif
43
44
/* The internal variables in the standalone libintl.a must have different
45
   names than the internal variables in GNU libc, otherwise programs
46
   using libintl.a cannot be linked statically.  */
47
#if !defined _LIBC
48
# define _nl_default_dirname libintl_nl_default_dirname
49
# define _nl_domain_bindings libintl_nl_domain_bindings
50
#endif
51
52
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>.  */
53
#ifndef offsetof
54
# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
55
#endif
56
57
/* @@ end of prolog @@ */
58
59
/* Contains the default location of the message catalogs.  */
60
extern const char _nl_default_dirname[];
61
#ifdef _LIBC
62
libc_hidden_proto (_nl_default_dirname)
63
#endif
64
65
/* List with bindings of specific domains.  */
66
extern struct binding *_nl_domain_bindings;
67
68
/* Lock variable to protect the global data in the gettext implementation.  */
69
gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
70
71
72
/* Names for the libintl functions are a problem.  They must not clash
73
   with existing names and they should follow ANSI C.  But this source
74
   code is also used in GNU C Library where the names have a __
75
   prefix.  So we have to make a difference here.  */
76
#ifdef _LIBC
77
# define BINDTEXTDOMAIN __bindtextdomain
78
# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
79
# ifndef strdup
80
#  define strdup(str) __strdup (str)
81
# endif
82
#else
83
# define BINDTEXTDOMAIN libintl_bindtextdomain
84
# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
85
#endif
86
87
/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
88
   to be used for the DOMAINNAME message catalog.
89
   If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
90
   modified, only the current value is returned.
91
   If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
92
   modified nor returned.  */
93
static void
94
set_binding_values (const char *domainname,
95
		    const char **dirnamep, const char **codesetp)
96
{
97
  struct binding *binding;
98
  int modified;
99
100
  /* Some sanity checks.  */
101
  if (domainname == NULL || domainname[0] == '\0')
102
    {
103
      if (dirnamep)
104
	*dirnamep = NULL;
105
      if (codesetp)
106
	*codesetp = NULL;
107
      return;
108
    }
109
110
  gl_rwlock_wrlock (_nl_state_lock);
111
112
  modified = 0;
113
114
  for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
115
    {
116
      int compare = strcmp (domainname, binding->domainname);
117
      if (compare == 0)
118
	/* We found it!  */
119
	break;
120
      if (compare < 0)
121
	{
122
	  /* It is not in the list.  */
123
	  binding = NULL;
124
	  break;
125
	}
126
    }
127
128
  if (binding != NULL)
129
    {
130
      if (dirnamep)
131
	{
132
	  const char *dirname = *dirnamep;
133
134
	  if (dirname == NULL)
135
	    /* The current binding has be to returned.  */
136
	    *dirnamep = binding->dirname;
137
	  else
138
	    {
139
	      /* The domain is already bound.  If the new value and the old
140
		 one are equal we simply do nothing.  Otherwise replace the
141
		 old binding.  */
142
	      char *result = binding->dirname;
143
	      if (strcmp (dirname, result) != 0)
144
		{
145
		  if (strcmp (dirname, _nl_default_dirname) == 0)
146
		    result = (char *) _nl_default_dirname;
147
		  else
148
		    {
149
#if defined _LIBC || defined HAVE_STRDUP
150
		      result = strdup (dirname);
151
#else
152
		      size_t len = strlen (dirname) + 1;
153
		      result = (char *) malloc (len);
154
		      if (__builtin_expect (result != NULL, 1))
155
			memcpy (result, dirname, len);
156
#endif
157
		    }
158
159
		  if (__builtin_expect (result != NULL, 1))
160
		    {
161
		      if (binding->dirname != _nl_default_dirname)
162
			free (binding->dirname);
163
164
		      binding->dirname = result;
165
		      modified = 1;
166
		    }
167
		}
168
	      *dirnamep = result;
169
	    }
170
	}
171
172
      if (codesetp)
173
	{
174
	  const char *codeset = *codesetp;
175
176
	  if (codeset == NULL)
177
	    /* The current binding has be to returned.  */
178
	    *codesetp = binding->codeset;
179
	  else
180
	    {
181
	      /* The domain is already bound.  If the new value and the old
182
		 one are equal we simply do nothing.  Otherwise replace the
183
		 old binding.  */
184
	      char *result = binding->codeset;
185
	      if (result == NULL || strcmp (codeset, result) != 0)
186
		{
187
#if defined _LIBC || defined HAVE_STRDUP
188
		  result = strdup (codeset);
189
#else
190
		  size_t len = strlen (codeset) + 1;
191
		  result = (char *) malloc (len);
192
		  if (__builtin_expect (result != NULL, 1))
193
		    memcpy (result, codeset, len);
194
#endif
195
196
		  if (__builtin_expect (result != NULL, 1))
197
		    {
198
		      if (binding->codeset != NULL)
199
			free (binding->codeset);
200
201
		      binding->codeset = result;
202
		      modified = 1;
203
		    }
204
		}
205
	      *codesetp = result;
206
	    }
207
	}
208
    }
209
  else if ((dirnamep == NULL || *dirnamep == NULL)
210
	   && (codesetp == NULL || *codesetp == NULL))
211
    {
212
      /* Simply return the default values.  */
213
      if (dirnamep)
214
	*dirnamep = _nl_default_dirname;
215
      if (codesetp)
216
	*codesetp = NULL;
217
    }
218
  else
219
    {
220
      /* We have to create a new binding.  */
221
      size_t len = strlen (domainname) + 1;
222
      struct binding *new_binding =
223
	(struct binding *) malloc (offsetof (struct binding, domainname) + len);
224
225
      if (__builtin_expect (new_binding == NULL, 0))
226
	goto failed;
227
228
      memcpy (new_binding->domainname, domainname, len);
229
230
      if (dirnamep)
231
	{
232
	  const char *dirname = *dirnamep;
233
234
	  if (dirname == NULL)
235
	    /* The default value.  */
236
	    dirname = _nl_default_dirname;
237
	  else
238
	    {
239
	      if (strcmp (dirname, _nl_default_dirname) == 0)
240
		dirname = _nl_default_dirname;
241
	      else
242
		{
243
		  char *result;
244
#if defined _LIBC || defined HAVE_STRDUP
245
		  result = strdup (dirname);
246
		  if (__builtin_expect (result == NULL, 0))
247
		    goto failed_dirname;
248
#else
249
		  size_t len = strlen (dirname) + 1;
250
		  result = (char *) malloc (len);
251
		  if (__builtin_expect (result == NULL, 0))
252
		    goto failed_dirname;
253
		  memcpy (result, dirname, len);
254
#endif
255
		  dirname = result;
256
		}
257
	    }
258
	  *dirnamep = dirname;
259
	  new_binding->dirname = (char *) dirname;
260
	}
261
      else
262
	/* The default value.  */
263
	new_binding->dirname = (char *) _nl_default_dirname;
264
265
      if (codesetp)
266
	{
267
	  const char *codeset = *codesetp;
268
269
	  if (codeset != NULL)
270
	    {
271
	      char *result;
272
273
#if defined _LIBC || defined HAVE_STRDUP
274
	      result = strdup (codeset);
275
	      if (__builtin_expect (result == NULL, 0))
276
		goto failed_codeset;
277
#else
278
	      size_t len = strlen (codeset) + 1;
279
	      result = (char *) malloc (len);
280
	      if (__builtin_expect (result == NULL, 0))
281
		goto failed_codeset;
282
	      memcpy (result, codeset, len);
283
#endif
284
	      codeset = result;
285
	    }
286
	  *codesetp = codeset;
287
	  new_binding->codeset = (char *) codeset;
288
	}
289
      else
290
	new_binding->codeset = NULL;
291
292
      /* Now enqueue it.  */
293
      if (_nl_domain_bindings == NULL
294
	  || strcmp (domainname, _nl_domain_bindings->domainname) < 0)
295
	{
296
	  new_binding->next = _nl_domain_bindings;
297
	  _nl_domain_bindings = new_binding;
298
	}
299
      else
300
	{
301
	  binding = _nl_domain_bindings;
302
	  while (binding->next != NULL
303
		 && strcmp (domainname, binding->next->domainname) > 0)
304
	    binding = binding->next;
305
306
	  new_binding->next = binding->next;
307
	  binding->next = new_binding;
308
	}
309
310
      modified = 1;
311
312
      /* Here we deal with memory allocation failures.  */
313
      if (0)
314
	{
315
	failed_codeset:
316
	  if (new_binding->dirname != _nl_default_dirname)
317
	    free (new_binding->dirname);
318
	failed_dirname:
319
	  free (new_binding);
320
	failed:
321
	  if (dirnamep)
322
	    *dirnamep = NULL;
323
	  if (codesetp)
324
	    *codesetp = NULL;
325
	}
326
    }
327
328
  /* If we modified any binding, we flush the caches.  */
329
  if (modified)
330
    ++_nl_msg_cat_cntr;
331
332
  gl_rwlock_unlock (_nl_state_lock);
333
}
334
335
/* Specify that the DOMAINNAME message catalog will be found
336
   in DIRNAME rather than in the system locale data base.  */
337
char *
338
BINDTEXTDOMAIN (const char *domainname, const char *dirname)
339
{
340
  set_binding_values (domainname, &dirname, NULL);
341
  return (char *) dirname;
342
}
343
344
/* Specify the character encoding in which the messages from the
345
   DOMAINNAME message catalog will be returned.  */
346
char *
347
BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset)
348
{
349
  set_binding_values (domainname, NULL, &codeset);
350
  return (char *) codeset;
351
}
352
353
#ifdef _LIBC
354
/* Aliases for function names in GNU C Library.  */
355
weak_alias (__bindtextdomain, bindtextdomain);
356
weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
357
#endif
(-)a/intl/config.charset (-640 lines)
Lines 1-640 Link Here
1
#! /bin/sh
2
# Output a system dependent table of character encoding aliases.
3
#
4
#   Copyright (C) 2000-2004, 2006 Free Software Foundation, Inc.
5
#
6
#   This program is free software; you can redistribute it and/or modify it
7
#   under the terms of the GNU Library General Public License as published
8
#   by the Free Software Foundation; either version 2, or (at your option)
9
#   any later version.
10
#
11
#   This program is distributed in the hope that it will be useful,
12
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
#   Library General Public License for more details.
15
#
16
#   You should have received a copy of the GNU Library General Public
17
#   License along with this program; if not, write to the Free Software
18
#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19
#   USA.
20
#
21
# The table consists of lines of the form
22
#    ALIAS  CANONICAL
23
#
24
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
25
# ALIAS is compared in a case sensitive way.
26
#
27
# CANONICAL is the GNU canonical name for this character encoding.
28
# It must be an encoding supported by libiconv. Support by GNU libc is
29
# also desirable. CANONICAL is case insensitive. Usually an upper case
30
# MIME charset name is preferred.
31
# The current list of GNU canonical charset names is as follows.
32
#
33
#       name              MIME?             used by which systems
34
#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin
35
#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
36
#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
37
#   ISO-8859-3              Y   glibc solaris
38
#   ISO-8859-4              Y   osf solaris freebsd netbsd darwin
39
#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
40
#   ISO-8859-6              Y   glibc aix hpux solaris
41
#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd darwin
42
#   ISO-8859-8              Y   glibc aix hpux osf solaris
43
#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin
44
#   ISO-8859-13                 glibc netbsd darwin
45
#   ISO-8859-14                 glibc
46
#   ISO-8859-15                 glibc aix osf solaris freebsd darwin
47
#   KOI8-R                  Y   glibc solaris freebsd netbsd darwin
48
#   KOI8-U                  Y   glibc freebsd netbsd darwin
49
#   KOI8-T                      glibc
50
#   CP437                       dos
51
#   CP775                       dos
52
#   CP850                       aix osf dos
53
#   CP852                       dos
54
#   CP855                       dos
55
#   CP856                       aix
56
#   CP857                       dos
57
#   CP861                       dos
58
#   CP862                       dos
59
#   CP864                       dos
60
#   CP865                       dos
61
#   CP866                       freebsd netbsd darwin dos
62
#   CP869                       dos
63
#   CP874                       woe32 dos
64
#   CP922                       aix
65
#   CP932                       aix woe32 dos
66
#   CP943                       aix
67
#   CP949                       osf woe32 dos
68
#   CP950                       woe32 dos
69
#   CP1046                      aix
70
#   CP1124                      aix
71
#   CP1125                      dos
72
#   CP1129                      aix
73
#   CP1250                      woe32
74
#   CP1251                      glibc solaris netbsd darwin woe32
75
#   CP1252                      aix woe32
76
#   CP1253                      woe32
77
#   CP1254                      woe32
78
#   CP1255                      glibc woe32
79
#   CP1256                      woe32
80
#   CP1257                      woe32
81
#   GB2312                  Y   glibc aix hpux irix solaris freebsd netbsd darwin
82
#   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
83
#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
84
#   EUC-TW                      glibc aix hpux irix osf solaris netbsd
85
#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin
86
#   BIG5-HKSCS                  glibc solaris
87
#   GBK                         glibc aix osf solaris woe32 dos
88
#   GB18030                     glibc solaris netbsd
89
#   SHIFT_JIS               Y   hpux osf solaris freebsd netbsd darwin
90
#   JOHAB                       glibc solaris woe32
91
#   TIS-620                     glibc aix hpux osf solaris
92
#   VISCII                  Y   glibc
93
#   TCVN5712-1                  glibc
94
#   GEORGIAN-PS                 glibc
95
#   HP-ROMAN8                   hpux
96
#   HP-ARABIC8                  hpux
97
#   HP-GREEK8                   hpux
98
#   HP-HEBREW8                  hpux
99
#   HP-TURKISH8                 hpux
100
#   HP-KANA8                    hpux
101
#   DEC-KANJI                   osf
102
#   DEC-HANYU                   osf
103
#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin
104
#
105
# Note: Names which are not marked as being a MIME name should not be used in
106
# Internet protocols for information interchange (mail, news, etc.).
107
#
108
# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
109
# must understand both names and treat them as equivalent.
110
#
111
# The first argument passed to this file is the canonical host specification,
112
#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
113
# or
114
#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
115
116
host="$1"
117
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
118
echo "# This file contains a table of character encoding aliases,"
119
echo "# suitable for operating system '${os}'."
120
echo "# It was automatically generated from config.charset."
121
# List of references, updated during installation:
122
echo "# Packages using this file: "
123
case "$os" in
124
    linux-gnulibc1*)
125
	# Linux libc5 doesn't have nl_langinfo(CODESET); therefore
126
	# localcharset.c falls back to using the full locale name
127
	# from the environment variables.
128
	echo "C ASCII"
129
	echo "POSIX ASCII"
130
	for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
131
	         en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
132
	         en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
133
	         es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
134
	         et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
135
	         fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
136
	         it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
137
	         sv_FI sv_SE; do
138
	  echo "$l ISO-8859-1"
139
	  echo "$l.iso-8859-1 ISO-8859-1"
140
	  echo "$l.iso-8859-15 ISO-8859-15"
141
	  echo "$l.iso-8859-15@euro ISO-8859-15"
142
	  echo "$l@euro ISO-8859-15"
143
	  echo "$l.cp-437 CP437"
144
	  echo "$l.cp-850 CP850"
145
	  echo "$l.cp-1252 CP1252"
146
	  echo "$l.cp-1252@euro CP1252"
147
	  #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
148
	  echo "$l.utf-8 UTF-8"
149
	  echo "$l.utf-8@euro UTF-8"
150
	done
151
	for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
152
	         sl_SI sr sr_CS sr_YU; do
153
	  echo "$l ISO-8859-2"
154
	  echo "$l.iso-8859-2 ISO-8859-2"
155
	  echo "$l.cp-852 CP852"
156
	  echo "$l.cp-1250 CP1250"
157
	  echo "$l.utf-8 UTF-8"
158
	done
159
	for l in mk mk_MK ru ru_RU; do
160
	  echo "$l ISO-8859-5"
161
	  echo "$l.iso-8859-5 ISO-8859-5"
162
	  echo "$l.koi8-r KOI8-R"
163
	  echo "$l.cp-866 CP866"
164
	  echo "$l.cp-1251 CP1251"
165
	  echo "$l.utf-8 UTF-8"
166
	done
167
	for l in ar ar_SA; do
168
	  echo "$l ISO-8859-6"
169
	  echo "$l.iso-8859-6 ISO-8859-6"
170
	  echo "$l.cp-864 CP864"
171
	  #echo "$l.cp-868 CP868" # not a commonly used encoding
172
	  echo "$l.cp-1256 CP1256"
173
	  echo "$l.utf-8 UTF-8"
174
	done
175
	for l in el el_GR gr gr_GR; do
176
	  echo "$l ISO-8859-7"
177
	  echo "$l.iso-8859-7 ISO-8859-7"
178
	  echo "$l.cp-869 CP869"
179
	  echo "$l.cp-1253 CP1253"
180
	  echo "$l.cp-1253@euro CP1253"
181
	  echo "$l.utf-8 UTF-8"
182
	  echo "$l.utf-8@euro UTF-8"
183
	done
184
	for l in he he_IL iw iw_IL; do
185
	  echo "$l ISO-8859-8"
186
	  echo "$l.iso-8859-8 ISO-8859-8"
187
	  echo "$l.cp-862 CP862"
188
	  echo "$l.cp-1255 CP1255"
189
	  echo "$l.utf-8 UTF-8"
190
	done
191
	for l in tr tr_TR; do
192
	  echo "$l ISO-8859-9"
193
	  echo "$l.iso-8859-9 ISO-8859-9"
194
	  echo "$l.cp-857 CP857"
195
	  echo "$l.cp-1254 CP1254"
196
	  echo "$l.utf-8 UTF-8"
197
	done
198
	for l in lt lt_LT lv lv_LV; do
199
	  #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
200
	  echo "$l ISO-8859-13"
201
	done
202
	for l in ru_UA uk uk_UA; do
203
	  echo "$l KOI8-U"
204
	done
205
	for l in zh zh_CN; do
206
	  #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
207
	  echo "$l GB2312"
208
	done
209
	for l in ja ja_JP ja_JP.EUC; do
210
	  echo "$l EUC-JP"
211
	done
212
	for l in ko ko_KR; do
213
	  echo "$l EUC-KR"
214
	done
215
	for l in th th_TH; do
216
	  echo "$l TIS-620"
217
	done
218
	for l in fa fa_IR; do
219
	  #echo "$l ISIRI-3342" # a broken encoding
220
	  echo "$l.utf-8 UTF-8"
221
	done
222
	;;
223
    linux* | *-gnu*)
224
	# With glibc-2.1 or newer, we don't need any canonicalization,
225
	# because glibc has iconv and both glibc and libiconv support all
226
	# GNU canonical names directly. Therefore, the Makefile does not
227
	# need to install the alias file at all.
228
	# The following applies only to glibc-2.0.x and older libcs.
229
	echo "ISO_646.IRV:1983 ASCII"
230
	;;
231
    aix*)
232
	echo "ISO8859-1 ISO-8859-1"
233
	echo "ISO8859-2 ISO-8859-2"
234
	echo "ISO8859-5 ISO-8859-5"
235
	echo "ISO8859-6 ISO-8859-6"
236
	echo "ISO8859-7 ISO-8859-7"
237
	echo "ISO8859-8 ISO-8859-8"
238
	echo "ISO8859-9 ISO-8859-9"
239
	echo "ISO8859-15 ISO-8859-15"
240
	echo "IBM-850 CP850"
241
	echo "IBM-856 CP856"
242
	echo "IBM-921 ISO-8859-13"
243
	echo "IBM-922 CP922"
244
	echo "IBM-932 CP932"
245
	echo "IBM-943 CP943"
246
	echo "IBM-1046 CP1046"
247
	echo "IBM-1124 CP1124"
248
	echo "IBM-1129 CP1129"
249
	echo "IBM-1252 CP1252"
250
	echo "IBM-eucCN GB2312"
251
	echo "IBM-eucJP EUC-JP"
252
	echo "IBM-eucKR EUC-KR"
253
	echo "IBM-eucTW EUC-TW"
254
	echo "big5 BIG5"
255
	echo "GBK GBK"
256
	echo "TIS-620 TIS-620"
257
	echo "UTF-8 UTF-8"
258
	;;
259
    hpux*)
260
	echo "iso88591 ISO-8859-1"
261
	echo "iso88592 ISO-8859-2"
262
	echo "iso88595 ISO-8859-5"
263
	echo "iso88596 ISO-8859-6"
264
	echo "iso88597 ISO-8859-7"
265
	echo "iso88598 ISO-8859-8"
266
	echo "iso88599 ISO-8859-9"
267
	echo "iso885915 ISO-8859-15"
268
	echo "roman8 HP-ROMAN8"
269
	echo "arabic8 HP-ARABIC8"
270
	echo "greek8 HP-GREEK8"
271
	echo "hebrew8 HP-HEBREW8"
272
	echo "turkish8 HP-TURKISH8"
273
	echo "kana8 HP-KANA8"
274
	echo "tis620 TIS-620"
275
	echo "big5 BIG5"
276
	echo "eucJP EUC-JP"
277
	echo "eucKR EUC-KR"
278
	echo "eucTW EUC-TW"
279
	echo "hp15CN GB2312"
280
	#echo "ccdc ?" # what is this?
281
	echo "SJIS SHIFT_JIS"
282
	echo "utf8 UTF-8"
283
	;;
284
    irix*)
285
	echo "ISO8859-1 ISO-8859-1"
286
	echo "ISO8859-2 ISO-8859-2"
287
	echo "ISO8859-5 ISO-8859-5"
288
	echo "ISO8859-7 ISO-8859-7"
289
	echo "ISO8859-9 ISO-8859-9"
290
	echo "eucCN GB2312"
291
	echo "eucJP EUC-JP"
292
	echo "eucKR EUC-KR"
293
	echo "eucTW EUC-TW"
294
	;;
295
    osf*)
296
	echo "ISO8859-1 ISO-8859-1"
297
	echo "ISO8859-2 ISO-8859-2"
298
	echo "ISO8859-4 ISO-8859-4"
299
	echo "ISO8859-5 ISO-8859-5"
300
	echo "ISO8859-7 ISO-8859-7"
301
	echo "ISO8859-8 ISO-8859-8"
302
	echo "ISO8859-9 ISO-8859-9"
303
	echo "ISO8859-15 ISO-8859-15"
304
	echo "cp850 CP850"
305
	echo "big5 BIG5"
306
	echo "dechanyu DEC-HANYU"
307
	echo "dechanzi GB2312"
308
	echo "deckanji DEC-KANJI"
309
	echo "deckorean EUC-KR"
310
	echo "eucJP EUC-JP"
311
	echo "eucKR EUC-KR"
312
	echo "eucTW EUC-TW"
313
	echo "GBK GBK"
314
	echo "KSC5601 CP949"
315
	echo "sdeckanji EUC-JP"
316
	echo "SJIS SHIFT_JIS"
317
	echo "TACTIS TIS-620"
318
	echo "UTF-8 UTF-8"
319
	;;
320
    solaris*)
321
	echo "646 ASCII"
322
	echo "ISO8859-1 ISO-8859-1"
323
	echo "ISO8859-2 ISO-8859-2"
324
	echo "ISO8859-3 ISO-8859-3"
325
	echo "ISO8859-4 ISO-8859-4"
326
	echo "ISO8859-5 ISO-8859-5"
327
	echo "ISO8859-6 ISO-8859-6"
328
	echo "ISO8859-7 ISO-8859-7"
329
	echo "ISO8859-8 ISO-8859-8"
330
	echo "ISO8859-9 ISO-8859-9"
331
	echo "ISO8859-15 ISO-8859-15"
332
	echo "koi8-r KOI8-R"
333
	echo "ansi-1251 CP1251"
334
	echo "BIG5 BIG5"
335
	echo "Big5-HKSCS BIG5-HKSCS"
336
	echo "gb2312 GB2312"
337
	echo "GBK GBK"
338
	echo "GB18030 GB18030"
339
	echo "cns11643 EUC-TW"
340
	echo "5601 EUC-KR"
341
	echo "ko_KR.johap92 JOHAB"
342
	echo "eucJP EUC-JP"
343
	echo "PCK SHIFT_JIS"
344
	echo "TIS620.2533 TIS-620"
345
	#echo "sun_eu_greek ?" # what is this?
346
	echo "UTF-8 UTF-8"
347
	;;
348
    freebsd* | os2*)
349
	# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
350
	# localcharset.c falls back to using the full locale name
351
	# from the environment variables.
352
	# Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
353
	# reuse FreeBSD's locale data for OS/2.
354
	echo "C ASCII"
355
	echo "US-ASCII ASCII"
356
	for l in la_LN lt_LN; do
357
	  echo "$l.ASCII ASCII"
358
	done
359
	for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
360
	         fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
361
	         lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
362
	  echo "$l.ISO_8859-1 ISO-8859-1"
363
	  echo "$l.DIS_8859-15 ISO-8859-15"
364
	done
365
	for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
366
	  echo "$l.ISO_8859-2 ISO-8859-2"
367
	done
368
	for l in la_LN lt_LT; do
369
	  echo "$l.ISO_8859-4 ISO-8859-4"
370
	done
371
	for l in ru_RU ru_SU; do
372
	  echo "$l.KOI8-R KOI8-R"
373
	  echo "$l.ISO_8859-5 ISO-8859-5"
374
	  echo "$l.CP866 CP866"
375
	done
376
	echo "uk_UA.KOI8-U KOI8-U"
377
	echo "zh_TW.BIG5 BIG5"
378
	echo "zh_TW.Big5 BIG5"
379
	echo "zh_CN.EUC GB2312"
380
	echo "ja_JP.EUC EUC-JP"
381
	echo "ja_JP.SJIS SHIFT_JIS"
382
	echo "ja_JP.Shift_JIS SHIFT_JIS"
383
	echo "ko_KR.EUC EUC-KR"
384
	;;
385
    netbsd*)
386
	echo "646 ASCII"
387
	echo "ISO8859-1 ISO-8859-1"
388
	echo "ISO8859-2 ISO-8859-2"
389
	echo "ISO8859-4 ISO-8859-4"
390
	echo "ISO8859-5 ISO-8859-5"
391
	echo "ISO8859-7 ISO-8859-7"
392
	echo "ISO8859-13 ISO-8859-13"
393
	echo "ISO8859-15 ISO-8859-15"
394
	echo "eucCN GB2312"
395
	echo "eucJP EUC-JP"
396
	echo "eucKR EUC-KR"
397
	echo "eucTW EUC-TW"
398
	echo "BIG5 BIG5"
399
	echo "SJIS SHIFT_JIS"
400
	;;
401
    darwin[56]*)
402
	# Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
403
	# localcharset.c falls back to using the full locale name
404
	# from the environment variables.
405
	echo "C ASCII"
406
	for l in en_AU en_CA en_GB en_US la_LN; do
407
	  echo "$l.US-ASCII ASCII"
408
	done
409
	for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
410
	         fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
411
	         nl_NL no_NO pt_PT sv_SE; do
412
	  echo "$l ISO-8859-1"
413
	  echo "$l.ISO8859-1 ISO-8859-1"
414
	  echo "$l.ISO8859-15 ISO-8859-15"
415
	done
416
	for l in la_LN; do
417
	  echo "$l.ISO8859-1 ISO-8859-1"
418
	  echo "$l.ISO8859-15 ISO-8859-15"
419
	done
420
	for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
421
	  echo "$l.ISO8859-2 ISO-8859-2"
422
	done
423
	for l in la_LN lt_LT; do
424
	  echo "$l.ISO8859-4 ISO-8859-4"
425
	done
426
	for l in ru_RU; do
427
	  echo "$l.KOI8-R KOI8-R"
428
	  echo "$l.ISO8859-5 ISO-8859-5"
429
	  echo "$l.CP866 CP866"
430
	done
431
	for l in bg_BG; do
432
	  echo "$l.CP1251 CP1251"
433
	done
434
	echo "uk_UA.KOI8-U KOI8-U"
435
	echo "zh_TW.BIG5 BIG5"
436
	echo "zh_TW.Big5 BIG5"
437
	echo "zh_CN.EUC GB2312"
438
	echo "ja_JP.EUC EUC-JP"
439
	echo "ja_JP.SJIS SHIFT_JIS"
440
	echo "ko_KR.EUC EUC-KR"
441
	;;
442
    darwin*)
443
	# Darwin 7.5 has nl_langinfo(CODESET), but it is useless:
444
	# - It returns the empty string when LANG is set to a locale of the
445
	#   form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
446
	#   LC_CTYPE file.
447
	# - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
448
	#   the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
449
	# - The documentation says:
450
	#     "... all code that calls BSD system routines should ensure
451
	#      that the const *char parameters of these routines are in UTF-8
452
	#      encoding. All BSD system functions expect their string
453
	#      parameters to be in UTF-8 encoding and nothing else."
454
	#   It also says
455
	#     "An additional caveat is that string parameters for files,
456
	#      paths, and other file-system entities must be in canonical
457
	#      UTF-8. In a canonical UTF-8 Unicode string, all decomposable
458
	#      characters are decomposed ..."
459
	#   but this is not true: You can pass non-decomposed UTF-8 strings
460
	#   to file system functions, and it is the OS which will convert
461
	#   them to decomposed UTF-8 before accessing the file system.
462
	# - The Apple Terminal application displays UTF-8 by default.
463
	# - However, other applications are free to use different encodings:
464
	#   - xterm uses ISO-8859-1 by default.
465
	#   - TextEdit uses MacRoman by default.
466
	# We prefer UTF-8 over decomposed UTF-8-MAC because one should
467
	# minimize the use of decomposed Unicode. Unfortunately, through the
468
	# Darwin file system, decomposed UTF-8 strings are leaked into user
469
	# space nevertheless.
470
	echo "* UTF-8"
471
	;;
472
    beos*)
473
	# BeOS has a single locale, and it has UTF-8 encoding.
474
	echo "* UTF-8"
475
	;;
476
    msdosdjgpp*)
477
	# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
478
	# localcharset.c falls back to using the full locale name
479
	# from the environment variables.
480
	echo "#"
481
	echo "# The encodings given here may not all be correct."
482
	echo "# If you find that the encoding given for your language and"
483
	echo "# country is not the one your DOS machine actually uses, just"
484
	echo "# correct it in this file, and send a mail to"
485
	echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
486
	echo "# and Bruno Haible <bruno@clisp.org>."
487
	echo "#"
488
	echo "C ASCII"
489
	# ISO-8859-1 languages
490
	echo "ca CP850"
491
	echo "ca_ES CP850"
492
	echo "da CP865"    # not CP850 ??
493
	echo "da_DK CP865" # not CP850 ??
494
	echo "de CP850"
495
	echo "de_AT CP850"
496
	echo "de_CH CP850"
497
	echo "de_DE CP850"
498
	echo "en CP850"
499
	echo "en_AU CP850" # not CP437 ??
500
	echo "en_CA CP850"
501
	echo "en_GB CP850"
502
	echo "en_NZ CP437"
503
	echo "en_US CP437"
504
	echo "en_ZA CP850" # not CP437 ??
505
	echo "es CP850"
506
	echo "es_AR CP850"
507
	echo "es_BO CP850"
508
	echo "es_CL CP850"
509
	echo "es_CO CP850"
510
	echo "es_CR CP850"
511
	echo "es_CU CP850"
512
	echo "es_DO CP850"
513
	echo "es_EC CP850"
514
	echo "es_ES CP850"
515
	echo "es_GT CP850"
516
	echo "es_HN CP850"
517
	echo "es_MX CP850"
518
	echo "es_NI CP850"
519
	echo "es_PA CP850"
520
	echo "es_PY CP850"
521
	echo "es_PE CP850"
522
	echo "es_SV CP850"
523
	echo "es_UY CP850"
524
	echo "es_VE CP850"
525
	echo "et CP850"
526
	echo "et_EE CP850"
527
	echo "eu CP850"
528
	echo "eu_ES CP850"
529
	echo "fi CP850"
530
	echo "fi_FI CP850"
531
	echo "fr CP850"
532
	echo "fr_BE CP850"
533
	echo "fr_CA CP850"
534
	echo "fr_CH CP850"
535
	echo "fr_FR CP850"
536
	echo "ga CP850"
537
	echo "ga_IE CP850"
538
	echo "gd CP850"
539
	echo "gd_GB CP850"
540
	echo "gl CP850"
541
	echo "gl_ES CP850"
542
	echo "id CP850"    # not CP437 ??
543
	echo "id_ID CP850" # not CP437 ??
544
	echo "is CP861"    # not CP850 ??
545
	echo "is_IS CP861" # not CP850 ??
546
	echo "it CP850"
547
	echo "it_CH CP850"
548
	echo "it_IT CP850"
549
	echo "lt CP775"
550
	echo "lt_LT CP775"
551
	echo "lv CP775"
552
	echo "lv_LV CP775"
553
	echo "nb CP865"    # not CP850 ??
554
	echo "nb_NO CP865" # not CP850 ??
555
	echo "nl CP850"
556
	echo "nl_BE CP850"
557
	echo "nl_NL CP850"
558
	echo "nn CP865"    # not CP850 ??
559
	echo "nn_NO CP865" # not CP850 ??
560
	echo "no CP865"    # not CP850 ??
561
	echo "no_NO CP865" # not CP850 ??
562
	echo "pt CP850"
563
	echo "pt_BR CP850"
564
	echo "pt_PT CP850"
565
	echo "sv CP850"
566
	echo "sv_SE CP850"
567
	# ISO-8859-2 languages
568
	echo "cs CP852"
569
	echo "cs_CZ CP852"
570
	echo "hr CP852"
571
	echo "hr_HR CP852"
572
	echo "hu CP852"
573
	echo "hu_HU CP852"
574
	echo "pl CP852"
575
	echo "pl_PL CP852"
576
	echo "ro CP852"
577
	echo "ro_RO CP852"
578
	echo "sk CP852"
579
	echo "sk_SK CP852"
580
	echo "sl CP852"
581
	echo "sl_SI CP852"
582
	echo "sq CP852"
583
	echo "sq_AL CP852"
584
	echo "sr CP852"    # CP852 or CP866 or CP855 ??
585
	echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
586
	echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
587
	# ISO-8859-3 languages
588
	echo "mt CP850"
589
	echo "mt_MT CP850"
590
	# ISO-8859-5 languages
591
	echo "be CP866"
592
	echo "be_BE CP866"
593
	echo "bg CP866"    # not CP855 ??
594
	echo "bg_BG CP866" # not CP855 ??
595
	echo "mk CP866"    # not CP855 ??
596
	echo "mk_MK CP866" # not CP855 ??
597
	echo "ru CP866"
598
	echo "ru_RU CP866"
599
	echo "uk CP1125"
600
	echo "uk_UA CP1125"
601
	# ISO-8859-6 languages
602
	echo "ar CP864"
603
	echo "ar_AE CP864"
604
	echo "ar_DZ CP864"
605
	echo "ar_EG CP864"
606
	echo "ar_IQ CP864"
607
	echo "ar_IR CP864"
608
	echo "ar_JO CP864"
609
	echo "ar_KW CP864"
610
	echo "ar_MA CP864"
611
	echo "ar_OM CP864"
612
	echo "ar_QA CP864"
613
	echo "ar_SA CP864"
614
	echo "ar_SY CP864"
615
	# ISO-8859-7 languages
616
	echo "el CP869"
617
	echo "el_GR CP869"
618
	# ISO-8859-8 languages
619
	echo "he CP862"
620
	echo "he_IL CP862"
621
	# ISO-8859-9 languages
622
	echo "tr CP857"
623
	echo "tr_TR CP857"
624
	# Japanese
625
	echo "ja CP932"
626
	echo "ja_JP CP932"
627
	# Chinese
628
	echo "zh_CN GBK"
629
	echo "zh_TW CP950" # not CP938 ??
630
	# Korean
631
	echo "kr CP949"    # not CP934 ??
632
	echo "kr_KR CP949" # not CP934 ??
633
	# Thai
634
	echo "th CP874"
635
	echo "th_TH CP874"
636
	# Other
637
	echo "eo CP850"
638
	echo "eo_EO CP850"
639
	;;
640
esac
(-)a/intl/dcgettext.c (-56 lines)
Lines 1-56 Link Here
1
/* Implementation of the dcgettext(3) function.
2
   Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22
23
#include "gettextP.h"
24
#ifdef _LIBC
25
# include <libintl.h>
26
#else
27
# include "libgnuintl.h"
28
#endif
29
30
/* @@ end of prolog @@ */
31
32
/* Names for the libintl functions are a problem.  They must not clash
33
   with existing names and they should follow ANSI C.  But this source
34
   code is also used in GNU C Library where the names have a __
35
   prefix.  So we have to make a difference here.  */
36
#ifdef _LIBC
37
# define DCGETTEXT __dcgettext
38
# define DCIGETTEXT __dcigettext
39
#else
40
# define DCGETTEXT libintl_dcgettext
41
# define DCIGETTEXT libintl_dcigettext
42
#endif
43
44
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
45
   locale.  */
46
char *
47
DCGETTEXT (const char *domainname, const char *msgid, int category)
48
{
49
  return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
50
}
51
52
#ifdef _LIBC
53
/* Alias for function name in GNU C Library.  */
54
INTDEF(__dcgettext)
55
weak_alias (__dcgettext, dcgettext);
56
#endif
(-)a/intl/dcigettext.c (-1654 lines)
Lines 1-1654 Link Here
1
/* Implementation of the internal dcigettext function.
2
   Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
20
   This must come before <config.h> because <config.h> may include
21
   <features.h>, and once <features.h> has been included, it's too late.  */
22
#ifndef _GNU_SOURCE
23
# define _GNU_SOURCE	1
24
#endif
25
26
#ifdef HAVE_CONFIG_H
27
# include <config.h>
28
#endif
29
30
/* NL_LOCALE_NAME does not work in glibc-2.4.  Ignore it.  */
31
#undef HAVE_NL_LOCALE_NAME
32
33
#include <sys/types.h>
34
35
#ifdef __GNUC__
36
# define alloca __builtin_alloca
37
# define HAVE_ALLOCA 1
38
#else
39
# ifdef _MSC_VER
40
#  include <malloc.h>
41
#  define alloca _alloca
42
# else
43
#  if defined HAVE_ALLOCA_H || defined _LIBC
44
#   include <alloca.h>
45
#  else
46
#   ifdef _AIX
47
 #pragma alloca
48
#   else
49
#    ifndef alloca
50
char *alloca ();
51
#    endif
52
#   endif
53
#  endif
54
# endif
55
#endif
56
57
#include <errno.h>
58
#ifndef errno
59
extern int errno;
60
#endif
61
#ifndef __set_errno
62
# define __set_errno(val) errno = (val)
63
#endif
64
65
#include <stddef.h>
66
#include <stdlib.h>
67
#include <string.h>
68
69
#if defined HAVE_UNISTD_H || defined _LIBC
70
# include <unistd.h>
71
#endif
72
73
#include <locale.h>
74
75
#ifdef _LIBC
76
  /* Guess whether integer division by zero raises signal SIGFPE.
77
     Set to 1 only if you know for sure.  In case of doubt, set to 0.  */
78
# if defined __alpha__ || defined __arm__ || defined __i386__ \
79
     || defined __m68k__ || defined __s390__
80
#  define INTDIV0_RAISES_SIGFPE 1
81
# else
82
#  define INTDIV0_RAISES_SIGFPE 0
83
# endif
84
#endif
85
#if !INTDIV0_RAISES_SIGFPE
86
# include <signal.h>
87
#endif
88
89
#if defined HAVE_SYS_PARAM_H || defined _LIBC
90
# include <sys/param.h>
91
#endif
92
93
#if !defined _LIBC && HAVE_NL_LOCALE_NAME
94
# include <langinfo.h>
95
#endif
96
97
#include "gettextP.h"
98
#include "plural-exp.h"
99
#ifdef _LIBC
100
# include <libintl.h>
101
#else
102
# ifdef IN_LIBGLOCALE
103
#  include <libintl.h>
104
# endif
105
# include "libgnuintl.h"
106
#endif
107
#include "hash-string.h"
108
109
/* Handle multi-threaded applications.  */
110
#ifdef _LIBC
111
# include <bits/libc-lock.h>
112
# define gl_rwlock_define_initialized __libc_rwlock_define_initialized
113
# define gl_rwlock_rdlock __libc_rwlock_rdlock
114
# define gl_rwlock_wrlock __libc_rwlock_wrlock
115
# define gl_rwlock_unlock __libc_rwlock_unlock
116
#else
117
# include "lock.h"
118
#endif
119
120
/* Alignment of types.  */
121
#if defined __GNUC__ && __GNUC__ >= 2
122
# define alignof(TYPE) __alignof__ (TYPE)
123
#else
124
# define alignof(TYPE) \
125
    ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
126
#endif
127
128
/* The internal variables in the standalone libintl.a must have different
129
   names than the internal variables in GNU libc, otherwise programs
130
   using libintl.a cannot be linked statically.  */
131
#if !defined _LIBC
132
# define _nl_default_default_domain libintl_nl_default_default_domain
133
# define _nl_current_default_domain libintl_nl_current_default_domain
134
# define _nl_default_dirname libintl_nl_default_dirname
135
# define _nl_domain_bindings libintl_nl_domain_bindings
136
#endif
137
138
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>.  */
139
#ifndef offsetof
140
# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
141
#endif
142
143
/* @@ end of prolog @@ */
144
145
#ifdef _LIBC
146
/* Rename the non ANSI C functions.  This is required by the standard
147
   because some ANSI C functions will require linking with this object
148
   file and the name space must not be polluted.  */
149
# define getcwd __getcwd
150
# ifndef stpcpy
151
#  define stpcpy __stpcpy
152
# endif
153
# define tfind __tfind
154
#else
155
# if !defined HAVE_GETCWD
156
char *getwd ();
157
#  define getcwd(buf, max) getwd (buf)
158
# else
159
#  if VMS
160
#   define getcwd(buf, max) (getcwd) (buf, max, 0)
161
#  else
162
char *getcwd ();
163
#  endif
164
# endif
165
# ifndef HAVE_STPCPY
166
static char *stpcpy (char *dest, const char *src);
167
# endif
168
# ifndef HAVE_MEMPCPY
169
static void *mempcpy (void *dest, const void *src, size_t n);
170
# endif
171
#endif
172
173
/* Amount to increase buffer size by in each try.  */
174
#define PATH_INCR 32
175
176
/* The following is from pathmax.h.  */
177
/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
178
   PATH_MAX but might cause redefinition warnings when sys/param.h is
179
   later included (as on MORE/BSD 4.3).  */
180
#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__)
181
# include <limits.h>
182
#endif
183
184
#ifndef _POSIX_PATH_MAX
185
# define _POSIX_PATH_MAX 255
186
#endif
187
188
#if !defined PATH_MAX && defined _PC_PATH_MAX
189
# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
190
#endif
191
192
/* Don't include sys/param.h if it already has been.  */
193
#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
194
# include <sys/param.h>
195
#endif
196
197
#if !defined PATH_MAX && defined MAXPATHLEN
198
# define PATH_MAX MAXPATHLEN
199
#endif
200
201
#ifndef PATH_MAX
202
# define PATH_MAX _POSIX_PATH_MAX
203
#endif
204
205
/* Pathname support.
206
   ISSLASH(C)           tests whether C is a directory separator character.
207
   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
208
                        it may be concatenated to a directory pathname.
209
   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
210
 */
211
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
212
  /* Win32, Cygwin, OS/2, DOS */
213
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
214
# define HAS_DEVICE(P) \
215
    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
216
     && (P)[1] == ':')
217
# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
218
# define IS_PATH_WITH_DIR(P) \
219
    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
220
#else
221
  /* Unix */
222
# define ISSLASH(C) ((C) == '/')
223
# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
224
# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
225
#endif
226
227
/* Whether to support different locales in different threads.  */
228
#if defined _LIBC || HAVE_NL_LOCALE_NAME || (HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS) || defined IN_LIBGLOCALE
229
# define HAVE_PER_THREAD_LOCALE
230
#endif
231
232
/* This is the type used for the search tree where known translations
233
   are stored.  */
234
struct known_translation_t
235
{
236
  /* Domain in which to search.  */
237
  const char *domainname;
238
239
  /* The category.  */
240
  int category;
241
242
#ifdef HAVE_PER_THREAD_LOCALE
243
  /* Name of the relevant locale category, or "" for the global locale.  */
244
  const char *localename;
245
#endif
246
247
#ifdef IN_LIBGLOCALE
248
  /* The character encoding.  */
249
  const char *encoding;
250
#endif
251
252
  /* State of the catalog counter at the point the string was found.  */
253
  int counter;
254
255
  /* Catalog where the string was found.  */
256
  struct loaded_l10nfile *domain;
257
258
  /* And finally the translation.  */
259
  const char *translation;
260
  size_t translation_length;
261
262
  /* Pointer to the string in question.  */
263
  char msgid[ZERO];
264
};
265
266
/* Root of the search tree with known translations.  We can use this
267
   only if the system provides the `tsearch' function family.  */
268
#if defined HAVE_TSEARCH || defined _LIBC
269
# include <search.h>
270
271
gl_rwlock_define_initialized (static, tree_lock)
272
273
static void *root;
274
275
# ifdef _LIBC
276
#  define tsearch __tsearch
277
# endif
278
279
/* Function to compare two entries in the table of known translations.  */
280
static int
281
transcmp (const void *p1, const void *p2)
282
{
283
  const struct known_translation_t *s1;
284
  const struct known_translation_t *s2;
285
  int result;
286
287
  s1 = (const struct known_translation_t *) p1;
288
  s2 = (const struct known_translation_t *) p2;
289
290
  result = strcmp (s1->msgid, s2->msgid);
291
  if (result == 0)
292
    {
293
      result = strcmp (s1->domainname, s2->domainname);
294
      if (result == 0)
295
	{
296
#ifdef HAVE_PER_THREAD_LOCALE
297
	  result = strcmp (s1->localename, s2->localename);
298
	  if (result == 0)
299
#endif
300
	    {
301
#ifdef IN_LIBGLOCALE
302
	      result = strcmp (s1->encoding, s2->encoding);
303
	      if (result == 0)
304
#endif
305
		/* We compare the category last (though this is the cheapest
306
		   operation) since it is hopefully always the same (namely
307
		   LC_MESSAGES).  */
308
		result = s1->category - s2->category;
309
	    }
310
	}
311
    }
312
313
  return result;
314
}
315
#endif
316
317
/* Name of the default domain used for gettext(3) prior any call to
318
   textdomain(3).  The default value for this is "messages".  */
319
const char _nl_default_default_domain[] attribute_hidden = "messages";
320
321
#ifndef IN_LIBGLOCALE
322
/* Value used as the default domain for gettext(3).  */
323
const char *_nl_current_default_domain attribute_hidden
324
     = _nl_default_default_domain;
325
#endif
326
327
/* Contains the default location of the message catalogs.  */
328
#if defined __EMX__
329
extern const char _nl_default_dirname[];
330
#else
331
# ifdef _LIBC
332
extern const char _nl_default_dirname[];
333
libc_hidden_proto (_nl_default_dirname)
334
# endif
335
const char _nl_default_dirname[] = LOCALEDIR;
336
# ifdef _LIBC
337
libc_hidden_data_def (_nl_default_dirname)
338
# endif
339
#endif
340
341
#ifndef IN_LIBGLOCALE
342
/* List with bindings of specific domains created by bindtextdomain()
343
   calls.  */
344
struct binding *_nl_domain_bindings;
345
#endif
346
347
/* Prototypes for local functions.  */
348
static char *plural_lookup (struct loaded_l10nfile *domain,
349
			    unsigned long int n,
350
			    const char *translation, size_t translation_len)
351
     internal_function;
352
353
#ifdef IN_LIBGLOCALE
354
static const char *guess_category_value (int category,
355
					 const char *categoryname,
356
					 const char *localename)
357
     internal_function;
358
#else
359
static const char *guess_category_value (int category,
360
					 const char *categoryname)
361
     internal_function;
362
#endif
363
364
#ifdef _LIBC
365
# include "../locale/localeinfo.h"
366
# define category_to_name(category) \
367
  _nl_category_names.str + _nl_category_name_idxs[category]
368
#else
369
static const char *category_to_name (int category) internal_function;
370
#endif
371
#if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE
372
static const char *get_output_charset (struct binding *domainbinding)
373
     internal_function;
374
#endif
375
376
377
/* For those loosing systems which don't have `alloca' we have to add
378
   some additional code emulating it.  */
379
#ifdef HAVE_ALLOCA
380
/* Nothing has to be done.  */
381
# define freea(p) /* nothing */
382
# define ADD_BLOCK(list, address) /* nothing */
383
# define FREE_BLOCKS(list) /* nothing */
384
#else
385
struct block_list
386
{
387
  void *address;
388
  struct block_list *next;
389
};
390
# define ADD_BLOCK(list, addr)						      \
391
  do {									      \
392
    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
393
    /* If we cannot get a free block we cannot add the new element to	      \
394
       the list.  */							      \
395
    if (newp != NULL) {							      \
396
      newp->address = (addr);						      \
397
      newp->next = (list);						      \
398
      (list) = newp;							      \
399
    }									      \
400
  } while (0)
401
# define FREE_BLOCKS(list)						      \
402
  do {									      \
403
    while (list != NULL) {						      \
404
      struct block_list *old = list;					      \
405
      list = list->next;						      \
406
      free (old->address);						      \
407
      free (old);							      \
408
    }									      \
409
  } while (0)
410
# undef alloca
411
# define alloca(size) (malloc (size))
412
# define freea(p) free (p)
413
#endif	/* have alloca */
414
415
416
#ifdef _LIBC
417
/* List of blocks allocated for translations.  */
418
typedef struct transmem_list
419
{
420
  struct transmem_list *next;
421
  char data[ZERO];
422
} transmem_block_t;
423
static struct transmem_list *transmem_list;
424
#else
425
typedef unsigned char transmem_block_t;
426
#endif
427
428
429
/* Names for the libintl functions are a problem.  They must not clash
430
   with existing names and they should follow ANSI C.  But this source
431
   code is also used in GNU C Library where the names have a __
432
   prefix.  So we have to make a difference here.  */
433
#ifdef _LIBC
434
# define DCIGETTEXT __dcigettext
435
#else
436
# define DCIGETTEXT libintl_dcigettext
437
#endif
438
439
/* Lock variable to protect the global data in the gettext implementation.  */
440
gl_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
441
442
/* Checking whether the binaries runs SUID must be done and glibc provides
443
   easier methods therefore we make a difference here.  */
444
#ifdef _LIBC
445
# define ENABLE_SECURE __libc_enable_secure
446
# define DETERMINE_SECURE
447
#else
448
# ifndef HAVE_GETUID
449
#  define getuid() 0
450
# endif
451
# ifndef HAVE_GETGID
452
#  define getgid() 0
453
# endif
454
# ifndef HAVE_GETEUID
455
#  define geteuid() getuid()
456
# endif
457
# ifndef HAVE_GETEGID
458
#  define getegid() getgid()
459
# endif
460
static int enable_secure;
461
# define ENABLE_SECURE (enable_secure == 1)
462
# define DETERMINE_SECURE \
463
  if (enable_secure == 0)						      \
464
    {									      \
465
      if (getuid () != geteuid () || getgid () != getegid ())		      \
466
	enable_secure = 1;						      \
467
      else								      \
468
	enable_secure = -1;						      \
469
    }
470
#endif
471
472
/* Get the function to evaluate the plural expression.  */
473
#include "eval-plural.h"
474
475
/* Look up MSGID in the DOMAINNAME message catalog for the current
476
   CATEGORY locale and, if PLURAL is nonzero, search over string
477
   depending on the plural form determined by N.  */
478
#ifdef IN_LIBGLOCALE
479
char *
480
gl_dcigettext (const char *domainname,
481
	       const char *msgid1, const char *msgid2,
482
	       int plural, unsigned long int n,
483
	       int category,
484
	       const char *localename, const char *encoding)
485
#else
486
char *
487
DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
488
	    int plural, unsigned long int n, int category)
489
#endif
490
{
491
#ifndef HAVE_ALLOCA
492
  struct block_list *block_list = NULL;
493
#endif
494
  struct loaded_l10nfile *domain;
495
  struct binding *binding;
496
  const char *categoryname;
497
  const char *categoryvalue;
498
  const char *dirname;
499
  char *xdomainname;
500
  char *single_locale;
501
  char *retval;
502
  size_t retlen;
503
  int saved_errno;
504
#if defined HAVE_TSEARCH || defined _LIBC
505
  struct known_translation_t *search;
506
  struct known_translation_t **foundp = NULL;
507
  size_t msgid_len;
508
# if defined HAVE_PER_THREAD_LOCALE && !defined IN_LIBGLOCALE
509
  const char *localename;
510
# endif
511
#endif
512
  size_t domainname_len;
513
514
  /* If no real MSGID is given return NULL.  */
515
  if (msgid1 == NULL)
516
    return NULL;
517
518
#ifdef _LIBC
519
  if (category < 0 || category >= __LC_LAST || category == LC_ALL)
520
    /* Bogus.  */
521
    return (plural == 0
522
	    ? (char *) msgid1
523
	    /* Use the Germanic plural rule.  */
524
	    : n == 1 ? (char *) msgid1 : (char *) msgid2);
525
#endif
526
527
  gl_rwlock_rdlock (_nl_state_lock);
528
529
  /* If DOMAINNAME is NULL, we are interested in the default domain.  If
530
     CATEGORY is not LC_MESSAGES this might not make much sense but the
531
     definition left this undefined.  */
532
  if (domainname == NULL)
533
    domainname = _nl_current_default_domain;
534
535
  /* OS/2 specific: backward compatibility with older libintl versions  */
536
#ifdef LC_MESSAGES_COMPAT
537
  if (category == LC_MESSAGES_COMPAT)
538
    category = LC_MESSAGES;
539
#endif
540
541
#if defined HAVE_TSEARCH || defined _LIBC
542
  msgid_len = strlen (msgid1) + 1;
543
544
  /* Try to find the translation among those which we found at
545
     some time.  */
546
  search = (struct known_translation_t *)
547
	   alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
548
  memcpy (search->msgid, msgid1, msgid_len);
549
  search->domainname = domainname;
550
  search->category = category;
551
# ifdef HAVE_PER_THREAD_LOCALE
552
#  ifndef IN_LIBGLOCALE
553
#   ifdef _LIBC
554
  localename = __current_locale_name (category);
555
#   else
556
#    if HAVE_NL_LOCALE_NAME
557
  /* NL_LOCALE_NAME is public glibc API introduced in glibc-2.4.  */
558
  localename = nl_langinfo (NL_LOCALE_NAME (category));
559
#    else
560
#     if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS
561
  /* The __names field is not public glibc API and must therefore not be used
562
     in code that is installed in public locations.  */
563
  {
564
    locale_t thread_locale = uselocale (NULL);
565
    if (thread_locale != LC_GLOBAL_LOCALE)
566
      localename = thread_locale->__names[category];
567
    else
568
      localename = "";
569
  }
570
#     endif
571
#    endif
572
#   endif
573
#  endif
574
  search->localename = localename;
575
#  ifdef IN_LIBGLOCALE
576
  search->encoding = encoding;
577
#  endif
578
# endif
579
580
  /* Since tfind/tsearch manage a balanced tree, concurrent tfind and
581
     tsearch calls can be fatal.  */
582
  gl_rwlock_rdlock (tree_lock);
583
584
  foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
585
586
  gl_rwlock_unlock (tree_lock);
587
588
  freea (search);
589
  if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
590
    {
591
      /* Now deal with plural.  */
592
      if (plural)
593
	retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation,
594
				(*foundp)->translation_length);
595
      else
596
	retval = (char *) (*foundp)->translation;
597
598
      gl_rwlock_unlock (_nl_state_lock);
599
      return retval;
600
    }
601
#endif
602
603
  /* Preserve the `errno' value.  */
604
  saved_errno = errno;
605
606
  /* See whether this is a SUID binary or not.  */
607
  DETERMINE_SECURE;
608
609
  /* First find matching binding.  */
610
#ifdef IN_LIBGLOCALE
611
  /* We can use a trivial binding, since _nl_find_msg will ignore it anyway,
612
     and _nl_load_domain and _nl_find_domain just pass it through.  */
613
  binding = NULL;
614
  dirname = bindtextdomain (domainname, NULL);
615
#else
616
  for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
617
    {
618
      int compare = strcmp (domainname, binding->domainname);
619
      if (compare == 0)
620
	/* We found it!  */
621
	break;
622
      if (compare < 0)
623
	{
624
	  /* It is not in the list.  */
625
	  binding = NULL;
626
	  break;
627
	}
628
    }
629
630
  if (binding == NULL)
631
    dirname = _nl_default_dirname;
632
  else
633
    {
634
      dirname = binding->dirname;
635
#endif
636
      if (!IS_ABSOLUTE_PATH (dirname))
637
	{
638
	  /* We have a relative path.  Make it absolute now.  */
639
	  size_t dirname_len = strlen (dirname) + 1;
640
	  size_t path_max;
641
	  char *resolved_dirname;
642
	  char *ret;
643
644
	  path_max = (unsigned int) PATH_MAX;
645
	  path_max += 2;		/* The getcwd docs say to do this.  */
646
647
	  for (;;)
648
	    {
649
	      resolved_dirname = (char *) alloca (path_max + dirname_len);
650
	      ADD_BLOCK (block_list, tmp_dirname);
651
652
	      __set_errno (0);
653
	      ret = getcwd (resolved_dirname, path_max);
654
	      if (ret != NULL || errno != ERANGE)
655
		break;
656
657
	      path_max += path_max / 2;
658
	      path_max += PATH_INCR;
659
	    }
660
661
	  if (ret == NULL)
662
	    /* We cannot get the current working directory.  Don't signal an
663
	       error but simply return the default string.  */
664
	    goto return_untranslated;
665
666
	  stpcpy (stpcpy (strchr (resolved_dirname, '\0'), "/"), dirname);
667
	  dirname = resolved_dirname;
668
	}
669
#ifndef IN_LIBGLOCALE
670
    }
671
#endif
672
673
  /* Now determine the symbolic name of CATEGORY and its value.  */
674
  categoryname = category_to_name (category);
675
#ifdef IN_LIBGLOCALE
676
  categoryvalue = guess_category_value (category, categoryname, localename);
677
#else
678
  categoryvalue = guess_category_value (category, categoryname);
679
#endif
680
681
  domainname_len = strlen (domainname);
682
  xdomainname = (char *) alloca (strlen (categoryname)
683
				 + domainname_len + 5);
684
  ADD_BLOCK (block_list, xdomainname);
685
686
  stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
687
		  domainname, domainname_len),
688
	  ".mo");
689
690
  /* Creating working area.  */
691
  single_locale = (char *) alloca (strlen (categoryvalue) + 1);
692
  ADD_BLOCK (block_list, single_locale);
693
694
695
  /* Search for the given string.  This is a loop because we perhaps
696
     got an ordered list of languages to consider for the translation.  */
697
  while (1)
698
    {
699
      /* Make CATEGORYVALUE point to the next element of the list.  */
700
      while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
701
	++categoryvalue;
702
      if (categoryvalue[0] == '\0')
703
	{
704
	  /* The whole contents of CATEGORYVALUE has been searched but
705
	     no valid entry has been found.  We solve this situation
706
	     by implicitly appending a "C" entry, i.e. no translation
707
	     will take place.  */
708
	  single_locale[0] = 'C';
709
	  single_locale[1] = '\0';
710
	}
711
      else
712
	{
713
	  char *cp = single_locale;
714
	  while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
715
	    *cp++ = *categoryvalue++;
716
	  *cp = '\0';
717
718
	  /* When this is a SUID binary we must not allow accessing files
719
	     outside the dedicated directories.  */
720
	  if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale))
721
	    /* Ingore this entry.  */
722
	    continue;
723
	}
724
725
      /* If the current locale value is C (or POSIX) we don't load a
726
	 domain.  Return the MSGID.  */
727
      if (strcmp (single_locale, "C") == 0
728
	  || strcmp (single_locale, "POSIX") == 0)
729
	break;
730
731
      /* Find structure describing the message catalog matching the
732
	 DOMAINNAME and CATEGORY.  */
733
      domain = _nl_find_domain (dirname, single_locale, xdomainname, binding);
734
735
      if (domain != NULL)
736
	{
737
#if defined IN_LIBGLOCALE
738
	  retval = _nl_find_msg (domain, binding, encoding, msgid1, &retlen);
739
#else
740
	  retval = _nl_find_msg (domain, binding, msgid1, 1, &retlen);
741
#endif
742
743
	  if (retval == NULL)
744
	    {
745
	      int cnt;
746
747
	      for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
748
		{
749
#if defined IN_LIBGLOCALE
750
		  retval = _nl_find_msg (domain->successor[cnt], binding,
751
					 encoding, msgid1, &retlen);
752
#else
753
		  retval = _nl_find_msg (domain->successor[cnt], binding,
754
					 msgid1, 1, &retlen);
755
#endif
756
757
		  if (retval != NULL)
758
		    {
759
		      domain = domain->successor[cnt];
760
		      break;
761
		    }
762
		}
763
	    }
764
765
	  /* Returning -1 means that some resource problem exists
766
	     (likely memory) and that the strings could not be
767
	     converted.  Return the original strings.  */
768
	  if (__builtin_expect (retval == (char *) -1, 0))
769
	    break;
770
771
	  if (retval != NULL)
772
	    {
773
	      /* Found the translation of MSGID1 in domain DOMAIN:
774
		 starting at RETVAL, RETLEN bytes.  */
775
	      FREE_BLOCKS (block_list);
776
#if defined HAVE_TSEARCH || defined _LIBC
777
	      if (foundp == NULL)
778
		{
779
		  /* Create a new entry and add it to the search tree.  */
780
		  size_t size;
781
		  struct known_translation_t *newp;
782
783
		  size = offsetof (struct known_translation_t, msgid)
784
			 + msgid_len + domainname_len + 1;
785
# ifdef HAVE_PER_THREAD_LOCALE
786
		  size += strlen (localename) + 1;
787
# endif
788
		  newp = (struct known_translation_t *) malloc (size);
789
		  if (newp != NULL)
790
		    {
791
		      char *new_domainname;
792
# ifdef HAVE_PER_THREAD_LOCALE
793
		      char *new_localename;
794
# endif
795
796
		      new_domainname = mempcpy (newp->msgid, msgid1, msgid_len);
797
		      memcpy (new_domainname, domainname, domainname_len + 1);
798
# ifdef HAVE_PER_THREAD_LOCALE
799
		      new_localename = new_domainname + domainname_len + 1;
800
		      strcpy (new_localename, localename);
801
# endif
802
		      newp->domainname = new_domainname;
803
		      newp->category = category;
804
# ifdef HAVE_PER_THREAD_LOCALE
805
		      newp->localename = new_localename;
806
# endif
807
# ifdef IN_LIBGLOCALE
808
		      newp->encoding = encoding;
809
# endif
810
		      newp->counter = _nl_msg_cat_cntr;
811
		      newp->domain = domain;
812
		      newp->translation = retval;
813
		      newp->translation_length = retlen;
814
815
		      gl_rwlock_wrlock (tree_lock);
816
817
		      /* Insert the entry in the search tree.  */
818
		      foundp = (struct known_translation_t **)
819
			tsearch (newp, &root, transcmp);
820
821
		      gl_rwlock_unlock (tree_lock);
822
823
		      if (foundp == NULL
824
			  || __builtin_expect (*foundp != newp, 0))
825
			/* The insert failed.  */
826
			free (newp);
827
		    }
828
		}
829
	      else
830
		{
831
		  /* We can update the existing entry.  */
832
		  (*foundp)->counter = _nl_msg_cat_cntr;
833
		  (*foundp)->domain = domain;
834
		  (*foundp)->translation = retval;
835
		  (*foundp)->translation_length = retlen;
836
		}
837
#endif
838
	      __set_errno (saved_errno);
839
840
	      /* Now deal with plural.  */
841
	      if (plural)
842
		retval = plural_lookup (domain, n, retval, retlen);
843
844
	      gl_rwlock_unlock (_nl_state_lock);
845
	      return retval;
846
	    }
847
	}
848
    }
849
850
 return_untranslated:
851
  /* Return the untranslated MSGID.  */
852
  FREE_BLOCKS (block_list);
853
  gl_rwlock_unlock (_nl_state_lock);
854
#ifndef _LIBC
855
  if (!ENABLE_SECURE)
856
    {
857
      extern void _nl_log_untranslated (const char *logfilename,
858
					const char *domainname,
859
					const char *msgid1, const char *msgid2,
860
					int plural);
861
      const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED");
862
863
      if (logfilename != NULL && logfilename[0] != '\0')
864
	_nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural);
865
    }
866
#endif
867
  __set_errno (saved_errno);
868
  return (plural == 0
869
	  ? (char *) msgid1
870
	  /* Use the Germanic plural rule.  */
871
	  : n == 1 ? (char *) msgid1 : (char *) msgid2);
872
}
873
874
875
/* Look up the translation of msgid within DOMAIN_FILE and DOMAINBINDING.
876
   Return it if found.  Return NULL if not found or in case of a conversion
877
   failure (problem in the particular message catalog).  Return (char *) -1
878
   in case of a memory allocation failure during conversion (only if
879
   ENCODING != NULL resp. CONVERT == true).  */
880
char *
881
internal_function
882
#ifdef IN_LIBGLOCALE
883
_nl_find_msg (struct loaded_l10nfile *domain_file,
884
	      struct binding *domainbinding, const char *encoding,
885
	      const char *msgid,
886
	      size_t *lengthp)
887
#else
888
_nl_find_msg (struct loaded_l10nfile *domain_file,
889
	      struct binding *domainbinding,
890
	      const char *msgid, int convert,
891
	      size_t *lengthp)
892
#endif
893
{
894
  struct loaded_domain *domain;
895
  nls_uint32 nstrings;
896
  size_t act;
897
  char *result;
898
  size_t resultlen;
899
900
  if (domain_file->decided <= 0)
901
    _nl_load_domain (domain_file, domainbinding);
902
903
  if (domain_file->data == NULL)
904
    return NULL;
905
906
  domain = (struct loaded_domain *) domain_file->data;
907
908
  nstrings = domain->nstrings;
909
910
  /* Locate the MSGID and its translation.  */
911
  if (domain->hash_tab != NULL)
912
    {
913
      /* Use the hashing table.  */
914
      nls_uint32 len = strlen (msgid);
915
      nls_uint32 hash_val = __hash_string (msgid);
916
      nls_uint32 idx = hash_val % domain->hash_size;
917
      nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
918
919
      while (1)
920
	{
921
	  nls_uint32 nstr =
922
	    W (domain->must_swap_hash_tab, domain->hash_tab[idx]);
923
924
	  if (nstr == 0)
925
	    /* Hash table entry is empty.  */
926
	    return NULL;
927
928
	  nstr--;
929
930
	  /* Compare msgid with the original string at index nstr.
931
	     We compare the lengths with >=, not ==, because plural entries
932
	     are represented by strings with an embedded NUL.  */
933
	  if (nstr < nstrings
934
	      ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len
935
		&& (strcmp (msgid,
936
			    domain->data + W (domain->must_swap,
937
					      domain->orig_tab[nstr].offset))
938
		    == 0)
939
	      : domain->orig_sysdep_tab[nstr - nstrings].length > len
940
		&& (strcmp (msgid,
941
			    domain->orig_sysdep_tab[nstr - nstrings].pointer)
942
		    == 0))
943
	    {
944
	      act = nstr;
945
	      goto found;
946
	    }
947
948
	  if (idx >= domain->hash_size - incr)
949
	    idx -= domain->hash_size - incr;
950
	  else
951
	    idx += incr;
952
	}
953
      /* NOTREACHED */
954
    }
955
  else
956
    {
957
      /* Try the default method:  binary search in the sorted array of
958
	 messages.  */
959
      size_t top, bottom;
960
961
      bottom = 0;
962
      top = nstrings;
963
      while (bottom < top)
964
	{
965
	  int cmp_val;
966
967
	  act = (bottom + top) / 2;
968
	  cmp_val = strcmp (msgid, (domain->data
969
				    + W (domain->must_swap,
970
					 domain->orig_tab[act].offset)));
971
	  if (cmp_val < 0)
972
	    top = act;
973
	  else if (cmp_val > 0)
974
	    bottom = act + 1;
975
	  else
976
	    goto found;
977
	}
978
      /* No translation was found.  */
979
      return NULL;
980
    }
981
982
 found:
983
  /* The translation was found at index ACT.  If we have to convert the
984
     string to use a different character set, this is the time.  */
985
  if (act < nstrings)
986
    {
987
      result = (char *)
988
	(domain->data + W (domain->must_swap, domain->trans_tab[act].offset));
989
      resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
990
    }
991
  else
992
    {
993
      result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer;
994
      resultlen = domain->trans_sysdep_tab[act - nstrings].length;
995
    }
996
997
#if defined _LIBC || HAVE_ICONV
998
# ifdef IN_LIBGLOCALE
999
  if (encoding != NULL)
1000
# else
1001
  if (convert)
1002
# endif
1003
    {
1004
      /* We are supposed to do a conversion.  */
1005
# ifndef IN_LIBGLOCALE
1006
      const char *encoding = get_output_charset (domainbinding);
1007
# endif
1008
1009
      /* Search whether a table with converted translations for this
1010
	 encoding has already been allocated.  */
1011
      size_t nconversions = domain->nconversions;
1012
      struct converted_domain *convd = NULL;
1013
      size_t i;
1014
1015
      for (i = nconversions; i > 0; )
1016
	{
1017
	  i--;
1018
	  if (strcmp (domain->conversions[i].encoding, encoding) == 0)
1019
	    {
1020
	      convd = &domain->conversions[i];
1021
	      break;
1022
	    }
1023
	}
1024
1025
      if (convd == NULL)
1026
	{
1027
	  /* Allocate a table for the converted translations for this
1028
	     encoding.  */
1029
	  struct converted_domain *new_conversions =
1030
	    (struct converted_domain *)
1031
	    (domain->conversions != NULL
1032
	     ? realloc (domain->conversions,
1033
			(nconversions + 1) * sizeof (struct converted_domain))
1034
	     : malloc ((nconversions + 1) * sizeof (struct converted_domain)));
1035
1036
	  if (__builtin_expect (new_conversions == NULL, 0))
1037
	    /* Nothing we can do, no more memory.  We cannot use the
1038
	       translation because it might be encoded incorrectly.  */
1039
	    return (char *) -1;
1040
1041
	  domain->conversions = new_conversions;
1042
1043
	  /* Copy the 'encoding' string to permanent storage.  */
1044
	  encoding = strdup (encoding);
1045
	  if (__builtin_expect (encoding == NULL, 0))
1046
	    /* Nothing we can do, no more memory.  We cannot use the
1047
	       translation because it might be encoded incorrectly.  */
1048
	    return (char *) -1;
1049
1050
	  convd = &new_conversions[nconversions];
1051
	  convd->encoding = encoding;
1052
1053
	  /* Find out about the character set the file is encoded with.
1054
	     This can be found (in textual form) in the entry "".  If this
1055
	     entry does not exist or if this does not contain the 'charset='
1056
	     information, we will assume the charset matches the one the
1057
	     current locale and we don't have to perform any conversion.  */
1058
# ifdef _LIBC
1059
	  convd->conv = (__gconv_t) -1;
1060
# else
1061
#  if HAVE_ICONV
1062
	  convd->conv = (iconv_t) -1;
1063
#  endif
1064
# endif
1065
	  {
1066
	    char *nullentry;
1067
	    size_t nullentrylen;
1068
1069
	    /* Get the header entry.  This is a recursion, but it doesn't
1070
	       reallocate domain->conversions because we pass
1071
	       encoding = NULL or convert = 0, respectively.  */
1072
	    nullentry =
1073
# ifdef IN_LIBGLOCALE
1074
	      _nl_find_msg (domain_file, domainbinding, NULL, "",
1075
			    &nullentrylen);
1076
# else
1077
	      _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
1078
# endif
1079
1080
	    if (nullentry != NULL)
1081
	      {
1082
		const char *charsetstr;
1083
1084
		charsetstr = strstr (nullentry, "charset=");
1085
		if (charsetstr != NULL)
1086
		  {
1087
		    size_t len;
1088
		    char *charset;
1089
		    const char *outcharset;
1090
1091
		    charsetstr += strlen ("charset=");
1092
		    len = strcspn (charsetstr, " \t\n");
1093
1094
		    charset = (char *) alloca (len + 1);
1095
# if defined _LIBC || HAVE_MEMPCPY
1096
		    *((char *) mempcpy (charset, charsetstr, len)) = '\0';
1097
# else
1098
		    memcpy (charset, charsetstr, len);
1099
		    charset[len] = '\0';
1100
# endif
1101
1102
		    outcharset = encoding;
1103
1104
# ifdef _LIBC
1105
		    /* We always want to use transliteration.  */
1106
		    outcharset = norm_add_slashes (outcharset, "TRANSLIT");
1107
		    charset = norm_add_slashes (charset, "");
1108
		    int r = __gconv_open (outcharset, charset, &convd->conv,
1109
					  GCONV_AVOID_NOCONV);
1110
		    if (__builtin_expect (r != __GCONV_OK, 0))
1111
		      {
1112
			/* If the output encoding is the same there is
1113
			   nothing to do.  Otherwise do not use the
1114
			   translation at all.  */
1115
			if (__builtin_expect (r != __GCONV_NOCONV, 1))
1116
			  return NULL;
1117
1118
			convd->conv = (__gconv_t) -1;
1119
		      }
1120
# else
1121
#  if HAVE_ICONV
1122
		    /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
1123
		       we want to use transliteration.  */
1124
#   if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
1125
       || _LIBICONV_VERSION >= 0x0105
1126
		    if (strchr (outcharset, '/') == NULL)
1127
		      {
1128
			char *tmp;
1129
1130
			len = strlen (outcharset);
1131
			tmp = (char *) alloca (len + 10 + 1);
1132
			memcpy (tmp, outcharset, len);
1133
			memcpy (tmp + len, "//TRANSLIT", 10 + 1);
1134
			outcharset = tmp;
1135
1136
			convd->conv = iconv_open (outcharset, charset);
1137
1138
			freea (outcharset);
1139
		      }
1140
		    else
1141
#   endif
1142
		      convd->conv = iconv_open (outcharset, charset);
1143
#  endif
1144
# endif
1145
1146
		    freea (charset);
1147
		  }
1148
	      }
1149
	  }
1150
	  convd->conv_tab = NULL;
1151
	  /* Here domain->conversions is still == new_conversions.  */
1152
	  domain->nconversions++;
1153
	}
1154
1155
      if (
1156
# ifdef _LIBC
1157
	  convd->conv != (__gconv_t) -1
1158
# else
1159
#  if HAVE_ICONV
1160
	  convd->conv != (iconv_t) -1
1161
#  endif
1162
# endif
1163
	  )
1164
	{
1165
	  /* We are supposed to do a conversion.  First allocate an
1166
	     appropriate table with the same structure as the table
1167
	     of translations in the file, where we can put the pointers
1168
	     to the converted strings in.
1169
	     There is a slight complication with plural entries.  They
1170
	     are represented by consecutive NUL terminated strings.  We
1171
	     handle this case by converting RESULTLEN bytes, including
1172
	     NULs.  */
1173
1174
	  if (convd->conv_tab == NULL
1175
	      && ((convd->conv_tab =
1176
		    (char **) calloc (nstrings + domain->n_sysdep_strings,
1177
				      sizeof (char *)))
1178
		  == NULL))
1179
	    /* Mark that we didn't succeed allocating a table.  */
1180
	    convd->conv_tab = (char **) -1;
1181
1182
	  if (__builtin_expect (convd->conv_tab == (char **) -1, 0))
1183
	    /* Nothing we can do, no more memory.  We cannot use the
1184
	       translation because it might be encoded incorrectly.  */
1185
	    return (char *) -1;
1186
1187
	  if (convd->conv_tab[act] == NULL)
1188
	    {
1189
	      /* We haven't used this string so far, so it is not
1190
		 translated yet.  Do this now.  */
1191
	      /* We use a bit more efficient memory handling.
1192
		 We allocate always larger blocks which get used over
1193
		 time.  This is faster than many small allocations.   */
1194
	      __libc_lock_define_initialized (static, lock)
1195
# define INITIAL_BLOCK_SIZE	4080
1196
	      static unsigned char *freemem;
1197
	      static size_t freemem_size;
1198
1199
	      const unsigned char *inbuf;
1200
	      unsigned char *outbuf;
1201
	      int malloc_count;
1202
# ifndef _LIBC
1203
	      transmem_block_t *transmem_list = NULL;
1204
# endif
1205
1206
	      __libc_lock_lock (lock);
1207
1208
	      inbuf = (const unsigned char *) result;
1209
	      outbuf = freemem + sizeof (size_t);
1210
1211
	      malloc_count = 0;
1212
	      while (1)
1213
		{
1214
		  transmem_block_t *newmem;
1215
# ifdef _LIBC
1216
		  size_t non_reversible;
1217
		  int res;
1218
1219
		  if (freemem_size < sizeof (size_t))
1220
		    goto resize_freemem;
1221
1222
		  res = __gconv (convd->conv,
1223
				 &inbuf, inbuf + resultlen,
1224
				 &outbuf,
1225
				 outbuf + freemem_size - sizeof (size_t),
1226
				 &non_reversible);
1227
1228
		  if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT)
1229
		    break;
1230
1231
		  if (res != __GCONV_FULL_OUTPUT)
1232
		    {
1233
		      /* We should not use the translation at all, it
1234
			 is incorrectly encoded.  */
1235
		      __libc_lock_unlock (lock);
1236
		      return NULL;
1237
		    }
1238
1239
		  inbuf = (const unsigned char *) result;
1240
# else
1241
#  if HAVE_ICONV
1242
		  const char *inptr = (const char *) inbuf;
1243
		  size_t inleft = resultlen;
1244
		  char *outptr = (char *) outbuf;
1245
		  size_t outleft;
1246
1247
		  if (freemem_size < sizeof (size_t))
1248
		    goto resize_freemem;
1249
1250
		  outleft = freemem_size - sizeof (size_t);
1251
		  if (iconv (convd->conv,
1252
			     (ICONV_CONST char **) &inptr, &inleft,
1253
			     &outptr, &outleft)
1254
		      != (size_t) (-1))
1255
		    {
1256
		      outbuf = (unsigned char *) outptr;
1257
		      break;
1258
		    }
1259
		  if (errno != E2BIG)
1260
		    {
1261
		      __libc_lock_unlock (lock);
1262
		      return NULL;
1263
		    }
1264
#  endif
1265
# endif
1266
1267
		resize_freemem:
1268
		  /* We must allocate a new buffer or resize the old one.  */
1269
		  if (malloc_count > 0)
1270
		    {
1271
		      ++malloc_count;
1272
		      freemem_size = malloc_count * INITIAL_BLOCK_SIZE;
1273
		      newmem = (transmem_block_t *) realloc (transmem_list,
1274
							     freemem_size);
1275
# ifdef _LIBC
1276
		      if (newmem != NULL)
1277
			transmem_list = transmem_list->next;
1278
		      else
1279
			{
1280
			  struct transmem_list *old = transmem_list;
1281
1282
			  transmem_list = transmem_list->next;
1283
			  free (old);
1284
			}
1285
# endif
1286
		    }
1287
		  else
1288
		    {
1289
		      malloc_count = 1;
1290
		      freemem_size = INITIAL_BLOCK_SIZE;
1291
		      newmem = (transmem_block_t *) malloc (freemem_size);
1292
		    }
1293
		  if (__builtin_expect (newmem == NULL, 0))
1294
		    {
1295
		      freemem = NULL;
1296
		      freemem_size = 0;
1297
		      __libc_lock_unlock (lock);
1298
		      return (char *) -1;
1299
		    }
1300
1301
# ifdef _LIBC
1302
		  /* Add the block to the list of blocks we have to free
1303
		     at some point.  */
1304
		  newmem->next = transmem_list;
1305
		  transmem_list = newmem;
1306
1307
		  freemem = (unsigned char *) newmem->data;
1308
		  freemem_size -= offsetof (struct transmem_list, data);
1309
# else
1310
		  transmem_list = newmem;
1311
		  freemem = newmem;
1312
# endif
1313
1314
		  outbuf = freemem + sizeof (size_t);
1315
		}
1316
1317
	      /* We have now in our buffer a converted string.  Put this
1318
		 into the table of conversions.  */
1319
	      *(size_t *) freemem = outbuf - freemem - sizeof (size_t);
1320
	      convd->conv_tab[act] = (char *) freemem;
1321
	      /* Shrink freemem, but keep it aligned.  */
1322
	      freemem_size -= outbuf - freemem;
1323
	      freemem = outbuf;
1324
	      freemem += freemem_size & (alignof (size_t) - 1);
1325
	      freemem_size = freemem_size & ~ (alignof (size_t) - 1);
1326
1327
	      __libc_lock_unlock (lock);
1328
	    }
1329
1330
	  /* Now convd->conv_tab[act] contains the translation of all
1331
	     the plural variants.  */
1332
	  result = convd->conv_tab[act] + sizeof (size_t);
1333
	  resultlen = *(size_t *) convd->conv_tab[act];
1334
	}
1335
    }
1336
1337
  /* The result string is converted.  */
1338
1339
#endif /* _LIBC || HAVE_ICONV */
1340
1341
  *lengthp = resultlen;
1342
  return result;
1343
}
1344
1345
1346
/* Look up a plural variant.  */
1347
static char *
1348
internal_function
1349
plural_lookup (struct loaded_l10nfile *domain, unsigned long int n,
1350
	       const char *translation, size_t translation_len)
1351
{
1352
  struct loaded_domain *domaindata = (struct loaded_domain *) domain->data;
1353
  unsigned long int index;
1354
  const char *p;
1355
1356
  index = plural_eval (domaindata->plural, n);
1357
  if (index >= domaindata->nplurals)
1358
    /* This should never happen.  It means the plural expression and the
1359
       given maximum value do not match.  */
1360
    index = 0;
1361
1362
  /* Skip INDEX strings at TRANSLATION.  */
1363
  p = translation;
1364
  while (index-- > 0)
1365
    {
1366
#ifdef _LIBC
1367
      p = __rawmemchr (p, '\0');
1368
#else
1369
      p = strchr (p, '\0');
1370
#endif
1371
      /* And skip over the NUL byte.  */
1372
      p++;
1373
1374
      if (p >= translation + translation_len)
1375
	/* This should never happen.  It means the plural expression
1376
	   evaluated to a value larger than the number of variants
1377
	   available for MSGID1.  */
1378
	return (char *) translation;
1379
    }
1380
  return (char *) p;
1381
}
1382
1383
#ifndef _LIBC
1384
/* Return string representation of locale CATEGORY.  */
1385
static const char *
1386
internal_function
1387
category_to_name (int category)
1388
{
1389
  const char *retval;
1390
1391
  switch (category)
1392
  {
1393
#ifdef LC_COLLATE
1394
  case LC_COLLATE:
1395
    retval = "LC_COLLATE";
1396
    break;
1397
#endif
1398
#ifdef LC_CTYPE
1399
  case LC_CTYPE:
1400
    retval = "LC_CTYPE";
1401
    break;
1402
#endif
1403
#ifdef LC_MONETARY
1404
  case LC_MONETARY:
1405
    retval = "LC_MONETARY";
1406
    break;
1407
#endif
1408
#ifdef LC_NUMERIC
1409
  case LC_NUMERIC:
1410
    retval = "LC_NUMERIC";
1411
    break;
1412
#endif
1413
#ifdef LC_TIME
1414
  case LC_TIME:
1415
    retval = "LC_TIME";
1416
    break;
1417
#endif
1418
#ifdef LC_MESSAGES
1419
  case LC_MESSAGES:
1420
    retval = "LC_MESSAGES";
1421
    break;
1422
#endif
1423
#ifdef LC_RESPONSE
1424
  case LC_RESPONSE:
1425
    retval = "LC_RESPONSE";
1426
    break;
1427
#endif
1428
#ifdef LC_ALL
1429
  case LC_ALL:
1430
    /* This might not make sense but is perhaps better than any other
1431
       value.  */
1432
    retval = "LC_ALL";
1433
    break;
1434
#endif
1435
  default:
1436
    /* If you have a better idea for a default value let me know.  */
1437
    retval = "LC_XXX";
1438
  }
1439
1440
  return retval;
1441
}
1442
#endif
1443
1444
/* Guess value of current locale from value of the environment variables
1445
   or system-dependent defaults.  */
1446
static const char *
1447
internal_function
1448
#ifdef IN_LIBGLOCALE
1449
guess_category_value (int category, const char *categoryname,
1450
		      const char *locale)
1451
1452
#else
1453
guess_category_value (int category, const char *categoryname)
1454
#endif
1455
{
1456
  const char *language;
1457
#ifndef IN_LIBGLOCALE
1458
  const char *locale;
1459
# ifndef _LIBC
1460
  const char *language_default;
1461
  int locale_defaulted;
1462
# endif
1463
#endif
1464
1465
  /* We use the settings in the following order:
1466
     1. The value of the environment variable 'LANGUAGE'.  This is a GNU
1467
        extension.  Its value can be a colon-separated list of locale names.
1468
     2. The value of the environment variable 'LC_ALL', 'LC_xxx', or 'LANG'.
1469
        More precisely, the first among these that is set to a non-empty value.
1470
        This is how POSIX specifies it.  The value is a single locale name.
1471
     3. A system-dependent preference list of languages.  Its value can be a
1472
        colon-separated list of locale names.
1473
     4. A system-dependent default locale name.
1474
     This way:
1475
       - System-dependent settings can be overridden by environment variables.
1476
       - If the system provides both a list of languages and a default locale,
1477
         the former is used.  */
1478
1479
#ifndef IN_LIBGLOCALE
1480
  /* Fetch the locale name, through the POSIX method of looking to `LC_ALL',
1481
     `LC_xxx', and `LANG'.  On some systems this can be done by the
1482
     `setlocale' function itself.  */
1483
# ifdef _LIBC
1484
  locale = __current_locale_name (category);
1485
# else
1486
#  if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS
1487
  /* The __names field is not public glibc API and must therefore not be used
1488
     in code that is installed in public locations.  */
1489
  locale_t thread_locale = uselocale (NULL);
1490
  if (thread_locale != LC_GLOBAL_LOCALE)
1491
    {
1492
      locale = thread_locale->__names[category];
1493
      locale_defaulted = 0;
1494
    }
1495
  else
1496
#  endif
1497
    {
1498
      locale = _nl_locale_name_posix (category, categoryname);
1499
      locale_defaulted = 0;
1500
      if (locale == NULL)
1501
	{
1502
	  locale = _nl_locale_name_default ();
1503
	  locale_defaulted = 1;
1504
	}
1505
    }
1506
# endif
1507
#endif
1508
1509
  /* Ignore LANGUAGE and its system-dependent analogon if the locale is set
1510
     to "C" because
1511
     1. "C" locale usually uses the ASCII encoding, and most international
1512
	messages use non-ASCII characters. These characters get displayed
1513
	as question marks (if using glibc's iconv()) or as invalid 8-bit
1514
	characters (because other iconv()s refuse to convert most non-ASCII
1515
	characters to ASCII). In any case, the output is ugly.
1516
     2. The precise output of some programs in the "C" locale is specified
1517
	by POSIX and should not depend on environment variables like
1518
	"LANGUAGE" or system-dependent information.  We allow such programs
1519
        to use gettext().  */
1520
  if (strcmp (locale, "C") == 0)
1521
    return locale;
1522
1523
  /* The highest priority value is the value of the 'LANGUAGE' environment
1524
     variable.  */
1525
  language = getenv ("LANGUAGE");
1526
  if (language != NULL && language[0] != '\0')
1527
    return language;
1528
#if !defined IN_LIBGLOCALE && !defined _LIBC
1529
  /* The next priority value is the locale name, if not defaulted.  */
1530
  if (locale_defaulted)
1531
    {
1532
      /* The next priority value is the default language preferences list. */
1533
      language_default = _nl_language_preferences_default ();
1534
      if (language_default != NULL)
1535
        return language_default;
1536
    }
1537
  /* The least priority value is the locale name, if defaulted.  */
1538
#endif
1539
  return locale;
1540
}
1541
1542
#if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE
1543
/* Returns the output charset.  */
1544
static const char *
1545
internal_function
1546
get_output_charset (struct binding *domainbinding)
1547
{
1548
  /* The output charset should normally be determined by the locale.  But
1549
     sometimes the locale is not used or not correctly set up, so we provide
1550
     a possibility for the user to override this: the OUTPUT_CHARSET
1551
     environment variable.  Moreover, the value specified through
1552
     bind_textdomain_codeset overrides both.  */
1553
  if (domainbinding != NULL && domainbinding->codeset != NULL)
1554
    return domainbinding->codeset;
1555
  else
1556
    {
1557
      /* For speed reasons, we look at the value of OUTPUT_CHARSET only
1558
	 once.  This is a user variable that is not supposed to change
1559
	 during a program run.  */
1560
      static char *output_charset_cache;
1561
      static int output_charset_cached;
1562
1563
      if (!output_charset_cached)
1564
	{
1565
	  const char *value = getenv ("OUTPUT_CHARSET");
1566
1567
	  if (value != NULL && value[0] != '\0')
1568
	    {
1569
	      size_t len = strlen (value) + 1;
1570
	      char *value_copy = (char *) malloc (len);
1571
1572
	      if (value_copy != NULL)
1573
		memcpy (value_copy, value, len);
1574
	      output_charset_cache = value_copy;
1575
	    }
1576
	  output_charset_cached = 1;
1577
	}
1578
1579
      if (output_charset_cache != NULL)
1580
	return output_charset_cache;
1581
      else
1582
	{
1583
# ifdef _LIBC
1584
	  return _NL_CURRENT (LC_CTYPE, CODESET);
1585
# else
1586
#  if HAVE_ICONV
1587
	  extern const char *locale_charset (void);
1588
	  return locale_charset ();
1589
#  endif
1590
# endif
1591
	}
1592
    }
1593
}
1594
#endif
1595
1596
/* @@ begin of epilog @@ */
1597
1598
/* We don't want libintl.a to depend on any other library.  So we
1599
   avoid the non-standard function stpcpy.  In GNU C Library this
1600
   function is available, though.  Also allow the symbol HAVE_STPCPY
1601
   to be defined.  */
1602
#if !_LIBC && !HAVE_STPCPY
1603
static char *
1604
stpcpy (char *dest, const char *src)
1605
{
1606
  while ((*dest++ = *src++) != '\0')
1607
    /* Do nothing. */ ;
1608
  return dest - 1;
1609
}
1610
#endif
1611
1612
#if !_LIBC && !HAVE_MEMPCPY
1613
static void *
1614
mempcpy (void *dest, const void *src, size_t n)
1615
{
1616
  return (void *) ((char *) memcpy (dest, src, n) + n);
1617
}
1618
#endif
1619
1620
1621
#ifdef _LIBC
1622
/* If we want to free all resources we have to do some work at
1623
   program's end.  */
1624
libc_freeres_fn (free_mem)
1625
{
1626
  void *old;
1627
1628
  while (_nl_domain_bindings != NULL)
1629
    {
1630
      struct binding *oldp = _nl_domain_bindings;
1631
      _nl_domain_bindings = _nl_domain_bindings->next;
1632
      if (oldp->dirname != _nl_default_dirname)
1633
	/* Yes, this is a pointer comparison.  */
1634
	free (oldp->dirname);
1635
      free (oldp->codeset);
1636
      free (oldp);
1637
    }
1638
1639
  if (_nl_current_default_domain != _nl_default_default_domain)
1640
    /* Yes, again a pointer comparison.  */
1641
    free ((char *) _nl_current_default_domain);
1642
1643
  /* Remove the search tree with the known translations.  */
1644
  __tdestroy (root, free);
1645
  root = NULL;
1646
1647
  while (transmem_list != NULL)
1648
    {
1649
      old = transmem_list;
1650
      transmem_list = transmem_list->next;
1651
      free (old);
1652
    }
1653
}
1654
#endif
(-)a/intl/dcngettext.c (-57 lines)
Lines 1-57 Link Here
1
/* Implementation of the dcngettext(3) function.
2
   Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22
23
#include "gettextP.h"
24
#ifdef _LIBC
25
# include <libintl.h>
26
#else
27
# include "libgnuintl.h"
28
#endif
29
30
/* @@ end of prolog @@ */
31
32
/* Names for the libintl functions are a problem.  They must not clash
33
   with existing names and they should follow ANSI C.  But this source
34
   code is also used in GNU C Library where the names have a __
35
   prefix.  So we have to make a difference here.  */
36
#ifdef _LIBC
37
# define DCNGETTEXT __dcngettext
38
# define DCIGETTEXT __dcigettext
39
#else
40
# define DCNGETTEXT libintl_dcngettext
41
# define DCIGETTEXT libintl_dcigettext
42
#endif
43
44
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
45
   locale.  */
46
char *
47
DCNGETTEXT (const char *domainname,
48
	    const char *msgid1, const char *msgid2, unsigned long int n,
49
	    int category)
50
{
51
  return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
52
}
53
54
#ifdef _LIBC
55
/* Alias for function name in GNU C Library.  */
56
weak_alias (__dcngettext, dcngettext);
57
#endif
(-)a/intl/dgettext.c (-58 lines)
Lines 1-58 Link Here
1
/* Implementation of the dgettext(3) function.
2
   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22
23
#include "gettextP.h"
24
25
#include <locale.h>
26
27
#ifdef _LIBC
28
# include <libintl.h>
29
#else
30
# include "libgnuintl.h"
31
#endif
32
33
/* @@ end of prolog @@ */
34
35
/* Names for the libintl functions are a problem.  They must not clash
36
   with existing names and they should follow ANSI C.  But this source
37
   code is also used in GNU C Library where the names have a __
38
   prefix.  So we have to make a difference here.  */
39
#ifdef _LIBC
40
# define DGETTEXT __dgettext
41
# define DCGETTEXT INTUSE(__dcgettext)
42
#else
43
# define DGETTEXT libintl_dgettext
44
# define DCGETTEXT libintl_dcgettext
45
#endif
46
47
/* Look up MSGID in the DOMAINNAME message catalog of the current
48
   LC_MESSAGES locale.  */
49
char *
50
DGETTEXT (const char *domainname, const char *msgid)
51
{
52
  return DCGETTEXT (domainname, msgid, LC_MESSAGES);
53
}
54
55
#ifdef _LIBC
56
/* Alias for function name in GNU C Library.  */
57
weak_alias (__dgettext, dgettext);
58
#endif
(-)a/intl/dngettext.c (-59 lines)
Lines 1-59 Link Here
1
/* Implementation of the dngettext(3) function.
2
   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22
23
#include "gettextP.h"
24
25
#include <locale.h>
26
27
#ifdef _LIBC
28
# include <libintl.h>
29
#else
30
# include "libgnuintl.h"
31
#endif
32
33
/* @@ end of prolog @@ */
34
35
/* Names for the libintl functions are a problem.  They must not clash
36
   with existing names and they should follow ANSI C.  But this source
37
   code is also used in GNU C Library where the names have a __
38
   prefix.  So we have to make a difference here.  */
39
#ifdef _LIBC
40
# define DNGETTEXT __dngettext
41
# define DCNGETTEXT __dcngettext
42
#else
43
# define DNGETTEXT libintl_dngettext
44
# define DCNGETTEXT libintl_dcngettext
45
#endif
46
47
/* Look up MSGID in the DOMAINNAME message catalog of the current
48
   LC_MESSAGES locale and skip message according to the plural form.  */
49
char *
50
DNGETTEXT (const char *domainname,
51
	   const char *msgid1, const char *msgid2, unsigned long int n)
52
{
53
  return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
54
}
55
56
#ifdef _LIBC
57
/* Alias for function name in GNU C Library.  */
58
weak_alias (__dngettext, dngettext);
59
#endif
(-)a/intl/eval-plural.h (-108 lines)
Lines 1-108 Link Here
1
/* Plural expression evaluation.
2
   Copyright (C) 2000-2003 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifndef STATIC
20
#define STATIC static
21
#endif
22
23
/* Evaluate the plural expression and return an index value.  */
24
STATIC
25
unsigned long int
26
internal_function
27
plural_eval (struct expression *pexp, unsigned long int n)
28
{
29
  switch (pexp->nargs)
30
    {
31
    case 0:
32
      switch (pexp->operation)
33
	{
34
	case var:
35
	  return n;
36
	case num:
37
	  return pexp->val.num;
38
	default:
39
	  break;
40
	}
41
      /* NOTREACHED */
42
      break;
43
    case 1:
44
      {
45
	/* pexp->operation must be lnot.  */
46
	unsigned long int arg = plural_eval (pexp->val.args[0], n);
47
	return ! arg;
48
      }
49
    case 2:
50
      {
51
	unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
52
	if (pexp->operation == lor)
53
	  return leftarg || plural_eval (pexp->val.args[1], n);
54
	else if (pexp->operation == land)
55
	  return leftarg && plural_eval (pexp->val.args[1], n);
56
	else
57
	  {
58
	    unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
59
60
	    switch (pexp->operation)
61
	      {
62
	      case mult:
63
		return leftarg * rightarg;
64
	      case divide:
65
#if !INTDIV0_RAISES_SIGFPE
66
		if (rightarg == 0)
67
		  raise (SIGFPE);
68
#endif
69
		return leftarg / rightarg;
70
	      case module:
71
#if !INTDIV0_RAISES_SIGFPE
72
		if (rightarg == 0)
73
		  raise (SIGFPE);
74
#endif
75
		return leftarg % rightarg;
76
	      case plus:
77
		return leftarg + rightarg;
78
	      case minus:
79
		return leftarg - rightarg;
80
	      case less_than:
81
		return leftarg < rightarg;
82
	      case greater_than:
83
		return leftarg > rightarg;
84
	      case less_or_equal:
85
		return leftarg <= rightarg;
86
	      case greater_or_equal:
87
		return leftarg >= rightarg;
88
	      case equal:
89
		return leftarg == rightarg;
90
	      case not_equal:
91
		return leftarg != rightarg;
92
	      default:
93
		break;
94
	      }
95
	  }
96
	/* NOTREACHED */
97
	break;
98
      }
99
    case 3:
100
      {
101
	/* pexp->operation must be qmop.  */
102
	unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
103
	return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
104
      }
105
    }
106
  /* NOTREACHED */
107
  return 0;
108
}
(-)a/intl/explodename.c (-133 lines)
Lines 1-133 Link Here
1
/* Copyright (C) 1995-1998, 2000-2001, 2003, 2005 Free Software Foundation, Inc.
2
   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22
23
#include <stdlib.h>
24
#include <string.h>
25
#include <sys/types.h>
26
27
#include "loadinfo.h"
28
29
/* On some strange systems still no definition of NULL is found.  Sigh!  */
30
#ifndef NULL
31
# if defined __STDC__ && __STDC__
32
#  define NULL ((void *) 0)
33
# else
34
#  define NULL 0
35
# endif
36
#endif
37
38
/* @@ end of prolog @@ */
39
40
/* Split a locale name NAME into a leading language part and all the
41
   rest.  Return a pointer to the first character after the language,
42
   i.e. to the first byte of the rest.  */
43
static char *_nl_find_language (const char *name);
44
45
static char *
46
_nl_find_language (const char *name)
47
{
48
  while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '.')
49
    ++name;
50
51
  return (char *) name;
52
}
53
54
55
int
56
_nl_explode_name (char *name,
57
		  const char **language, const char **modifier,
58
		  const char **territory, const char **codeset,
59
		  const char **normalized_codeset)
60
{
61
  char *cp;
62
  int mask;
63
64
  *modifier = NULL;
65
  *territory = NULL;
66
  *codeset = NULL;
67
  *normalized_codeset = NULL;
68
69
  /* Now we determine the single parts of the locale name.  First
70
     look for the language.  Termination symbols are `_', '.', and `@'.  */
71
  mask = 0;
72
  *language = cp = name;
73
  cp = _nl_find_language (*language);
74
75
  if (*language == cp)
76
    /* This does not make sense: language has to be specified.  Use
77
       this entry as it is without exploding.  Perhaps it is an alias.  */
78
    cp = strchr (*language, '\0');
79
  else
80
    {
81
      if (cp[0] == '_')
82
	{
83
	  /* Next is the territory.  */
84
	  cp[0] = '\0';
85
	  *territory = ++cp;
86
87
	  while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@')
88
	    ++cp;
89
90
	  mask |= XPG_TERRITORY;
91
	}
92
93
      if (cp[0] == '.')
94
	{
95
	  /* Next is the codeset.  */
96
	  cp[0] = '\0';
97
	  *codeset = ++cp;
98
99
	  while (cp[0] != '\0' && cp[0] != '@')
100
	    ++cp;
101
102
	  mask |= XPG_CODESET;
103
104
	  if (*codeset != cp && (*codeset)[0] != '\0')
105
	    {
106
	      *normalized_codeset = _nl_normalize_codeset (*codeset,
107
							   cp - *codeset);
108
	      if (strcmp (*codeset, *normalized_codeset) == 0)
109
		free ((char *) *normalized_codeset);
110
	      else
111
		mask |= XPG_NORM_CODESET;
112
	    }
113
	}
114
    }
115
116
  if (cp[0] == '@')
117
    {
118
      /* Next is the modifier.  */
119
      cp[0] = '\0';
120
      *modifier = ++cp;
121
122
      if (cp[0] != '\0')
123
	mask |= XPG_MODIFIER;
124
    }
125
126
  if (*territory != NULL && (*territory)[0] == '\0')
127
    mask &= ~XPG_TERRITORY;
128
129
  if (*codeset != NULL && (*codeset)[0] == '\0')
130
    mask &= ~XPG_CODESET;
131
132
  return mask;
133
}
(-)a/intl/export.h (-6 lines)
Lines 1-6 Link Here
1
2
#if @HAVE_VISIBILITY@ && BUILDING_LIBINTL
3
#define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default")))
4
#else
5
#define LIBINTL_DLL_EXPORTED
6
#endif
(-)a/intl/finddomain.c (-208 lines)
Lines 1-208 Link Here
1
/* Handle list of needed message catalogs
2
   Copyright (C) 1995-1999, 2000-2001, 2003-2006 Free Software Foundation, Inc.
3
   Written by Ulrich Drepper <drepper@gnu.org>, 1995.
4
5
   This program is free software; you can redistribute it and/or modify it
6
   under the terms of the GNU Library General Public License as published
7
   by the Free Software Foundation; either version 2, or (at your option)
8
   any later version.
9
10
   This program is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Library General Public License for more details.
14
15
   You should have received a copy of the GNU Library General Public
16
   License along with this program; if not, write to the Free Software
17
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18
   USA.  */
19
20
#ifdef HAVE_CONFIG_H
21
# include <config.h>
22
#endif
23
24
#include <stdio.h>
25
#include <sys/types.h>
26
#include <stdlib.h>
27
#include <string.h>
28
29
#if defined HAVE_UNISTD_H || defined _LIBC
30
# include <unistd.h>
31
#endif
32
33
#include "gettextP.h"
34
#ifdef _LIBC
35
# include <libintl.h>
36
#else
37
# include "libgnuintl.h"
38
#endif
39
40
/* Handle multi-threaded applications.  */
41
#ifdef _LIBC
42
# include <bits/libc-lock.h>
43
# define gl_rwlock_define_initialized __libc_rwlock_define_initialized
44
# define gl_rwlock_rdlock __libc_rwlock_rdlock
45
# define gl_rwlock_wrlock __libc_rwlock_wrlock
46
# define gl_rwlock_unlock __libc_rwlock_unlock
47
#else
48
# include "lock.h"
49
#endif
50
51
/* @@ end of prolog @@ */
52
/* List of already loaded domains.  */
53
static struct loaded_l10nfile *_nl_loaded_domains;
54
55
56
/* Return a data structure describing the message catalog described by
57
   the DOMAINNAME and CATEGORY parameters with respect to the currently
58
   established bindings.  */
59
struct loaded_l10nfile *
60
internal_function
61
_nl_find_domain (const char *dirname, char *locale,
62
		 const char *domainname, struct binding *domainbinding)
63
{
64
  struct loaded_l10nfile *retval;
65
  const char *language;
66
  const char *modifier;
67
  const char *territory;
68
  const char *codeset;
69
  const char *normalized_codeset;
70
  const char *alias_value;
71
  int mask;
72
73
  /* LOCALE can consist of up to four recognized parts for the XPG syntax:
74
75
		language[_territory][.codeset][@modifier]
76
77
     Beside the first part all of them are allowed to be missing.  If
78
     the full specified locale is not found, the less specific one are
79
     looked for.  The various parts will be stripped off according to
80
     the following order:
81
		(1) codeset
82
		(2) normalized codeset
83
		(3) territory
84
		(4) modifier
85
   */
86
87
  /* We need to protect modifying the _NL_LOADED_DOMAINS data.  */
88
  gl_rwlock_define_initialized (static, lock);
89
  gl_rwlock_rdlock (lock);
90
91
  /* If we have already tested for this locale entry there has to
92
     be one data set in the list of loaded domains.  */
93
  retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
94
			       strlen (dirname) + 1, 0, locale, NULL, NULL,
95
			       NULL, NULL, domainname, 0);
96
97
  gl_rwlock_unlock (lock);
98
99
  if (retval != NULL)
100
    {
101
      /* We know something about this locale.  */
102
      int cnt;
103
104
      if (retval->decided <= 0)
105
	_nl_load_domain (retval, domainbinding);
106
107
      if (retval->data != NULL)
108
	return retval;
109
110
      for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
111
	{
112
	  if (retval->successor[cnt]->decided <= 0)
113
	    _nl_load_domain (retval->successor[cnt], domainbinding);
114
115
	  if (retval->successor[cnt]->data != NULL)
116
	    break;
117
	}
118
119
      return retval;
120
      /* NOTREACHED */
121
    }
122
123
  /* See whether the locale value is an alias.  If yes its value
124
     *overwrites* the alias name.  No test for the original value is
125
     done.  */
126
  alias_value = _nl_expand_alias (locale);
127
  if (alias_value != NULL)
128
    {
129
#if defined _LIBC || defined HAVE_STRDUP
130
      locale = strdup (alias_value);
131
      if (locale == NULL)
132
	return NULL;
133
#else
134
      size_t len = strlen (alias_value) + 1;
135
      locale = (char *) malloc (len);
136
      if (locale == NULL)
137
	return NULL;
138
139
      memcpy (locale, alias_value, len);
140
#endif
141
    }
142
143
  /* Now we determine the single parts of the locale name.  First
144
     look for the language.  Termination symbols are `_', '.', and `@'.  */
145
  mask = _nl_explode_name (locale, &language, &modifier, &territory,
146
			   &codeset, &normalized_codeset);
147
148
  /* We need to protect modifying the _NL_LOADED_DOMAINS data.  */
149
  gl_rwlock_wrlock (lock);
150
151
  /* Create all possible locale entries which might be interested in
152
     generalization.  */
153
  retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
154
			       strlen (dirname) + 1, mask, language, territory,
155
			       codeset, normalized_codeset, modifier,
156
			       domainname, 1);
157
158
  gl_rwlock_unlock (lock);
159
160
  if (retval == NULL)
161
    /* This means we are out of core.  */
162
    return NULL;
163
164
  if (retval->decided <= 0)
165
    _nl_load_domain (retval, domainbinding);
166
  if (retval->data == NULL)
167
    {
168
      int cnt;
169
      for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
170
	{
171
	  if (retval->successor[cnt]->decided <= 0)
172
	    _nl_load_domain (retval->successor[cnt], domainbinding);
173
	  if (retval->successor[cnt]->data != NULL)
174
	    break;
175
	}
176
    }
177
178
  /* The room for an alias was dynamically allocated.  Free it now.  */
179
  if (alias_value != NULL)
180
    free (locale);
181
182
  /* The space for normalized_codeset is dynamically allocated.  Free it.  */
183
  if (mask & XPG_NORM_CODESET)
184
    free ((void *) normalized_codeset);
185
186
  return retval;
187
}
188
189
190
#ifdef _LIBC
191
/* This is called from iconv/gconv_db.c's free_mem, as locales must
192
   be freed before freeing gconv steps arrays.  */
193
void __libc_freeres_fn_section
194
_nl_finddomain_subfreeres ()
195
{
196
  struct loaded_l10nfile *runp = _nl_loaded_domains;
197
198
  while (runp != NULL)
199
    {
200
      struct loaded_l10nfile *here = runp;
201
      if (runp->data != NULL)
202
	_nl_unload_domain ((struct loaded_domain *) runp->data);
203
      runp = runp->next;
204
      free ((char *) here->filename);
205
      free (here);
206
    }
207
}
208
#endif
(-)a/intl/gettext.c (-63 lines)
Lines 1-63 Link Here
1
/* Implementation of gettext(3) function.
2
   Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifdef HAVE_CONFIG_H
20
# include <config.h>
21
#endif
22
23
#ifdef _LIBC
24
# define __need_NULL
25
# include <stddef.h>
26
#else
27
# include <stdlib.h>		/* Just for NULL.  */
28
#endif
29
30
#include "gettextP.h"
31
#ifdef _LIBC
32
# include <libintl.h>
33
#else
34
# include "libgnuintl.h"
35
#endif
36
37
/* @@ end of prolog @@ */
38
39
/* Names for the libintl functions are a problem.  They must not clash
40
   with existing names and they should follow ANSI C.  But this source
41
   code is also used in GNU C Library where the names have a __
42
   prefix.  So we have to make a difference here.  */
43
#ifdef _LIBC
44
# define GETTEXT __gettext
45
# define DCGETTEXT INTUSE(__dcgettext)
46
#else
47
# define GETTEXT libintl_gettext
48
# define DCGETTEXT libintl_dcgettext
49
#endif
50
51
/* Look up MSGID in the current default message catalog for the current
52
   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
53
   text).  */
54
char *
55
GETTEXT (const char *msgid)
56
{
57
  return DCGETTEXT (NULL, msgid, LC_MESSAGES);
58
}
59
60
#ifdef _LIBC
61
/* Alias for function name in GNU C Library.  */
62
weak_alias (__gettext, gettext);
63
#endif
(-)a/intl/gettextP.h (-247 lines)
Lines 1-247 Link Here
1
/* Header describing internals of libintl library.
2
   Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc.
3
   Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
4
5
   This program is free software; you can redistribute it and/or modify it
6
   under the terms of the GNU Library General Public License as published
7
   by the Free Software Foundation; either version 2, or (at your option)
8
   any later version.
9
10
   This program is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Library General Public License for more details.
14
15
   You should have received a copy of the GNU Library General Public
16
   License along with this program; if not, write to the Free Software
17
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18
   USA.  */
19
20
#ifndef _GETTEXTP_H
21
#define _GETTEXTP_H
22
23
#include <stddef.h>		/* Get size_t.  */
24
25
#ifdef _LIBC
26
# include "../iconv/gconv_int.h"
27
#else
28
# if HAVE_ICONV
29
#  include <iconv.h>
30
# endif
31
#endif
32
33
#ifdef _LIBC
34
extern char *__gettext (const char *__msgid);
35
extern char *__dgettext (const char *__domainname, const char *__msgid);
36
extern char *__dcgettext (const char *__domainname, const char *__msgid,
37
			  int __category);
38
extern char *__ngettext (const char *__msgid1, const char *__msgid2,
39
			 unsigned long int __n);
40
extern char *__dngettext (const char *__domainname,
41
			  const char *__msgid1, const char *__msgid2,
42
			  unsigned long int n);
43
extern char *__dcngettext (const char *__domainname,
44
			   const char *__msgid1, const char *__msgid2,
45
			   unsigned long int __n, int __category);
46
extern char *__dcigettext (const char *__domainname,
47
			   const char *__msgid1, const char *__msgid2,
48
			   int __plural, unsigned long int __n,
49
			   int __category);
50
extern char *__textdomain (const char *__domainname);
51
extern char *__bindtextdomain (const char *__domainname,
52
			       const char *__dirname);
53
extern char *__bind_textdomain_codeset (const char *__domainname,
54
					const char *__codeset);
55
extern void _nl_finddomain_subfreeres (void) attribute_hidden;
56
extern void _nl_unload_domain (struct loaded_domain *__domain)
57
     internal_function attribute_hidden;
58
#else
59
/* Declare the exported libintl_* functions, in a way that allows us to
60
   call them under their real name.  */
61
# undef _INTL_REDIRECT_INLINE
62
# undef _INTL_REDIRECT_MACROS
63
# define _INTL_REDIRECT_MACROS
64
# include "libgnuintl.h"
65
# ifdef IN_LIBGLOCALE
66
extern char *gl_dcigettext (const char *__domainname,
67
			    const char *__msgid1, const char *__msgid2,
68
			    int __plural, unsigned long int __n,
69
			    int __category,
70
			    const char *__localename, const char *__encoding);
71
# else
72
extern char *libintl_dcigettext (const char *__domainname,
73
				 const char *__msgid1, const char *__msgid2,
74
				 int __plural, unsigned long int __n,
75
				 int __category);
76
# endif
77
#endif
78
79
#include "loadinfo.h"
80
81
#include "gmo.h"		/* Get nls_uint32.  */
82
83
/* @@ end of prolog @@ */
84
85
#ifndef internal_function
86
# define internal_function
87
#endif
88
89
#ifndef attribute_hidden
90
# define attribute_hidden
91
#endif
92
93
/* Tell the compiler when a conditional or integer expression is
94
   almost always true or almost always false.  */
95
#ifndef HAVE_BUILTIN_EXPECT
96
# define __builtin_expect(expr, val) (expr)
97
#endif
98
99
#ifndef W
100
# define W(flag, data) ((flag) ? SWAP (data) : (data))
101
#endif
102
103
104
#ifdef _LIBC
105
# include <byteswap.h>
106
# define SWAP(i) bswap_32 (i)
107
#else
108
static inline nls_uint32
109
SWAP (i)
110
     nls_uint32 i;
111
{
112
  return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
113
}
114
#endif
115
116
117
/* In-memory representation of system dependent string.  */
118
struct sysdep_string_desc
119
{
120
  /* Length of addressed string, including the trailing NUL.  */
121
  size_t length;
122
  /* Pointer to addressed string.  */
123
  const char *pointer;
124
};
125
126
/* Cache of translated strings after charset conversion.
127
   Note: The strings are converted to the target encoding only on an as-needed
128
   basis.  */
129
struct converted_domain
130
{
131
  /* The target encoding name.  */
132
  const char *encoding;
133
  /* The descriptor for conversion from the message catalog's encoding to
134
     this target encoding.  */
135
#ifdef _LIBC
136
  __gconv_t conv;
137
#else
138
# if HAVE_ICONV
139
  iconv_t conv;
140
# endif
141
#endif
142
  /* The table of translated strings after charset conversion.  */
143
  char **conv_tab;
144
};
145
146
/* The representation of an opened message catalog.  */
147
struct loaded_domain
148
{
149
  /* Pointer to memory containing the .mo file.  */
150
  const char *data;
151
  /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed.  */
152
  int use_mmap;
153
  /* Size of mmap()ed memory.  */
154
  size_t mmap_size;
155
  /* 1 if the .mo file uses a different endianness than this machine.  */
156
  int must_swap;
157
  /* Pointer to additional malloc()ed memory.  */
158
  void *malloced;
159
160
  /* Number of static strings pairs.  */
161
  nls_uint32 nstrings;
162
  /* Pointer to descriptors of original strings in the file.  */
163
  const struct string_desc *orig_tab;
164
  /* Pointer to descriptors of translated strings in the file.  */
165
  const struct string_desc *trans_tab;
166
167
  /* Number of system dependent strings pairs.  */
168
  nls_uint32 n_sysdep_strings;
169
  /* Pointer to descriptors of original sysdep strings.  */
170
  const struct sysdep_string_desc *orig_sysdep_tab;
171
  /* Pointer to descriptors of translated sysdep strings.  */
172
  const struct sysdep_string_desc *trans_sysdep_tab;
173
174
  /* Size of hash table.  */
175
  nls_uint32 hash_size;
176
  /* Pointer to hash table.  */
177
  const nls_uint32 *hash_tab;
178
  /* 1 if the hash table uses a different endianness than this machine.  */
179
  int must_swap_hash_tab;
180
181
  /* Cache of charset conversions of the translated strings.  */
182
  struct converted_domain *conversions;
183
  size_t nconversions;
184
185
  struct expression *plural;
186
  unsigned long int nplurals;
187
};
188
189
/* We want to allocate a string at the end of the struct.  But ISO C
190
   doesn't allow zero sized arrays.  */
191
#ifdef __GNUC__
192
# define ZERO 0
193
#else
194
# define ZERO 1
195
#endif
196
197
/* A set of settings bound to a message domain.  Used to store settings
198
   from bindtextdomain() and bind_textdomain_codeset().  */
199
struct binding
200
{
201
  struct binding *next;
202
  char *dirname;
203
  char *codeset;
204
  char domainname[ZERO];
205
};
206
207
/* A counter which is incremented each time some previous translations
208
   become invalid.
209
   This variable is part of the external ABI of the GNU libintl.  */
210
#ifdef IN_LIBGLOCALE
211
# include <glocale/config.h>
212
extern LIBGLOCALE_DLL_EXPORTED int _nl_msg_cat_cntr;
213
#else
214
extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr;
215
#endif
216
217
#ifndef _LIBC
218
const char *_nl_language_preferences_default (void);
219
const char *_nl_locale_name_posix (int category, const char *categoryname);
220
const char *_nl_locale_name_default (void);
221
const char *_nl_locale_name (int category, const char *categoryname);
222
#endif
223
224
struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
225
					 const char *__domainname,
226
					 struct binding *__domainbinding)
227
     internal_function;
228
void _nl_load_domain (struct loaded_l10nfile *__domain,
229
		      struct binding *__domainbinding)
230
     internal_function;
231
232
#ifdef IN_LIBGLOCALE
233
char *_nl_find_msg (struct loaded_l10nfile *domain_file,
234
		    struct binding *domainbinding, const char *encoding,
235
		    const char *msgid,
236
		    size_t *lengthp)
237
     internal_function;
238
#else
239
char *_nl_find_msg (struct loaded_l10nfile *domain_file,
240
		    struct binding *domainbinding, const char *msgid,
241
		    int convert, size_t *lengthp)
242
     internal_function;
243
#endif
244
245
/* @@ begin of epilog @@ */
246
247
#endif /* gettextP.h  */
(-)a/intl/gmo.h (-149 lines)
Lines 1-149 Link Here
1
/* Description of GNU message catalog format: general file layout.
2
   Copyright (C) 1995, 1997, 2000-2002, 2004 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
#ifndef _GETTEXT_H
20
#define _GETTEXT_H 1
21
22
#include <limits.h>
23
24
/* @@ end of prolog @@ */
25
26
/* The magic number of the GNU message catalog format.  */
27
#define _MAGIC 0x950412de
28
#define _MAGIC_SWAPPED 0xde120495
29
30
/* Revision number of the currently used .mo (binary) file format.  */
31
#define MO_REVISION_NUMBER 0
32
#define MO_REVISION_NUMBER_WITH_SYSDEP_I 1
33
34
/* The following contortions are an attempt to use the C preprocessor
35
   to determine an unsigned integral type that is 32 bits wide.  An
36
   alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
37
   as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
38
   when cross-compiling.  */
39
40
#if __STDC__
41
# define UINT_MAX_32_BITS 4294967295U
42
#else
43
# define UINT_MAX_32_BITS 0xFFFFFFFF
44
#endif
45
46
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
47
   This should be valid for all systems GNU cares about because
48
   that doesn't include 16-bit systems, and only modern systems
49
   (that certainly have <limits.h>) have 64+-bit integral types.  */
50
51
#ifndef UINT_MAX
52
# define UINT_MAX UINT_MAX_32_BITS
53
#endif
54
55
#if UINT_MAX == UINT_MAX_32_BITS
56
typedef unsigned nls_uint32;
57
#else
58
# if USHRT_MAX == UINT_MAX_32_BITS
59
typedef unsigned short nls_uint32;
60
# else
61
#  if ULONG_MAX == UINT_MAX_32_BITS
62
typedef unsigned long nls_uint32;
63
#  else
64
  /* The following line is intended to throw an error.  Using #error is
65
     not portable enough.  */
66
  "Cannot determine unsigned 32-bit data type."
67
#  endif
68
# endif
69
#endif
70
71
72
/* Header for binary .mo file format.  */
73
struct mo_file_header
74
{
75
  /* The magic number.  */
76
  nls_uint32 magic;
77
  /* The revision number of the file format.  */
78
  nls_uint32 revision;
79
80
  /* The following are only used in .mo files with major revision 0 or 1.  */
81
82
  /* The number of strings pairs.  */
83
  nls_uint32 nstrings;
84
  /* Offset of table with start offsets of original strings.  */
85
  nls_uint32 orig_tab_offset;
86
  /* Offset of table with start offsets of translated strings.  */
87
  nls_uint32 trans_tab_offset;
88
  /* Size of hash table.  */
89
  nls_uint32 hash_tab_size;
90
  /* Offset of first hash table entry.  */
91
  nls_uint32 hash_tab_offset;
92
93
  /* The following are only used in .mo files with minor revision >= 1.  */
94
95
  /* The number of system dependent segments.  */
96
  nls_uint32 n_sysdep_segments;
97
  /* Offset of table describing system dependent segments.  */
98
  nls_uint32 sysdep_segments_offset;
99
  /* The number of system dependent strings pairs.  */
100
  nls_uint32 n_sysdep_strings;
101
  /* Offset of table with start offsets of original sysdep strings.  */
102
  nls_uint32 orig_sysdep_tab_offset;
103
  /* Offset of table with start offsets of translated sysdep strings.  */
104
  nls_uint32 trans_sysdep_tab_offset;
105
};
106
107
/* Descriptor for static string contained in the binary .mo file.  */
108
struct string_desc
109
{
110
  /* Length of addressed string, not including the trailing NUL.  */
111
  nls_uint32 length;
112
  /* Offset of string in file.  */
113
  nls_uint32 offset;
114
};
115
116
/* The following are only used in .mo files with minor revision >= 1.  */
117
118
/* Descriptor for system dependent string segment.  */
119
struct sysdep_segment
120
{
121
  /* Length of addressed string, including the trailing NUL.  */
122
  nls_uint32 length;
123
  /* Offset of string in file.  */
124
  nls_uint32 offset;
125
};
126
127
/* Descriptor for system dependent string.  */
128
struct sysdep_string
129
{
130
  /* Offset of static string segments in file.  */
131
  nls_uint32 offset;
132
  /* Alternating sequence of static and system dependent segments.
133
     The last segment is a static segment, including the trailing NUL.  */
134
  struct segment_pair
135
  {
136
    /* Size of static segment.  */
137
    nls_uint32 segsize;
138
    /* Reference to system dependent string segment, or ~0 at the end.  */
139
    nls_uint32 sysdepref;
140
  } segments[1];
141
};
142
143
/* Marker for the end of the segments[] array.  This has the value 0xFFFFFFFF,
144
   regardless whether 'int' is 16 bit, 32 bit, or 64 bit.  */
145
#define SEGMENTS_END ((nls_uint32) ~0)
146
147
/* @@ begin of epilog @@ */
148
149
#endif	/* gettext.h  */
(-)a/intl/hash-string.c (-51 lines)
Lines 1-51 Link Here
1
/* Implements a string hashing function.
2
   Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Lesser General Public
7
   License as published by the Free Software Foundation; either
8
   version 2.1 of the License, or (at your option) any later version.
9
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Lesser General Public License for more details.
14
15
   You should have received a copy of the GNU Lesser General Public
16
   License along with the GNU C Library; if not, write to the Free
17
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
   Boston, MA 02110-1301, USA.  */
19
20
#ifdef HAVE_CONFIG_H
21
# include <config.h>
22
#endif
23
24
/* Specification.  */
25
#include "hash-string.h"
26
27
28
/* Defines the so called `hashpjw' function by P.J. Weinberger
29
   [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
30
   1986, 1987 Bell Telephone Laboratories, Inc.]  */
31
unsigned long int
32
__hash_string (const char *str_param)
33
{
34
  unsigned long int hval, g;
35
  const char *str = str_param;
36
37
  /* Compute the hash value for the given string.  */
38
  hval = 0;
39
  while (*str != '\0')
40
    {
41
      hval <<= 4;
42
      hval += (unsigned char) *str++;
43
      g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
44
      if (g != 0)
45
	{
46
	  hval ^= g >> (HASHWORDBITS - 8);
47
	  hval ^= g;
48
	}
49
    }
50
  return hval;
51
}
(-)a/intl/hash-string.h (-36 lines)
Lines 1-36 Link Here
1
/* Description of GNU message catalog format: string hashing function.
2
   Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc.
3
4
   This program is free software; you can redistribute it and/or modify it
5
   under the terms of the GNU Library General Public License as published
6
   by the Free Software Foundation; either version 2, or (at your option)
7
   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 GNU
12
   Library General Public License for more details.
13
14
   You should have received a copy of the GNU Library General Public
15
   License along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
   USA.  */
18
19
/* @@ end of prolog @@ */
20
21
/* We assume to have `unsigned long int' value with at least 32 bits.  */
22
#define HASHWORDBITS 32
23
24
25
#ifndef _LIBC
26
# ifdef IN_LIBINTL
27
#  define __hash_string libintl_hash_string
28
# else
29
#  define __hash_string hash_string
30
# endif
31
#endif
32
33
/* Defines the so called `hashpjw' function by P.J. Weinberger
34
   [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
35
   1986, 1987 Bell Telephone Laboratories, Inc.]  */
36
extern unsigned long int __hash_string (const char *str_param);
(-)a/intl/intl-compat.c (-133 lines)
Lines 1-133 Link Here
1
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
2
   Library.
3
   Copyright (C) 1995, 2000-2003, 2005 Software Foundation, Inc.
4
5
   This program is free software; you can redistribute it and/or modify it
6
   under the terms of the GNU Library General Public License as published
7
   by the Free Software Foundation; either version 2, or (at your option)
8
   any later version.
9
10
   This program is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Library General Public License for more details.
14
15
   You should have received a copy of the GNU Library General Public
16
   License along with this program; if not, write to the Free Software
17
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18
   USA.  */
19
20
#ifdef HAVE_CONFIG_H
21
# include <config.h>
22
#endif
23
24
#include "gettextP.h"
25
26
/* @@ end of prolog @@ */
27
28
/* This file redirects the gettext functions (without prefix) to those
29
   defined in the included GNU libintl library (with "libintl_" prefix).
30
   It is compiled into libintl in order to make the AM_GNU_GETTEXT test
31
   of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
32
   has the redirections primarily in the <libintl.h> include file.
33
   It is also compiled into libgnuintl so that libgnuintl.so can be used
34
   as LD_PRELOADable library on glibc systems, to provide the extra
35
   features that the functions in the libc don't have (namely, logging).  */
36
37
38
#undef gettext
39
#undef dgettext
40
#undef dcgettext
41
#undef ngettext
42
#undef dngettext
43
#undef dcngettext
44
#undef textdomain
45
#undef bindtextdomain
46
#undef bind_textdomain_codeset
47
48
49
/* When building a DLL, we must export some functions.  Note that because
50
   the functions are only defined for binary backward compatibility, we
51
   don't need to use __declspec(dllimport) in any case.  */
52
#if HAVE_VISIBILITY && BUILDING_DLL
53
# define DLL_EXPORTED __attribute__((__visibility__("default")))
54
#elif defined _MSC_VER && BUILDING_DLL
55
# define DLL_EXPORTED __declspec(dllexport)
56
#else
57
# define DLL_EXPORTED
58
#endif
59
60
61
DLL_EXPORTED
62
char *
63
gettext (const char *msgid)
64
{