summaryrefslogtreecommitdiffstats
path: root/meta/packages/psmisc/psmisc-20.2/gettext.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/psmisc/psmisc-20.2/gettext.patch')
-rw-r--r--meta/packages/psmisc/psmisc-20.2/gettext.patch18062
1 files changed, 18062 insertions, 0 deletions
diff --git a/meta/packages/psmisc/psmisc-20.2/gettext.patch b/meta/packages/psmisc/psmisc-20.2/gettext.patch
new file mode 100644
index 0000000000..971850f489
--- /dev/null
+++ b/meta/packages/psmisc/psmisc-20.2/gettext.patch
@@ -0,0 +1,18062 @@
1diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/ABOUT-NLS psmisc-20.2.works.clean/ABOUT-NLS
2--- tmp/work/psmisc-20.2-r0/psmisc-20.2/ABOUT-NLS 2001-04-13 23:00:47.000000000 -0500
3+++ psmisc-20.2.works.clean/ABOUT-NLS 2004-10-13 15:18:41.000000000 -0500
4@@ -1,8 +1,8 @@
5 Notes on the Free Translation Project
6 *************************************
7
8- Free software is going international! The Free Translation Project
9-is a way to get maintainers of free software, translators, and users all
10+Free software is going international! The Free Translation Project is
11+a way to get maintainers of free software, translators, and users all
12 together, so that will gradually become able to speak many languages.
13 A few packages already provide translations for their messages.
14
15@@ -25,7 +25,7 @@
16 Quick configuration advice
17 ==========================
18
19- If you want to exploit the full power of internationalization, you
20+If you want to exploit the full power of internationalization, you
21 should configure it using
22
23 ./configure --with-included-gettext
24@@ -48,10 +48,10 @@
25 INSTALL Matters
26 ===============
27
28- Some packages are "localizable" when properly installed; the
29-programs they contain can be made to speak your own native language.
30-Most such packages use GNU `gettext'. Other packages have their own
31-ways to internationalization, predating GNU `gettext'.
32+Some packages are "localizable" when properly installed; the programs
33+they contain can be made to speak your own native language. Most such
34+packages use GNU `gettext'. Other packages have their own ways to
35+internationalization, predating GNU `gettext'.
36
37 By default, this package will be installed to allow translation of
38 messages. It will automatically detect whether the system already
39@@ -98,18 +98,27 @@
40 Using This Package
41 ==================
42
43- As a user, if your language has been installed for this package, you
44+As a user, if your language has been installed for this package, you
45 only have to set the `LANG' environment variable to the appropriate
46-ISO 639 `LL' two-letter code prior to using the programs in the
47-package. For example, let's suppose that you speak German. At the
48-shell prompt, merely execute `setenv LANG de' (in `csh'),
49-`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
50-can be done from your `.login' or `.profile' file, once and for all.
51+`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
52+and `CC' is an ISO 3166 two-letter country code. For example, let's
53+suppose that you speak German and live in Germany. At the shell
54+prompt, merely execute `setenv LANG de_DE' (in `csh'),
55+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
56+This can be done from your `.login' or `.profile' file, once and for
57+all.
58
59- Some languages have dialects in different countries. To specify
60-such a dialect, the notation `LL_CC' can be used, which combines an
61-ISO 639 language code `LL' and an ISO 3166 two-letter country code
62-`CC'. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil.
63+ You might think that the country code specification is redundant.
64+But in fact, some languages have dialects in different countries. For
65+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
66+country code serves to distinguish the dialects.
67+
68+ The locale naming convention of `LL_CC', with `LL' denoting the
69+language and `CC' denoting the country, is the one use on systems based
70+on GNU libc. On other systems, some variations of this scheme are
71+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
72+locales supported by your system for your country by running the command
73+`locale -a | grep '^LL''.
74
75 Not all programs have translations for all languages. By default, an
76 English message is shown in place of a nonexistent translation. If you
77@@ -120,12 +129,25 @@
78 set to the primary language; this is required by other parts of the
79 system libraries. For example, some Swedish users who would rather
80 read translations in German than English for when Swedish is not
81-available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
82+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
83+
84+ Special advice for Norwegian users: The language code for Norwegian
85+bokma*l changed from `no' to `nb' recently (in 2003). During the
86+transition period, while some message catalogs for this language are
87+installed under `nb' and some older ones under `no', it's recommended
88+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
89+older translations are used.
90+
91+ In the `LANGUAGE' environment variable, but not in the `LANG'
92+environment variable, `LL_CC' combinations can be abbreviated as `LL'
93+to denote the language's main dialect. For example, `de' is equivalent
94+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
95+(Portuguese as spoken in Portugal) in this context.
96
97 Translating Teams
98 =================
99
100- For the Free Translation Project to be a success, we need interested
101+For the Free Translation Project to be a success, we need interested
102 people who like their own language and write it well, and who are also
103 able to synergize with other translators speaking the same language.
104 Each translation team has its own mailing list. The up-to-date list of
105@@ -155,99 +177,559 @@
106 Available Packages
107 ==================
108
109- Languages are not equally supported in all packages. The following
110-matrix shows the current state of internationalization, as of July
111-2000. The matrix shows, in regard of each package, for which languages
112+Languages are not equally supported in all packages. The following
113+matrix shows the current state of internationalization, as of January
114+2004. The matrix shows, in regard of each package, for which languages
115 PO files have been submitted to translation coordination, with a
116 translation percentage of at least 50%.
117
118- Ready PO files bg cs da de el en eo es et fi fr gl hr id it
119- .----------------------------------------------.
120- a2ps | [] [] |
121- bash | [] [] [] |
122- bison | [] [] [] [] |
123- clisp | [] [] [] [] |
124- cpio | [] [] [] |
125- diffutils | [] [] [] [] [] |
126- enscript | [] [] |
127- error | [] |
128- fileutils | [] [] [] [] [] [] [] [] |
129- findutils | [] [] [] [] [] [] |
130- flex | [] [] |
131- gcal | |
132- gcc | |
133- gettext | [] [] [] [] [] [] [] [] [] |
134- gnupg | [] [] [] [] |
135- grep | [] [] [] [] [] [] [] [] [] [] |
136- hello | [] [] [] [] [] [] [] |
137- id-utils | [] |
138- indent | [] [] [] [] [] |
139- libc | [] [] [] [] [] [] [] [] |
140- lilypond | |
141- lynx | [] [] [] |
142- m4 | [] [] [] [] [] [] |
143- make | [] [] [] [] |
144- music | [] |
145- parted | [] [] |
146- ptx | [] [] [] [] [] [] [] |
147- python | |
148- recode | [] [] [] [] [] [] [] |
149- sed | [] [] [] [] [] [] [] |
150- sh-utils | [] [] [] [] [] [] [] [] [] |
151- sharutils | [] [] [] [] [] [] |
152- tar | [] [] [] [] [] [] [] |
153- texinfo | [] [] [] [] |
154- textutils | [] [] [] [] [] [] [] |
155- util-linux | |
156- wdiff | [] [] [] [] [] |
157- wget | [] [] [] [] [] [] [] [] |
158- `----------------------------------------------'
159- bg cs da de el en eo es et fi fr gl hr id it
160- 1 14 15 28 11 1 4 19 12 1 30 16 0 3 12
161+ Ready PO files af am ar az be bg bs ca cs da de el en en_GB eo es
162+ +----------------------------------------------------+
163+ a2ps | [] [] [] [] |
164+ aegis | () |
165+ ant-phone | () |
166+ anubis | |
167+ ap-utils | |
168+ aspell | [] |
169+ bash | [] [] [] [] |
170+ batchelor | |
171+ bfd | [] [] |
172+ binutils | [] [] |
173+ bison | [] [] [] |
174+ bluez-pin | [] [] [] |
175+ clisp | |
176+ clisp | [] [] [] |
177+ console-tools | [] [] |
178+ coreutils | [] [] [] [] |
179+ cpio | [] [] [] |
180+ darkstat | [] () [] |
181+ diffutils | [] [] [] [] [] [] [] |
182+ e2fsprogs | [] [] [] |
183+ enscript | [] [] [] [] |
184+ error | [] [] [] [] [] |
185+ fetchmail | [] () [] [] [] [] |
186+ fileutils | [] [] [] |
187+ findutils | [] [] [] [] [] [] [] |
188+ flex | [] [] [] [] |
189+ fslint | |
190+ gas | [] |
191+ gawk | [] [] [] [] |
192+ gbiff | [] |
193+ gcal | [] |
194+ gcc | [] [] |
195+ gettext | [] [] [] [] [] |
196+ gettext-examples | [] [] [] [] |
197+ gettext-runtime | [] [] [] [] [] |
198+ gettext-tools | [] [] [] |
199+ gimp-print | [] [] [] [] [] |
200+ gliv | |
201+ glunarclock | [] [] |
202+ gnubiff | [] |
203+ gnucash | [] () [] [] |
204+ gnucash-glossary | [] () [] |
205+ gnupg | [] () [] [] [] [] |
206+ gpe-aerial | [] |
207+ gpe-beam | [] [] |
208+ gpe-calendar | [] [] |
209+ gpe-clock | [] [] |
210+ gpe-conf | [] [] |
211+ gpe-contacts | [] [] |
212+ gpe-edit | [] |
213+ gpe-go | [] |
214+ gpe-login | [] [] |
215+ gpe-ownerinfo | [] [] |
216+ gpe-sketchbook | [] [] |
217+ gpe-su | [] [] |
218+ gpe-taskmanager | [] [] |
219+ gpe-timesheet | [] |
220+ gpe-today | [] [] |
221+ gpe-todo | [] [] |
222+ gphoto2 | [] [] [] [] |
223+ gprof | [] [] [] |
224+ gpsdrive | () () () |
225+ gramadoir | [] |
226+ grep | [] [] [] [] [] [] |
227+ gretl | [] |
228+ gtick | [] () |
229+ hello | [] [] [] [] [] [] |
230+ id-utils | [] [] |
231+ indent | [] [] [] [] |
232+ iso_3166 | [] [] [] [] [] [] [] [] [] [] |
233+ iso_3166_1 | [] [] [] [] [] [] |
234+ iso_3166_2 | |
235+ iso_3166_3 | [] |
236+ iso_4217 | [] [] [] [] |
237+ iso_639 | |
238+ jpilot | [] [] [] |
239+ jtag | |
240+ jwhois | [] |
241+ kbd | [] [] [] [] [] |
242+ latrine | () |
243+ ld | [] [] |
244+ libc | [] [] [] [] [] [] |
245+ libgpewidget | [] [] |
246+ libiconv | [] [] [] [] [] |
247+ lifelines | [] () |
248+ lilypond | [] |
249+ lingoteach | |
250+ lingoteach_lessons | () () |
251+ lynx | [] [] [] [] |
252+ m4 | [] [] [] [] |
253+ mailutils | [] [] |
254+ make | [] [] [] |
255+ man-db | [] () [] [] () |
256+ minicom | [] [] [] |
257+ mysecretdiary | [] [] [] |
258+ nano | [] () [] [] [] |
259+ nano_1_0 | [] () [] [] [] |
260+ opcodes | [] |
261+ parted | [] [] [] [] [] |
262+ ptx | [] [] [] [] [] |
263+ python | |
264+ radius | [] |
265+ recode | [] [] [] [] [] [] [] |
266+ rpm | [] [] |
267+ screem | |
268+ scrollkeeper | [] [] [] [] [] [] |
269+ sed | [] [] [] [] [] [] |
270+ sh-utils | [] [] [] |
271+ shared-mime-info | |
272+ sharutils | [] [] [] [] [] [] |
273+ silky | () |
274+ skencil | [] () [] |
275+ sketch | [] () [] |
276+ soundtracker | [] [] [] |
277+ sp | [] |
278+ tar | [] [] [] [] |
279+ texinfo | [] [] [] |
280+ textutils | [] [] [] [] |
281+ tin | () () |
282+ tp-robot | |
283+ tuxpaint | [] [] [] [] [] [] [] |
284+ unicode-han-tra... | |
285+ unicode-transla... | |
286+ util-linux | [] [] [] [] [] |
287+ vorbis-tools | [] [] [] [] |
288+ wastesedge | () |
289+ wdiff | [] [] [] [] |
290+ wget | [] [] [] [] [] [] |
291+ xchat | [] [] [] [] |
292+ xfree86_xkb_xml | [] [] |
293+ xpad | [] |
294+ +----------------------------------------------------+
295+ af am ar az be bg bs ca cs da de el en en_GB eo es
296+ 4 0 0 1 9 4 1 40 41 60 78 17 1 5 13 68
297
298- ja ko lv nl no pl pt pt_BR ru sk sl sv zh
299- .-------------------------------------------.
300- a2ps | [] [] [] | 5
301- bash | | 3
302- bison | [] [] [] | 7
303- clisp | [] | 5
304- cpio | [] [] [] [] [] | 8
305- diffutils | [] [] [] | 8
306- enscript | [] [] | 4
307- error | | 1
308- fileutils | [] [] [] [] [] [] [] [] [] | 17
309- findutils | [] [] [] [] [] [] | 12
310- flex | [] [] [] | 5
311- gcal | | 0
312- gcc | [] | 1
313- gettext | [] [] [] [] [] [] [] [] [] | 18
314- gnupg | [] [] [] | 7
315- grep | [] [] [] [] [] [] [] | 17
316- hello | [] [] [] [] [] [] [] [] | 15
317- id-utils | [] [] [] | 4
318- indent | [] [] [] [] [] | 10
319- libc | [] [] [] [] [] [] [] [] | 16
320- lilypond | [] [] | 2
321- lynx | [] [] [] [] | 7
322- m4 | [] [] [] [] [] | 11
323- make | [] [] [] [] [] | 9
324- music | [] | 2
325- parted | [] [] [] [] | 6
326- ptx | [] [] [] [] [] [] | 13
327- python | | 0
328- recode | [] [] [] | 10
329- sed | [] [] [] [] [] [] [] | 14
330- sh-utils | [] [] [] [] [] [] [] [] [] [] | 19
331- sharutils | [] [] [] [] | 10
332- tar | [] [] [] [] [] [] [] [] | 15
333- texinfo | [] [] | 6
334- textutils | [] [] [] [] [] [] [] [] | 15
335- util-linux | [] | 1
336- wdiff | [] [] [] [] [] | 10
337- wget | [] [] [] [] [] [] [] [] [] | 17
338- `-------------------------------------------'
339- 28 teams ja ko lv nl no pl pt pt_BR ru sk sl sv zh
340- 38 domains 20 8 0 25 6 18 1 16 27 9 10 20 3 330
341+ et eu fa fi fr ga gl he hr hu id is it ja ko lg
342+ +-------------------------------------------------+
343+ a2ps | [] [] [] () () |
344+ aegis | |
345+ ant-phone | [] |
346+ anubis | [] |
347+ ap-utils | [] |
348+ aspell | [] [] |
349+ bash | [] [] |
350+ batchelor | [] [] |
351+ bfd | [] |
352+ binutils | [] [] |
353+ bison | [] [] [] [] |
354+ bluez-pin | [] [] [] [] [] |
355+ clisp | |
356+ clisp | [] |
357+ console-tools | |
358+ coreutils | [] [] [] [] [] [] |
359+ cpio | [] [] [] [] |
360+ darkstat | () [] [] [] |
361+ diffutils | [] [] [] [] [] [] [] |
362+ e2fsprogs | |
363+ enscript | [] [] |
364+ error | [] [] [] [] |
365+ fetchmail | [] |
366+ fileutils | [] [] [] [] [] [] |
367+ findutils | [] [] [] [] [] [] [] [] [] [] [] |
368+ flex | [] [] [] |
369+ fslint | [] |
370+ gas | [] |
371+ gawk | [] [] [] |
372+ gbiff | [] |
373+ gcal | [] |
374+ gcc | [] |
375+ gettext | [] [] [] |
376+ gettext-examples | [] [] |
377+ gettext-runtime | [] [] [] [] [] |
378+ gettext-tools | [] [] [] |
379+ gimp-print | [] [] |
380+ gliv | () |
381+ glunarclock | [] [] [] [] |
382+ gnubiff | [] |
383+ gnucash | () [] |
384+ gnucash-glossary | [] |
385+ gnupg | [] [] [] [] [] [] [] |
386+ gpe-aerial | [] |
387+ gpe-beam | [] |
388+ gpe-calendar | [] [] [] |
389+ gpe-clock | [] |
390+ gpe-conf | [] |
391+ gpe-contacts | [] [] |
392+ gpe-edit | [] [] |
393+ gpe-go | [] |
394+ gpe-login | [] [] |
395+ gpe-ownerinfo | [] [] [] |
396+ gpe-sketchbook | [] |
397+ gpe-su | [] |
398+ gpe-taskmanager | [] |
399+ gpe-timesheet | [] [] [] |
400+ gpe-today | [] [] |
401+ gpe-todo | [] [] |
402+ gphoto2 | [] [] [] |
403+ gprof | [] [] |
404+ gpsdrive | () () () |
405+ gramadoir | [] [] |
406+ grep | [] [] [] [] [] [] [] [] [] [] [] |
407+ gretl | [] [] |
408+ gtick | [] [] [] |
409+ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
410+ id-utils | [] [] [] [] |
411+ indent | [] [] [] [] [] [] [] [] [] |
412+ iso_3166 | [] [] [] [] [] [] [] |
413+ iso_3166_1 | [] [] [] [] [] |
414+ iso_3166_2 | |
415+ iso_3166_3 | |
416+ iso_4217 | [] [] [] [] [] [] |
417+ iso_639 | |
418+ jpilot | [] () |
419+ jtag | [] |
420+ jwhois | [] [] [] [] |
421+ kbd | [] |
422+ latrine | [] |
423+ ld | [] |
424+ libc | [] [] [] [] [] [] |
425+ libgpewidget | [] [] [] [] |
426+ libiconv | [] [] [] [] [] [] [] [] [] |
427+ lifelines | () |
428+ lilypond | [] |
429+ lingoteach | [] [] |
430+ lingoteach_lessons | |
431+ lynx | [] [] [] [] |
432+ m4 | [] [] [] [] |
433+ mailutils | |
434+ make | [] [] [] [] [] [] |
435+ man-db | () () |
436+ minicom | [] [] [] [] |
437+ mysecretdiary | [] [] |
438+ nano | [] [] [] [] |
439+ nano_1_0 | [] [] [] [] |
440+ opcodes | [] |
441+ parted | [] [] [] |
442+ ptx | [] [] [] [] [] [] [] |
443+ python | |
444+ radius | [] |
445+ recode | [] [] [] [] [] [] |
446+ rpm | [] [] |
447+ screem | |
448+ scrollkeeper | [] |
449+ sed | [] [] [] [] [] [] [] [] [] |
450+ sh-utils | [] [] [] [] [] [] [] |
451+ shared-mime-info | [] [] [] |
452+ sharutils | [] [] [] [] [] |
453+ silky | () [] () () |
454+ skencil | [] |
455+ sketch | [] |
456+ soundtracker | [] [] |
457+ sp | [] () |
458+ tar | [] [] [] [] [] [] [] [] [] |
459+ texinfo | [] [] [] [] |
460+ textutils | [] [] [] [] [] [] |
461+ tin | [] () |
462+ tp-robot | [] |
463+ tuxpaint | [] [] [] [] [] [] [] [] [] |
464+ unicode-han-tra... | |
465+ unicode-transla... | [] [] |
466+ util-linux | [] [] [] [] () [] |
467+ vorbis-tools | [] |
468+ wastesedge | () |
469+ wdiff | [] [] [] [] [] [] |
470+ wget | [] [] [] [] [] [] [] |
471+ xchat | [] [] [] |
472+ xfree86_xkb_xml | [] [] |
473+ xpad | [] [] |
474+ +-------------------------------------------------+
475+ et eu fa fi fr ga gl he hr hu id is it ja ko lg
476+ 22 2 1 26 106 28 24 8 10 41 33 1 26 33 12 0
477+
478+ lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
479+ +-----------------------------------------------------+
480+ a2ps | [] [] () () [] [] [] |
481+ aegis | () () () |
482+ ant-phone | [] [] |
483+ anubis | [] [] [] [] [] [] |
484+ ap-utils | [] () [] |
485+ aspell | [] |
486+ bash | [] [] [] |
487+ batchelor | [] |
488+ bfd | [] |
489+ binutils | [] |
490+ bison | [] [] [] [] [] |
491+ bluez-pin | [] [] [] |
492+ clisp | |
493+ clisp | [] |
494+ console-tools | [] |
495+ coreutils | [] [] |
496+ cpio | [] [] [] [] [] |
497+ darkstat | [] [] [] [] |
498+ diffutils | [] [] [] [] [] [] |
499+ e2fsprogs | [] |
500+ enscript | [] [] [] [] |
501+ error | [] [] [] |
502+ fetchmail | [] [] () [] |
503+ fileutils | [] [] [] |
504+ findutils | [] [] [] [] [] |
505+ flex | [] [] [] [] |
506+ fslint | [] [] |
507+ gas | |
508+ gawk | [] [] [] |
509+ gbiff | [] [] |
510+ gcal | |
511+ gcc | |
512+ gettext | [] [] [] |
513+ gettext-examples | [] [] [] |
514+ gettext-runtime | [] [] [] [] |
515+ gettext-tools | [] [] |
516+ gimp-print | [] |
517+ gliv | [] [] [] |
518+ glunarclock | [] [] [] [] |
519+ gnubiff | [] |
520+ gnucash | [] [] () [] |
521+ gnucash-glossary | [] [] |
522+ gnupg | [] |
523+ gpe-aerial | [] [] [] [] |
524+ gpe-beam | [] [] [] [] |
525+ gpe-calendar | [] [] [] [] |
526+ gpe-clock | [] [] [] [] |
527+ gpe-conf | [] [] [] [] |
528+ gpe-contacts | [] [] [] [] |
529+ gpe-edit | [] [] [] [] |
530+ gpe-go | [] [] [] |
531+ gpe-login | [] [] [] [] |
532+ gpe-ownerinfo | [] [] [] [] |
533+ gpe-sketchbook | [] [] [] [] |
534+ gpe-su | [] [] [] [] |
535+ gpe-taskmanager | [] [] [] [] |
536+ gpe-timesheet | [] [] [] [] |
537+ gpe-today | [] [] [] [] |
538+ gpe-todo | [] [] [] [] |
539+ gphoto2 | [] |
540+ gprof | [] [] |
541+ gpsdrive | () () [] |
542+ gramadoir | () [] |
543+ grep | [] [] [] [] [] |
544+ gretl | |
545+ gtick | [] [] [] |
546+ hello | [] [] [] [] [] [] [] [] [] [] |
547+ id-utils | [] [] [] [] |
548+ indent | [] [] [] [] |
549+ iso_3166 | [] [] [] |
550+ iso_3166_1 | [] [] |
551+ iso_3166_2 | |
552+ iso_3166_3 | [] |
553+ iso_4217 | [] [] [] [] [] [] [] [] |
554+ iso_639 | [] |
555+ jpilot | () () |
556+ jtag | |
557+ jwhois | [] [] [] [] () |
558+ kbd | [] [] [] |
559+ latrine | [] |
560+ ld | |
561+ libc | [] [] [] [] |
562+ libgpewidget | [] [] [] |
563+ libiconv | [] [] [] [] [] |
564+ lifelines | |
565+ lilypond | |
566+ lingoteach | |
567+ lingoteach_lessons | |
568+ lynx | [] [] [] |
569+ m4 | [] [] [] [] [] |
570+ mailutils | [] [] [] |
571+ make | [] [] [] [] |
572+ man-db | [] |
573+ minicom | [] [] [] [] |
574+ mysecretdiary | [] [] [] |
575+ nano | [] [] [] [] [] |
576+ nano_1_0 | [] [] [] [] [] [] |
577+ opcodes | [] [] |
578+ parted | [] [] [] [] |
579+ ptx | [] [] [] [] [] [] [] [] |
580+ python | |
581+ radius | [] [] |
582+ recode | [] [] [] [] |
583+ rpm | [] [] [] |
584+ screem | |
585+ scrollkeeper | [] [] [] [] [] |
586+ sed | [] [] [] |
587+ sh-utils | [] [] |
588+ shared-mime-info | [] [] |
589+ sharutils | [] [] |
590+ silky | () |
591+ skencil | [] [] |
592+ sketch | [] [] |
593+ soundtracker | |
594+ sp | |
595+ tar | [] [] [] [] [] [] |
596+ texinfo | [] [] [] [] |
597+ textutils | [] [] |
598+ tin | |
599+ tp-robot | [] |
600+ tuxpaint | [] [] [] [] [] [] [] [] |
601+ unicode-han-tra... | |
602+ unicode-transla... | |
603+ util-linux | [] [] [] |
604+ vorbis-tools | [] [] [] |
605+ wastesedge | |
606+ wdiff | [] [] [] [] [] |
607+ wget | [] [] [] |
608+ xchat | [] [] [] |
609+ xfree86_xkb_xml | [] [] |
610+ xpad | [] [] |
611+ +-----------------------------------------------------+
612+ lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
613+ 1 2 0 3 12 0 10 69 6 7 1 40 26 36 76 63
614+
615+ sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
616+ +-----------------------------------------------------+
617+ a2ps | [] [] [] [] | 16
618+ aegis | | 0
619+ ant-phone | | 3
620+ anubis | [] [] | 9
621+ ap-utils | () | 3
622+ aspell | | 4
623+ bash | | 9
624+ batchelor | | 3
625+ bfd | [] [] | 6
626+ binutils | [] [] [] | 8
627+ bison | [] [] | 14
628+ bluez-pin | [] [] [] | 14
629+ clisp | | 0
630+ clisp | | 5
631+ console-tools | | 3
632+ coreutils | [] [] [] [] | 16
633+ cpio | [] [] | 14
634+ darkstat | [] [] [] () () | 12
635+ diffutils | [] [] [] | 23
636+ e2fsprogs | [] [] | 6
637+ enscript | [] [] | 12
638+ error | [] [] [] | 15
639+ fetchmail | [] [] | 11
640+ fileutils | [] [] [] [] [] | 17
641+ findutils | [] [] [] [] [] [] | 29
642+ flex | [] [] | 13
643+ fslint | | 3
644+ gas | [] | 3
645+ gawk | [] [] | 12
646+ gbiff | | 4
647+ gcal | [] [] | 4
648+ gcc | [] | 4
649+ gettext | [] [] [] [] [] | 16
650+ gettext-examples | [] [] [] [] [] | 14
651+ gettext-runtime | [] [] [] [] [] [] [] [] | 22
652+ gettext-tools | [] [] [] [] [] [] | 14
653+ gimp-print | [] [] | 10
654+ gliv | | 3
655+ glunarclock | [] [] [] | 13
656+ gnubiff | | 3
657+ gnucash | [] [] | 9
658+ gnucash-glossary | [] [] [] | 8
659+ gnupg | [] [] [] [] | 17
660+ gpe-aerial | [] | 7
661+ gpe-beam | [] | 8
662+ gpe-calendar | [] [] [] [] | 13
663+ gpe-clock | [] [] [] | 10
664+ gpe-conf | [] [] | 9
665+ gpe-contacts | [] [] [] | 11
666+ gpe-edit | [] [] [] [] [] | 12
667+ gpe-go | | 5
668+ gpe-login | [] [] [] [] [] | 13
669+ gpe-ownerinfo | [] [] [] [] | 13
670+ gpe-sketchbook | [] [] | 9
671+ gpe-su | [] [] [] | 10
672+ gpe-taskmanager | [] [] [] | 10
673+ gpe-timesheet | [] [] [] [] | 12
674+ gpe-today | [] [] [] [] [] | 13
675+ gpe-todo | [] [] [] [] | 12
676+ gphoto2 | [] [] [] | 11
677+ gprof | [] [] | 9
678+ gpsdrive | [] [] | 3
679+ gramadoir | [] | 5
680+ grep | [] [] [] [] | 26
681+ gretl | | 3
682+ gtick | | 7
683+ hello | [] [] [] [] [] | 34
684+ id-utils | [] [] | 12
685+ indent | [] [] [] [] | 21
686+ iso_3166 | [] [] [] [] [] [] [] | 27
687+ iso_3166_1 | [] [] [] | 16
688+ iso_3166_2 | | 0
689+ iso_3166_3 | | 2
690+ iso_4217 | [] [] [] [] [] [] | 24
691+ iso_639 | | 1
692+ jpilot | [] [] [] [] [] | 9
693+ jtag | [] | 2
694+ jwhois | () [] [] | 11
695+ kbd | [] [] | 11
696+ latrine | | 2
697+ ld | [] [] | 5
698+ libc | [] [] [] [] | 20
699+ libgpewidget | [] [] [] [] | 13
700+ libiconv | [] [] [] [] [] [] [] [] | 27
701+ lifelines | [] | 2
702+ lilypond | [] | 3
703+ lingoteach | | 2
704+ lingoteach_lessons | () | 0
705+ lynx | [] [] [] | 14
706+ m4 | [] [] | 15
707+ mailutils | | 5
708+ make | [] [] [] | 16
709+ man-db | [] | 5
710+ minicom | | 11
711+ mysecretdiary | [] [] | 10
712+ nano | [] [] [] [] | 17
713+ nano_1_0 | [] [] [] | 17
714+ opcodes | [] [] | 6
715+ parted | [] [] [] | 15
716+ ptx | [] [] | 22
717+ python | | 0
718+ radius | | 4
719+ recode | [] [] [] | 20
720+ rpm | [] [] | 9
721+ screem | [] [] | 2
722+ scrollkeeper | [] [] [] | 15
723+ sed | [] [] [] [] [] [] | 24
724+ sh-utils | [] [] | 14
725+ shared-mime-info | [] [] | 7
726+ sharutils | [] [] [] [] | 17
727+ silky | () | 3
728+ skencil | [] | 6
729+ sketch | [] | 6
730+ soundtracker | [] [] | 7
731+ sp | [] | 3
732+ tar | [] [] [] [] [] | 24
733+ texinfo | [] [] [] | 14
734+ textutils | [] [] [] [] | 16
735+ tin | | 1
736+ tp-robot | | 2
737+ tuxpaint | [] [] [] [] [] | 29
738+ unicode-han-tra... | | 0
739+ unicode-transla... | | 2
740+ util-linux | [] [] | 15
741+ vorbis-tools | | 8
742+ wastesedge | | 0
743+ wdiff | [] [] [] | 18
744+ wget | [] [] [] [] [] [] [] [] | 24
745+ xchat | [] [] [] [] [] | 15
746+ xfree86_xkb_xml | [] [] [] [] [] | 11
747+ xpad | | 5
748+ +-----------------------------------------------------+
749+ 63 teams sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
750+ 131 domains 47 19 28 83 0 0 59 13 1 1 11 0 22 22 0 1373
751
752 Some counters in the preceding matrix are higher than the number of
753 visible blocks let us expect. This is because a few extra PO files are
754@@ -260,7 +742,7 @@
755 lag between the mere existence a PO file and its wide availability in a
756 distribution.
757
758- If July 2000 seems to be old, you may fetch a more recent copy of
759+ If January 2004 seems to be old, you may fetch a more recent copy of
760 this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
761 matrix with full percentage details can be found at
762 `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
763@@ -268,15 +750,17 @@
764 Using `gettext' in new packages
765 ===============================
766
767- If you are writing a freely available program and want to
768+If you are writing a freely available program and want to
769 internationalize it you are welcome to use GNU `gettext' in your
770-package. Of course the GNU Public License applies to your sources from
771-then if you include `gettext' directly in your distribution on but
772-since you are writing free software anyway this is no restriction.
773+package. Of course you have to respect the GNU Library General Public
774+License which covers the use of the GNU `gettext' library. This means
775+in particular that even non-free programs can use `libintl' as a shared
776+library, whereas only free software can use `libintl' as a static
777+library or use modified versions of `libintl'.
778
779- Once the sources are change appropriately and the setup can handle to
780-use of `gettext' the only thing missing are the translations. The Free
781-Translation Project is also available for packages which are not
782+ Once the sources are changed appropriately and the setup can handle
783+the use of `gettext' the only thing missing are the translations. The
784+Free Translation Project is also available for packages which are not
785 developed inside the GNU project. Therefore the information given above
786 applies also for every other Free Software Project. Contact
787 `translation@iro.umontreal.ca' to make the `.pot' files available to
788diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/ChangeLog psmisc-20.2.works.clean/ChangeLog
789--- tmp/work/psmisc-20.2-r0/psmisc-20.2/ChangeLog 2001-10-17 17:43:07.000000000 -0500
790+++ psmisc-20.2.works.clean/ChangeLog 2004-10-13 15:18:42.000000000 -0500
791@@ -1,3 +1,35 @@
792+2004-10-13 gettextize <bug-gnu-gettext@gnu.org>
793+
794+ * Makefile.am (SUBDIRS): Add intl.
795+ (EXTRA_DIST): Add config.rpath.
796+ * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
797+
798+2004-10-13 gettextize <bug-gnu-gettext@gnu.org>
799+
800+ * Makefile.am (SUBDIRS): Add intl.
801+ * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
802+
803+2004-10-13 gettextize <bug-gnu-gettext@gnu.org>
804+
805+ * Makefile.am (SUBDIRS): Add intl.
806+ * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
807+
808+2004-10-13 gettextize <bug-gnu-gettext@gnu.org>
809+
810+ * configure.in (AC_CONFIG_FILES): Add po/Makefile.in.
811+
812+2004-10-13 gettextize <bug-gnu-gettext@gnu.org>
813+
814+ * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
815+
816+2004-10-13 gettextize <bug-gnu-gettext@gnu.org>
817+
818+ * Makefile.am (SUBDIRS): Remove intl.
819+ (ACLOCAL_AMFLAGS): New variable.
820+ (EXTRA_DIST): Add config.rpath.
821+ * configure.in (AC_CONFIG_FILES): Add m4/Makefile.
822+ (AC_CONFIG_FILES): Remove intl/Makefile.
823+
824 Changes in 20.2 (18-OCT-2001)
825 =============================
826 - Added NLS/gettext
827diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/ChangeLog~ psmisc-20.2.works.clean/ChangeLog~
828diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/Makefile.am psmisc-20.2.works.clean/Makefile.am
829--- tmp/work/psmisc-20.2-r0/psmisc-20.2/Makefile.am 2001-06-12 19:49:47.000000000 -0500
830+++ psmisc-20.2.works.clean/Makefile.am 2004-10-13 15:19:08.000000000 -0500
831@@ -1,4 +1,5 @@
832+SUBDIRS = intl po doc src
833
834-SUBDIRS = doc intl src po
835+EXTRA_DIST= config.rpath config.rpath ABOUT-NLS
836
837-EXTRA_DIST=ABOUT-NLS
838+ACLOCAL_AMFLAGS = -I m4
839diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/Makefile.am~ psmisc-20.2.works.clean/Makefile.am~
840diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/Makefile.in psmisc-20.2.works.clean/Makefile.in
841diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/aclocal.m4 psmisc-20.2.works.clean/aclocal.m4
842diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/autom4te.cache/output.0 psmisc-20.2.works.clean/autom4te.cache/output.0
843diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/autom4te.cache/output.1 psmisc-20.2.works.clean/autom4te.cache/output.1
844diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/autom4te.cache/output.2 psmisc-20.2.works.clean/autom4te.cache/output.2
845diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/autom4te.cache/requests psmisc-20.2.works.clean/autom4te.cache/requests
846diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/autom4te.cache/traces.0 psmisc-20.2.works.clean/autom4te.cache/traces.0
847diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/autom4te.cache/traces.1 psmisc-20.2.works.clean/autom4te.cache/traces.1
848diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/autom4te.cache/traces.2 psmisc-20.2.works.clean/autom4te.cache/traces.2
849diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/config.guess psmisc-20.2.works.clean/config.guess
850diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/config.h.in psmisc-20.2.works.clean/config.h.in
851diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/config.rpath psmisc-20.2.works.clean/config.rpath
852diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/config.sub psmisc-20.2.works.clean/config.sub
853diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/configure psmisc-20.2.works.clean/configure
854diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/configure.in psmisc-20.2.works.clean/configure.in
855--- tmp/work/psmisc-20.2-r0/psmisc-20.2/configure.in 2001-06-15 07:21:07.000000000 -0500
856+++ psmisc-20.2.works.clean/configure.in 2004-10-13 15:19:18.000000000 -0500
857@@ -1,5 +1,6 @@
858 dnl Process this file with autoconf to produce a configure script.
859-AC_INIT(src/comm.h)
860+AC_INIT
861+AC_CONFIG_SRCDIR([src/comm.h])
862 AM_CONFIG_HEADER(config.h)
863 AM_INIT_AUTOMAKE(psmisc,20.2)
864
865@@ -23,7 +24,15 @@
866 AC_C_CONST
867 AC_TYPE_PID_T
868 AC_TYPE_SIZE_T
869-AC_STRUCT_ST_RDEV
870+AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV:
871+ your code should no longer depend upon `HAVE_ST_RDEV', but
872+ `HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and
873+ the `AC_DEFINE' when you adjust the code.])
874+AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
875+ [Define to 1 if your `struct stat' has `st_rdev'.
876+ Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
877+ instead.])])
878+
879 AC_TYPE_UID_T
880
881 dnl Check for language stuff
882@@ -33,4 +42,5 @@
883 dnl Checks for library functions.
884 AC_CHECK_FUNCS(strdup strerror strtoul)
885
886-AC_OUTPUT(Makefile doc/Makefile src/Makefile intl/Makefile po/Makefile.in)
887+AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile po/Makefile.in m4/Makefile intl/Makefile intl/libgnuintl.h ])
888+AC_OUTPUT
889diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/configure.in~ psmisc-20.2.works.clean/configure.in~
890diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/depcomp psmisc-20.2.works.clean/depcomp
891diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/doc/Makefile.in psmisc-20.2.works.clean/doc/Makefile.in
892--- tmp/work/psmisc-20.2-r0/psmisc-20.2/doc/Makefile.in 2001-10-17 17:49:50.000000000 -0500
893+++ psmisc-20.2.works.clean/doc/Makefile.in 2004-10-13 15:20:17.000000000 -0500
894@@ -1,6 +1,8 @@
895-# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
896+# Makefile.in generated by automake 1.8.4 from Makefile.am.
897+# @configure_input@
898
899-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
900+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
901+# 2003, 2004 Free Software Foundation, Inc.
902 # This Makefile.in is free software; the Free Software Foundation
903 # gives unlimited permission to copy and/or distribute it,
904 # with or without modifications, as long as this notice is preserved.
905@@ -10,111 +12,192 @@
906 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
907 # PARTICULAR PURPOSE.
908
909-
910-SHELL = @SHELL@
911-
912+@SET_MAKE@
913 srcdir = @srcdir@
914 top_srcdir = @top_srcdir@
915 VPATH = @srcdir@
916-prefix = @prefix@
917-exec_prefix = @exec_prefix@
918-
919-bindir = @bindir@
920-sbindir = @sbindir@
921-libexecdir = @libexecdir@
922-datadir = @datadir@
923-sysconfdir = @sysconfdir@
924-sharedstatedir = @sharedstatedir@
925-localstatedir = @localstatedir@
926-libdir = @libdir@
927-infodir = @infodir@
928-mandir = @mandir@
929-includedir = @includedir@
930-oldincludedir = /usr/include
931-
932-DESTDIR =
933-
934 pkgdatadir = $(datadir)/@PACKAGE@
935 pkglibdir = $(libdir)/@PACKAGE@
936 pkgincludedir = $(includedir)/@PACKAGE@
937-
938 top_builddir = ..
939-
940-ACLOCAL = @ACLOCAL@
941-AUTOCONF = @AUTOCONF@
942-AUTOMAKE = @AUTOMAKE@
943-AUTOHEADER = @AUTOHEADER@
944-
945+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
946 INSTALL = @INSTALL@
947-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
948-INSTALL_DATA = @INSTALL_DATA@
949-INSTALL_SCRIPT = @INSTALL_SCRIPT@
950-transform = @program_transform_name@
951-
952+install_sh_DATA = $(install_sh) -c -m 644
953+install_sh_PROGRAM = $(install_sh) -c
954+install_sh_SCRIPT = $(install_sh) -c
955+INSTALL_HEADER = $(INSTALL_DATA)
956+transform = $(program_transform_name)
957 NORMAL_INSTALL = :
958 PRE_INSTALL = :
959 POST_INSTALL = :
960 NORMAL_UNINSTALL = :
961 PRE_UNINSTALL = :
962 POST_UNINSTALL = :
963-host_alias = @host_alias@
964 host_triplet = @host@
965+subdir = doc
966+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
967+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
968+am__aclocal_m4_deps = $(top_srcdir)/configure.in
969+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
970+ $(ACLOCAL_M4)
971+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
972+CONFIG_HEADER = $(top_builddir)/config.h
973+CONFIG_CLEAN_FILES =
974+SOURCES =
975+DIST_SOURCES =
976+man1dir = $(mandir)/man1
977+am__installdirs = "$(DESTDIR)$(man1dir)"
978+NROFF = nroff
979+MANS = $(man_MANS)
980+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
981+ACLOCAL = @ACLOCAL@
982+ALLOCA = @ALLOCA@
983+AMDEP_FALSE = @AMDEP_FALSE@
984+AMDEP_TRUE = @AMDEP_TRUE@
985+AMTAR = @AMTAR@
986+AUTOCONF = @AUTOCONF@
987+AUTOHEADER = @AUTOHEADER@
988+AUTOMAKE = @AUTOMAKE@
989+AWK = @AWK@
990 BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
991-CATALOGS = @CATALOGS@
992 CATOBJEXT = @CATOBJEXT@
993 CC = @CC@
994+CCDEPMODE = @CCDEPMODE@
995+CFLAGS = @CFLAGS@
996 CPP = @CPP@
997+CPPFLAGS = @CPPFLAGS@
998+CYGPATH_W = @CYGPATH_W@
999 DATADIRNAME = @DATADIRNAME@
1000-GMOFILES = @GMOFILES@
1001+DEFS = @DEFS@
1002+DEPDIR = @DEPDIR@
1003+ECHO_C = @ECHO_C@
1004+ECHO_N = @ECHO_N@
1005+ECHO_T = @ECHO_T@
1006+EGREP = @EGREP@
1007+EXEEXT = @EXEEXT@
1008+GENCAT = @GENCAT@
1009+GLIBC21 = @GLIBC21@
1010 GMSGFMT = @GMSGFMT@
1011+HAVE_ASPRINTF = @HAVE_ASPRINTF@
1012+HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
1013+HAVE_SNPRINTF = @HAVE_SNPRINTF@
1014+HAVE_WPRINTF = @HAVE_WPRINTF@
1015+INSTALL_DATA = @INSTALL_DATA@
1016+INSTALL_PROGRAM = @INSTALL_PROGRAM@
1017+INSTALL_SCRIPT = @INSTALL_SCRIPT@
1018+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1019+INSTOBJEXT = @INSTOBJEXT@
1020 INTLBISON = @INTLBISON@
1021 INTLLIBS = @INTLLIBS@
1022 INTLOBJS = @INTLOBJS@
1023 INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
1024+LDFLAGS = @LDFLAGS@
1025 LIBICONV = @LIBICONV@
1026+LIBINTL = @LIBINTL@
1027+LIBOBJS = @LIBOBJS@
1028+LIBS = @LIBS@
1029+LTLIBICONV = @LTLIBICONV@
1030+LTLIBINTL = @LTLIBINTL@
1031+LTLIBOBJS = @LTLIBOBJS@
1032 MAKEINFO = @MAKEINFO@
1033 MKINSTALLDIRS = @MKINSTALLDIRS@
1034 MSGFMT = @MSGFMT@
1035+MSGMERGE = @MSGMERGE@
1036+OBJEXT = @OBJEXT@
1037 PACKAGE = @PACKAGE@
1038-POFILES = @POFILES@
1039+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
1040+PACKAGE_NAME = @PACKAGE_NAME@
1041+PACKAGE_STRING = @PACKAGE_STRING@
1042+PACKAGE_TARNAME = @PACKAGE_TARNAME@
1043+PACKAGE_VERSION = @PACKAGE_VERSION@
1044+PATH_SEPARATOR = @PATH_SEPARATOR@
1045 POSUB = @POSUB@
1046 RANLIB = @RANLIB@
1047+SET_MAKE = @SET_MAKE@
1048+SHELL = @SHELL@
1049+STRIP = @STRIP@
1050 TERMCAP_LIB = @TERMCAP_LIB@
1051 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
1052 USE_NLS = @USE_NLS@
1053 VERSION = @VERSION@
1054-
1055+XGETTEXT = @XGETTEXT@
1056+ac_ct_CC = @ac_ct_CC@
1057+ac_ct_RANLIB = @ac_ct_RANLIB@
1058+ac_ct_STRIP = @ac_ct_STRIP@
1059+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
1060+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
1061+am__include = @am__include@
1062+am__leading_dot = @am__leading_dot@
1063+am__quote = @am__quote@
1064+bindir = @bindir@
1065+build = @build@
1066+build_alias = @build_alias@
1067+build_cpu = @build_cpu@
1068+build_os = @build_os@
1069+build_vendor = @build_vendor@
1070+datadir = @datadir@
1071+exec_prefix = @exec_prefix@
1072+host = @host@
1073+host_alias = @host_alias@
1074+host_cpu = @host_cpu@
1075+host_os = @host_os@
1076+host_vendor = @host_vendor@
1077+includedir = @includedir@
1078+infodir = @infodir@
1079+install_sh = @install_sh@
1080+libdir = @libdir@
1081+libexecdir = @libexecdir@
1082+localstatedir = @localstatedir@
1083+mandir = @mandir@
1084+mkdir_p = @mkdir_p@
1085+oldincludedir = @oldincludedir@
1086+prefix = @prefix@
1087+program_transform_name = @program_transform_name@
1088+sbindir = @sbindir@
1089+sharedstatedir = @sharedstatedir@
1090+sysconfdir = @sysconfdir@
1091+target_alias = @target_alias@
1092 man_MANS = fuser.1 killall.1 pidof.1 pstree.1
1093-
1094 EXTRA_DIST = $(man_MANS)
1095-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
1096-CONFIG_HEADER = ../config.h
1097-CONFIG_CLEAN_FILES =
1098-man1dir = $(mandir)/man1
1099-MANS = $(man_MANS)
1100-
1101-NROFF = nroff
1102-DIST_COMMON = Makefile.am Makefile.in
1103-
1104-
1105-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
1106+all: all-am
1107
1108-TAR = tar
1109-GZIP_ENV = --best
1110-all: all-redirect
1111 .SUFFIXES:
1112-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
1113- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
1114-
1115-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
1116- cd $(top_builddir) \
1117- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
1118+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
1119+ @for dep in $?; do \
1120+ case '$(am__configure_deps)' in \
1121+ *$$dep*) \
1122+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
1123+ && exit 0; \
1124+ exit 1;; \
1125+ esac; \
1126+ done; \
1127+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
1128+ cd $(top_srcdir) && \
1129+ $(AUTOMAKE) --foreign doc/Makefile
1130+.PRECIOUS: Makefile
1131+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
1132+ @case '$?' in \
1133+ *config.status*) \
1134+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
1135+ *) \
1136+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
1137+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
1138+ esac;
1139
1140+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
1141+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
1142
1143-install-man1:
1144- $(mkinstalldirs) $(DESTDIR)$(man1dir)
1145- @list='$(man1_MANS)'; \
1146- l2='$(man_MANS)'; for i in $$l2; do \
1147+$(top_srcdir)/configure: $(am__configure_deps)
1148+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
1149+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
1150+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
1151+uninstall-info-am:
1152+install-man1: $(man1_MANS) $(man_MANS)
1153+ @$(NORMAL_INSTALL)
1154+ test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
1155+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
1156+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
1157+ for i in $$l2; do \
1158 case "$$i" in \
1159 *.1*) list="$$list $$i" ;; \
1160 esac; \
1161@@ -123,112 +206,158 @@
1162 if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
1163 else file=$$i; fi; \
1164 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
1165+ case "$$ext" in \
1166+ 1*) ;; \
1167+ *) ext='1' ;; \
1168+ esac; \
1169 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
1170+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
1171 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
1172- echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
1173- $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
1174+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
1175+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
1176 done
1177-
1178 uninstall-man1:
1179- @list='$(man1_MANS)'; \
1180- l2='$(man_MANS)'; for i in $$l2; do \
1181+ @$(NORMAL_UNINSTALL)
1182+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
1183+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
1184+ for i in $$l2; do \
1185 case "$$i" in \
1186 *.1*) list="$$list $$i" ;; \
1187 esac; \
1188 done; \
1189 for i in $$list; do \
1190 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
1191+ case "$$ext" in \
1192+ 1*) ;; \
1193+ *) ext='1' ;; \
1194+ esac; \
1195 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
1196+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
1197 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
1198- echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
1199- rm -f $(DESTDIR)$(man1dir)/$$inst; \
1200+ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
1201+ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
1202 done
1203-install-man: $(MANS)
1204- @$(NORMAL_INSTALL)
1205- $(MAKE) $(AM_MAKEFLAGS) install-man1
1206-uninstall-man:
1207- @$(NORMAL_UNINSTALL)
1208- $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
1209 tags: TAGS
1210 TAGS:
1211
1212+ctags: CTAGS
1213+CTAGS:
1214
1215-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
1216-
1217-subdir = doc
1218
1219 distdir: $(DISTFILES)
1220- @for file in $(DISTFILES); do \
1221- d=$(srcdir); \
1222+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
1223+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
1224+ list='$(DISTFILES)'; for file in $$list; do \
1225+ case $$file in \
1226+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
1227+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
1228+ esac; \
1229+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
1230+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
1231+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
1232+ dir="/$$dir"; \
1233+ $(mkdir_p) "$(distdir)$$dir"; \
1234+ else \
1235+ dir=''; \
1236+ fi; \
1237 if test -d $$d/$$file; then \
1238- cp -pr $$d/$$file $(distdir)/$$file; \
1239+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
1240+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
1241+ fi; \
1242+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
1243 else \
1244 test -f $(distdir)/$$file \
1245- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
1246- || cp -p $$d/$$file $(distdir)/$$file || :; \
1247+ || cp -p $$d/$$file $(distdir)/$$file \
1248+ || exit 1; \
1249 fi; \
1250 done
1251-info-am:
1252-info: info-am
1253-dvi-am:
1254-dvi: dvi-am
1255 check-am: all-am
1256 check: check-am
1257-installcheck-am:
1258-installcheck: installcheck-am
1259-install-exec-am:
1260+all-am: Makefile $(MANS)
1261+installdirs:
1262+ for dir in "$(DESTDIR)$(man1dir)"; do \
1263+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
1264+ done
1265+install: install-am
1266 install-exec: install-exec-am
1267-
1268-install-data-am: install-man
1269 install-data: install-data-am
1270+uninstall: uninstall-am
1271
1272 install-am: all-am
1273 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
1274-install: install-am
1275-uninstall-am: uninstall-man
1276-uninstall: uninstall-am
1277-all-am: Makefile $(MANS)
1278-all-redirect: all-am
1279-install-strip:
1280- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
1281-installdirs:
1282- $(mkinstalldirs) $(DESTDIR)$(mandir)/man1
1283-
1284
1285+installcheck: installcheck-am
1286+install-strip:
1287+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1288+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1289+ `test -z '$(STRIP)' || \
1290+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
1291 mostlyclean-generic:
1292
1293 clean-generic:
1294
1295 distclean-generic:
1296- -rm -f Makefile $(CONFIG_CLEAN_FILES)
1297- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
1298+ -rm -f $(CONFIG_CLEAN_FILES)
1299
1300 maintainer-clean-generic:
1301-mostlyclean-am: mostlyclean-generic
1302+ @echo "This command is intended for maintainers to use"
1303+ @echo "it deletes files that may require special tools to rebuild."
1304+clean: clean-am
1305
1306-mostlyclean: mostlyclean-am
1307+clean-am: clean-generic mostlyclean-am
1308
1309-clean-am: clean-generic mostlyclean-am
1310+distclean: distclean-am
1311+ -rm -f Makefile
1312+distclean-am: clean-am distclean-generic
1313
1314-clean: clean-am
1315+dvi: dvi-am
1316
1317-distclean-am: distclean-generic clean-am
1318+dvi-am:
1319
1320-distclean: distclean-am
1321+html: html-am
1322
1323-maintainer-clean-am: maintainer-clean-generic distclean-am
1324- @echo "This command is intended for maintainers to use;"
1325- @echo "it deletes files that may require special tools to rebuild."
1326+info: info-am
1327+
1328+info-am:
1329+
1330+install-data-am: install-man
1331+
1332+install-exec-am:
1333+
1334+install-info: install-info-am
1335+
1336+install-man: install-man1
1337+
1338+installcheck-am:
1339
1340 maintainer-clean: maintainer-clean-am
1341+ -rm -f Makefile
1342+maintainer-clean-am: distclean-am maintainer-clean-generic
1343
1344-.PHONY: install-man1 uninstall-man1 install-man uninstall-man tags \
1345-distdir info-am info dvi-am dvi check check-am installcheck-am \
1346-installcheck install-exec-am install-exec install-data-am install-data \
1347-install-am install uninstall-am uninstall all-redirect all-am all \
1348-installdirs mostlyclean-generic distclean-generic clean-generic \
1349-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
1350+mostlyclean: mostlyclean-am
1351+
1352+mostlyclean-am: mostlyclean-generic
1353+
1354+pdf: pdf-am
1355+
1356+pdf-am:
1357+
1358+ps: ps-am
1359
1360+ps-am:
1361+
1362+uninstall-am: uninstall-info-am uninstall-man
1363+
1364+uninstall-man: uninstall-man1
1365+
1366+.PHONY: all all-am check check-am clean clean-generic distclean \
1367+ distclean-generic distdir dvi dvi-am html html-am info info-am \
1368+ install install-am install-data install-data-am install-exec \
1369+ install-exec-am install-info install-info-am install-man \
1370+ install-man1 install-strip installcheck installcheck-am \
1371+ installdirs maintainer-clean maintainer-clean-generic \
1372+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
1373+ uninstall-am uninstall-info-am uninstall-man uninstall-man1
1374
1375 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1376 # Otherwise a system limit (for SysV at least) may be exceeded.
1377diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/install-sh psmisc-20.2.works.clean/install-sh
1378diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/ChangeLog psmisc-20.2.works.clean/intl/ChangeLog
1379--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/ChangeLog 2001-04-13 23:00:42.000000000 -0500
1380+++ psmisc-20.2.works.clean/intl/ChangeLog 2004-10-13 15:18:41.000000000 -0500
1381@@ -1,4 +1,4 @@
1382-2001-03-09 GNU <bug-gnu-utils@gnu.org>
1383+2004-01-29 GNU <bug-gnu-gettext@gnu.org>
1384
1385- * Version 0.10.36 released.
1386+ * Version 0.14.1 released.
1387
1388diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/Makefile.in psmisc-20.2.works.clean/intl/Makefile.in
1389--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/Makefile.in 2001-04-13 23:00:42.000000000 -0500
1390+++ psmisc-20.2.works.clean/intl/Makefile.in 2004-10-13 15:18:41.000000000 -0500
1391@@ -1,19 +1,20 @@
1392-# Makefile for directory with message catalog handling in GNU NLS Utilities.
1393-# Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
1394+# Makefile for directory with message catalog handling library of GNU gettext
1395+# Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
1396 #
1397-# This program is free software; you can redistribute it and/or modify
1398-# it under the terms of the GNU General Public License as published by
1399-# the Free Software Foundation; either version 2, or (at your option)
1400+# This program is free software; you can redistribute it and/or modify it
1401+# under the terms of the GNU Library General Public License as published
1402+# by the Free Software Foundation; either version 2, or (at your option)
1403 # any later version.
1404 #
1405 # This program is distributed in the hope that it will be useful,
1406 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1407-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1408-# GNU General Public License for more details.
1409+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1410+# Library General Public License for more details.
1411 #
1412-# You should have received a copy of the GNU General Public License
1413-# along with this program; if not, write to the Free Software
1414-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1415+# You should have received a copy of the GNU Library General Public
1416+# License along with this program; if not, write to the Free Software
1417+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1418+# USA.
1419
1420 PACKAGE = @PACKAGE@
1421 VERSION = @VERSION@
1422@@ -23,23 +24,23 @@
1423 srcdir = @srcdir@
1424 top_srcdir = @top_srcdir@
1425 top_builddir = ..
1426-VPATH = @srcdir@
1427+#VPATH = $(srcdir)
1428
1429 prefix = @prefix@
1430 exec_prefix = @exec_prefix@
1431 transform = @program_transform_name@
1432-libdir = $(exec_prefix)/lib
1433-includedir = $(prefix)/include
1434-datadir = $(prefix)/share
1435+libdir = @libdir@
1436+includedir = @includedir@
1437+datadir = @datadir@
1438 localedir = $(datadir)/locale
1439-gettextsrcdir = @datadir@/gettext/intl
1440+gettextsrcdir = $(datadir)/gettext/intl
1441 aliaspath = $(localedir)
1442 subdir = intl
1443
1444 INSTALL = @INSTALL@
1445 INSTALL_DATA = @INSTALL_DATA@
1446 MKINSTALLDIRS = @MKINSTALLDIRS@
1447-mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
1448+mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
1449
1450 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
1451
1452@@ -51,89 +52,202 @@
1453 YFLAGS = --name-prefix=__gettext
1454
1455 DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
1456--DLIBDIR=\"$(libdir)\" @DEFS@
1457+-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
1458+-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
1459+-Dset_relocation_prefix=libintl_set_relocation_prefix \
1460+-Drelocate=libintl_relocate \
1461+-DDEPENDS_ON_LIBICONV=1 @DEFS@
1462 CPPFLAGS = @CPPFLAGS@
1463 CFLAGS = @CFLAGS@
1464 LDFLAGS = @LDFLAGS@
1465+LIBS = @LIBS@
1466
1467 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
1468
1469-HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
1470-COMHDRS = gettext.h gettextP.h hash-string.h
1471-SOURCES = $(COMSRCS) intl-compat.c
1472-COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
1473-finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
1474-explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
1475-localcharset.c
1476-OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
1477-finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
1478-explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
1479-plural.$lo localcharset.$lo
1480-GETTOBJS = intl-compat.$lo
1481+HEADERS = \
1482+ gmo.h \
1483+ gettextP.h \
1484+ hash-string.h \
1485+ loadinfo.h \
1486+ plural-exp.h \
1487+ eval-plural.h \
1488+ localcharset.h \
1489+ relocatable.h \
1490+ xsize.h \
1491+ printf-args.h printf-args.c \
1492+ printf-parse.h wprintf-parse.h printf-parse.c \
1493+ vasnprintf.h vasnwprintf.h vasnprintf.c \
1494+ os2compat.h \
1495+ libgnuintl.h.in
1496+SOURCES = \
1497+ bindtextdom.c \
1498+ dcgettext.c \
1499+ dgettext.c \
1500+ gettext.c \
1501+ finddomain.c \
1502+ loadmsgcat.c \
1503+ localealias.c \
1504+ textdomain.c \
1505+ l10nflist.c \
1506+ explodename.c \
1507+ dcigettext.c \
1508+ dcngettext.c \
1509+ dngettext.c \
1510+ ngettext.c \
1511+ plural.y \
1512+ plural-exp.c \
1513+ localcharset.c \
1514+ relocatable.c \
1515+ localename.c \
1516+ log.c \
1517+ printf.c \
1518+ osdep.c \
1519+ os2compat.c \
1520+ intl-compat.c
1521+OBJECTS = \
1522+ bindtextdom.$lo \
1523+ dcgettext.$lo \
1524+ dgettext.$lo \
1525+ gettext.$lo \
1526+ finddomain.$lo \
1527+ loadmsgcat.$lo \
1528+ localealias.$lo \
1529+ textdomain.$lo \
1530+ l10nflist.$lo \
1531+ explodename.$lo \
1532+ dcigettext.$lo \
1533+ dcngettext.$lo \
1534+ dngettext.$lo \
1535+ ngettext.$lo \
1536+ plural.$lo \
1537+ plural-exp.$lo \
1538+ localcharset.$lo \
1539+ relocatable.$lo \
1540+ localename.$lo \
1541+ log.$lo \
1542+ printf.$lo \
1543+ osdep.$lo \
1544+ intl-compat.$lo
1545 DISTFILES.common = Makefile.in \
1546 config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
1547 DISTFILES.generated = plural.c
1548 DISTFILES.normal = VERSION
1549-DISTFILES.gettext = libintl.glibc
1550-DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c
1551+DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
1552+libgnuintl.h_vms Makefile.vms \
1553+libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
1554+DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
1555+COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
1556+
1557+all: all-@USE_INCLUDED_LIBINTL@
1558+all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
1559+all-no: all-no-@BUILD_INCLUDED_LIBINTL@
1560+all-no-yes: libgnuintl.$la
1561+all-no-no:
1562+
1563+libintl.a libgnuintl.a: $(OBJECTS)
1564+ rm -f $@
1565+ $(AR) cru $@ $(OBJECTS)
1566+ $(RANLIB) $@
1567+
1568+libintl.la libgnuintl.la: $(OBJECTS)
1569+ $(LIBTOOL) --mode=link \
1570+ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
1571+ $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
1572+ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
1573+ -rpath $(libdir) \
1574+ -no-undefined
1575
1576 # Libtool's library version information for libintl.
1577 # Before making a gettext release, the gettext maintainer must change this
1578 # according to the libtool documentation, section "Library interface versions".
1579 # Maintainers of other packages that include the intl directory must *not*
1580 # change these values.
1581-LTV_CURRENT=1
1582+LTV_CURRENT=7
1583 LTV_REVISION=0
1584-LTV_AGE=0
1585+LTV_AGE=4
1586
1587 .SUFFIXES:
1588 .SUFFIXES: .c .y .o .lo .sin .sed
1589+
1590 .c.o:
1591 $(COMPILE) $<
1592-.c.lo:
1593- $(LIBTOOL) --mode=compile $(COMPILE) $<
1594
1595 .y.c:
1596 $(YACC) $(YFLAGS) --output $@ $<
1597 rm -f $*.h
1598
1599-.sin.sed:
1600- sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
1601- mv t-$@ $@
1602-
1603-INCLUDES = -I.. -I. -I$(top_srcdir)/intl
1604+bindtextdom.lo: $(srcdir)/bindtextdom.c
1605+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
1606+dcgettext.lo: $(srcdir)/dcgettext.c
1607+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
1608+dgettext.lo: $(srcdir)/dgettext.c
1609+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
1610+gettext.lo: $(srcdir)/gettext.c
1611+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
1612+finddomain.lo: $(srcdir)/finddomain.c
1613+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
1614+loadmsgcat.lo: $(srcdir)/loadmsgcat.c
1615+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
1616+localealias.lo: $(srcdir)/localealias.c
1617+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
1618+textdomain.lo: $(srcdir)/textdomain.c
1619+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
1620+l10nflist.lo: $(srcdir)/l10nflist.c
1621+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
1622+explodename.lo: $(srcdir)/explodename.c
1623+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
1624+dcigettext.lo: $(srcdir)/dcigettext.c
1625+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
1626+dcngettext.lo: $(srcdir)/dcngettext.c
1627+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
1628+dngettext.lo: $(srcdir)/dngettext.c
1629+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
1630+ngettext.lo: $(srcdir)/ngettext.c
1631+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
1632+plural.lo: $(srcdir)/plural.c
1633+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
1634+plural-exp.lo: $(srcdir)/plural-exp.c
1635+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
1636+localcharset.lo: $(srcdir)/localcharset.c
1637+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
1638+relocatable.lo: $(srcdir)/relocatable.c
1639+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
1640+localename.lo: $(srcdir)/localename.c
1641+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
1642+log.lo: $(srcdir)/log.c
1643+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
1644+printf.lo: $(srcdir)/printf.c
1645+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
1646+osdep.lo: $(srcdir)/osdep.c
1647+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
1648+intl-compat.lo: $(srcdir)/intl-compat.c
1649+ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
1650
1651-all: all-@USE_INCLUDED_LIBINTL@
1652-all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
1653-all-no: all-no-@BUILD_INCLUDED_LIBINTL@
1654-all-no-yes: libgnuintl.$la
1655-all-no-no:
1656+ref-add.sed: $(srcdir)/ref-add.sin
1657+ sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
1658+ mv t-ref-add.sed ref-add.sed
1659+ref-del.sed: $(srcdir)/ref-del.sin
1660+ sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
1661+ mv t-ref-del.sed ref-del.sed
1662
1663-libintl.a libgnuintl.a: $(OBJECTS)
1664- rm -f $@
1665- $(AR) cru $@ $(OBJECTS)
1666- $(RANLIB) $@
1667+INCLUDES = -I. -I$(srcdir) -I..
1668
1669-libintl.la libgnuintl.la: $(OBJECTS)
1670- $(LIBTOOL) --mode=link \
1671- $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
1672- $(OBJECTS) @LIBICONV@ \
1673- -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
1674- -rpath $(libdir) \
1675- -no-undefined
1676+libgnuintl.h: $(srcdir)/libgnuintl.h.in
1677+ sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
1678+ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
1679+ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
1680+ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
1681+ < $(srcdir)/libgnuintl.h.in > libgnuintl.h
1682
1683 libintl.h: libgnuintl.h
1684- cp $(srcdir)/libgnuintl.h libintl.h
1685+ cp libgnuintl.h libintl.h
1686
1687-charset.alias: config.charset
1688+charset.alias: $(srcdir)/config.charset
1689 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
1690 mv t-$@ $@
1691
1692 check: all
1693
1694-# This installation goal is only used in GNU gettext. Packages which
1695-# only use the library should use install instead.
1696-
1697 # We must not install the libintl.h/libintl.a files if we are on a
1698 # system which has the GNU gettext() function in its C library or in a
1699 # separate library.
1700@@ -141,25 +255,50 @@
1701 # package, you have to use `configure --with-included-gettext'.
1702 install: install-exec install-data
1703 install-exec: all
1704- if test "$(PACKAGE)" = "gettext" \
1705- && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
1706+ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
1707+ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
1708 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
1709 $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
1710 $(LIBTOOL) --mode=install \
1711 $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
1712+ if test "@RELOCATABLE@" = yes; then \
1713+ dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
1714+ if test -n "$$dependencies"; then \
1715+ rm -f $(DESTDIR)$(libdir)/libintl.la; \
1716+ fi; \
1717+ fi; \
1718 else \
1719 : ; \
1720 fi
1721- if test '@USE_INCLUDED_LIBINTL@' = yes; then \
1722+ if test "$(PACKAGE)" = "gettext-tools" \
1723+ && test '@USE_INCLUDED_LIBINTL@' = no; then \
1724 $(mkinstalldirs) $(DESTDIR)$(libdir); \
1725- test -f $(DESTDIR)$(libdir)/charset.alias \
1726- && orig=$(DESTDIR)$(libdir)/charset.alias \
1727- || orig=charset.alias; \
1728+ $(LIBTOOL) --mode=install \
1729+ $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
1730+ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
1731+ $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
1732+ $(LIBTOOL) --mode=uninstall \
1733+ rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
1734+ else \
1735+ : ; \
1736+ fi
1737+ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
1738+ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
1739 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
1740 dest=$(DESTDIR)$(libdir)/charset.alias; \
1741- sed -f ref-add.sed $$orig > $$temp; \
1742- $(INSTALL_DATA) $$temp $$dest; \
1743- rm -f $$temp; \
1744+ if test -f $(DESTDIR)$(libdir)/charset.alias; then \
1745+ orig=$(DESTDIR)$(libdir)/charset.alias; \
1746+ sed -f ref-add.sed $$orig > $$temp; \
1747+ $(INSTALL_DATA) $$temp $$dest; \
1748+ rm -f $$temp; \
1749+ else \
1750+ if test @GLIBC21@ = no; then \
1751+ orig=charset.alias; \
1752+ sed -f ref-add.sed $$orig > $$temp; \
1753+ $(INSTALL_DATA) $$temp $$dest; \
1754+ rm -f $$temp; \
1755+ fi; \
1756+ fi; \
1757 $(mkinstalldirs) $(DESTDIR)$(localedir); \
1758 test -f $(DESTDIR)$(localedir)/locale.alias \
1759 && orig=$(DESTDIR)$(localedir)/locale.alias \
1760@@ -173,16 +312,22 @@
1761 : ; \
1762 fi
1763 install-data: all
1764- if test "$(PACKAGE)" = "gettext"; then \
1765+ if test "$(PACKAGE)" = "gettext-tools"; then \
1766 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
1767 $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
1768 $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
1769- dists="$(DISTFILES.common)"; \
1770+ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
1771 for file in $$dists; do \
1772 $(INSTALL_DATA) $(srcdir)/$$file \
1773 $(DESTDIR)$(gettextsrcdir)/$$file; \
1774 done; \
1775 chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
1776+ dists="$(DISTFILES.generated)"; \
1777+ for file in $$dists; do \
1778+ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
1779+ $(INSTALL_DATA) $$dir/$$file \
1780+ $(DESTDIR)$(gettextsrcdir)/$$file; \
1781+ done; \
1782 dists="$(DISTFILES.obsolete)"; \
1783 for file in $$dists; do \
1784 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
1785@@ -191,18 +336,51 @@
1786 : ; \
1787 fi
1788
1789+install-strip: install
1790+
1791+installdirs:
1792+ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
1793+ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
1794+ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
1795+ else \
1796+ : ; \
1797+ fi
1798+ if test "$(PACKAGE)" = "gettext-tools" \
1799+ && test '@USE_INCLUDED_LIBINTL@' = no; then \
1800+ $(mkinstalldirs) $(DESTDIR)$(libdir); \
1801+ else \
1802+ : ; \
1803+ fi
1804+ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
1805+ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
1806+ $(mkinstalldirs) $(DESTDIR)$(localedir); \
1807+ else \
1808+ : ; \
1809+ fi
1810+ if test "$(PACKAGE)" = "gettext-tools"; then \
1811+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
1812+ else \
1813+ : ; \
1814+ fi
1815+
1816 # Define this as empty until I found a useful application.
1817 installcheck:
1818
1819 uninstall:
1820- if test "$(PACKAGE)" = "gettext" \
1821- && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
1822+ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
1823+ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
1824 rm -f $(DESTDIR)$(includedir)/libintl.h; \
1825 $(LIBTOOL) --mode=uninstall \
1826 rm -f $(DESTDIR)$(libdir)/libintl.$la; \
1827 else \
1828 : ; \
1829 fi
1830+ if test "$(PACKAGE)" = "gettext-tools" \
1831+ && test '@USE_INCLUDED_LIBINTL@' = no; then \
1832+ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
1833+ else \
1834+ : ; \
1835+ fi
1836 if test '@USE_INCLUDED_LIBINTL@' = yes; then \
1837 if test -f $(DESTDIR)$(libdir)/charset.alias; then \
1838 temp=$(DESTDIR)$(libdir)/t-charset.alias; \
1839@@ -229,25 +407,36 @@
1840 else \
1841 : ; \
1842 fi
1843- if test "$(PACKAGE)" = "gettext"; then \
1844- for file in VERSION ChangeLog $(DISTFILES.common); do \
1845+ if test "$(PACKAGE)" = "gettext-tools"; then \
1846+ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
1847 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
1848 done; \
1849 else \
1850 : ; \
1851 fi
1852
1853-info dvi:
1854+info dvi ps pdf html:
1855
1856 $(OBJECTS): ../config.h libgnuintl.h
1857-bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
1858-dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
1859+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
1860+dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
1861+explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
1862+dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
1863+dcigettext.$lo: $(srcdir)/eval-plural.h
1864+localcharset.$lo: $(srcdir)/localcharset.h
1865+localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
1866+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
1867
1868 tags: TAGS
1869
1870 TAGS: $(HEADERS) $(SOURCES)
1871 here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
1872
1873+ctags: CTAGS
1874+
1875+CTAGS: $(HEADERS) $(SOURCES)
1876+ here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
1877+
1878 id: ID
1879
1880 ID: $(HEADERS) $(SOURCES)
1881@@ -255,15 +444,15 @@
1882
1883
1884 mostlyclean:
1885- rm -f *.a *.la *.o *.lo core core.*
1886- rm -f libintl.h charset.alias ref-add.sed ref-del.sed
1887+ rm -f *.a *.la *.o *.obj *.lo core core.*
1888+ rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
1889 rm -f -r .libs _libs
1890
1891 clean: mostlyclean
1892
1893 distclean: clean
1894 rm -f Makefile ID TAGS
1895- if test "$(PACKAGE)" = gettext; then \
1896+ if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
1897 rm -f ChangeLog.inst $(DISTFILES.normal); \
1898 else \
1899 : ; \
1900@@ -278,20 +467,26 @@
1901 # other files which should not be distributed in other packages.
1902 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
1903 dist distdir: Makefile
1904- if test "$(PACKAGE)" = gettext; then \
1905- additional="$(DISTFILES.gettext)"; \
1906+ if test "$(PACKAGE)" = "gettext-tools"; then \
1907+ : ; \
1908 else \
1909- additional="$(DISTFILES.normal)"; \
1910- fi; \
1911- $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
1912- for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
1913- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
1914- || cp -p $(srcdir)/$$file $(distdir); \
1915- done
1916+ if test "$(PACKAGE)" = "gettext-runtime"; then \
1917+ additional="$(DISTFILES.gettext)"; \
1918+ else \
1919+ additional="$(DISTFILES.normal)"; \
1920+ fi; \
1921+ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
1922+ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
1923+ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
1924+ cp -p $$dir/$$file $(distdir); \
1925+ done; \
1926+ fi
1927
1928-Makefile: Makefile.in ../config.status
1929- cd .. \
1930- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
1931+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
1932+ cd $(top_builddir) && $(SHELL) ./config.status
1933+# This would be more efficient, but doesn't work any more with autoconf-2.57,
1934+# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
1935+# cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
1936
1937 # Tell versions [3.59,3.63) of GNU make not to export all variables.
1938 # Otherwise a system limit (for SysV at least) may be exceeded.
1939diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/VERSION psmisc-20.2.works.clean/intl/VERSION
1940--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/VERSION 2001-04-13 23:00:42.000000000 -0500
1941+++ psmisc-20.2.works.clean/intl/VERSION 2004-10-13 15:18:41.000000000 -0500
1942@@ -1 +1 @@
1943-GNU gettext library from gettext-0.10.36
1944+GNU gettext library from gettext-0.14.1
1945diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/bindtextdom.c psmisc-20.2.works.clean/intl/bindtextdom.c
1946--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/bindtextdom.c 2001-04-13 23:00:42.000000000 -0500
1947+++ psmisc-20.2.works.clean/intl/bindtextdom.c 2004-10-13 15:18:41.000000000 -0500
1948@@ -1,19 +1,20 @@
1949 /* Implementation of the bindtextdomain(3) function
1950- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
1951+ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
1952
1953- This program is free software; you can redistribute it and/or modify
1954- it under the terms of the GNU General Public License as published by
1955- the Free Software Foundation; either version 2, or (at your option)
1956+ This program is free software; you can redistribute it and/or modify it
1957+ under the terms of the GNU Library General Public License as published
1958+ by the Free Software Foundation; either version 2, or (at your option)
1959 any later version.
1960
1961 This program is distributed in the hope that it will be useful,
1962 but WITHOUT ANY WARRANTY; without even the implied warranty of
1963- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1964- GNU General Public License for more details.
1965+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1966+ Library General Public License for more details.
1967
1968- You should have received a copy of the GNU General Public License
1969- along with this program; if not, write to the Free Software Foundation,
1970- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1971+ You should have received a copy of the GNU Library General Public
1972+ License along with this program; if not, write to the Free Software
1973+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1974+ USA. */
1975
1976 #ifdef HAVE_CONFIG_H
1977 # include <config.h>
1978@@ -44,8 +45,8 @@
1979 names than the internal variables in GNU libc, otherwise programs
1980 using libintl.a cannot be linked statically. */
1981 #if !defined _LIBC
1982-# define _nl_default_dirname _nl_default_dirname__
1983-# define _nl_domain_bindings _nl_domain_bindings__
1984+# define _nl_default_dirname libintl_nl_default_dirname
1985+# define _nl_domain_bindings libintl_nl_domain_bindings
1986 #endif
1987
1988 /* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
1989@@ -57,12 +58,17 @@
1990
1991 /* Contains the default location of the message catalogs. */
1992 extern const char _nl_default_dirname[];
1993+#ifdef _LIBC
1994+extern const char _nl_default_dirname_internal[] attribute_hidden;
1995+#else
1996+# define INTUSE(name) name
1997+#endif
1998
1999 /* List with bindings of specific domains. */
2000 extern struct binding *_nl_domain_bindings;
2001
2002 /* Lock variable to protect the global data in the gettext implementation. */
2003-__libc_rwlock_define (extern, _nl_state_lock)
2004+__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
2005
2006
2007 /* Names for the libintl functions are a problem. They must not clash
2008@@ -76,15 +82,10 @@
2009 # define strdup(str) __strdup (str)
2010 # endif
2011 #else
2012-# define BINDTEXTDOMAIN bindtextdomain__
2013-# define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__
2014+# define BINDTEXTDOMAIN libintl_bindtextdomain
2015+# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
2016 #endif
2017
2018-/* Prototypes for local functions. */
2019-static void set_binding_values PARAMS ((const char *domainname,
2020- const char **dirnamep,
2021- const char **codesetp));
2022-
2023 /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
2024 to be used for the DOMAINNAME message catalog.
2025 If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
2026@@ -92,10 +93,8 @@
2027 If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
2028 modified nor returned. */
2029 static void
2030-set_binding_values (domainname, dirnamep, codesetp)
2031- const char *domainname;
2032- const char **dirnamep;
2033- const char **codesetp;
2034+set_binding_values (const char *domainname,
2035+ const char **dirnamep, const char **codesetp)
2036 {
2037 struct binding *binding;
2038 int modified;
2039@@ -145,8 +144,8 @@
2040 char *result = binding->dirname;
2041 if (strcmp (dirname, result) != 0)
2042 {
2043- if (strcmp (dirname, _nl_default_dirname) == 0)
2044- result = (char *) _nl_default_dirname;
2045+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
2046+ result = (char *) INTUSE(_nl_default_dirname);
2047 else
2048 {
2049 #if defined _LIBC || defined HAVE_STRDUP
2050@@ -161,7 +160,7 @@
2051
2052 if (__builtin_expect (result != NULL, 1))
2053 {
2054- if (binding->dirname != _nl_default_dirname)
2055+ if (binding->dirname != INTUSE(_nl_default_dirname))
2056 free (binding->dirname);
2057
2058 binding->dirname = result;
2059@@ -202,6 +201,7 @@
2060 free (binding->codeset);
2061
2062 binding->codeset = result;
2063+ binding->codeset_cntr++;
2064 modified = 1;
2065 }
2066 }
2067@@ -214,7 +214,7 @@
2068 {
2069 /* Simply return the default values. */
2070 if (dirnamep)
2071- *dirnamep = _nl_default_dirname;
2072+ *dirnamep = INTUSE(_nl_default_dirname);
2073 if (codesetp)
2074 *codesetp = NULL;
2075 }
2076@@ -236,11 +236,11 @@
2077
2078 if (dirname == NULL)
2079 /* The default value. */
2080- dirname = _nl_default_dirname;
2081+ dirname = INTUSE(_nl_default_dirname);
2082 else
2083 {
2084- if (strcmp (dirname, _nl_default_dirname) == 0)
2085- dirname = _nl_default_dirname;
2086+ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
2087+ dirname = INTUSE(_nl_default_dirname);
2088 else
2089 {
2090 char *result;
2091@@ -263,7 +263,9 @@
2092 }
2093 else
2094 /* The default value. */
2095- new_binding->dirname = (char *) _nl_default_dirname;
2096+ new_binding->dirname = (char *) INTUSE(_nl_default_dirname);
2097+
2098+ new_binding->codeset_cntr = 0;
2099
2100 if (codesetp)
2101 {
2102@@ -285,6 +287,7 @@
2103 memcpy (result, codeset, len);
2104 #endif
2105 codeset = result;
2106+ new_binding->codeset_cntr++;
2107 }
2108 *codesetp = codeset;
2109 new_binding->codeset = (char *) codeset;
2110@@ -316,7 +319,7 @@
2111 if (0)
2112 {
2113 failed_codeset:
2114- if (new_binding->dirname != _nl_default_dirname)
2115+ if (new_binding->dirname != INTUSE(_nl_default_dirname))
2116 free (new_binding->dirname);
2117 failed_dirname:
2118 free (new_binding);
2119@@ -338,9 +341,7 @@
2120 /* Specify that the DOMAINNAME message catalog will be found
2121 in DIRNAME rather than in the system locale data base. */
2122 char *
2123-BINDTEXTDOMAIN (domainname, dirname)
2124- const char *domainname;
2125- const char *dirname;
2126+BINDTEXTDOMAIN (const char *domainname, const char *dirname)
2127 {
2128 set_binding_values (domainname, &dirname, NULL);
2129 return (char *) dirname;
2130@@ -349,9 +350,7 @@
2131 /* Specify the character encoding in which the messages from the
2132 DOMAINNAME message catalog will be returned. */
2133 char *
2134-BIND_TEXTDOMAIN_CODESET (domainname, codeset)
2135- const char *domainname;
2136- const char *codeset;
2137+BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset)
2138 {
2139 set_binding_values (domainname, NULL, &codeset);
2140 return (char *) codeset;
2141diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/config.charset psmisc-20.2.works.clean/intl/config.charset
2142diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dcgettext.c psmisc-20.2.works.clean/intl/dcgettext.c
2143--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dcgettext.c 2001-04-13 23:00:42.000000000 -0500
2144+++ psmisc-20.2.works.clean/intl/dcgettext.c 2004-10-13 15:18:41.000000000 -0500
2145@@ -1,19 +1,20 @@
2146 /* Implementation of the dcgettext(3) function.
2147- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
2148+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
2149
2150- This program is free software; you can redistribute it and/or modify
2151- it under the terms of the GNU General Public License as published by
2152- the Free Software Foundation; either version 2, or (at your option)
2153+ This program is free software; you can redistribute it and/or modify it
2154+ under the terms of the GNU Library General Public License as published
2155+ by the Free Software Foundation; either version 2, or (at your option)
2156 any later version.
2157
2158 This program is distributed in the hope that it will be useful,
2159 but WITHOUT ANY WARRANTY; without even the implied warranty of
2160- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2161- GNU General Public License for more details.
2162+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2163+ Library General Public License for more details.
2164
2165- You should have received a copy of the GNU General Public License
2166- along with this program; if not, write to the Free Software Foundation,
2167- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2168+ You should have received a copy of the GNU Library General Public
2169+ License along with this program; if not, write to the Free Software
2170+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2171+ USA. */
2172
2173 #ifdef HAVE_CONFIG_H
2174 # include <config.h>
2175@@ -36,22 +37,20 @@
2176 # define DCGETTEXT __dcgettext
2177 # define DCIGETTEXT __dcigettext
2178 #else
2179-# define DCGETTEXT dcgettext__
2180-# define DCIGETTEXT dcigettext__
2181+# define DCGETTEXT libintl_dcgettext
2182+# define DCIGETTEXT libintl_dcigettext
2183 #endif
2184
2185 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
2186 locale. */
2187 char *
2188-DCGETTEXT (domainname, msgid, category)
2189- const char *domainname;
2190- const char *msgid;
2191- int category;
2192+DCGETTEXT (const char *domainname, const char *msgid, int category)
2193 {
2194 return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
2195 }
2196
2197 #ifdef _LIBC
2198 /* Alias for function name in GNU C Library. */
2199+INTDEF(__dcgettext)
2200 weak_alias (__dcgettext, dcgettext);
2201 #endif
2202diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dcigettext.c psmisc-20.2.works.clean/intl/dcigettext.c
2203--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dcigettext.c 2001-04-13 23:00:43.000000000 -0500
2204+++ psmisc-20.2.works.clean/intl/dcigettext.c 2004-10-13 15:18:41.000000000 -0500
2205@@ -1,19 +1,20 @@
2206 /* Implementation of the internal dcigettext function.
2207- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
2208+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
2209
2210- This program is free software; you can redistribute it and/or modify
2211- it under the terms of the GNU General Public License as published by
2212- the Free Software Foundation; either version 2, or (at your option)
2213+ This program is free software; you can redistribute it and/or modify it
2214+ under the terms of the GNU Library General Public License as published
2215+ by the Free Software Foundation; either version 2, or (at your option)
2216 any later version.
2217
2218 This program is distributed in the hope that it will be useful,
2219 but WITHOUT ANY WARRANTY; without even the implied warranty of
2220- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2221- GNU General Public License for more details.
2222+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2223+ Library General Public License for more details.
2224
2225- You should have received a copy of the GNU General Public License
2226- along with this program; if not, write to the Free Software Foundation,
2227- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2228+ You should have received a copy of the GNU Library General Public
2229+ License along with this program; if not, write to the Free Software
2230+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2231+ USA. */
2232
2233 /* Tell glibc's <string.h> to provide a prototype for mempcpy().
2234 This must come before <config.h> because <config.h> may include
2235@@ -32,14 +33,19 @@
2236 # define alloca __builtin_alloca
2237 # define HAVE_ALLOCA 1
2238 #else
2239-# if defined HAVE_ALLOCA_H || defined _LIBC
2240-# include <alloca.h>
2241+# ifdef _MSC_VER
2242+# include <malloc.h>
2243+# define alloca _alloca
2244 # else
2245-# ifdef _AIX
2246- #pragma alloca
2247+# if defined HAVE_ALLOCA_H || defined _LIBC
2248+# include <alloca.h>
2249 # else
2250-# ifndef alloca
2251+# ifdef _AIX
2252+ #pragma alloca
2253+# else
2254+# ifndef alloca
2255 char *alloca ();
2256+# endif
2257 # endif
2258 # endif
2259 # endif
2260@@ -55,13 +61,7 @@
2261
2262 #include <stddef.h>
2263 #include <stdlib.h>
2264-
2265 #include <string.h>
2266-#if !HAVE_STRCHR && !defined _LIBC
2267-# ifndef strchr
2268-# define strchr index
2269-# endif
2270-#endif
2271
2272 #if defined HAVE_UNISTD_H || defined _LIBC
2273 # include <unistd.h>
2274@@ -69,11 +69,26 @@
2275
2276 #include <locale.h>
2277
2278+#ifdef _LIBC
2279+ /* Guess whether integer division by zero raises signal SIGFPE.
2280+ Set to 1 only if you know for sure. In case of doubt, set to 0. */
2281+# if defined __alpha__ || defined __arm__ || defined __i386__ \
2282+ || defined __m68k__ || defined __s390__
2283+# define INTDIV0_RAISES_SIGFPE 1
2284+# else
2285+# define INTDIV0_RAISES_SIGFPE 0
2286+# endif
2287+#endif
2288+#if !INTDIV0_RAISES_SIGFPE
2289+# include <signal.h>
2290+#endif
2291+
2292 #if defined HAVE_SYS_PARAM_H || defined _LIBC
2293 # include <sys/param.h>
2294 #endif
2295
2296 #include "gettextP.h"
2297+#include "plural-exp.h"
2298 #ifdef _LIBC
2299 # include <libintl.h>
2300 #else
2301@@ -106,10 +121,10 @@
2302 names than the internal variables in GNU libc, otherwise programs
2303 using libintl.a cannot be linked statically. */
2304 #if !defined _LIBC
2305-# define _nl_default_default_domain _nl_default_default_domain__
2306-# define _nl_current_default_domain _nl_current_default_domain__
2307-# define _nl_default_dirname _nl_default_dirname__
2308-# define _nl_domain_bindings _nl_domain_bindings__
2309+# define _nl_default_default_domain libintl_nl_default_default_domain
2310+# define _nl_current_default_domain libintl_nl_current_default_domain
2311+# define _nl_default_dirname libintl_nl_default_dirname
2312+# define _nl_domain_bindings libintl_nl_domain_bindings
2313 #endif
2314
2315 /* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
2316@@ -133,13 +148,17 @@
2317 char *getwd ();
2318 # define getcwd(buf, max) getwd (buf)
2319 # else
2320+# if VMS
2321+# define getcwd(buf, max) (getcwd) (buf, max, 0)
2322+# else
2323 char *getcwd ();
2324+# endif
2325 # endif
2326 # ifndef HAVE_STPCPY
2327-static char *stpcpy PARAMS ((char *dest, const char *src));
2328+static char *stpcpy (char *dest, const char *src);
2329 # endif
2330 # ifndef HAVE_MEMPCPY
2331-static void *mempcpy PARAMS ((void *dest, const void *src, size_t n));
2332+static void *mempcpy (void *dest, const void *src, size_t n);
2333 # endif
2334 #endif
2335
2336@@ -197,16 +216,6 @@
2337 # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
2338 #endif
2339
2340-/* XPG3 defines the result of `setlocale (category, NULL)' as:
2341- ``Directs `setlocale()' to query `category' and return the current
2342- setting of `local'.''
2343- However it does not specify the exact format. Neither do SUSV2 and
2344- ISO C 99. So we can use this feature only on selected systems (e.g.
2345- those using GNU C Library). */
2346-#ifdef _LIBC
2347-# define HAVE_LOCALE_NULL
2348-#endif
2349-
2350 /* This is the type used for the search tree where known translations
2351 are stored. */
2352 struct known_translation_t
2353@@ -243,11 +252,8 @@
2354 # endif
2355
2356 /* Function to compare two entries in the table of known translations. */
2357-static int transcmp PARAMS ((const void *p1, const void *p2));
2358 static int
2359-transcmp (p1, p2)
2360- const void *p1;
2361- const void *p2;
2362+transcmp (const void *p1, const void *p2)
2363 {
2364 const struct known_translation_t *s1;
2365 const struct known_translation_t *s2;
2366@@ -271,39 +277,54 @@
2367 }
2368 #endif
2369
2370+#ifndef INTVARDEF
2371+# define INTVARDEF(name)
2372+#endif
2373+#ifndef INTUSE
2374+# define INTUSE(name) name
2375+#endif
2376+
2377 /* Name of the default domain used for gettext(3) prior any call to
2378 textdomain(3). The default value for this is "messages". */
2379-const char _nl_default_default_domain[] = "messages";
2380+const char _nl_default_default_domain[] attribute_hidden = "messages";
2381
2382 /* Value used as the default domain for gettext(3). */
2383-const char *_nl_current_default_domain = _nl_default_default_domain;
2384+const char *_nl_current_default_domain attribute_hidden
2385+ = _nl_default_default_domain;
2386
2387 /* Contains the default location of the message catalogs. */
2388+#if defined __EMX__
2389+extern const char _nl_default_dirname[];
2390+#else
2391 const char _nl_default_dirname[] = LOCALEDIR;
2392+INTVARDEF (_nl_default_dirname)
2393+#endif
2394
2395 /* List with bindings of specific domains created by bindtextdomain()
2396 calls. */
2397 struct binding *_nl_domain_bindings;
2398
2399 /* Prototypes for local functions. */
2400-static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain,
2401- unsigned long int n,
2402- const char *translation,
2403- size_t translation_len))
2404- internal_function;
2405-static unsigned long int plural_eval PARAMS ((struct expression *pexp,
2406- unsigned long int n))
2407+static char *plural_lookup (struct loaded_l10nfile *domain,
2408+ unsigned long int n,
2409+ const char *translation, size_t translation_len)
2410 internal_function;
2411-static const char *category_to_name PARAMS ((int category)) internal_function;
2412-static const char *guess_category_value PARAMS ((int category,
2413- const char *categoryname))
2414+static const char *guess_category_value (int category,
2415+ const char *categoryname)
2416 internal_function;
2417+#ifdef _LIBC
2418+# include "../locale/localeinfo.h"
2419+# define category_to_name(category) _nl_category_names[category]
2420+#else
2421+static const char *category_to_name (int category) internal_function;
2422+#endif
2423
2424
2425 /* For those loosing systems which don't have `alloca' we have to add
2426 some additional code emulating it. */
2427 #ifdef HAVE_ALLOCA
2428 /* Nothing has to be done. */
2429+# define freea(p) /* nothing */
2430 # define ADD_BLOCK(list, address) /* nothing */
2431 # define FREE_BLOCKS(list) /* nothing */
2432 #else
2433@@ -328,11 +349,13 @@
2434 while (list != NULL) { \
2435 struct block_list *old = list; \
2436 list = list->next; \
2437+ free (old->address); \
2438 free (old); \
2439 } \
2440 } while (0)
2441 # undef alloca
2442 # define alloca(size) (malloc (size))
2443+# define freea(p) free (p)
2444 #endif /* have alloca */
2445
2446
2447@@ -356,12 +379,12 @@
2448 #ifdef _LIBC
2449 # define DCIGETTEXT __dcigettext
2450 #else
2451-# define DCIGETTEXT dcigettext__
2452+# define DCIGETTEXT libintl_dcigettext
2453 #endif
2454
2455 /* Lock variable to protect the global data in the gettext implementation. */
2456 #ifdef _LIBC
2457-__libc_rwlock_define_initialized (, _nl_state_lock)
2458+__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
2459 #endif
2460
2461 /* Checking whether the binaries runs SUID must be done and glibc provides
2462@@ -370,6 +393,18 @@
2463 # define ENABLE_SECURE __libc_enable_secure
2464 # define DETERMINE_SECURE
2465 #else
2466+# ifndef HAVE_GETUID
2467+# define getuid() 0
2468+# endif
2469+# ifndef HAVE_GETGID
2470+# define getgid() 0
2471+# endif
2472+# ifndef HAVE_GETEUID
2473+# define geteuid() getuid()
2474+# endif
2475+# ifndef HAVE_GETEGID
2476+# define getegid() getgid()
2477+# endif
2478 static int enable_secure;
2479 # define ENABLE_SECURE (enable_secure == 1)
2480 # define DETERMINE_SECURE \
2481@@ -382,17 +417,15 @@
2482 }
2483 #endif
2484
2485+/* Get the function to evaluate the plural expression. */
2486+#include "eval-plural.h"
2487+
2488 /* Look up MSGID in the DOMAINNAME message catalog for the current
2489 CATEGORY locale and, if PLURAL is nonzero, search over string
2490 depending on the plural form determined by N. */
2491 char *
2492-DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
2493- const char *domainname;
2494- const char *msgid1;
2495- const char *msgid2;
2496- int plural;
2497- unsigned long int n;
2498- int category;
2499+DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
2500+ int plural, unsigned long int n, int category)
2501 {
2502 #ifndef HAVE_ALLOCA
2503 struct block_list *block_list = NULL;
2504@@ -417,6 +450,15 @@
2505 if (msgid1 == NULL)
2506 return NULL;
2507
2508+#ifdef _LIBC
2509+ if (category < 0 || category >= __LC_LAST || category == LC_ALL)
2510+ /* Bogus. */
2511+ return (plural == 0
2512+ ? (char *) msgid1
2513+ /* Use the Germanic plural rule. */
2514+ : n == 1 ? (char *) msgid1 : (char *) msgid2);
2515+#endif
2516+
2517 __libc_rwlock_rdlock (_nl_state_lock);
2518
2519 /* If DOMAINNAME is NULL, we are interested in the default domain. If
2520@@ -425,6 +467,12 @@
2521 if (domainname == NULL)
2522 domainname = _nl_current_default_domain;
2523
2524+ /* OS/2 specific: backward compatibility with older libintl versions */
2525+#ifdef LC_MESSAGES_COMPAT
2526+ if (category == LC_MESSAGES_COMPAT)
2527+ category = LC_MESSAGES;
2528+#endif
2529+
2530 #if defined HAVE_TSEARCH || defined _LIBC
2531 msgid_len = strlen (msgid1) + 1;
2532
2533@@ -437,6 +485,7 @@
2534 search->category = category;
2535
2536 foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
2537+ freea (search);
2538 if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
2539 {
2540 /* Now deal with plural. */
2541@@ -473,7 +522,7 @@
2542 }
2543
2544 if (binding == NULL)
2545- dirname = (char *) _nl_default_dirname;
2546+ dirname = (char *) INTUSE(_nl_default_dirname);
2547 else if (IS_ABSOLUTE_PATH (binding->dirname))
2548 dirname = binding->dirname;
2549 else
2550@@ -501,16 +550,9 @@
2551 }
2552
2553 if (ret == NULL)
2554- {
2555- /* We cannot get the current working directory. Don't signal an
2556- error but simply return the default string. */
2557- FREE_BLOCKS (block_list);
2558- __set_errno (saved_errno);
2559- return (plural == 0
2560- ? (char *) msgid1
2561- /* Use the Germanic plural rule. */
2562- : n == 1 ? (char *) msgid1 : (char *) msgid2);
2563- }
2564+ /* We cannot get the current working directory. Don't signal an
2565+ error but simply return the default string. */
2566+ goto return_untranslated;
2567
2568 stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
2569 }
2570@@ -567,16 +609,7 @@
2571 domain. Return the MSGID. */
2572 if (strcmp (single_locale, "C") == 0
2573 || strcmp (single_locale, "POSIX") == 0)
2574- {
2575- FREE_BLOCKS (block_list);
2576- __libc_rwlock_unlock (_nl_state_lock);
2577- __set_errno (saved_errno);
2578- return (plural == 0
2579- ? (char *) msgid1
2580- /* Use the Germanic plural rule. */
2581- : n == 1 ? (char *) msgid1 : (char *) msgid2);
2582- }
2583-
2584+ break;
2585
2586 /* Find structure describing the message catalog matching the
2587 DOMAINNAME and CATEGORY. */
2588@@ -584,7 +617,7 @@
2589
2590 if (domain != NULL)
2591 {
2592- retval = _nl_find_msg (domain, msgid1, &retlen);
2593+ retval = _nl_find_msg (domain, binding, msgid1, &retlen);
2594
2595 if (retval == NULL)
2596 {
2597@@ -592,8 +625,8 @@
2598
2599 for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
2600 {
2601- retval = _nl_find_msg (domain->successor[cnt], msgid1,
2602- &retlen);
2603+ retval = _nl_find_msg (domain->successor[cnt], binding,
2604+ msgid1, &retlen);
2605
2606 if (retval != NULL)
2607 {
2608@@ -608,7 +641,6 @@
2609 /* Found the translation of MSGID1 in domain DOMAIN:
2610 starting at RETVAL, RETLEN bytes. */
2611 FREE_BLOCKS (block_list);
2612- __set_errno (saved_errno);
2613 #if defined HAVE_TSEARCH || defined _LIBC
2614 if (foundp == NULL)
2615 {
2616@@ -647,6 +679,8 @@
2617 (*foundp)->translation_length = retlen;
2618 }
2619 #endif
2620+ __set_errno (saved_errno);
2621+
2622 /* Now deal with plural. */
2623 if (plural)
2624 retval = plural_lookup (domain, n, retval, retlen);
2625@@ -656,32 +690,56 @@
2626 }
2627 }
2628 }
2629- /* NOTREACHED */
2630+
2631+ return_untranslated:
2632+ /* Return the untranslated MSGID. */
2633+ FREE_BLOCKS (block_list);
2634+ __libc_rwlock_unlock (_nl_state_lock);
2635+#ifndef _LIBC
2636+ if (!ENABLE_SECURE)
2637+ {
2638+ extern void _nl_log_untranslated (const char *logfilename,
2639+ const char *domainname,
2640+ const char *msgid1, const char *msgid2,
2641+ int plural);
2642+ const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED");
2643+
2644+ if (logfilename != NULL && logfilename[0] != '\0')
2645+ _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural);
2646+ }
2647+#endif
2648+ __set_errno (saved_errno);
2649+ return (plural == 0
2650+ ? (char *) msgid1
2651+ /* Use the Germanic plural rule. */
2652+ : n == 1 ? (char *) msgid1 : (char *) msgid2);
2653 }
2654
2655
2656 char *
2657 internal_function
2658-_nl_find_msg (domain_file, msgid, lengthp)
2659- struct loaded_l10nfile *domain_file;
2660- const char *msgid;
2661- size_t *lengthp;
2662+_nl_find_msg (struct loaded_l10nfile *domain_file,
2663+ struct binding *domainbinding, const char *msgid,
2664+ size_t *lengthp)
2665 {
2666 struct loaded_domain *domain;
2667+ nls_uint32 nstrings;
2668 size_t act;
2669 char *result;
2670 size_t resultlen;
2671
2672 if (domain_file->decided == 0)
2673- _nl_load_domain (domain_file);
2674+ _nl_load_domain (domain_file, domainbinding);
2675
2676 if (domain_file->data == NULL)
2677 return NULL;
2678
2679 domain = (struct loaded_domain *) domain_file->data;
2680
2681+ nstrings = domain->nstrings;
2682+
2683 /* Locate the MSGID and its translation. */
2684- if (domain->hash_size > 2 && domain->hash_tab != NULL)
2685+ if (domain->hash_tab != NULL)
2686 {
2687 /* Use the hashing table. */
2688 nls_uint32 len = strlen (msgid);
2689@@ -691,22 +749,30 @@
2690
2691 while (1)
2692 {
2693- nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
2694+ nls_uint32 nstr =
2695+ W (domain->must_swap_hash_tab, domain->hash_tab[idx]);
2696
2697 if (nstr == 0)
2698 /* Hash table entry is empty. */
2699 return NULL;
2700
2701- /* Compare msgid with the original string at index nstr-1.
2702+ nstr--;
2703+
2704+ /* Compare msgid with the original string at index nstr.
2705 We compare the lengths with >=, not ==, because plural entries
2706 are represented by strings with an embedded NUL. */
2707- if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) >= len
2708- && (strcmp (msgid,
2709- domain->data + W (domain->must_swap,
2710- domain->orig_tab[nstr - 1].offset))
2711- == 0))
2712+ if (nstr < nstrings
2713+ ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len
2714+ && (strcmp (msgid,
2715+ domain->data + W (domain->must_swap,
2716+ domain->orig_tab[nstr].offset))
2717+ == 0)
2718+ : domain->orig_sysdep_tab[nstr - nstrings].length > len
2719+ && (strcmp (msgid,
2720+ domain->orig_sysdep_tab[nstr - nstrings].pointer)
2721+ == 0))
2722 {
2723- act = nstr - 1;
2724+ act = nstr;
2725 goto found;
2726 }
2727
2728@@ -724,7 +790,7 @@
2729 size_t top, bottom;
2730
2731 bottom = 0;
2732- top = domain->nstrings;
2733+ top = nstrings;
2734 while (bottom < top)
2735 {
2736 int cmp_val;
2737@@ -747,11 +813,29 @@
2738 found:
2739 /* The translation was found at index ACT. If we have to convert the
2740 string to use a different character set, this is the time. */
2741- result = ((char *) domain->data
2742- + W (domain->must_swap, domain->trans_tab[act].offset));
2743- resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
2744+ if (act < nstrings)
2745+ {
2746+ result = (char *)
2747+ (domain->data + W (domain->must_swap, domain->trans_tab[act].offset));
2748+ resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
2749+ }
2750+ else
2751+ {
2752+ result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer;
2753+ resultlen = domain->trans_sysdep_tab[act - nstrings].length;
2754+ }
2755
2756 #if defined _LIBC || HAVE_ICONV
2757+ if (domain->codeset_cntr
2758+ != (domainbinding != NULL ? domainbinding->codeset_cntr : 0))
2759+ {
2760+ /* The domain's codeset has changed through bind_textdomain_codeset()
2761+ since the message catalog was initialized or last accessed. We
2762+ have to reinitialize the converter. */
2763+ _nl_free_domain_conv (domain);
2764+ _nl_init_domain_conv (domain_file, domain, domainbinding);
2765+ }
2766+
2767 if (
2768 # ifdef _LIBC
2769 domain->conv != (__gconv_t) -1
2770@@ -772,8 +856,9 @@
2771 NULs. */
2772
2773 if (domain->conv_tab == NULL
2774- && ((domain->conv_tab = (char **) calloc (domain->nstrings,
2775- sizeof (char *)))
2776+ && ((domain->conv_tab =
2777+ (char **) calloc (nstrings + domain->n_sysdep_strings,
2778+ sizeof (char *)))
2779 == NULL))
2780 /* Mark that we didn't succeed allocating a table. */
2781 domain->conv_tab = (char **) -1;
2782@@ -942,11 +1027,8 @@
2783 /* Look up a plural variant. */
2784 static char *
2785 internal_function
2786-plural_lookup (domain, n, translation, translation_len)
2787- struct loaded_l10nfile *domain;
2788- unsigned long int n;
2789- const char *translation;
2790- size_t translation_len;
2791+plural_lookup (struct loaded_l10nfile *domain, unsigned long int n,
2792+ const char *translation, size_t translation_len)
2793 {
2794 struct loaded_domain *domaindata = (struct loaded_domain *) domain->data;
2795 unsigned long int index;
2796@@ -979,93 +1061,11 @@
2797 return (char *) p;
2798 }
2799
2800-
2801-/* Function to evaluate the plural expression and return an index value. */
2802-static unsigned long int
2803-internal_function
2804-plural_eval (pexp, n)
2805- struct expression *pexp;
2806- unsigned long int n;
2807-{
2808- switch (pexp->nargs)
2809- {
2810- case 0:
2811- switch (pexp->operation)
2812- {
2813- case var:
2814- return n;
2815- case num:
2816- return pexp->val.num;
2817- default:
2818- break;
2819- }
2820- /* NOTREACHED */
2821- break;
2822- case 1:
2823- {
2824- /* pexp->operation must be lnot. */
2825- unsigned long int arg = plural_eval (pexp->val.args[0], n);
2826- return ! arg;
2827- }
2828- case 2:
2829- {
2830- unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
2831- if (pexp->operation == lor)
2832- return leftarg || plural_eval (pexp->val.args[1], n);
2833- else if (pexp->operation == land)
2834- return leftarg && plural_eval (pexp->val.args[1], n);
2835- else
2836- {
2837- unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
2838-
2839- switch (pexp->operation)
2840- {
2841- case mult:
2842- return leftarg * rightarg;
2843- case divide:
2844- return leftarg / rightarg;
2845- case module:
2846- return leftarg % rightarg;
2847- case plus:
2848- return leftarg + rightarg;
2849- case minus:
2850- return leftarg - rightarg;
2851- case less_than:
2852- return leftarg < rightarg;
2853- case greater_than:
2854- return leftarg > rightarg;
2855- case less_or_equal:
2856- return leftarg <= rightarg;
2857- case greater_or_equal:
2858- return leftarg >= rightarg;
2859- case equal:
2860- return leftarg == rightarg;
2861- case not_equal:
2862- return leftarg != rightarg;
2863- default:
2864- break;
2865- }
2866- }
2867- /* NOTREACHED */
2868- break;
2869- }
2870- case 3:
2871- {
2872- /* pexp->operation must be qmop. */
2873- unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
2874- return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
2875- }
2876- }
2877- /* NOTREACHED */
2878- return 0;
2879-}
2880-
2881-
2882+#ifndef _LIBC
2883 /* Return string representation of locale CATEGORY. */
2884 static const char *
2885 internal_function
2886-category_to_name (category)
2887- int category;
2888+category_to_name (int category)
2889 {
2890 const char *retval;
2891
2892@@ -1120,13 +1120,12 @@
2893
2894 return retval;
2895 }
2896+#endif
2897
2898 /* Guess value of current locale from value of the environment variables. */
2899 static const char *
2900 internal_function
2901-guess_category_value (category, categoryname)
2902- int category;
2903- const char *categoryname;
2904+guess_category_value (int category, const char *categoryname)
2905 {
2906 const char *language;
2907 const char *retval;
2908@@ -1141,27 +1140,21 @@
2909 /* We have to proceed with the POSIX methods of looking to `LC_ALL',
2910 `LC_xxx', and `LANG'. On some systems this can be done by the
2911 `setlocale' function itself. */
2912-#if defined _LIBC || (defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL)
2913- retval = setlocale (category, NULL);
2914+#ifdef _LIBC
2915+ retval = __current_locale_name (category);
2916 #else
2917- /* Setting of LC_ALL overwrites all other. */
2918- retval = getenv ("LC_ALL");
2919- if (retval == NULL || retval[0] == '\0')
2920- {
2921- /* Next comes the name of the desired category. */
2922- retval = getenv (categoryname);
2923- if (retval == NULL || retval[0] == '\0')
2924- {
2925- /* Last possibility is the LANG environment variable. */
2926- retval = getenv ("LANG");
2927- if (retval == NULL || retval[0] == '\0')
2928- /* We use C as the default domain. POSIX says this is
2929- implementation defined. */
2930- return "C";
2931- }
2932- }
2933+ retval = _nl_locale_name (category, categoryname);
2934 #endif
2935
2936+ /* Ignore LANGUAGE if the locale is set to "C" because
2937+ 1. "C" locale usually uses the ASCII encoding, and most international
2938+ messages use non-ASCII characters. These characters get displayed
2939+ as question marks (if using glibc's iconv()) or as invalid 8-bit
2940+ characters (because other iconv()s refuse to convert most non-ASCII
2941+ characters to ASCII). In any case, the output is ugly.
2942+ 2. The precise output of some programs in the "C" locale is specified
2943+ by POSIX and should not depend on environment variables like
2944+ "LANGUAGE". We allow such programs to use gettext(). */
2945 return language != NULL && strcmp (retval, "C") != 0 ? language : retval;
2946 }
2947
2948@@ -1173,9 +1166,7 @@
2949 to be defined. */
2950 #if !_LIBC && !HAVE_STPCPY
2951 static char *
2952-stpcpy (dest, src)
2953- char *dest;
2954- const char *src;
2955+stpcpy (char *dest, const char *src)
2956 {
2957 while ((*dest++ = *src++) != '\0')
2958 /* Do nothing. */ ;
2959@@ -1185,10 +1176,7 @@
2960
2961 #if !_LIBC && !HAVE_MEMPCPY
2962 static void *
2963-mempcpy (dest, src, n)
2964- void *dest;
2965- const void *src;
2966- size_t n;
2967+mempcpy (void *dest, const void *src, size_t n)
2968 {
2969 return (void *) ((char *) memcpy (dest, src, n) + n);
2970 }
2971@@ -1198,8 +1186,7 @@
2972 #ifdef _LIBC
2973 /* If we want to free all resources we have to do some work at
2974 program's end. */
2975-static void __attribute__ ((unused))
2976-free_mem (void)
2977+libc_freeres_fn (free_mem)
2978 {
2979 void *old;
2980
2981@@ -1207,7 +1194,7 @@
2982 {
2983 struct binding *oldp = _nl_domain_bindings;
2984 _nl_domain_bindings = _nl_domain_bindings->next;
2985- if (oldp->dirname != _nl_default_dirname)
2986+ if (oldp->dirname != INTUSE(_nl_default_dirname))
2987 /* Yes, this is a pointer comparison. */
2988 free (oldp->dirname);
2989 free (oldp->codeset);
2990@@ -1229,6 +1216,4 @@
2991 free (old);
2992 }
2993 }
2994-
2995-text_set_element (__libc_subfreeres, free_mem);
2996 #endif
2997diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dcngettext.c psmisc-20.2.works.clean/intl/dcngettext.c
2998--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dcngettext.c 2001-04-13 23:00:43.000000000 -0500
2999+++ psmisc-20.2.works.clean/intl/dcngettext.c 2004-10-13 15:18:41.000000000 -0500
3000@@ -1,19 +1,20 @@
3001 /* Implementation of the dcngettext(3) function.
3002- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
3003+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
3004
3005- This program is free software; you can redistribute it and/or modify
3006- it under the terms of the GNU General Public License as published by
3007- the Free Software Foundation; either version 2, or (at your option)
3008+ This program is free software; you can redistribute it and/or modify it
3009+ under the terms of the GNU Library General Public License as published
3010+ by the Free Software Foundation; either version 2, or (at your option)
3011 any later version.
3012
3013 This program is distributed in the hope that it will be useful,
3014 but WITHOUT ANY WARRANTY; without even the implied warranty of
3015- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3016- GNU General Public License for more details.
3017+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3018+ Library General Public License for more details.
3019
3020- You should have received a copy of the GNU General Public License
3021- along with this program; if not, write to the Free Software Foundation,
3022- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3023+ You should have received a copy of the GNU Library General Public
3024+ License along with this program; if not, write to the Free Software
3025+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3026+ USA. */
3027
3028 #ifdef HAVE_CONFIG_H
3029 # include <config.h>
3030@@ -36,19 +37,16 @@
3031 # define DCNGETTEXT __dcngettext
3032 # define DCIGETTEXT __dcigettext
3033 #else
3034-# define DCNGETTEXT dcngettext__
3035-# define DCIGETTEXT dcigettext__
3036+# define DCNGETTEXT libintl_dcngettext
3037+# define DCIGETTEXT libintl_dcigettext
3038 #endif
3039
3040 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
3041 locale. */
3042 char *
3043-DCNGETTEXT (domainname, msgid1, msgid2, n, category)
3044- const char *domainname;
3045- const char *msgid1;
3046- const char *msgid2;
3047- unsigned long int n;
3048- int category;
3049+DCNGETTEXT (const char *domainname,
3050+ const char *msgid1, const char *msgid2, unsigned long int n,
3051+ int category)
3052 {
3053 return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
3054 }
3055diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dgettext.c psmisc-20.2.works.clean/intl/dgettext.c
3056--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dgettext.c 2001-04-13 23:00:42.000000000 -0500
3057+++ psmisc-20.2.works.clean/intl/dgettext.c 2004-10-13 15:18:41.000000000 -0500
3058@@ -1,27 +1,29 @@
3059 /* Implementation of the dgettext(3) function.
3060- Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
3061+ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
3062
3063- This program is free software; you can redistribute it and/or modify
3064- it under the terms of the GNU General Public License as published by
3065- the Free Software Foundation; either version 2, or (at your option)
3066+ This program is free software; you can redistribute it and/or modify it
3067+ under the terms of the GNU Library General Public License as published
3068+ by the Free Software Foundation; either version 2, or (at your option)
3069 any later version.
3070
3071 This program is distributed in the hope that it will be useful,
3072 but WITHOUT ANY WARRANTY; without even the implied warranty of
3073- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3074- GNU General Public License for more details.
3075+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3076+ Library General Public License for more details.
3077
3078- You should have received a copy of the GNU General Public License
3079- along with this program; if not, write to the Free Software Foundation,
3080- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3081+ You should have received a copy of the GNU Library General Public
3082+ License along with this program; if not, write to the Free Software
3083+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3084+ USA. */
3085
3086 #ifdef HAVE_CONFIG_H
3087 # include <config.h>
3088 #endif
3089
3090+#include "gettextP.h"
3091+
3092 #include <locale.h>
3093
3094-#include "gettextP.h"
3095 #ifdef _LIBC
3096 # include <libintl.h>
3097 #else
3098@@ -36,18 +38,16 @@
3099 prefix. So we have to make a difference here. */
3100 #ifdef _LIBC
3101 # define DGETTEXT __dgettext
3102-# define DCGETTEXT __dcgettext
3103+# define DCGETTEXT INTUSE(__dcgettext)
3104 #else
3105-# define DGETTEXT dgettext__
3106-# define DCGETTEXT dcgettext__
3107+# define DGETTEXT libintl_dgettext
3108+# define DCGETTEXT libintl_dcgettext
3109 #endif
3110
3111 /* Look up MSGID in the DOMAINNAME message catalog of the current
3112 LC_MESSAGES locale. */
3113 char *
3114-DGETTEXT (domainname, msgid)
3115- const char *domainname;
3116- const char *msgid;
3117+DGETTEXT (const char *domainname, const char *msgid)
3118 {
3119 return DCGETTEXT (domainname, msgid, LC_MESSAGES);
3120 }
3121diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dngettext.c psmisc-20.2.works.clean/intl/dngettext.c
3122--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/dngettext.c 2001-04-13 23:00:43.000000000 -0500
3123+++ psmisc-20.2.works.clean/intl/dngettext.c 2004-10-13 15:18:41.000000000 -0500
3124@@ -1,27 +1,29 @@
3125 /* Implementation of the dngettext(3) function.
3126- Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
3127+ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
3128
3129- This program is free software; you can redistribute it and/or modify
3130- it under the terms of the GNU General Public License as published by
3131- the Free Software Foundation; either version 2, or (at your option)
3132+ This program is free software; you can redistribute it and/or modify it
3133+ under the terms of the GNU Library General Public License as published
3134+ by the Free Software Foundation; either version 2, or (at your option)
3135 any later version.
3136
3137 This program is distributed in the hope that it will be useful,
3138 but WITHOUT ANY WARRANTY; without even the implied warranty of
3139- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3140- GNU General Public License for more details.
3141+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3142+ Library General Public License for more details.
3143
3144- You should have received a copy of the GNU General Public License
3145- along with this program; if not, write to the Free Software Foundation,
3146- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3147+ You should have received a copy of the GNU Library General Public
3148+ License along with this program; if not, write to the Free Software
3149+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3150+ USA. */
3151
3152 #ifdef HAVE_CONFIG_H
3153 # include <config.h>
3154 #endif
3155
3156+#include "gettextP.h"
3157+
3158 #include <locale.h>
3159
3160-#include "gettextP.h"
3161 #ifdef _LIBC
3162 # include <libintl.h>
3163 #else
3164@@ -38,18 +40,15 @@
3165 # define DNGETTEXT __dngettext
3166 # define DCNGETTEXT __dcngettext
3167 #else
3168-# define DNGETTEXT dngettext__
3169-# define DCNGETTEXT dcngettext__
3170+# define DNGETTEXT libintl_dngettext
3171+# define DCNGETTEXT libintl_dcngettext
3172 #endif
3173
3174 /* Look up MSGID in the DOMAINNAME message catalog of the current
3175 LC_MESSAGES locale and skip message according to the plural form. */
3176 char *
3177-DNGETTEXT (domainname, msgid1, msgid2, n)
3178- const char *domainname;
3179- const char *msgid1;
3180- const char *msgid2;
3181- unsigned long int n;
3182+DNGETTEXT (const char *domainname,
3183+ const char *msgid1, const char *msgid2, unsigned long int n)
3184 {
3185 return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
3186 }
3187diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/eval-plural.h psmisc-20.2.works.clean/intl/eval-plural.h
3188--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/eval-plural.h 1969-12-31 18:00:00.000000000 -0600
3189+++ psmisc-20.2.works.clean/intl/eval-plural.h 2004-10-13 15:18:41.000000000 -0500
3190@@ -0,0 +1,108 @@
3191+/* Plural expression evaluation.
3192+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
3193+
3194+ This program is free software; you can redistribute it and/or modify it
3195+ under the terms of the GNU Library General Public License as published
3196+ by the Free Software Foundation; either version 2, or (at your option)
3197+ any later version.
3198+
3199+ This program is distributed in the hope that it will be useful,
3200+ but WITHOUT ANY WARRANTY; without even the implied warranty of
3201+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3202+ Library General Public License for more details.
3203+
3204+ You should have received a copy of the GNU Library General Public
3205+ License along with this program; if not, write to the Free Software
3206+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3207+ USA. */
3208+
3209+#ifndef STATIC
3210+#define STATIC static
3211+#endif
3212+
3213+/* Evaluate the plural expression and return an index value. */
3214+STATIC
3215+unsigned long int
3216+internal_function
3217+plural_eval (struct expression *pexp, unsigned long int n)
3218+{
3219+ switch (pexp->nargs)
3220+ {
3221+ case 0:
3222+ switch (pexp->operation)
3223+ {
3224+ case var:
3225+ return n;
3226+ case num:
3227+ return pexp->val.num;
3228+ default:
3229+ break;
3230+ }
3231+ /* NOTREACHED */
3232+ break;
3233+ case 1:
3234+ {
3235+ /* pexp->operation must be lnot. */
3236+ unsigned long int arg = plural_eval (pexp->val.args[0], n);
3237+ return ! arg;
3238+ }
3239+ case 2:
3240+ {
3241+ unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
3242+ if (pexp->operation == lor)
3243+ return leftarg || plural_eval (pexp->val.args[1], n);
3244+ else if (pexp->operation == land)
3245+ return leftarg && plural_eval (pexp->val.args[1], n);
3246+ else
3247+ {
3248+ unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
3249+
3250+ switch (pexp->operation)
3251+ {
3252+ case mult:
3253+ return leftarg * rightarg;
3254+ case divide:
3255+#if !INTDIV0_RAISES_SIGFPE
3256+ if (rightarg == 0)
3257+ raise (SIGFPE);
3258+#endif
3259+ return leftarg / rightarg;
3260+ case module:
3261+#if !INTDIV0_RAISES_SIGFPE
3262+ if (rightarg == 0)
3263+ raise (SIGFPE);
3264+#endif
3265+ return leftarg % rightarg;
3266+ case plus:
3267+ return leftarg + rightarg;
3268+ case minus:
3269+ return leftarg - rightarg;
3270+ case less_than:
3271+ return leftarg < rightarg;
3272+ case greater_than:
3273+ return leftarg > rightarg;
3274+ case less_or_equal:
3275+ return leftarg <= rightarg;
3276+ case greater_or_equal:
3277+ return leftarg >= rightarg;
3278+ case equal:
3279+ return leftarg == rightarg;
3280+ case not_equal:
3281+ return leftarg != rightarg;
3282+ default:
3283+ break;
3284+ }
3285+ }
3286+ /* NOTREACHED */
3287+ break;
3288+ }
3289+ case 3:
3290+ {
3291+ /* pexp->operation must be qmop. */
3292+ unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
3293+ return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
3294+ }
3295+ }
3296+ /* NOTREACHED */
3297+ return 0;
3298+}
3299diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/explodename.c psmisc-20.2.works.clean/intl/explodename.c
3300--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/explodename.c 2001-04-13 23:00:42.000000000 -0500
3301+++ psmisc-20.2.works.clean/intl/explodename.c 2004-10-13 15:18:41.000000000 -0500
3302@@ -1,19 +1,20 @@
3303-/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
3304+/* Copyright (C) 1995-1998, 2000-2001, 2003 Free Software Foundation, Inc.
3305 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
3306
3307- This program is free software; you can redistribute it and/or modify
3308- it under the terms of the GNU General Public License as published by
3309- the Free Software Foundation; either version 2, or (at your option)
3310+ This program is free software; you can redistribute it and/or modify it
3311+ under the terms of the GNU Library General Public License as published
3312+ by the Free Software Foundation; either version 2, or (at your option)
3313 any later version.
3314
3315 This program is distributed in the hope that it will be useful,
3316 but WITHOUT ANY WARRANTY; without even the implied warranty of
3317- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3318- GNU General Public License for more details.
3319+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3320+ Library General Public License for more details.
3321
3322- You should have received a copy of the GNU General Public License
3323- along with this program; if not, write to the Free Software Foundation,
3324- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3325+ You should have received a copy of the GNU Library General Public
3326+ License along with this program; if not, write to the Free Software
3327+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3328+ USA. */
3329
3330 #ifdef HAVE_CONFIG_H
3331 # include <config.h>
3332@@ -37,8 +38,7 @@
3333 /* @@ end of prolog @@ */
3334
3335 char *
3336-_nl_find_language (name)
3337- const char *name;
3338+_nl_find_language (const char *name)
3339 {
3340 while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
3341 && name[0] != '+' && name[0] != ',')
3342@@ -49,17 +49,11 @@
3343
3344
3345 int
3346-_nl_explode_name (name, language, modifier, territory, codeset,
3347- normalized_codeset, special, sponsor, revision)
3348- char *name;
3349- const char **language;
3350- const char **modifier;
3351- const char **territory;
3352- const char **codeset;
3353- const char **normalized_codeset;
3354- const char **special;
3355- const char **sponsor;
3356- const char **revision;
3357+_nl_explode_name (char *name,
3358+ const char **language, const char **modifier,
3359+ const char **territory, const char **codeset,
3360+ const char **normalized_codeset, const char **special,
3361+ const char **sponsor, const char **revision)
3362 {
3363 enum { undecided, xpg, cen } syntax;
3364 char *cp;
3365diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/finddomain.c psmisc-20.2.works.clean/intl/finddomain.c
3366--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/finddomain.c 2001-04-13 23:00:42.000000000 -0500
3367+++ psmisc-20.2.works.clean/intl/finddomain.c 2004-10-13 15:18:41.000000000 -0500
3368@@ -1,20 +1,21 @@
3369 /* Handle list of needed message catalogs
3370- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
3371+ Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
3372 Written by Ulrich Drepper <drepper@gnu.org>, 1995.
3373
3374- This program is free software; you can redistribute it and/or modify
3375- it under the terms of the GNU General Public License as published by
3376- the Free Software Foundation; either version 2, or (at your option)
3377+ This program is free software; you can redistribute it and/or modify it
3378+ under the terms of the GNU Library General Public License as published
3379+ by the Free Software Foundation; either version 2, or (at your option)
3380 any later version.
3381
3382 This program is distributed in the hope that it will be useful,
3383 but WITHOUT ANY WARRANTY; without even the implied warranty of
3384- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3385- GNU General Public License for more details.
3386+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3387+ Library General Public License for more details.
3388
3389- You should have received a copy of the GNU General Public License
3390- along with this program; if not, write to the Free Software Foundation,
3391- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3392+ You should have received a copy of the GNU Library General Public
3393+ License along with this program; if not, write to the Free Software
3394+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3395+ USA. */
3396
3397 #ifdef HAVE_CONFIG_H
3398 # include <config.h>
3399@@ -46,11 +47,8 @@
3400 established bindings. */
3401 struct loaded_l10nfile *
3402 internal_function
3403-_nl_find_domain (dirname, locale, domainname, domainbinding)
3404- const char *dirname;
3405- char *locale;
3406- const char *domainname;
3407- struct binding *domainbinding;
3408+_nl_find_domain (const char *dirname, char *locale,
3409+ const char *domainname, struct binding *domainbinding)
3410 {
3411 struct loaded_l10nfile *retval;
3412 const char *language;
3413@@ -89,15 +87,14 @@
3414 be one data set in the list of loaded domains. */
3415 retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
3416 strlen (dirname) + 1, 0, locale, NULL, NULL,
3417- NULL, NULL, NULL, NULL, NULL, domainname,
3418- domainbinding, 0);
3419+ NULL, NULL, NULL, NULL, NULL, domainname, 0);
3420 if (retval != NULL)
3421 {
3422 /* We know something about this locale. */
3423 int cnt;
3424
3425 if (retval->decided == 0)
3426- _nl_load_domain (retval);
3427+ _nl_load_domain (retval, domainbinding);
3428
3429 if (retval->data != NULL)
3430 return retval;
3431@@ -105,7 +102,7 @@
3432 for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
3433 {
3434 if (retval->successor[cnt]->decided == 0)
3435- _nl_load_domain (retval->successor[cnt]);
3436+ _nl_load_domain (retval->successor[cnt], domainbinding);
3437
3438 if (retval->successor[cnt]->data != NULL)
3439 break;
3440@@ -146,21 +143,20 @@
3441 retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
3442 strlen (dirname) + 1, mask, language, territory,
3443 codeset, normalized_codeset, modifier, special,
3444- sponsor, revision, domainname, domainbinding,
3445- 1);
3446+ sponsor, revision, domainname, 1);
3447 if (retval == NULL)
3448 /* This means we are out of core. */
3449 return NULL;
3450
3451 if (retval->decided == 0)
3452- _nl_load_domain (retval);
3453+ _nl_load_domain (retval, domainbinding);
3454 if (retval->data == NULL)
3455 {
3456 int cnt;
3457 for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
3458 {
3459 if (retval->successor[cnt]->decided == 0)
3460- _nl_load_domain (retval->successor[cnt]);
3461+ _nl_load_domain (retval->successor[cnt], domainbinding);
3462 if (retval->successor[cnt]->data != NULL)
3463 break;
3464 }
3465@@ -179,8 +175,7 @@
3466
3467
3468 #ifdef _LIBC
3469-static void __attribute__ ((unused))
3470-free_mem (void)
3471+libc_freeres_fn (free_mem)
3472 {
3473 struct loaded_l10nfile *runp = _nl_loaded_domains;
3474
3475@@ -194,6 +189,4 @@
3476 free (here);
3477 }
3478 }
3479-
3480-text_set_element (__libc_subfreeres, free_mem);
3481 #endif
3482diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gettext.c psmisc-20.2.works.clean/intl/gettext.c
3483--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gettext.c 2001-04-13 23:00:42.000000000 -0500
3484+++ psmisc-20.2.works.clean/intl/gettext.c 2004-10-13 15:18:41.000000000 -0500
3485@@ -1,19 +1,20 @@
3486 /* Implementation of gettext(3) function.
3487- Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
3488+ Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
3489
3490- This program is free software; you can redistribute it and/or modify
3491- it under the terms of the GNU General Public License as published by
3492- the Free Software Foundation; either version 2, or (at your option)
3493+ This program is free software; you can redistribute it and/or modify it
3494+ under the terms of the GNU Library General Public License as published
3495+ by the Free Software Foundation; either version 2, or (at your option)
3496 any later version.
3497
3498 This program is distributed in the hope that it will be useful,
3499 but WITHOUT ANY WARRANTY; without even the implied warranty of
3500- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3501- GNU General Public License for more details.
3502+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3503+ Library General Public License for more details.
3504
3505- You should have received a copy of the GNU General Public License
3506- along with this program; if not, write to the Free Software Foundation,
3507- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3508+ You should have received a copy of the GNU Library General Public
3509+ License along with this program; if not, write to the Free Software
3510+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3511+ USA. */
3512
3513 #ifdef HAVE_CONFIG_H
3514 # include <config.h>
3515@@ -41,18 +42,17 @@
3516 prefix. So we have to make a difference here. */
3517 #ifdef _LIBC
3518 # define GETTEXT __gettext
3519-# define DCGETTEXT __dcgettext
3520+# define DCGETTEXT INTUSE(__dcgettext)
3521 #else
3522-# define GETTEXT gettext__
3523-# define DCGETTEXT dcgettext__
3524+# define GETTEXT libintl_gettext
3525+# define DCGETTEXT libintl_dcgettext
3526 #endif
3527
3528 /* Look up MSGID in the current default message catalog for the current
3529 LC_MESSAGES locale. If not found, returns MSGID itself (the default
3530 text). */
3531 char *
3532-GETTEXT (msgid)
3533- const char *msgid;
3534+GETTEXT (const char *msgid)
3535 {
3536 return DCGETTEXT (NULL, msgid, LC_MESSAGES);
3537 }
3538diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gettext.h psmisc-20.2.works.clean/intl/gettext.h
3539--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gettext.h 2001-04-13 23:00:42.000000000 -0500
3540+++ psmisc-20.2.works.clean/intl/gettext.h 2004-10-13 15:19:00.000000000 -0500
3541@@ -1,101 +1,69 @@
3542-/* Description of GNU message catalog format: general file layout.
3543- Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
3544+/* Convenience header for conditional use of GNU <libintl.h>.
3545+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
3546
3547- This program is free software; you can redistribute it and/or modify
3548- it under the terms of the GNU General Public License as published by
3549- the Free Software Foundation; either version 2, or (at your option)
3550+ This program is free software; you can redistribute it and/or modify it
3551+ under the terms of the GNU Library General Public License as published
3552+ by the Free Software Foundation; either version 2, or (at your option)
3553 any later version.
3554
3555 This program is distributed in the hope that it will be useful,
3556 but WITHOUT ANY WARRANTY; without even the implied warranty of
3557- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3558- GNU General Public License for more details.
3559-
3560- You should have received a copy of the GNU General Public License
3561- along with this program; if not, write to the Free Software Foundation,
3562- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3563-
3564-#ifndef _GETTEXT_H
3565-#define _GETTEXT_H 1
3566-
3567-#if HAVE_LIMITS_H || _LIBC
3568-# include <limits.h>
3569-#endif
3570+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3571+ Library General Public License for more details.
3572
3573-/* @@ end of prolog @@ */
3574+ You should have received a copy of the GNU Library General Public
3575+ License along with this program; if not, write to the Free Software
3576+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3577+ USA. */
3578
3579-/* The magic number of the GNU message catalog format. */
3580-#define _MAGIC 0x950412de
3581-#define _MAGIC_SWAPPED 0xde120495
3582+#ifndef _LIBGETTEXT_H
3583+#define _LIBGETTEXT_H 1
3584
3585-/* Revision number of the currently used .mo (binary) file format. */
3586-#define MO_REVISION_NUMBER 0
3587+/* NLS can be disabled through the configure --disable-nls option. */
3588+#if ENABLE_NLS
3589
3590-/* The following contortions are an attempt to use the C preprocessor
3591- to determine an unsigned integral type that is 32 bits wide. An
3592- alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
3593- as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
3594- when cross-compiling. */
3595+/* Get declarations of GNU message catalog functions. */
3596+# include <libintl.h>
3597
3598-#if __STDC__
3599-# define UINT_MAX_32_BITS 4294967295U
3600 #else
3601-# define UINT_MAX_32_BITS 0xFFFFFFFF
3602-#endif
3603-
3604-/* If UINT_MAX isn't defined, assume it's a 32-bit type.
3605- This should be valid for all systems GNU cares about because
3606- that doesn't include 16-bit systems, and only modern systems
3607- (that certainly have <limits.h>) have 64+-bit integral types. */
3608
3609-#ifndef UINT_MAX
3610-# define UINT_MAX UINT_MAX_32_BITS
3611-#endif
3612-
3613-#if UINT_MAX == UINT_MAX_32_BITS
3614-typedef unsigned nls_uint32;
3615-#else
3616-# if USHRT_MAX == UINT_MAX_32_BITS
3617-typedef unsigned short nls_uint32;
3618-# else
3619-# if ULONG_MAX == UINT_MAX_32_BITS
3620-typedef unsigned long nls_uint32;
3621-# else
3622- /* The following line is intended to throw an error. Using #error is
3623- not portable enough. */
3624- "Cannot determine unsigned 32-bit data type."
3625-# endif
3626-# endif
3627+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
3628+ chokes if dcgettext is defined as a macro. So include it now, to make
3629+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
3630+ as well because people using "gettext.h" will not include <libintl.h>,
3631+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
3632+ is OK. */
3633+#if defined(__sun)
3634+# include <locale.h>
3635 #endif
3636
3637+/* Disabled NLS.
3638+ The casts to 'const char *' serve the purpose of producing warnings
3639+ for invalid uses of the value returned from these functions.
3640+ On pre-ANSI systems without 'const', the config.h file is supposed to
3641+ contain "#define const". */
3642+# define gettext(Msgid) ((const char *) (Msgid))
3643+# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
3644+# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
3645+# define ngettext(Msgid1, Msgid2, N) \
3646+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
3647+# define dngettext(Domainname, Msgid1, Msgid2, N) \
3648+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
3649+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
3650+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
3651+# define textdomain(Domainname) ((const char *) (Domainname))
3652+# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
3653+# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
3654
3655-/* Header for binary .mo file format. */
3656-struct mo_file_header
3657-{
3658- /* The magic number. */
3659- nls_uint32 magic;
3660- /* The revision number of the file format. */
3661- nls_uint32 revision;
3662- /* The number of strings pairs. */
3663- nls_uint32 nstrings;
3664- /* Offset of table with start offsets of original strings. */
3665- nls_uint32 orig_tab_offset;
3666- /* Offset of table with start offsets of translation strings. */
3667- nls_uint32 trans_tab_offset;
3668- /* Size of hashing table. */
3669- nls_uint32 hash_tab_size;
3670- /* Offset of first hashing entry. */
3671- nls_uint32 hash_tab_offset;
3672-};
3673-
3674-struct string_desc
3675-{
3676- /* Length of addressed string. */
3677- nls_uint32 length;
3678- /* Offset of string in file. */
3679- nls_uint32 offset;
3680-};
3681+#endif
3682
3683-/* @@ begin of epilog @@ */
3684+/* A pseudo function call that serves as a marker for the automated
3685+ extraction of messages, but does not call gettext(). The run-time
3686+ translation is done at a different place in the code.
3687+ The argument, String, should be a literal string. Concatenated strings
3688+ and other string expressions won't work.
3689+ The macro's expansion is not parenthesized, so that it is suitable as
3690+ initializer for static 'char[]' or 'const char[]' variables. */
3691+#define gettext_noop(String) String
3692
3693-#endif /* gettext.h */
3694+#endif /* _LIBGETTEXT_H */
3695diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gettextP.h psmisc-20.2.works.clean/intl/gettextP.h
3696--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gettextP.h 2001-04-13 23:00:42.000000000 -0500
3697+++ psmisc-20.2.works.clean/intl/gettextP.h 2004-10-13 15:18:41.000000000 -0500
3698@@ -1,20 +1,21 @@
3699 /* Header describing internals of libintl library.
3700- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
3701+ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
3702 Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
3703
3704- This program is free software; you can redistribute it and/or modify
3705- it under the terms of the GNU General Public License as published by
3706- the Free Software Foundation; either version 2, or (at your option)
3707+ This program is free software; you can redistribute it and/or modify it
3708+ under the terms of the GNU Library General Public License as published
3709+ by the Free Software Foundation; either version 2, or (at your option)
3710 any later version.
3711
3712 This program is distributed in the hope that it will be useful,
3713 but WITHOUT ANY WARRANTY; without even the implied warranty of
3714- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3715- GNU General Public License for more details.
3716+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3717+ Library General Public License for more details.
3718
3719- You should have received a copy of the GNU General Public License
3720- along with this program; if not, write to the Free Software Foundation,
3721- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
3722+ You should have received a copy of the GNU Library General Public
3723+ License along with this program; if not, write to the Free Software
3724+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
3725+ USA. */
3726
3727 #ifndef _GETTEXTP_H
3728 #define _GETTEXTP_H
3729@@ -31,22 +32,18 @@
3730
3731 #include "loadinfo.h"
3732
3733-#include "gettext.h" /* Get nls_uint32. */
3734+#include "gmo.h" /* Get nls_uint32. */
3735
3736 /* @@ end of prolog @@ */
3737
3738-#ifndef PARAMS
3739-# if __STDC__
3740-# define PARAMS(args) args
3741-# else
3742-# define PARAMS(args) ()
3743-# endif
3744-#endif
3745-
3746 #ifndef internal_function
3747 # define internal_function
3748 #endif
3749
3750+#ifndef attribute_hidden
3751+# define attribute_hidden
3752+#endif
3753+
3754 /* Tell the compiler when a conditional or integer expression is
3755 almost always true or almost always false. */
3756 #ifndef HAVE_BUILTIN_EXPECT
3757@@ -71,63 +68,51 @@
3758 #endif
3759
3760
3761-/* This is the representation of the expressions to determine the
3762- plural form. */
3763-struct expression
3764-{
3765- int nargs; /* Number of arguments. */
3766- enum operator
3767- {
3768- /* Without arguments: */
3769- var, /* The variable "n". */
3770- num, /* Decimal number. */
3771- /* Unary operators: */
3772- lnot, /* Logical NOT. */
3773- /* Binary operators: */
3774- mult, /* Multiplication. */
3775- divide, /* Division. */
3776- module, /* Module operation. */
3777- plus, /* Addition. */
3778- minus, /* Subtraction. */
3779- less_than, /* Comparison. */
3780- greater_than, /* Comparison. */
3781- less_or_equal, /* Comparison. */
3782- greater_or_equal, /* Comparison. */
3783- equal, /* Comparision for equality. */
3784- not_equal, /* Comparision for inequality. */
3785- land, /* Logical AND. */
3786- lor, /* Logical OR. */
3787- /* Ternary operators: */
3788- qmop /* Question mark operator. */
3789- } operation;
3790- union
3791- {
3792- unsigned long int num; /* Number value for `num'. */
3793- struct expression *args[3]; /* Up to three arguments. */
3794- } val;
3795-};
3796-
3797-/* This is the data structure to pass information to the parser and get
3798- the result in a thread-safe way. */
3799-struct parse_args
3800+/* In-memory representation of system dependent string. */
3801+struct sysdep_string_desc
3802 {
3803- const char *cp;
3804- struct expression *res;
3805+ /* Length of addressed string, including the trailing NUL. */
3806+ size_t length;
3807+ /* Pointer to addressed string. */
3808+ const char *pointer;
3809 };
3810
3811-
3812 /* The representation of an opened message catalog. */
3813 struct loaded_domain
3814 {
3815+ /* Pointer to memory containing the .mo file. */
3816 const char *data;
3817+ /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */
3818 int use_mmap;
3819+ /* Size of mmap()ed memory. */
3820 size_t mmap_size;
3821+ /* 1 if the .mo file uses a different endianness than this machine. */
3822 int must_swap;
3823+ /* Pointer to additional malloc()ed memory. */
3824+ void *malloced;
3825+
3826+ /* Number of static strings pairs. */
3827 nls_uint32 nstrings;
3828- struct string_desc *orig_tab;
3829- struct string_desc *trans_tab;
3830+ /* Pointer to descriptors of original strings in the file. */
3831+ const struct string_desc *orig_tab;
3832+ /* Pointer to descriptors of translated strings in the file. */
3833+ const struct string_desc *trans_tab;
3834+
3835+ /* Number of system dependent strings pairs. */
3836+ nls_uint32 n_sysdep_strings;
3837+ /* Pointer to descriptors of original sysdep strings. */
3838+ const struct sysdep_string_desc *orig_sysdep_tab;
3839+ /* Pointer to descriptors of translated sysdep strings. */
3840+ const struct sysdep_string_desc *trans_sysdep_tab;
3841+
3842+ /* Size of hash table. */
3843 nls_uint32 hash_size;
3844- nls_uint32 *hash_tab;
3845+ /* Pointer to hash table. */
3846+ const nls_uint32 *hash_tab;
3847+ /* 1 if the hash table uses a different endianness than this machine. */
3848+ int must_swap_hash_tab;
3849+
3850+ int codeset_cntr;
3851 #ifdef _LIBC
3852 __gconv_t conv;
3853 #else
3854@@ -155,6 +140,7 @@
3855 {
3856 struct binding *next;
3857 char *dirname;
3858+ int codeset_cntr; /* Incremented each time codeset changes. */
3859 char *codeset;
3860 char domainname[ZERO];
3861 };
3862@@ -164,72 +150,64 @@
3863 This variable is part of the external ABI of the GNU libintl. */
3864 extern int _nl_msg_cat_cntr;
3865
3866-struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
3867- char *__locale,
3868- const char *__domainname,
3869- struct binding *__domainbinding))
3870+#ifndef _LIBC
3871+const char *_nl_locale_name (int category, const char *categoryname);
3872+#endif
3873+
3874+struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
3875+ const char *__domainname,
3876+ struct binding *__domainbinding)
3877 internal_function;
3878-void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
3879+void _nl_load_domain (struct loaded_l10nfile *__domain,
3880+ struct binding *__domainbinding)
3881 internal_function;
3882-void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
3883+void _nl_unload_domain (struct loaded_domain *__domain)
3884+ internal_function;
3885+const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file,
3886+ struct loaded_domain *__domain,
3887+ struct binding *__domainbinding)
3888+ internal_function;
3889+void _nl_free_domain_conv (struct loaded_domain *__domain)
3890 internal_function;
3891
3892-#ifdef _LIBC
3893-extern char *__gettext PARAMS ((const char *__msgid));
3894-extern char *__dgettext PARAMS ((const char *__domainname,
3895- const char *__msgid));
3896-extern char *__dcgettext PARAMS ((const char *__domainname,
3897- const char *__msgid, int __category));
3898-extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
3899- unsigned long int __n));
3900-extern char *__dngettext PARAMS ((const char *__domainname,
3901- const char *__msgid1, const char *__msgid2,
3902- unsigned long int n));
3903-extern char *__dcngettext PARAMS ((const char *__domainname,
3904- const char *__msgid1, const char *__msgid2,
3905- unsigned long int __n, int __category));
3906-extern char *__dcigettext PARAMS ((const char *__domainname,
3907- const char *__msgid1, const char *__msgid2,
3908- int __plural, unsigned long int __n,
3909- int __category));
3910-extern char *__textdomain PARAMS ((const char *__domainname));
3911-extern char *__bindtextdomain PARAMS ((const char *__domainname,
3912- const char *__dirname));
3913-extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
3914- const char *__codeset));
3915-#else
3916-extern char *gettext__ PARAMS ((const char *__msgid));
3917-extern char *dgettext__ PARAMS ((const char *__domainname,
3918- const char *__msgid));
3919-extern char *dcgettext__ PARAMS ((const char *__domainname,
3920- const char *__msgid, int __category));
3921-extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
3922- unsigned long int __n));
3923-extern char *dngettext__ PARAMS ((const char *__domainname,
3924- const char *__msgid1, const char *__msgid2,
3925- unsigned long int __n));
3926-extern char *dcngettext__ PARAMS ((const char *__domainname,
3927- const char *__msgid1, const char *__msgid2,
3928- unsigned long int __n, int __category));
3929-extern char *dcigettext__ PARAMS ((const char *__domainname,
3930- const char *__msgid1, const char *__msgid2,
3931- int __plural, unsigned long int __n,
3932- int __category));
3933-extern char *textdomain__ PARAMS ((const char *__domainname));
3934-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
3935- const char *__dirname));
3936-extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
3937- const char *__codeset));
3938-#endif
3939+char *_nl_find_msg (struct loaded_l10nfile *domain_file,
3940+ struct binding *domainbinding, const char *msgid,
3941+ size_t *lengthp)
3942+ internal_function;
3943
3944 #ifdef _LIBC
3945-extern void __gettext_free_exp PARAMS ((struct expression *exp))
3946- internal_function;
3947-extern int __gettextparse PARAMS ((void *arg));
3948+extern char *__gettext (const char *__msgid);
3949+extern char *__dgettext (const char *__domainname, const char *__msgid);
3950+extern char *__dcgettext (const char *__domainname, const char *__msgid,
3951+ int __category);
3952+extern char *__ngettext (const char *__msgid1, const char *__msgid2,
3953+ unsigned long int __n);
3954+extern char *__dngettext (const char *__domainname,
3955+ const char *__msgid1, const char *__msgid2,
3956+ unsigned long int n);
3957+extern char *__dcngettext (const char *__domainname,
3958+ const char *__msgid1, const char *__msgid2,
3959+ unsigned long int __n, int __category);
3960+extern char *__dcigettext (const char *__domainname,
3961+ const char *__msgid1, const char *__msgid2,
3962+ int __plural, unsigned long int __n,
3963+ int __category);
3964+extern char *__textdomain (const char *__domainname);
3965+extern char *__bindtextdomain (const char *__domainname,
3966+ const char *__dirname);
3967+extern char *__bind_textdomain_codeset (const char *__domainname,
3968+ const char *__codeset);
3969 #else
3970-extern void gettext_free_exp__ PARAMS ((struct expression *exp))
3971- internal_function;
3972-extern int gettextparse__ PARAMS ((void *arg));
3973+/* Declare the exported libintl_* functions, in a way that allows us to
3974+ call them under their real name. */
3975+# undef _INTL_REDIRECT_INLINE
3976+# undef _INTL_REDIRECT_MACROS
3977+# define _INTL_REDIRECT_MACROS
3978+# include "libgnuintl.h"
3979+extern char *libintl_dcigettext (const char *__domainname,
3980+ const char *__msgid1, const char *__msgid2,
3981+ int __plural, unsigned long int __n,
3982+ int __category);
3983 #endif
3984
3985 /* @@ begin of epilog @@ */
3986diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gmo.h psmisc-20.2.works.clean/intl/gmo.h
3987--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/gmo.h 1969-12-31 18:00:00.000000000 -0600
3988+++ psmisc-20.2.works.clean/intl/gmo.h 2004-10-13 15:18:41.000000000 -0500
3989@@ -0,0 +1,149 @@
3990+/* Description of GNU message catalog format: general file layout.
3991+ Copyright (C) 1995, 1997, 2000-2002, 2004 Free Software Foundation, Inc.
3992+
3993+ This program is free software; you can redistribute it and/or modify it
3994+ under the terms of the GNU Library General Public License as published
3995+ by the Free Software Foundation; either version 2, or (at your option)
3996+ any later version.
3997+
3998+ This program is distributed in the hope that it will be useful,
3999+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4000+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4001+ Library General Public License for more details.
4002+
4003+ You should have received a copy of the GNU Library General Public
4004+ License along with this program; if not, write to the Free Software
4005+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
4006+ USA. */
4007+
4008+#ifndef _GETTEXT_H
4009+#define _GETTEXT_H 1
4010+
4011+#include <limits.h>
4012+
4013+/* @@ end of prolog @@ */
4014+
4015+/* The magic number of the GNU message catalog format. */
4016+#define _MAGIC 0x950412de
4017+#define _MAGIC_SWAPPED 0xde120495
4018+
4019+/* Revision number of the currently used .mo (binary) file format. */
4020+#define MO_REVISION_NUMBER 0
4021+#define MO_REVISION_NUMBER_WITH_SYSDEP_I 1
4022+
4023+/* The following contortions are an attempt to use the C preprocessor
4024+ to determine an unsigned integral type that is 32 bits wide. An
4025+ alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
4026+ as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
4027+ when cross-compiling. */
4028+
4029+#if __STDC__
4030+# define UINT_MAX_32_BITS 4294967295U
4031+#else
4032+# define UINT_MAX_32_BITS 0xFFFFFFFF
4033+#endif
4034+
4035+/* If UINT_MAX isn't defined, assume it's a 32-bit type.
4036+ This should be valid for all systems GNU cares about because
4037+ that doesn't include 16-bit systems, and only modern systems
4038+ (that certainly have <limits.h>) have 64+-bit integral types. */
4039+
4040+#ifndef UINT_MAX
4041+# define UINT_MAX UINT_MAX_32_BITS
4042+#endif
4043+
4044+#if UINT_MAX == UINT_MAX_32_BITS
4045+typedef unsigned nls_uint32;
4046+#else
4047+# if USHRT_MAX == UINT_MAX_32_BITS
4048+typedef unsigned short nls_uint32;
4049+# else
4050+# if ULONG_MAX == UINT_MAX_32_BITS
4051+typedef unsigned long nls_uint32;
4052+# else
4053+ /* The following line is intended to throw an error. Using #error is
4054+ not portable enough. */
4055+ "Cannot determine unsigned 32-bit data type."
4056+# endif
4057+# endif
4058+#endif
4059+
4060+
4061+/* Header for binary .mo file format. */
4062+struct mo_file_header
4063+{
4064+ /* The magic number. */
4065+ nls_uint32 magic;
4066+ /* The revision number of the file format. */
4067+ nls_uint32 revision;
4068+
4069+ /* The following are only used in .mo files with major revision 0 or 1. */
4070+
4071+ /* The number of strings pairs. */
4072+ nls_uint32 nstrings;
4073+ /* Offset of table with start offsets of original strings. */
4074+ nls_uint32 orig_tab_offset;
4075+ /* Offset of table with start offsets of translated strings. */
4076+ nls_uint32 trans_tab_offset;
4077+ /* Size of hash table. */
4078+ nls_uint32 hash_tab_size;
4079+ /* Offset of first hash table entry. */
4080+ nls_uint32 hash_tab_offset;
4081+
4082+ /* The following are only used in .mo files with minor revision >= 1. */
4083+
4084+ /* The number of system dependent segments. */
4085+ nls_uint32 n_sysdep_segments;
4086+ /* Offset of table describing system dependent segments. */
4087+ nls_uint32 sysdep_segments_offset;
4088+ /* The number of system dependent strings pairs. */
4089+ nls_uint32 n_sysdep_strings;
4090+ /* Offset of table with start offsets of original sysdep strings. */
4091+ nls_uint32 orig_sysdep_tab_offset;
4092+ /* Offset of table with start offsets of translated sysdep strings. */
4093+ nls_uint32 trans_sysdep_tab_offset;
4094+};
4095+
4096+/* Descriptor for static string contained in the binary .mo file. */
4097+struct string_desc
4098+{
4099+ /* Length of addressed string, not including the trailing NUL. */
4100+ nls_uint32 length;
4101+ /* Offset of string in file. */
4102+ nls_uint32 offset;
4103+};
4104+
4105+/* The following are only used in .mo files with minor revision >= 1. */
4106+
4107+/* Descriptor for system dependent string segment. */
4108+struct sysdep_segment
4109+{
4110+ /* Length of addressed string, including the trailing NUL. */
4111+ nls_uint32 length;
4112+ /* Offset of string in file. */
4113+ nls_uint32 offset;
4114+};
4115+
4116+/* Descriptor for system dependent string. */
4117+struct sysdep_string
4118+{
4119+ /* Offset of static string segments in file. */
4120+ nls_uint32 offset;
4121+ /* Alternating sequence of static and system dependent segments.
4122+ The last segment is a static segment, including the trailing NUL. */
4123+ struct segment_pair
4124+ {
4125+ /* Size of static segment. */
4126+ nls_uint32 segsize;
4127+ /* Reference to system dependent string segment, or ~0 at the end. */
4128+ nls_uint32 sysdepref;
4129+ } segments[1];
4130+};
4131+
4132+/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF,
4133+ regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */
4134+#define SEGMENTS_END ((nls_uint32) ~0)
4135+
4136+/* @@ begin of epilog @@ */
4137+
4138+#endif /* gettext.h */
4139diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/hash-string.h psmisc-20.2.works.clean/intl/hash-string.h
4140--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/hash-string.h 2001-04-13 23:00:42.000000000 -0500
4141+++ psmisc-20.2.works.clean/intl/hash-string.h 2004-10-13 15:18:41.000000000 -0500
4142@@ -1,30 +1,23 @@
4143 /* Description of GNU message catalog format: string hashing function.
4144- Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
4145+ Copyright (C) 1995, 1997-1998, 2000-2003 Free Software Foundation, Inc.
4146
4147- This program is free software; you can redistribute it and/or modify
4148- it under the terms of the GNU General Public License as published by
4149- the Free Software Foundation; either version 2, or (at your option)
4150+ This program is free software; you can redistribute it and/or modify it
4151+ under the terms of the GNU Library General Public License as published
4152+ by the Free Software Foundation; either version 2, or (at your option)
4153 any later version.
4154
4155 This program is distributed in the hope that it will be useful,
4156 but WITHOUT ANY WARRANTY; without even the implied warranty of
4157- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4158- GNU General Public License for more details.
4159+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4160+ Library General Public License for more details.
4161
4162- You should have received a copy of the GNU General Public License
4163- along with this program; if not, write to the Free Software Foundation,
4164- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
4165+ You should have received a copy of the GNU Library General Public
4166+ License along with this program; if not, write to the Free Software
4167+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
4168+ USA. */
4169
4170 /* @@ end of prolog @@ */
4171
4172-#ifndef PARAMS
4173-# if __STDC__
4174-# define PARAMS(Args) Args
4175-# else
4176-# define PARAMS(Args) ()
4177-# endif
4178-#endif
4179-
4180 /* We assume to have `unsigned long int' value with at least 32 bits. */
4181 #define HASHWORDBITS 32
4182
4183@@ -32,11 +25,8 @@
4184 /* Defines the so called `hashpjw' function by P.J. Weinberger
4185 [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
4186 1986, 1987 Bell Telephone Laboratories, Inc.] */
4187-static unsigned long int hash_string PARAMS ((const char *__str_param));
4188-
4189 static inline unsigned long int
4190-hash_string (str_param)
4191- const char *str_param;
4192+hash_string (const char *str_param)
4193 {
4194 unsigned long int hval, g;
4195 const char *str = str_param;
4196@@ -46,7 +36,7 @@
4197 while (*str != '\0')
4198 {
4199 hval <<= 4;
4200- hval += (unsigned long int) *str++;
4201+ hval += (unsigned char) *str++;
4202 g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
4203 if (g != 0)
4204 {
4205diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/intl-compat.c psmisc-20.2.works.clean/intl/intl-compat.c
4206--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/intl-compat.c 2001-04-13 23:00:43.000000000 -0500
4207+++ psmisc-20.2.works.clean/intl/intl-compat.c 2004-10-13 15:18:41.000000000 -0500
4208@@ -1,71 +1,38 @@
4209 /* intl-compat.c - Stub functions to call gettext functions from GNU gettext
4210 Library.
4211- Copyright (C) 1995, 2000, 2001 Software Foundation, Inc.
4212+ Copyright (C) 1995, 2000-2003 Software Foundation, Inc.
4213
4214-This program is free software; you can redistribute it and/or modify
4215-it under the terms of the GNU General Public License as published by
4216-the Free Software Foundation; either version 2, or (at your option)
4217-any later version.
4218+ This program is free software; you can redistribute it and/or modify it
4219+ under the terms of the GNU Library General Public License as published
4220+ by the Free Software Foundation; either version 2, or (at your option)
4221+ any later version.
4222
4223-This program is distributed in the hope that it will be useful,
4224-but WITHOUT ANY WARRANTY; without even the implied warranty of
4225-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4226-GNU General Public License for more details.
4227+ This program is distributed in the hope that it will be useful,
4228+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4229+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4230+ Library General Public License for more details.
4231
4232-You should have received a copy of the GNU General Public License
4233-along with this program; if not, write to the Free Software
4234-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
4235+ You should have received a copy of the GNU Library General Public
4236+ License along with this program; if not, write to the Free Software
4237+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
4238+ USA. */
4239
4240 #ifdef HAVE_CONFIG_H
4241 # include <config.h>
4242 #endif
4243
4244-#include "libgnuintl.h"
4245 #include "gettextP.h"
4246
4247 /* @@ end of prolog @@ */
4248
4249-/* This file redirects the gettext functions (without prefix or suffix) to
4250- those defined in the included GNU gettext library (with "__" suffix).
4251- It is compiled into libintl when the included GNU gettext library is
4252- configured --with-included-gettext.
4253-
4254- This redirection works also in the case that the system C library or
4255- the system libintl library contain gettext/textdomain/... functions.
4256- If it didn't, we would need to add preprocessor level redirections to
4257- libgnuintl.h of the following form:
4258-
4259-# define gettext gettext__
4260-# define dgettext dgettext__
4261-# define dcgettext dcgettext__
4262-# define ngettext ngettext__
4263-# define dngettext dngettext__
4264-# define dcngettext dcngettext__
4265-# define textdomain textdomain__
4266-# define bindtextdomain bindtextdomain__
4267-# define bind_textdomain_codeset bind_textdomain_codeset__
4268-
4269- How does this redirection work? There are two cases.
4270- A. When libintl.a is linked into an executable, it works because
4271- functions defined in the executable always override functions in
4272- the shared libraries.
4273- B. When libintl.so is used, it works because
4274- 1. those systems defining gettext/textdomain/... in the C library
4275- (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are
4276- ELF systems and define these symbols as weak, thus explicitly
4277- letting other shared libraries override it.
4278- 2. those systems defining gettext/textdomain/... in a standalone
4279- libintl.so library (namely, Solaris 2.3 and newer) have this
4280- shared library in /usr/lib, and the linker will search /usr/lib
4281- *after* the directory where the GNU gettext library is installed.
4282-
4283- A third case, namely when libintl.a is linked into a shared library
4284- whose name is not libintl.so, is not supported. In this case, on
4285- Solaris, when -lintl precedes the linker option for the shared library
4286- containing GNU gettext, the system's gettext would indeed override
4287- the GNU gettext. Anyone doing this kind of stuff must be clever enough
4288- to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker
4289- command line. */
4290+/* This file redirects the gettext functions (without prefix) to those
4291+ defined in the included GNU libintl library (with "libintl_" prefix).
4292+ It is compiled into libintl in order to make the AM_GNU_GETTEXT test
4293+ of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
4294+ has the redirections primarily in the <libintl.h> include file.
4295+ It is also compiled into libgnuintl so that libgnuintl.so can be used
4296+ as LD_PRELOADable library on glibc systems, to provide the extra
4297+ features that the functions in the libc don't have (namely, logging). */
4298
4299
4300 #undef gettext
4301@@ -79,87 +46,86 @@
4302 #undef bind_textdomain_codeset
4303
4304
4305+/* When building a DLL, we must export some functions. Note that because
4306+ the functions are only defined for binary backward compatibility, we
4307+ don't need to use __declspec(dllimport) in any case. */
4308+#if defined _MSC_VER && BUILDING_DLL
4309+# define DLL_EXPORTED __declspec(dllexport)
4310+#else
4311+# define DLL_EXPORTED
4312+#endif
4313+
4314+
4315+DLL_EXPORTED
4316 char *
4317-gettext (msgid)
4318- const char *msgid;
4319+gettext (const char *msgid)
4320 {
4321- return gettext__ (msgid);
4322+ return libintl_gettext (msgid);
4323 }
4324
4325
4326+DLL_EXPORTED
4327 char *
4328-dgettext (domainname, msgid)
4329- const char *domainname;
4330- const char *msgid;
4331+dgettext (const char *domainname, const char *msgid)
4332 {
4333- return dgettext__ (domainname, msgid);
4334+ return libintl_dgettext (domainname, msgid);
4335 }
4336
4337
4338+DLL_EXPORTED
4339 char *
4340-dcgettext (domainname, msgid, category)
4341- const char *domainname;
4342- const char *msgid;
4343- int category;
4344+dcgettext (const char *domainname, const char *msgid, int category)
4345 {
4346- return dcgettext__ (domainname, msgid, category);
4347+ return libintl_dcgettext (domainname, msgid, category);
4348 }
4349
4350
4351+DLL_EXPORTED
4352 char *
4353-ngettext (msgid1, msgid2, n)
4354- const char *msgid1;
4355- const char *msgid2;
4356- unsigned long int n;
4357+ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
4358 {
4359- return ngettext__ (msgid1, msgid2, n);
4360+ return libintl_ngettext (msgid1, msgid2, n);
4361 }
4362
4363
4364+DLL_EXPORTED
4365 char *
4366-dngettext (domainname, msgid1, msgid2, n)
4367- const char *domainname;
4368- const char *msgid1;
4369- const char *msgid2;
4370- unsigned long int n;
4371+dngettext (const char *domainname,
4372+ const char *msgid1, const char *msgid2, unsigned long int n)
4373 {
4374- return dngettext__ (domainname, msgid1, msgid2, n);
4375+ return libintl_dngettext (domainname, msgid1, msgid2, n);
4376 }
4377
4378
4379+DLL_EXPORTED
4380 char *
4381-dcngettext (domainname, msgid1, msgid2, n, category)
4382- const char *domainname;
4383- const char *msgid1;
4384- const char *msgid2;
4385- unsigned long int n;
4386- int category;
4387+dcngettext (const char *domainname,
4388+ const char *msgid1, const char *msgid2, unsigned long int n,
4389+ int category)
4390 {
4391- return dcngettext__ (domainname, msgid1, msgid2, n, category);
4392+ return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
4393 }
4394
4395
4396+DLL_EXPORTED
4397 char *
4398-textdomain (domainname)
4399- const char *domainname;
4400+textdomain (const char *domainname)
4401 {
4402- return textdomain__ (domainname);
4403+ return libintl_textdomain (domainname);
4404 }
4405
4406
4407+DLL_EXPORTED
4408 char *
4409-bindtextdomain (domainname, dirname)
4410- const char *domainname;
4411- const char *dirname;
4412+bindtextdomain (const char *domainname, const char *dirname)
4413 {
4414- return bindtextdomain__ (domainname, dirname);
4415+ return libintl_bindtextdomain (domainname, dirname);
4416 }
4417
4418
4419+DLL_EXPORTED
4420 char *
4421-bind_textdomain_codeset (domainname, codeset)
4422- const char *domainname;
4423- const char *codeset;
4424+bind_textdomain_codeset (const char *domainname, const char *codeset)
4425 {
4426- return bind_textdomain_codeset__ (domainname, codeset);
4427+ return libintl_bind_textdomain_codeset (domainname, codeset);
4428 }
4429diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/l10nflist.c psmisc-20.2.works.clean/intl/l10nflist.c
4430--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/l10nflist.c 2001-04-13 23:00:42.000000000 -0500
4431+++ psmisc-20.2.works.clean/intl/l10nflist.c 2004-10-13 15:18:41.000000000 -0500
4432@@ -1,19 +1,20 @@
4433-/* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
4434+/* Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
4435 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
4436
4437- This program is free software; you can redistribute it and/or modify
4438- it under the terms of the GNU General Public License as published by
4439- the Free Software Foundation; either version 2, or (at your option)
4440+ This program is free software; you can redistribute it and/or modify it
4441+ under the terms of the GNU Library General Public License as published
4442+ by the Free Software Foundation; either version 2, or (at your option)
4443 any later version.
4444
4445 This program is distributed in the hope that it will be useful,
4446 but WITHOUT ANY WARRANTY; without even the implied warranty of
4447- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4448- GNU General Public License for more details.
4449+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4450+ Library General Public License for more details.
4451
4452- You should have received a copy of the GNU General Public License
4453- along with this program; if not, write to the Free Software Foundation,
4454- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
4455+ You should have received a copy of the GNU Library General Public
4456+ License along with this program; if not, write to the Free Software
4457+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
4458+ USA. */
4459
4460 /* Tell glibc's <string.h> to provide a prototype for stpcpy().
4461 This must come before <config.h> because <config.h> may include
4462@@ -27,11 +28,6 @@
4463 #endif
4464
4465 #include <string.h>
4466-#if !HAVE_STRCHR && !defined _LIBC
4467-# ifndef strchr
4468-# define strchr index
4469-# endif
4470-#endif
4471
4472 #if defined _LIBC || defined HAVE_ARGZ_H
4473 # include <argz.h>
4474@@ -62,20 +58,34 @@
4475 # endif
4476 #else
4477 # ifndef HAVE_STPCPY
4478-static char *stpcpy PARAMS ((char *dest, const char *src));
4479+static char *stpcpy (char *dest, const char *src);
4480 # endif
4481 #endif
4482
4483+/* Pathname support.
4484+ ISSLASH(C) tests whether C is a directory separator character.
4485+ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
4486+ it may be concatenated to a directory pathname.
4487+ */
4488+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
4489+ /* Win32, OS/2, DOS */
4490+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
4491+# define HAS_DEVICE(P) \
4492+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
4493+ && (P)[1] == ':')
4494+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
4495+#else
4496+ /* Unix */
4497+# define ISSLASH(C) ((C) == '/')
4498+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
4499+#endif
4500+
4501 /* Define function which are usually not available. */
4502
4503 #if !defined _LIBC && !defined HAVE___ARGZ_COUNT
4504 /* Returns the number of strings in ARGZ. */
4505-static size_t argz_count__ PARAMS ((const char *argz, size_t len));
4506-
4507 static size_t
4508-argz_count__ (argz, len)
4509- const char *argz;
4510- size_t len;
4511+argz_count__ (const char *argz, size_t len)
4512 {
4513 size_t count = 0;
4514 while (len > 0)
4515@@ -89,18 +99,17 @@
4516 }
4517 # undef __argz_count
4518 # define __argz_count(argz, len) argz_count__ (argz, len)
4519+#else
4520+# ifdef _LIBC
4521+# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len)
4522+# endif
4523 #endif /* !_LIBC && !HAVE___ARGZ_COUNT */
4524
4525 #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
4526 /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
4527 except the last into the character SEP. */
4528-static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
4529-
4530 static void
4531-argz_stringify__ (argz, len, sep)
4532- char *argz;
4533- size_t len;
4534- int sep;
4535+argz_stringify__ (char *argz, size_t len, int sep)
4536 {
4537 while (len > 0)
4538 {
4539@@ -113,17 +122,16 @@
4540 }
4541 # undef __argz_stringify
4542 # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
4543+#else
4544+# ifdef _LIBC
4545+# define __argz_stringify(argz, len, sep) \
4546+ INTUSE(__argz_stringify) (argz, len, sep)
4547+# endif
4548 #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
4549
4550 #if !defined _LIBC && !defined HAVE___ARGZ_NEXT
4551-static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
4552- const char *entry));
4553-
4554 static char *
4555-argz_next__ (argz, argz_len, entry)
4556- char *argz;
4557- size_t argz_len;
4558- const char *entry;
4559+argz_next__ (char *argz, size_t argz_len, const char *entry)
4560 {
4561 if (entry)
4562 {
4563@@ -144,11 +152,8 @@
4564
4565
4566 /* Return number of bits set in X. */
4567-static int pop PARAMS ((int x));
4568-
4569 static inline int
4570-pop (x)
4571- int x;
4572+pop (int x)
4573 {
4574 /* We assume that no more than 16 bits are used. */
4575 x = ((x & ~0x5555) >> 1) + (x & 0x5555);
4576@@ -161,32 +166,27 @@
4577
4578
4579 struct loaded_l10nfile *
4580-_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
4581- territory, codeset, normalized_codeset, modifier, special,
4582- sponsor, revision, filename, domainbinding, do_allocate)
4583- struct loaded_l10nfile **l10nfile_list;
4584- const char *dirlist;
4585- size_t dirlist_len;
4586- int mask;
4587- const char *language;
4588- const char *territory;
4589- const char *codeset;
4590- const char *normalized_codeset;
4591- const char *modifier;
4592- const char *special;
4593- const char *sponsor;
4594- const char *revision;
4595- const char *filename;
4596- struct binding *domainbinding;
4597- int do_allocate;
4598+_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
4599+ const char *dirlist, size_t dirlist_len,
4600+ int mask, const char *language, const char *territory,
4601+ const char *codeset, const char *normalized_codeset,
4602+ const char *modifier, const char *special,
4603+ const char *sponsor, const char *revision,
4604+ const char *filename, int do_allocate)
4605 {
4606 char *abs_filename;
4607- struct loaded_l10nfile *last = NULL;
4608+ struct loaded_l10nfile **lastp;
4609 struct loaded_l10nfile *retval;
4610 char *cp;
4611+ size_t dirlist_count;
4612 size_t entries;
4613 int cnt;
4614
4615+ /* If LANGUAGE contains an absolute directory specification, we ignore
4616+ DIRLIST. */
4617+ if (IS_ABSOLUTE_PATH (language))
4618+ dirlist_len = 0;
4619+
4620 /* Allocate room for the full file name. */
4621 abs_filename = (char *) malloc (dirlist_len
4622 + strlen (language)
4623@@ -204,7 +204,7 @@
4624 + (((mask & CEN_SPONSOR) != 0
4625 || (mask & CEN_REVISION) != 0)
4626 ? (1 + ((mask & CEN_SPONSOR) != 0
4627- ? strlen (sponsor) + 1 : 0)
4628+ ? strlen (sponsor) : 0)
4629 + ((mask & CEN_REVISION) != 0
4630 ? strlen (revision) + 1 : 0)) : 0)
4631 + 1 + strlen (filename) + 1);
4632@@ -212,14 +212,16 @@
4633 if (abs_filename == NULL)
4634 return NULL;
4635
4636- retval = NULL;
4637- last = NULL;
4638-
4639 /* Construct file name. */
4640- memcpy (abs_filename, dirlist, dirlist_len);
4641- __argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR);
4642- cp = abs_filename + (dirlist_len - 1);
4643- *cp++ = '/';
4644+ cp = abs_filename;
4645+ if (dirlist_len > 0)
4646+ {
4647+ memcpy (cp, dirlist, dirlist_len);
4648+ __argz_stringify (cp, dirlist_len, PATH_SEPARATOR);
4649+ cp += dirlist_len;
4650+ cp[-1] = '/';
4651+ }
4652+
4653 cp = stpcpy (cp, language);
4654
4655 if ((mask & TERRITORY) != 0)
4656@@ -266,7 +268,7 @@
4657
4658 /* Look in list of already loaded domains whether it is already
4659 available. */
4660- last = NULL;
4661+ lastp = l10nfile_list;
4662 for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
4663 if (retval->filename != NULL)
4664 {
4665@@ -281,7 +283,7 @@
4666 break;
4667 }
4668
4669- last = retval;
4670+ lastp = &retval->next;
4671 }
4672
4673 if (retval != NULL || do_allocate == 0)
4674@@ -290,52 +292,68 @@
4675 return retval;
4676 }
4677
4678- retval = (struct loaded_l10nfile *)
4679- malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
4680- * (1 << pop (mask))
4681- * sizeof (struct loaded_l10nfile *)));
4682+ dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1);
4683+
4684+ /* Allocate a new loaded_l10nfile. */
4685+ retval =
4686+ (struct loaded_l10nfile *)
4687+ malloc (sizeof (*retval)
4688+ + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0))
4689+ * sizeof (struct loaded_l10nfile *)));
4690 if (retval == NULL)
4691 return NULL;
4692
4693 retval->filename = abs_filename;
4694- retval->domainbinding = domainbinding;
4695- retval->decided = (__argz_count (dirlist, dirlist_len) != 1
4696+
4697+ /* We set retval->data to NULL here; it is filled in later.
4698+ Setting retval->decided to 1 here means that retval does not
4699+ correspond to a real file (dirlist_count > 1) or is not worth
4700+ looking up (if an unnormalized codeset was specified). */
4701+ retval->decided = (dirlist_count > 1
4702 || ((mask & XPG_CODESET) != 0
4703 && (mask & XPG_NORM_CODESET) != 0));
4704 retval->data = NULL;
4705
4706- if (last == NULL)
4707- {
4708- retval->next = *l10nfile_list;
4709- *l10nfile_list = retval;
4710- }
4711- else
4712- {
4713- retval->next = last->next;
4714- last->next = retval;
4715- }
4716+ retval->next = *lastp;
4717+ *lastp = retval;
4718
4719 entries = 0;
4720- /* If the DIRLIST is a real list the RETVAL entry corresponds not to
4721- a real file. So we have to use the DIRLIST separation mechanism
4722- of the inner loop. */
4723- cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
4724- for (; cnt >= 0; --cnt)
4725+ /* Recurse to fill the inheritance list of RETVAL.
4726+ If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL
4727+ entry does not correspond to a real file; retval->filename contains
4728+ colons. In this case we loop across all elements of DIRLIST and
4729+ across all bit patterns dominated by MASK.
4730+ If the DIRLIST is a single directory or entirely redundant (i.e.
4731+ DIRLIST_COUNT == 1), we loop across all bit patterns dominated by
4732+ MASK, excluding MASK itself.
4733+ In either case, we loop down from MASK to 0. This has the effect
4734+ that the extra bits in the locale name are dropped in this order:
4735+ first the modifier, then the territory, then the codeset, then the
4736+ normalized_codeset. */
4737+ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt)
4738 if ((cnt & ~mask) == 0
4739 && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
4740 && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
4741 {
4742- /* Iterate over all elements of the DIRLIST. */
4743- char *dir = NULL;
4744+ if (dirlist_count > 1)
4745+ {
4746+ /* Iterate over all elements of the DIRLIST. */
4747+ char *dir = NULL;
4748
4749- while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
4750- != NULL)
4751+ while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
4752+ != NULL)
4753+ retval->successor[entries++]
4754+ = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1,
4755+ cnt, language, territory, codeset,
4756+ normalized_codeset, modifier, special,
4757+ sponsor, revision, filename, 1);
4758+ }
4759+ else
4760 retval->successor[entries++]
4761- = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
4762- language, territory, codeset,
4763+ = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len,
4764+ cnt, language, territory, codeset,
4765 normalized_codeset, modifier, special,
4766- sponsor, revision, filename, domainbinding,
4767- 1);
4768+ sponsor, revision, filename, 1);
4769 }
4770 retval->successor[entries] = NULL;
4771
4772@@ -347,9 +365,7 @@
4773 names. The return value is dynamically allocated and has to be
4774 freed by the caller. */
4775 const char *
4776-_nl_normalize_codeset (codeset, name_len)
4777- const char *codeset;
4778- size_t name_len;
4779+_nl_normalize_codeset (const char *codeset, size_t name_len)
4780 {
4781 int len = 0;
4782 int only_digit = 1;
4783@@ -358,11 +374,11 @@
4784 size_t cnt;
4785
4786 for (cnt = 0; cnt < name_len; ++cnt)
4787- if (isalnum (codeset[cnt]))
4788+ if (isalnum ((unsigned char) codeset[cnt]))
4789 {
4790 ++len;
4791
4792- if (isalpha (codeset[cnt]))
4793+ if (isalpha ((unsigned char) codeset[cnt]))
4794 only_digit = 0;
4795 }
4796
4797@@ -376,9 +392,9 @@
4798 wp = retval;
4799
4800 for (cnt = 0; cnt < name_len; ++cnt)
4801- if (isalpha (codeset[cnt]))
4802- *wp++ = tolower (codeset[cnt]);
4803- else if (isdigit (codeset[cnt]))
4804+ if (isalpha ((unsigned char) codeset[cnt]))
4805+ *wp++ = tolower ((unsigned char) codeset[cnt]);
4806+ else if (isdigit ((unsigned char) codeset[cnt]))
4807 *wp++ = codeset[cnt];
4808
4809 *wp = '\0';
4810@@ -396,9 +412,7 @@
4811 to be defined. */
4812 #if !_LIBC && !HAVE_STPCPY
4813 static char *
4814-stpcpy (dest, src)
4815- char *dest;
4816- const char *src;
4817+stpcpy (char *dest, const char *src)
4818 {
4819 while ((*dest++ = *src++) != '\0')
4820 /* Do nothing. */ ;
4821diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/libgettext.h psmisc-20.2.works.clean/intl/libgettext.h
4822--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/libgettext.h 2001-04-13 23:00:42.000000000 -0500
4823+++ psmisc-20.2.works.clean/intl/libgettext.h 1969-12-31 18:00:00.000000000 -0600
4824@@ -1,48 +0,0 @@
4825-/* Convenience header for conditional use of GNU <libintl.h>.
4826- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
4827-
4828- This program is free software; you can redistribute it and/or modify
4829- it under the terms of the GNU General Public License as published by
4830- the Free Software Foundation; either version 2, or (at your option)
4831- any later version.
4832-
4833- This program is distributed in the hope that it will be useful,
4834- but WITHOUT ANY WARRANTY; without even the implied warranty of
4835- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4836- GNU General Public License for more details.
4837-
4838- You should have received a copy of the GNU General Public License
4839- along with this program; if not, write to the Free Software Foundation,
4840- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
4841-
4842-#ifndef _LIBGETTEXT_H
4843-#define _LIBGETTEXT_H 1
4844-
4845-/* NLS can be disabled through the configure --disable-nls option. */
4846-#if ENABLE_NLS
4847-
4848-/* Get declarations of GNU message catalog functions. */
4849-# include <libintl.h>
4850-
4851-#else
4852-
4853-# define gettext(Msgid) (Msgid)
4854-# define dgettext(Domainname, Msgid) (Msgid)
4855-# define dcgettext(Domainname, Msgid, Category) (Msgid)
4856-# define ngettext(Msgid1, Msgid2, N) \
4857- ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
4858-# define dngettext(Domainname, Msgid1, Msgid2, N) \
4859- ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
4860-# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
4861- ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
4862-# define textdomain(Domainname) ((char *) (Domainname))
4863-# define bindtextdomain(Domainname, Dirname) ((char *) (Dirname))
4864-# define bind_textdomain_codeset(Domainname, Codeset) ((char *) (Codeset))
4865-
4866-#endif
4867-
4868-/* For automatical extraction of messages sometimes no real
4869- translation is needed. Instead the string itself is the result. */
4870-#define gettext_noop(Str) (Str)
4871-
4872-#endif /* _LIBGETTEXT_H */
4873diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/libgnuintl.h psmisc-20.2.works.clean/intl/libgnuintl.h
4874--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/libgnuintl.h 2001-04-13 23:00:42.000000000 -0500
4875+++ psmisc-20.2.works.clean/intl/libgnuintl.h 1969-12-31 18:00:00.000000000 -0600
4876@@ -1,127 +0,0 @@
4877-/* Message catalogs for internationalization.
4878- Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
4879-
4880- This program is free software; you can redistribute it and/or modify
4881- it under the terms of the GNU General Public License as published by
4882- the Free Software Foundation; either version 2, or (at your option)
4883- any later version.
4884-
4885- This program is distributed in the hope that it will be useful,
4886- but WITHOUT ANY WARRANTY; without even the implied warranty of
4887- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4888- GNU General Public License for more details.
4889-
4890- You should have received a copy of the GNU General Public License
4891- along with this program; if not, write to the Free Software Foundation,
4892- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
4893-
4894-#ifndef _LIBINTL_H
4895-#define _LIBINTL_H 1
4896-
4897-#include <locale.h>
4898-
4899-/* The LC_MESSAGES locale category is the category used by the functions
4900- gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
4901- On systems that don't define it, use an arbitrary value instead.
4902- On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e.
4903- this file!) and then only defines LC_MESSAGES. To avoid a redefinition
4904- warning, don't define LC_MESSAGES in this case. */
4905-#if !defined LC_MESSAGES && !defined __LOCALE_H
4906-# define LC_MESSAGES 1729
4907-#endif
4908-
4909-/* We define an additional symbol to signal that we use the GNU
4910- implementation of gettext. */
4911-#define __USE_GNU_GETTEXT 1
4912-
4913-/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
4914- precedence over _conio_gettext. */
4915-#ifdef __DJGPP__
4916-# undef gettext
4917-# define gettext gettext
4918-#endif
4919-
4920-#ifndef PARAMS
4921-# if __STDC__ || defined __cplusplus
4922-# define PARAMS(args) args
4923-# else
4924-# define PARAMS(args) ()
4925-# endif
4926-#endif
4927-
4928-#ifdef __cplusplus
4929-extern "C" {
4930-#endif
4931-
4932-/* Look up MSGID in the current default message catalog for the current
4933- LC_MESSAGES locale. If not found, returns MSGID itself (the default
4934- text). */
4935-extern char *gettext PARAMS ((const char *__msgid));
4936-
4937-/* Look up MSGID in the DOMAINNAME message catalog for the current
4938- LC_MESSAGES locale. */
4939-extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
4940-
4941-/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
4942- locale. */
4943-extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
4944- int __category));
4945-
4946-
4947-/* Similar to `gettext' but select the plural form corresponding to the
4948- number N. */
4949-extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
4950- unsigned long int __n));
4951-
4952-/* Similar to `dgettext' but select the plural form corresponding to the
4953- number N. */
4954-extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1,
4955- const char *__msgid2, unsigned long int __n));
4956-
4957-/* Similar to `dcgettext' but select the plural form corresponding to the
4958- number N. */
4959-extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1,
4960- const char *__msgid2, unsigned long int __n,
4961- int __category));
4962-
4963-
4964-/* Set the current default message catalog to DOMAINNAME.
4965- If DOMAINNAME is null, return the current default.
4966- If DOMAINNAME is "", reset to the default of "messages". */
4967-extern char *textdomain PARAMS ((const char *__domainname));
4968-
4969-/* Specify that the DOMAINNAME message catalog will be found
4970- in DIRNAME rather than in the system locale data base. */
4971-extern char *bindtextdomain PARAMS ((const char *__domainname,
4972- const char *__dirname));
4973-
4974-/* Specify the character encoding in which the messages from the
4975- DOMAINNAME message catalog will be returned. */
4976-extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
4977- const char *__codeset));
4978-
4979-
4980-/* Optimized version of the functions above. */
4981-#if defined __OPTIMIZED
4982-/* These are macros, but could also be inline functions. */
4983-
4984-# define gettext(msgid) \
4985- dgettext (NULL, msgid)
4986-
4987-# define dgettext(domainname, msgid) \
4988- dcgettext (domainname, msgid, LC_MESSAGES)
4989-
4990-# define ngettext(msgid1, msgid2, n) \
4991- dngettext (NULL, msgid1, msgid2, n)
4992-
4993-# define dngettext(domainname, msgid1, msgid2, n) \
4994- dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
4995-
4996-#endif /* Optimizing. */
4997-
4998-
4999-#ifdef __cplusplus
5000-}
5001-#endif
5002-
5003-#endif /* libintl.h */
5004diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/libgnuintl.h.in psmisc-20.2.works.clean/intl/libgnuintl.h.in
5005--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/libgnuintl.h.in 1969-12-31 18:00:00.000000000 -0600
5006+++ psmisc-20.2.works.clean/intl/libgnuintl.h.in 2004-10-13 15:18:41.000000000 -0500
5007@@ -0,0 +1,383 @@
5008+/* Message catalogs for internationalization.
5009+ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
5010+
5011+ This program is free software; you can redistribute it and/or modify it
5012+ under the terms of the GNU Library General Public License as published
5013+ by the Free Software Foundation; either version 2, or (at your option)
5014+ any later version.
5015+
5016+ This program is distributed in the hope that it will be useful,
5017+ but WITHOUT ANY WARRANTY; without even the implied warranty of
5018+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5019+ Library General Public License for more details.
5020+
5021+ You should have received a copy of the GNU Library General Public
5022+ License along with this program; if not, write to the Free Software
5023+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
5024+ USA. */
5025+
5026+#ifndef _LIBINTL_H
5027+#define _LIBINTL_H 1
5028+
5029+#include <locale.h>
5030+
5031+/* The LC_MESSAGES locale category is the category used by the functions
5032+ gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
5033+ On systems that don't define it, use an arbitrary value instead.
5034+ On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
5035+ then includes <libintl.h> (i.e. this file!) and then only defines
5036+ LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
5037+ in this case. */
5038+#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
5039+# define LC_MESSAGES 1729
5040+#endif
5041+
5042+/* We define an additional symbol to signal that we use the GNU
5043+ implementation of gettext. */
5044+#define __USE_GNU_GETTEXT 1
5045+
5046+/* Provide information about the supported file formats. Returns the
5047+ maximum minor revision number supported for a given major revision. */
5048+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
5049+ ((major) == 0 ? 1 : -1)
5050+
5051+/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
5052+ precedence over _conio_gettext. */
5053+#ifdef __DJGPP__
5054+# undef gettext
5055+#endif
5056+
5057+#ifdef __cplusplus
5058+extern "C" {
5059+#endif
5060+
5061+
5062+/* We redirect the functions to those prefixed with "libintl_". This is
5063+ necessary, because some systems define gettext/textdomain/... in the C
5064+ library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
5065+ If we used the unprefixed names, there would be cases where the
5066+ definition in the C library would override the one in the libintl.so
5067+ shared library. Recall that on ELF systems, the symbols are looked
5068+ up in the following order:
5069+ 1. in the executable,
5070+ 2. in the shared libraries specified on the link command line, in order,
5071+ 3. in the dependencies of the shared libraries specified on the link
5072+ command line,
5073+ 4. in the dlopen()ed shared libraries, in the order in which they were
5074+ dlopen()ed.
5075+ The definition in the C library would override the one in libintl.so if
5076+ either
5077+ * -lc is given on the link command line and -lintl isn't, or
5078+ * -lc is given on the link command line before -lintl, or
5079+ * libintl.so is a dependency of a dlopen()ed shared library but not
5080+ linked to the executable at link time.
5081+ Since Solaris gettext() behaves differently than GNU gettext(), this
5082+ would be unacceptable.
5083+
5084+ The redirection happens by default through macros in C, so that &gettext
5085+ is independent of the compilation unit, but through inline functions in
5086+ C++, in order not to interfere with the name mangling of class fields or
5087+ class methods called 'gettext'. */
5088+
5089+/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
5090+ If he doesn't, we choose the method. A third possible method is
5091+ _INTL_REDIRECT_ASM, supported only by GCC. */
5092+#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
5093+# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
5094+# define _INTL_REDIRECT_ASM
5095+# else
5096+# ifdef __cplusplus
5097+# define _INTL_REDIRECT_INLINE
5098+# else
5099+# define _INTL_REDIRECT_MACROS
5100+# endif
5101+# endif
5102+#endif
5103+/* Auxiliary macros. */
5104+#ifdef _INTL_REDIRECT_ASM
5105+# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
5106+# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
5107+# define _INTL_STRINGIFY(prefix) #prefix
5108+#else
5109+# define _INTL_ASM(cname)
5110+#endif
5111+
5112+/* Look up MSGID in the current default message catalog for the current
5113+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
5114+ text). */
5115+#ifdef _INTL_REDIRECT_INLINE
5116+extern char *libintl_gettext (const char *__msgid);
5117+static inline char *gettext (const char *__msgid)
5118+{
5119+ return libintl_gettext (__msgid);
5120+}
5121+#else
5122+#ifdef _INTL_REDIRECT_MACROS
5123+# define gettext libintl_gettext
5124+#endif
5125+extern char *gettext (const char *__msgid)
5126+ _INTL_ASM (libintl_gettext);
5127+#endif
5128+
5129+/* Look up MSGID in the DOMAINNAME message catalog for the current
5130+ LC_MESSAGES locale. */
5131+#ifdef _INTL_REDIRECT_INLINE
5132+extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
5133+static inline char *dgettext (const char *__domainname, const char *__msgid)
5134+{
5135+ return libintl_dgettext (__domainname, __msgid);
5136+}
5137+#else
5138+#ifdef _INTL_REDIRECT_MACROS
5139+# define dgettext libintl_dgettext
5140+#endif
5141+extern char *dgettext (const char *__domainname, const char *__msgid)
5142+ _INTL_ASM (libintl_dgettext);
5143+#endif
5144+
5145+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
5146+ locale. */
5147+#ifdef _INTL_REDIRECT_INLINE
5148+extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
5149+ int __category);
5150+static inline char *dcgettext (const char *__domainname, const char *__msgid,
5151+ int __category)
5152+{
5153+ return libintl_dcgettext (__domainname, __msgid, __category);
5154+}
5155+#else
5156+#ifdef _INTL_REDIRECT_MACROS
5157+# define dcgettext libintl_dcgettext
5158+#endif
5159+extern char *dcgettext (const char *__domainname, const char *__msgid,
5160+ int __category)
5161+ _INTL_ASM (libintl_dcgettext);
5162+#endif
5163+
5164+
5165+/* Similar to `gettext' but select the plural form corresponding to the
5166+ number N. */
5167+#ifdef _INTL_REDIRECT_INLINE
5168+extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
5169+ unsigned long int __n);
5170+static inline char *ngettext (const char *__msgid1, const char *__msgid2,
5171+ unsigned long int __n)
5172+{
5173+ return libintl_ngettext (__msgid1, __msgid2, __n);
5174+}
5175+#else
5176+#ifdef _INTL_REDIRECT_MACROS
5177+# define ngettext libintl_ngettext
5178+#endif
5179+extern char *ngettext (const char *__msgid1, const char *__msgid2,
5180+ unsigned long int __n)
5181+ _INTL_ASM (libintl_ngettext);
5182+#endif
5183+
5184+/* Similar to `dgettext' but select the plural form corresponding to the
5185+ number N. */
5186+#ifdef _INTL_REDIRECT_INLINE
5187+extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
5188+ const char *__msgid2, unsigned long int __n);
5189+static inline char *dngettext (const char *__domainname, const char *__msgid1,
5190+ const char *__msgid2, unsigned long int __n)
5191+{
5192+ return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
5193+}
5194+#else
5195+#ifdef _INTL_REDIRECT_MACROS
5196+# define dngettext libintl_dngettext
5197+#endif
5198+extern char *dngettext (const char *__domainname,
5199+ const char *__msgid1, const char *__msgid2,
5200+ unsigned long int __n)
5201+ _INTL_ASM (libintl_dngettext);
5202+#endif
5203+
5204+/* Similar to `dcgettext' but select the plural form corresponding to the
5205+ number N. */
5206+#ifdef _INTL_REDIRECT_INLINE
5207+extern char *libintl_dcngettext (const char *__domainname,
5208+ const char *__msgid1, const char *__msgid2,
5209+ unsigned long int __n, int __category);
5210+static inline char *dcngettext (const char *__domainname,
5211+ const char *__msgid1, const char *__msgid2,
5212+ unsigned long int __n, int __category)
5213+{
5214+ return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
5215+}
5216+#else
5217+#ifdef _INTL_REDIRECT_MACROS
5218+# define dcngettext libintl_dcngettext
5219+#endif
5220+extern char *dcngettext (const char *__domainname,
5221+ const char *__msgid1, const char *__msgid2,
5222+ unsigned long int __n, int __category)
5223+ _INTL_ASM (libintl_dcngettext);
5224+#endif
5225+
5226+
5227+/* Set the current default message catalog to DOMAINNAME.
5228+ If DOMAINNAME is null, return the current default.
5229+ If DOMAINNAME is "", reset to the default of "messages". */
5230+#ifdef _INTL_REDIRECT_INLINE
5231+extern char *libintl_textdomain (const char *__domainname);
5232+static inline char *textdomain (const char *__domainname)
5233+{
5234+ return libintl_textdomain (__domainname);
5235+}
5236+#else
5237+#ifdef _INTL_REDIRECT_MACROS
5238+# define textdomain libintl_textdomain
5239+#endif
5240+extern char *textdomain (const char *__domainname)
5241+ _INTL_ASM (libintl_textdomain);
5242+#endif
5243+
5244+/* Specify that the DOMAINNAME message catalog will be found
5245+ in DIRNAME rather than in the system locale data base. */
5246+#ifdef _INTL_REDIRECT_INLINE
5247+extern char *libintl_bindtextdomain (const char *__domainname,
5248+ const char *__dirname);
5249+static inline char *bindtextdomain (const char *__domainname,
5250+ const char *__dirname)
5251+{
5252+ return libintl_bindtextdomain (__domainname, __dirname);
5253+}
5254+#else
5255+#ifdef _INTL_REDIRECT_MACROS
5256+# define bindtextdomain libintl_bindtextdomain
5257+#endif
5258+extern char *bindtextdomain (const char *__domainname, const char *__dirname)
5259+ _INTL_ASM (libintl_bindtextdomain);
5260+#endif
5261+
5262+/* Specify the character encoding in which the messages from the
5263+ DOMAINNAME message catalog will be returned. */
5264+#ifdef _INTL_REDIRECT_INLINE
5265+extern char *libintl_bind_textdomain_codeset (const char *__domainname,
5266+ const char *__codeset);
5267+static inline char *bind_textdomain_codeset (const char *__domainname,
5268+ const char *__codeset)
5269+{
5270+ return libintl_bind_textdomain_codeset (__domainname, __codeset);
5271+}
5272+#else
5273+#ifdef _INTL_REDIRECT_MACROS
5274+# define bind_textdomain_codeset libintl_bind_textdomain_codeset
5275+#endif
5276+extern char *bind_textdomain_codeset (const char *__domainname,
5277+ const char *__codeset)
5278+ _INTL_ASM (libintl_bind_textdomain_codeset);
5279+#endif
5280+
5281+
5282+/* Support for format strings with positions in *printf(), following the
5283+ POSIX/XSI specification.
5284+ Note: These replacements for the *printf() functions are visible only
5285+ in source files that #include <libintl.h> or #include "gettext.h".
5286+ Packages that use *printf() in source files that don't refer to _()
5287+ or gettext() but for which the format string could be the return value
5288+ of _() or gettext() need to add this #include. Oh well. */
5289+
5290+#if !@HAVE_POSIX_PRINTF@
5291+
5292+#include <stdio.h>
5293+#include <stddef.h>
5294+
5295+/* Get va_list. */
5296+#if __STDC__ || defined __cplusplus || defined _MSC_VER
5297+# include <stdarg.h>
5298+#else
5299+# include <varargs.h>
5300+#endif
5301+
5302+#undef fprintf
5303+#define fprintf libintl_fprintf
5304+extern int fprintf (FILE *, const char *, ...);
5305+#undef vfprintf
5306+#define vfprintf libintl_vfprintf
5307+extern int vfprintf (FILE *, const char *, va_list);
5308+
5309+#undef printf
5310+#define printf libintl_printf
5311+extern int printf (const char *, ...);
5312+#undef vprintf
5313+#define vprintf libintl_vprintf
5314+extern int vprintf (const char *, va_list);
5315+
5316+#undef sprintf
5317+#define sprintf libintl_sprintf
5318+extern int sprintf (char *, const char *, ...);
5319+#undef vsprintf
5320+#define vsprintf libintl_vsprintf
5321+extern int vsprintf (char *, const char *, va_list);
5322+
5323+#if @HAVE_SNPRINTF@
5324+
5325+#undef snprintf
5326+#define snprintf libintl_snprintf
5327+extern int snprintf (char *, size_t, const char *, ...);
5328+#undef vsnprintf
5329+#define vsnprintf libintl_vsnprintf
5330+extern int vsnprintf (char *, size_t, const char *, va_list);
5331+
5332+#endif
5333+
5334+#if @HAVE_ASPRINTF@
5335+
5336+#undef asprintf
5337+#define asprintf libintl_asprintf
5338+extern int asprintf (char **, const char *, ...);
5339+#undef vasprintf
5340+#define vasprintf libintl_vasprintf
5341+extern int vasprintf (char **, const char *, va_list);
5342+
5343+#endif
5344+
5345+#if @HAVE_WPRINTF@
5346+
5347+#undef fwprintf
5348+#define fwprintf libintl_fwprintf
5349+extern int fwprintf (FILE *, const wchar_t *, ...);
5350+#undef vfwprintf
5351+#define vfwprintf libintl_vfwprintf
5352+extern int vfwprintf (FILE *, const wchar_t *, va_list);
5353+
5354+#undef wprintf
5355+#define wprintf libintl_wprintf
5356+extern int wprintf (const wchar_t *, ...);
5357+#undef vwprintf
5358+#define vwprintf libintl_vwprintf
5359+extern int vwprintf (const wchar_t *, va_list);
5360+
5361+#undef swprintf
5362+#define swprintf libintl_swprintf
5363+extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
5364+#undef vswprintf
5365+#define vswprintf libintl_vswprintf
5366+extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
5367+
5368+#endif
5369+
5370+#endif
5371+
5372+
5373+/* Support for relocatable packages. */
5374+
5375+/* Sets the original and the current installation prefix of the package.
5376+ Relocation simply replaces a pathname starting with the original prefix
5377+ by the corresponding pathname with the current prefix instead. Both
5378+ prefixes should be directory names without trailing slash (i.e. use ""
5379+ instead of "/"). */
5380+#define libintl_set_relocation_prefix libintl_set_relocation_prefix
5381+extern void
5382+ libintl_set_relocation_prefix (const char *orig_prefix,
5383+ const char *curr_prefix);
5384+
5385+
5386+#ifdef __cplusplus
5387+}
5388+#endif
5389+
5390+#endif /* libintl.h */
5391diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/loadinfo.h psmisc-20.2.works.clean/intl/loadinfo.h
5392--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/loadinfo.h 2001-04-13 23:00:42.000000000 -0500
5393+++ psmisc-20.2.works.clean/intl/loadinfo.h 2004-10-13 15:18:41.000000000 -0500
5394@@ -1,31 +1,36 @@
5395-/* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
5396+/* Copyright (C) 1996-1999, 2000-2003 Free Software Foundation, Inc.
5397 This file is part of the GNU C Library.
5398 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
5399
5400- This program is free software; you can redistribute it and/or modify
5401- it under the terms of the GNU General Public License as published by
5402- the Free Software Foundation; either version 2, or (at your option)
5403+ This program is free software; you can redistribute it and/or modify it
5404+ under the terms of the GNU Library General Public License as published
5405+ by the Free Software Foundation; either version 2, or (at your option)
5406 any later version.
5407
5408 This program is distributed in the hope that it will be useful,
5409 but WITHOUT ANY WARRANTY; without even the implied warranty of
5410- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5411- GNU General Public License for more details.
5412+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5413+ Library General Public License for more details.
5414
5415- You should have received a copy of the GNU General Public License
5416- along with this program; if not, write to the Free Software Foundation,
5417- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
5418+ You should have received a copy of the GNU Library General Public
5419+ License along with this program; if not, write to the Free Software
5420+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
5421+ USA. */
5422
5423 #ifndef _LOADINFO_H
5424 #define _LOADINFO_H 1
5425
5426-#ifndef PARAMS
5427-# if __STDC__
5428-# define PARAMS(args) args
5429-# else
5430-# define PARAMS(args) ()
5431-# endif
5432-#endif
5433+/* Declarations of locale dependent catalog lookup functions.
5434+ Implemented in
5435+
5436+ localealias.c Possibly replace a locale name by another.
5437+ explodename.c Split a locale name into its various fields.
5438+ l10nflist.c Generate a list of filenames of possible message catalogs.
5439+ finddomain.c Find and open the relevant message catalogs.
5440+
5441+ The main function _nl_find_domain() in finddomain.c is declared
5442+ in gettextP.h.
5443+ */
5444
5445 #ifndef internal_function
5446 # define internal_function
5447@@ -63,7 +68,6 @@
5448 struct loaded_l10nfile
5449 {
5450 const char *filename;
5451- struct binding *domainbinding;
5452 int decided;
5453
5454 const void *data;
5455@@ -77,39 +81,65 @@
5456 names. Normalization allows the user to use any of the common
5457 names. The return value is dynamically allocated and has to be
5458 freed by the caller. */
5459-extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
5460- size_t name_len));
5461+extern const char *_nl_normalize_codeset (const char *codeset,
5462+ size_t name_len);
5463
5464+/* Lookup a locale dependent file.
5465+ *L10NFILE_LIST denotes a pool of lookup results of locale dependent
5466+ files of the same kind, sorted in decreasing order of ->filename.
5467+ DIRLIST and DIRLIST_LEN are an argz list of directories in which to
5468+ look, containing at least one directory (i.e. DIRLIST_LEN > 0).
5469+ MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER,
5470+ SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as
5471+ produced by _nl_explode_name(). FILENAME is the filename suffix.
5472+ The return value is the lookup result, either found in *L10NFILE_LIST,
5473+ or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
5474+ If the return value is non-NULL, it is added to *L10NFILE_LIST, and
5475+ its ->next field denotes the chaining inside *L10NFILE_LIST, and
5476+ furthermore its ->successor[] field contains a list of other lookup
5477+ results from which this lookup result inherits. */
5478 extern struct loaded_l10nfile *
5479-_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
5480- const char *dirlist, size_t dirlist_len, int mask,
5481- const char *language, const char *territory,
5482- const char *codeset,
5483- const char *normalized_codeset,
5484- const char *modifier, const char *special,
5485- const char *sponsor, const char *revision,
5486- const char *filename,
5487- struct binding *domainbinding, int do_allocate));
5488-
5489-
5490-extern const char *_nl_expand_alias PARAMS ((const char *name));
5491-
5492-/* normalized_codeset is dynamically allocated and has to be freed by
5493- the caller. */
5494-extern int _nl_explode_name PARAMS ((char *name, const char **language,
5495- const char **modifier,
5496- const char **territory,
5497- const char **codeset,
5498- const char **normalized_codeset,
5499- const char **special,
5500- const char **sponsor,
5501- const char **revision));
5502+_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
5503+ const char *dirlist, size_t dirlist_len, int mask,
5504+ const char *language, const char *territory,
5505+ const char *codeset, const char *normalized_codeset,
5506+ const char *modifier, const char *special,
5507+ const char *sponsor, const char *revision,
5508+ const char *filename, int do_allocate);
5509
5510-extern char *_nl_find_language PARAMS ((const char *name));
5511+/* Lookup the real locale name for a locale alias NAME, or NULL if
5512+ NAME is not a locale alias (but possibly a real locale name).
5513+ The return value is statically allocated and must not be freed. */
5514+extern const char *_nl_expand_alias (const char *name);
5515
5516+/* Split a locale name NAME into its pieces: language, modifier,
5517+ territory, codeset, special, sponsor, revision.
5518+ NAME gets destructively modified: NUL bytes are inserted here and
5519+ there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY,
5520+ *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a
5521+ pointer into the old NAME string, or NULL. *NORMALIZED_CODESET
5522+ gets assigned the expanded *CODESET, if it is different from *CODESET;
5523+ this one is dynamically allocated and has to be freed by the caller.
5524+ The return value is a bitmask, where each bit corresponds to one
5525+ filled-in value:
5526+ XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER,
5527+ TERRITORY for *TERRITORY,
5528+ XPG_CODESET for *CODESET,
5529+ XPG_NORM_CODESET for *NORMALIZED_CODESET,
5530+ CEN_SPECIAL for *SPECIAL,
5531+ CEN_SPONSOR for *SPONSOR,
5532+ CEN_REVISION for *REVISION.
5533+ */
5534+extern int _nl_explode_name (char *name, const char **language,
5535+ const char **modifier, const char **territory,
5536+ const char **codeset,
5537+ const char **normalized_codeset,
5538+ const char **special, const char **sponsor,
5539+ const char **revision);
5540
5541-extern char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
5542- const char *msgid, size_t *lengthp))
5543- internal_function;
5544+/* Split a locale name NAME into a leading language part and all the
5545+ rest. Return a pointer to the first character after the language,
5546+ i.e. to the first byte of the rest. */
5547+extern char *_nl_find_language (const char *name);
5548
5549 #endif /* loadinfo.h */
5550diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/loadmsgcat.c psmisc-20.2.works.clean/intl/loadmsgcat.c
5551--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/loadmsgcat.c 2001-04-13 23:00:42.000000000 -0500
5552+++ psmisc-20.2.works.clean/intl/loadmsgcat.c 2004-10-13 15:18:41.000000000 -0500
5553@@ -1,19 +1,20 @@
5554 /* Load needed message catalogs.
5555- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
5556+ Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
5557
5558- This program is free software; you can redistribute it and/or modify
5559- it under the terms of the GNU General Public License as published by
5560- the Free Software Foundation; either version 2, or (at your option)
5561+ This program is free software; you can redistribute it and/or modify it
5562+ under the terms of the GNU Library General Public License as published
5563+ by the Free Software Foundation; either version 2, or (at your option)
5564 any later version.
5565
5566 This program is distributed in the hope that it will be useful,
5567 but WITHOUT ANY WARRANTY; without even the implied warranty of
5568- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5569- GNU General Public License for more details.
5570+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5571+ Library General Public License for more details.
5572
5573- You should have received a copy of the GNU General Public License
5574- along with this program; if not, write to the Free Software Foundation,
5575- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
5576+ You should have received a copy of the GNU Library General Public
5577+ License along with this program; if not, write to the Free Software
5578+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
5579+ USA. */
5580
5581 /* Tell glibc's <string.h> to provide a prototype for mempcpy().
5582 This must come before <config.h> because <config.h> may include
5583@@ -33,17 +34,23 @@
5584 #include <sys/stat.h>
5585
5586 #ifdef __GNUC__
5587+# undef alloca
5588 # define alloca __builtin_alloca
5589 # define HAVE_ALLOCA 1
5590 #else
5591-# if defined HAVE_ALLOCA_H || defined _LIBC
5592-# include <alloca.h>
5593+# ifdef _MSC_VER
5594+# include <malloc.h>
5595+# define alloca _alloca
5596 # else
5597-# ifdef _AIX
5598- #pragma alloca
5599+# if defined HAVE_ALLOCA_H || defined _LIBC
5600+# include <alloca.h>
5601 # else
5602-# ifndef alloca
5603+# ifdef _AIX
5604+ #pragma alloca
5605+# else
5606+# ifndef alloca
5607 char *alloca ();
5608+# endif
5609 # endif
5610 # endif
5611 # endif
5612@@ -70,13 +77,380 @@
5613 # undef HAVE_MMAP
5614 #endif
5615
5616-#include "gettext.h"
5617+#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC
5618+# include <stdint.h>
5619+#endif
5620+#if defined HAVE_INTTYPES_H || defined _LIBC
5621+# include <inttypes.h>
5622+#endif
5623+
5624+#include "gmo.h"
5625 #include "gettextP.h"
5626+#include "hash-string.h"
5627+#include "plural-exp.h"
5628
5629 #ifdef _LIBC
5630 # include "../locale/localeinfo.h"
5631 #endif
5632
5633+/* Provide fallback values for macros that ought to be defined in <inttypes.h>.
5634+ Note that our fallback values need not be literal strings, because we don't
5635+ use them with preprocessor string concatenation. */
5636+#if !defined PRId8 || PRI_MACROS_BROKEN
5637+# undef PRId8
5638+# define PRId8 "d"
5639+#endif
5640+#if !defined PRIi8 || PRI_MACROS_BROKEN
5641+# undef PRIi8
5642+# define PRIi8 "i"
5643+#endif
5644+#if !defined PRIo8 || PRI_MACROS_BROKEN
5645+# undef PRIo8
5646+# define PRIo8 "o"
5647+#endif
5648+#if !defined PRIu8 || PRI_MACROS_BROKEN
5649+# undef PRIu8
5650+# define PRIu8 "u"
5651+#endif
5652+#if !defined PRIx8 || PRI_MACROS_BROKEN
5653+# undef PRIx8
5654+# define PRIx8 "x"
5655+#endif
5656+#if !defined PRIX8 || PRI_MACROS_BROKEN
5657+# undef PRIX8
5658+# define PRIX8 "X"
5659+#endif
5660+#if !defined PRId16 || PRI_MACROS_BROKEN
5661+# undef PRId16
5662+# define PRId16 "d"
5663+#endif
5664+#if !defined PRIi16 || PRI_MACROS_BROKEN
5665+# undef PRIi16
5666+# define PRIi16 "i"
5667+#endif
5668+#if !defined PRIo16 || PRI_MACROS_BROKEN
5669+# undef PRIo16
5670+# define PRIo16 "o"
5671+#endif
5672+#if !defined PRIu16 || PRI_MACROS_BROKEN
5673+# undef PRIu16
5674+# define PRIu16 "u"
5675+#endif
5676+#if !defined PRIx16 || PRI_MACROS_BROKEN
5677+# undef PRIx16
5678+# define PRIx16 "x"
5679+#endif
5680+#if !defined PRIX16 || PRI_MACROS_BROKEN
5681+# undef PRIX16
5682+# define PRIX16 "X"
5683+#endif
5684+#if !defined PRId32 || PRI_MACROS_BROKEN
5685+# undef PRId32
5686+# define PRId32 "d"
5687+#endif
5688+#if !defined PRIi32 || PRI_MACROS_BROKEN
5689+# undef PRIi32
5690+# define PRIi32 "i"
5691+#endif
5692+#if !defined PRIo32 || PRI_MACROS_BROKEN
5693+# undef PRIo32
5694+# define PRIo32 "o"
5695+#endif
5696+#if !defined PRIu32 || PRI_MACROS_BROKEN
5697+# undef PRIu32
5698+# define PRIu32 "u"
5699+#endif
5700+#if !defined PRIx32 || PRI_MACROS_BROKEN
5701+# undef PRIx32
5702+# define PRIx32 "x"
5703+#endif
5704+#if !defined PRIX32 || PRI_MACROS_BROKEN
5705+# undef PRIX32
5706+# define PRIX32 "X"
5707+#endif
5708+#if !defined PRId64 || PRI_MACROS_BROKEN
5709+# undef PRId64
5710+# define PRId64 (sizeof (long) == 8 ? "ld" : "lld")
5711+#endif
5712+#if !defined PRIi64 || PRI_MACROS_BROKEN
5713+# undef PRIi64
5714+# define PRIi64 (sizeof (long) == 8 ? "li" : "lli")
5715+#endif
5716+#if !defined PRIo64 || PRI_MACROS_BROKEN
5717+# undef PRIo64
5718+# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo")
5719+#endif
5720+#if !defined PRIu64 || PRI_MACROS_BROKEN
5721+# undef PRIu64
5722+# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu")
5723+#endif
5724+#if !defined PRIx64 || PRI_MACROS_BROKEN
5725+# undef PRIx64
5726+# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx")
5727+#endif
5728+#if !defined PRIX64 || PRI_MACROS_BROKEN
5729+# undef PRIX64
5730+# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX")
5731+#endif
5732+#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN
5733+# undef PRIdLEAST8
5734+# define PRIdLEAST8 "d"
5735+#endif
5736+#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN
5737+# undef PRIiLEAST8
5738+# define PRIiLEAST8 "i"
5739+#endif
5740+#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN
5741+# undef PRIoLEAST8
5742+# define PRIoLEAST8 "o"
5743+#endif
5744+#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN
5745+# undef PRIuLEAST8
5746+# define PRIuLEAST8 "u"
5747+#endif
5748+#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN
5749+# undef PRIxLEAST8
5750+# define PRIxLEAST8 "x"
5751+#endif
5752+#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN
5753+# undef PRIXLEAST8
5754+# define PRIXLEAST8 "X"
5755+#endif
5756+#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN
5757+# undef PRIdLEAST16
5758+# define PRIdLEAST16 "d"
5759+#endif
5760+#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN
5761+# undef PRIiLEAST16
5762+# define PRIiLEAST16 "i"
5763+#endif
5764+#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN
5765+# undef PRIoLEAST16
5766+# define PRIoLEAST16 "o"
5767+#endif
5768+#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN
5769+# undef PRIuLEAST16
5770+# define PRIuLEAST16 "u"
5771+#endif
5772+#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN
5773+# undef PRIxLEAST16
5774+# define PRIxLEAST16 "x"
5775+#endif
5776+#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN
5777+# undef PRIXLEAST16
5778+# define PRIXLEAST16 "X"
5779+#endif
5780+#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN
5781+# undef PRIdLEAST32
5782+# define PRIdLEAST32 "d"
5783+#endif
5784+#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN
5785+# undef PRIiLEAST32
5786+# define PRIiLEAST32 "i"
5787+#endif
5788+#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN
5789+# undef PRIoLEAST32
5790+# define PRIoLEAST32 "o"
5791+#endif
5792+#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN
5793+# undef PRIuLEAST32
5794+# define PRIuLEAST32 "u"
5795+#endif
5796+#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN
5797+# undef PRIxLEAST32
5798+# define PRIxLEAST32 "x"
5799+#endif
5800+#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN
5801+# undef PRIXLEAST32
5802+# define PRIXLEAST32 "X"
5803+#endif
5804+#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN
5805+# undef PRIdLEAST64
5806+# define PRIdLEAST64 PRId64
5807+#endif
5808+#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN
5809+# undef PRIiLEAST64
5810+# define PRIiLEAST64 PRIi64
5811+#endif
5812+#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN
5813+# undef PRIoLEAST64
5814+# define PRIoLEAST64 PRIo64
5815+#endif
5816+#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN
5817+# undef PRIuLEAST64
5818+# define PRIuLEAST64 PRIu64
5819+#endif
5820+#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN
5821+# undef PRIxLEAST64
5822+# define PRIxLEAST64 PRIx64
5823+#endif
5824+#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN
5825+# undef PRIXLEAST64
5826+# define PRIXLEAST64 PRIX64
5827+#endif
5828+#if !defined PRIdFAST8 || PRI_MACROS_BROKEN
5829+# undef PRIdFAST8
5830+# define PRIdFAST8 "d"
5831+#endif
5832+#if !defined PRIiFAST8 || PRI_MACROS_BROKEN
5833+# undef PRIiFAST8
5834+# define PRIiFAST8 "i"
5835+#endif
5836+#if !defined PRIoFAST8 || PRI_MACROS_BROKEN
5837+# undef PRIoFAST8
5838+# define PRIoFAST8 "o"
5839+#endif
5840+#if !defined PRIuFAST8 || PRI_MACROS_BROKEN
5841+# undef PRIuFAST8
5842+# define PRIuFAST8 "u"
5843+#endif
5844+#if !defined PRIxFAST8 || PRI_MACROS_BROKEN
5845+# undef PRIxFAST8
5846+# define PRIxFAST8 "x"
5847+#endif
5848+#if !defined PRIXFAST8 || PRI_MACROS_BROKEN
5849+# undef PRIXFAST8
5850+# define PRIXFAST8 "X"
5851+#endif
5852+#if !defined PRIdFAST16 || PRI_MACROS_BROKEN
5853+# undef PRIdFAST16
5854+# define PRIdFAST16 "d"
5855+#endif
5856+#if !defined PRIiFAST16 || PRI_MACROS_BROKEN
5857+# undef PRIiFAST16
5858+# define PRIiFAST16 "i"
5859+#endif
5860+#if !defined PRIoFAST16 || PRI_MACROS_BROKEN
5861+# undef PRIoFAST16
5862+# define PRIoFAST16 "o"
5863+#endif
5864+#if !defined PRIuFAST16 || PRI_MACROS_BROKEN
5865+# undef PRIuFAST16
5866+# define PRIuFAST16 "u"
5867+#endif
5868+#if !defined PRIxFAST16 || PRI_MACROS_BROKEN
5869+# undef PRIxFAST16
5870+# define PRIxFAST16 "x"
5871+#endif
5872+#if !defined PRIXFAST16 || PRI_MACROS_BROKEN
5873+# undef PRIXFAST16
5874+# define PRIXFAST16 "X"
5875+#endif
5876+#if !defined PRIdFAST32 || PRI_MACROS_BROKEN
5877+# undef PRIdFAST32
5878+# define PRIdFAST32 "d"
5879+#endif
5880+#if !defined PRIiFAST32 || PRI_MACROS_BROKEN
5881+# undef PRIiFAST32
5882+# define PRIiFAST32 "i"
5883+#endif
5884+#if !defined PRIoFAST32 || PRI_MACROS_BROKEN
5885+# undef PRIoFAST32
5886+# define PRIoFAST32 "o"
5887+#endif
5888+#if !defined PRIuFAST32 || PRI_MACROS_BROKEN
5889+# undef PRIuFAST32
5890+# define PRIuFAST32 "u"
5891+#endif
5892+#if !defined PRIxFAST32 || PRI_MACROS_BROKEN
5893+# undef PRIxFAST32
5894+# define PRIxFAST32 "x"
5895+#endif
5896+#if !defined PRIXFAST32 || PRI_MACROS_BROKEN
5897+# undef PRIXFAST32
5898+# define PRIXFAST32 "X"
5899+#endif
5900+#if !defined PRIdFAST64 || PRI_MACROS_BROKEN
5901+# undef PRIdFAST64
5902+# define PRIdFAST64 PRId64
5903+#endif
5904+#if !defined PRIiFAST64 || PRI_MACROS_BROKEN
5905+# undef PRIiFAST64
5906+# define PRIiFAST64 PRIi64
5907+#endif
5908+#if !defined PRIoFAST64 || PRI_MACROS_BROKEN
5909+# undef PRIoFAST64
5910+# define PRIoFAST64 PRIo64
5911+#endif
5912+#if !defined PRIuFAST64 || PRI_MACROS_BROKEN
5913+# undef PRIuFAST64
5914+# define PRIuFAST64 PRIu64
5915+#endif
5916+#if !defined PRIxFAST64 || PRI_MACROS_BROKEN
5917+# undef PRIxFAST64
5918+# define PRIxFAST64 PRIx64
5919+#endif
5920+#if !defined PRIXFAST64 || PRI_MACROS_BROKEN
5921+# undef PRIXFAST64
5922+# define PRIXFAST64 PRIX64
5923+#endif
5924+#if !defined PRIdMAX || PRI_MACROS_BROKEN
5925+# undef PRIdMAX
5926+# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")
5927+#endif
5928+#if !defined PRIiMAX || PRI_MACROS_BROKEN
5929+# undef PRIiMAX
5930+# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli")
5931+#endif
5932+#if !defined PRIoMAX || PRI_MACROS_BROKEN
5933+# undef PRIoMAX
5934+# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")
5935+#endif
5936+#if !defined PRIuMAX || PRI_MACROS_BROKEN
5937+# undef PRIuMAX
5938+# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")
5939+#endif
5940+#if !defined PRIxMAX || PRI_MACROS_BROKEN
5941+# undef PRIxMAX
5942+# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")
5943+#endif
5944+#if !defined PRIXMAX || PRI_MACROS_BROKEN
5945+# undef PRIXMAX
5946+# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX")
5947+#endif
5948+#if !defined PRIdPTR || PRI_MACROS_BROKEN
5949+# undef PRIdPTR
5950+# define PRIdPTR \
5951+ (sizeof (void *) == sizeof (long) ? "ld" : \
5952+ sizeof (void *) == sizeof (int) ? "d" : \
5953+ "lld")
5954+#endif
5955+#if !defined PRIiPTR || PRI_MACROS_BROKEN
5956+# undef PRIiPTR
5957+# define PRIiPTR \
5958+ (sizeof (void *) == sizeof (long) ? "li" : \
5959+ sizeof (void *) == sizeof (int) ? "i" : \
5960+ "lli")
5961+#endif
5962+#if !defined PRIoPTR || PRI_MACROS_BROKEN
5963+# undef PRIoPTR
5964+# define PRIoPTR \
5965+ (sizeof (void *) == sizeof (long) ? "lo" : \
5966+ sizeof (void *) == sizeof (int) ? "o" : \
5967+ "llo")
5968+#endif
5969+#if !defined PRIuPTR || PRI_MACROS_BROKEN
5970+# undef PRIuPTR
5971+# define PRIuPTR \
5972+ (sizeof (void *) == sizeof (long) ? "lu" : \
5973+ sizeof (void *) == sizeof (int) ? "u" : \
5974+ "llu")
5975+#endif
5976+#if !defined PRIxPTR || PRI_MACROS_BROKEN
5977+# undef PRIxPTR
5978+# define PRIxPTR \
5979+ (sizeof (void *) == sizeof (long) ? "lx" : \
5980+ sizeof (void *) == sizeof (int) ? "x" : \
5981+ "llx")
5982+#endif
5983+#if !defined PRIXPTR || PRI_MACROS_BROKEN
5984+# undef PRIXPTR
5985+# define PRIXPTR \
5986+ (sizeof (void *) == sizeof (long) ? "lX" : \
5987+ sizeof (void *) == sizeof (int) ? "X" : \
5988+ "llX")
5989+#endif
5990+
5991 /* @@ end of prolog @@ */
5992
5993 #ifdef _LIBC
5994@@ -90,16 +464,6 @@
5995 # define munmap __munmap
5996 #endif
5997
5998-/* Names for the libintl functions are a problem. They must not clash
5999- with existing names and they should follow ANSI C. But this source
6000- code is also used in GNU C Library where the names have a __
6001- prefix. So we have to make a difference here. */
6002-#ifdef _LIBC
6003-# define PLURAL_PARSE __gettextparse
6004-#else
6005-# define PLURAL_PARSE gettextparse__
6006-#endif
6007-
6008 /* For those losing systems which don't have `alloca' we have to add
6009 some additional code emulating it. */
6010 #ifdef HAVE_ALLOCA
6011@@ -126,85 +490,424 @@
6012 # define O_BINARY 0
6013 #endif
6014
6015+
6016 /* We need a sign, whether a new catalog was loaded, which can be associated
6017 with all translations. This is important if the translations are
6018 cached by one of GCC's features. */
6019 int _nl_msg_cat_cntr;
6020
6021-#if defined __GNUC__ \
6022- || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
6023
6024-/* These structs are the constant expression for the germanic plural
6025- form determination. It represents the expression "n != 1". */
6026-static const struct expression plvar =
6027-{
6028- .nargs = 0,
6029- .operation = var,
6030-};
6031-static const struct expression plone =
6032-{
6033- .nargs = 0,
6034- .operation = num,
6035- .val =
6036- {
6037- .num = 1
6038- }
6039-};
6040-static struct expression germanic_plural =
6041+/* Expand a system dependent string segment. Return NULL if unsupported. */
6042+static const char *
6043+get_sysdep_segment_value (const char *name)
6044 {
6045- .nargs = 2,
6046- .operation = not_equal,
6047- .val =
6048- {
6049- .args =
6050+ /* Test for an ISO C 99 section 7.8.1 format string directive.
6051+ Syntax:
6052+ P R I { d | i | o | u | x | X }
6053+ { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */
6054+ /* We don't use a table of 14 times 6 'const char *' strings here, because
6055+ data relocations cost startup time. */
6056+ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I')
6057 {
6058- [0] = (struct expression *) &plvar,
6059- [1] = (struct expression *) &plone
6060+ if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u'
6061+ || name[3] == 'x' || name[3] == 'X')
6062+ {
6063+ if (name[4] == '8' && name[5] == '\0')
6064+ {
6065+ if (name[3] == 'd')
6066+ return PRId8;
6067+ if (name[3] == 'i')
6068+ return PRIi8;
6069+ if (name[3] == 'o')
6070+ return PRIo8;
6071+ if (name[3] == 'u')
6072+ return PRIu8;
6073+ if (name[3] == 'x')
6074+ return PRIx8;
6075+ if (name[3] == 'X')
6076+ return PRIX8;
6077+ abort ();
6078+ }
6079+ if (name[4] == '1' && name[5] == '6' && name[6] == '\0')
6080+ {
6081+ if (name[3] == 'd')
6082+ return PRId16;
6083+ if (name[3] == 'i')
6084+ return PRIi16;
6085+ if (name[3] == 'o')
6086+ return PRIo16;
6087+ if (name[3] == 'u')
6088+ return PRIu16;
6089+ if (name[3] == 'x')
6090+ return PRIx16;
6091+ if (name[3] == 'X')
6092+ return PRIX16;
6093+ abort ();
6094+ }
6095+ if (name[4] == '3' && name[5] == '2' && name[6] == '\0')
6096+ {
6097+ if (name[3] == 'd')
6098+ return PRId32;
6099+ if (name[3] == 'i')
6100+ return PRIi32;
6101+ if (name[3] == 'o')
6102+ return PRIo32;
6103+ if (name[3] == 'u')
6104+ return PRIu32;
6105+ if (name[3] == 'x')
6106+ return PRIx32;
6107+ if (name[3] == 'X')
6108+ return PRIX32;
6109+ abort ();
6110+ }
6111+ if (name[4] == '6' && name[5] == '4' && name[6] == '\0')
6112+ {
6113+ if (name[3] == 'd')
6114+ return PRId64;
6115+ if (name[3] == 'i')
6116+ return PRIi64;
6117+ if (name[3] == 'o')
6118+ return PRIo64;
6119+ if (name[3] == 'u')
6120+ return PRIu64;
6121+ if (name[3] == 'x')
6122+ return PRIx64;
6123+ if (name[3] == 'X')
6124+ return PRIX64;
6125+ abort ();
6126+ }
6127+ if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A'
6128+ && name[7] == 'S' && name[8] == 'T')
6129+ {
6130+ if (name[9] == '8' && name[10] == '\0')
6131+ {
6132+ if (name[3] == 'd')
6133+ return PRIdLEAST8;
6134+ if (name[3] == 'i')
6135+ return PRIiLEAST8;
6136+ if (name[3] == 'o')
6137+ return PRIoLEAST8;
6138+ if (name[3] == 'u')
6139+ return PRIuLEAST8;
6140+ if (name[3] == 'x')
6141+ return PRIxLEAST8;
6142+ if (name[3] == 'X')
6143+ return PRIXLEAST8;
6144+ abort ();
6145+ }
6146+ if (name[9] == '1' && name[10] == '6' && name[11] == '\0')
6147+ {
6148+ if (name[3] == 'd')
6149+ return PRIdLEAST16;
6150+ if (name[3] == 'i')
6151+ return PRIiLEAST16;
6152+ if (name[3] == 'o')
6153+ return PRIoLEAST16;
6154+ if (name[3] == 'u')
6155+ return PRIuLEAST16;
6156+ if (name[3] == 'x')
6157+ return PRIxLEAST16;
6158+ if (name[3] == 'X')
6159+ return PRIXLEAST16;
6160+ abort ();
6161+ }
6162+ if (name[9] == '3' && name[10] == '2' && name[11] == '\0')
6163+ {
6164+ if (name[3] == 'd')
6165+ return PRIdLEAST32;
6166+ if (name[3] == 'i')
6167+ return PRIiLEAST32;
6168+ if (name[3] == 'o')
6169+ return PRIoLEAST32;
6170+ if (name[3] == 'u')
6171+ return PRIuLEAST32;
6172+ if (name[3] == 'x')
6173+ return PRIxLEAST32;
6174+ if (name[3] == 'X')
6175+ return PRIXLEAST32;
6176+ abort ();
6177+ }
6178+ if (name[9] == '6' && name[10] == '4' && name[11] == '\0')
6179+ {
6180+ if (name[3] == 'd')
6181+ return PRIdLEAST64;
6182+ if (name[3] == 'i')
6183+ return PRIiLEAST64;
6184+ if (name[3] == 'o')
6185+ return PRIoLEAST64;
6186+ if (name[3] == 'u')
6187+ return PRIuLEAST64;
6188+ if (name[3] == 'x')
6189+ return PRIxLEAST64;
6190+ if (name[3] == 'X')
6191+ return PRIXLEAST64;
6192+ abort ();
6193+ }
6194+ }
6195+ if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S'
6196+ && name[7] == 'T')
6197+ {
6198+ if (name[8] == '8' && name[9] == '\0')
6199+ {
6200+ if (name[3] == 'd')
6201+ return PRIdFAST8;
6202+ if (name[3] == 'i')
6203+ return PRIiFAST8;
6204+ if (name[3] == 'o')
6205+ return PRIoFAST8;
6206+ if (name[3] == 'u')
6207+ return PRIuFAST8;
6208+ if (name[3] == 'x')
6209+ return PRIxFAST8;
6210+ if (name[3] == 'X')
6211+ return PRIXFAST8;
6212+ abort ();
6213+ }
6214+ if (name[8] == '1' && name[9] == '6' && name[10] == '\0')
6215+ {
6216+ if (name[3] == 'd')
6217+ return PRIdFAST16;
6218+ if (name[3] == 'i')
6219+ return PRIiFAST16;
6220+ if (name[3] == 'o')
6221+ return PRIoFAST16;
6222+ if (name[3] == 'u')
6223+ return PRIuFAST16;
6224+ if (name[3] == 'x')
6225+ return PRIxFAST16;
6226+ if (name[3] == 'X')
6227+ return PRIXFAST16;
6228+ abort ();
6229+ }
6230+ if (name[8] == '3' && name[9] == '2' && name[10] == '\0')
6231+ {
6232+ if (name[3] == 'd')
6233+ return PRIdFAST32;
6234+ if (name[3] == 'i')
6235+ return PRIiFAST32;
6236+ if (name[3] == 'o')
6237+ return PRIoFAST32;
6238+ if (name[3] == 'u')
6239+ return PRIuFAST32;
6240+ if (name[3] == 'x')
6241+ return PRIxFAST32;
6242+ if (name[3] == 'X')
6243+ return PRIXFAST32;
6244+ abort ();
6245+ }
6246+ if (name[8] == '6' && name[9] == '4' && name[10] == '\0')
6247+ {
6248+ if (name[3] == 'd')
6249+ return PRIdFAST64;
6250+ if (name[3] == 'i')
6251+ return PRIiFAST64;
6252+ if (name[3] == 'o')
6253+ return PRIoFAST64;
6254+ if (name[3] == 'u')
6255+ return PRIuFAST64;
6256+ if (name[3] == 'x')
6257+ return PRIxFAST64;
6258+ if (name[3] == 'X')
6259+ return PRIXFAST64;
6260+ abort ();
6261+ }
6262+ }
6263+ if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X'
6264+ && name[7] == '\0')
6265+ {
6266+ if (name[3] == 'd')
6267+ return PRIdMAX;
6268+ if (name[3] == 'i')
6269+ return PRIiMAX;
6270+ if (name[3] == 'o')
6271+ return PRIoMAX;
6272+ if (name[3] == 'u')
6273+ return PRIuMAX;
6274+ if (name[3] == 'x')
6275+ return PRIxMAX;
6276+ if (name[3] == 'X')
6277+ return PRIXMAX;
6278+ abort ();
6279+ }
6280+ if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R'
6281+ && name[7] == '\0')
6282+ {
6283+ if (name[3] == 'd')
6284+ return PRIdPTR;
6285+ if (name[3] == 'i')
6286+ return PRIiPTR;
6287+ if (name[3] == 'o')
6288+ return PRIoPTR;
6289+ if (name[3] == 'u')
6290+ return PRIuPTR;
6291+ if (name[3] == 'x')
6292+ return PRIxPTR;
6293+ if (name[3] == 'X')
6294+ return PRIXPTR;
6295+ abort ();
6296+ }
6297+ }
6298 }
6299- }
6300-};
6301+ /* Test for a glibc specific printf() format directive flag. */
6302+ if (name[0] == 'I' && name[1] == '\0')
6303+ {
6304+#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
6305+ /* The 'I' flag, in numeric format directives, replaces ASCII digits
6306+ with the 'outdigits' defined in the LC_CTYPE locale facet. This is
6307+ used for Farsi (Persian) and maybe Arabic. */
6308+ return "I";
6309+#else
6310+ return "";
6311+#endif
6312+ }
6313+ /* Other system dependent strings are not valid. */
6314+ return NULL;
6315+}
6316
6317-# define INIT_GERMANIC_PLURAL()
6318+/* Initialize the codeset dependent parts of an opened message catalog.
6319+ Return the header entry. */
6320+const char *
6321+internal_function
6322+_nl_init_domain_conv (struct loaded_l10nfile *domain_file,
6323+ struct loaded_domain *domain,
6324+ struct binding *domainbinding)
6325+{
6326+ /* Find out about the character set the file is encoded with.
6327+ This can be found (in textual form) in the entry "". If this
6328+ entry does not exist or if this does not contain the `charset='
6329+ information, we will assume the charset matches the one the
6330+ current locale and we don't have to perform any conversion. */
6331+ char *nullentry;
6332+ size_t nullentrylen;
6333
6334+ /* Preinitialize fields, to avoid recursion during _nl_find_msg. */
6335+ domain->codeset_cntr =
6336+ (domainbinding != NULL ? domainbinding->codeset_cntr : 0);
6337+#ifdef _LIBC
6338+ domain->conv = (__gconv_t) -1;
6339 #else
6340+# if HAVE_ICONV
6341+ domain->conv = (iconv_t) -1;
6342+# endif
6343+#endif
6344+ domain->conv_tab = NULL;
6345
6346-/* For compilers without support for ISO C 99 struct/union initializers:
6347- Initialization at run-time. */
6348-
6349-static struct expression plvar;
6350-static struct expression plone;
6351-static struct expression germanic_plural;
6352+ /* Get the header entry. */
6353+ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen);
6354
6355-static void
6356-init_germanic_plural ()
6357-{
6358- if (plone.val.num == 0)
6359+ if (nullentry != NULL)
6360 {
6361- plvar.nargs = 0;
6362- plvar.operation = var;
6363+#if defined _LIBC || HAVE_ICONV
6364+ const char *charsetstr;
6365
6366- plone.nargs = 0;
6367- plone.operation = num;
6368- plone.val.num = 1;
6369+ charsetstr = strstr (nullentry, "charset=");
6370+ if (charsetstr != NULL)
6371+ {
6372+ size_t len;
6373+ char *charset;
6374+ const char *outcharset;
6375
6376- germanic_plural.nargs = 2;
6377- germanic_plural.operation = not_equal;
6378- germanic_plural.val.args[0] = &plvar;
6379- germanic_plural.val.args[1] = &plone;
6380+ charsetstr += strlen ("charset=");
6381+ len = strcspn (charsetstr, " \t\n");
6382+
6383+ charset = (char *) alloca (len + 1);
6384+# if defined _LIBC || HAVE_MEMPCPY
6385+ *((char *) mempcpy (charset, charsetstr, len)) = '\0';
6386+# else
6387+ memcpy (charset, charsetstr, len);
6388+ charset[len] = '\0';
6389+# endif
6390+
6391+ /* The output charset should normally be determined by the
6392+ locale. But sometimes the locale is not used or not correctly
6393+ set up, so we provide a possibility for the user to override
6394+ this. Moreover, the value specified through
6395+ bind_textdomain_codeset overrides both. */
6396+ if (domainbinding != NULL && domainbinding->codeset != NULL)
6397+ outcharset = domainbinding->codeset;
6398+ else
6399+ {
6400+ outcharset = getenv ("OUTPUT_CHARSET");
6401+ if (outcharset == NULL || outcharset[0] == '\0')
6402+ {
6403+# ifdef _LIBC
6404+ outcharset = _NL_CURRENT (LC_CTYPE, CODESET);
6405+# else
6406+# if HAVE_ICONV
6407+ extern const char *locale_charset (void);
6408+ outcharset = locale_charset ();
6409+# endif
6410+# endif
6411+ }
6412+ }
6413+
6414+# ifdef _LIBC
6415+ /* We always want to use transliteration. */
6416+ outcharset = norm_add_slashes (outcharset, "TRANSLIT");
6417+ charset = norm_add_slashes (charset, NULL);
6418+ if (__gconv_open (outcharset, charset, &domain->conv,
6419+ GCONV_AVOID_NOCONV)
6420+ != __GCONV_OK)
6421+ domain->conv = (__gconv_t) -1;
6422+# else
6423+# if HAVE_ICONV
6424+ /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
6425+ we want to use transliteration. */
6426+# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
6427+ || _LIBICONV_VERSION >= 0x0105
6428+ if (strchr (outcharset, '/') == NULL)
6429+ {
6430+ char *tmp;
6431+
6432+ len = strlen (outcharset);
6433+ tmp = (char *) alloca (len + 10 + 1);
6434+ memcpy (tmp, outcharset, len);
6435+ memcpy (tmp + len, "//TRANSLIT", 10 + 1);
6436+ outcharset = tmp;
6437+
6438+ domain->conv = iconv_open (outcharset, charset);
6439+
6440+ freea (outcharset);
6441+ }
6442+ else
6443+# endif
6444+ domain->conv = iconv_open (outcharset, charset);
6445+# endif
6446+# endif
6447+
6448+ freea (charset);
6449+ }
6450+#endif /* _LIBC || HAVE_ICONV */
6451 }
6452+
6453+ return nullentry;
6454 }
6455
6456-# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
6457+/* Frees the codeset dependent parts of an opened message catalog. */
6458+void
6459+internal_function
6460+_nl_free_domain_conv (struct loaded_domain *domain)
6461+{
6462+ if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
6463+ free (domain->conv_tab);
6464
6465+#ifdef _LIBC
6466+ if (domain->conv != (__gconv_t) -1)
6467+ __gconv_close (domain->conv);
6468+#else
6469+# if HAVE_ICONV
6470+ if (domain->conv != (iconv_t) -1)
6471+ iconv_close (domain->conv);
6472+# endif
6473 #endif
6474-
6475+}
6476
6477 /* Load the message catalogs specified by FILENAME. If it is no valid
6478 message catalog do nothing. */
6479 void
6480 internal_function
6481-_nl_load_domain (domain_file)
6482- struct loaded_l10nfile *domain_file;
6483+_nl_load_domain (struct loaded_l10nfile *domain_file,
6484+ struct binding *domainbinding)
6485 {
6486 int fd;
6487 size_t size;
6488@@ -216,12 +919,16 @@
6489 struct mo_file_header *data = (struct mo_file_header *) -1;
6490 int use_mmap = 0;
6491 struct loaded_domain *domain;
6492- char *nullentry;
6493- size_t nullentrylen;
6494+ int revision;
6495+ const char *nullentry;
6496
6497 domain_file->decided = 1;
6498 domain_file->data = NULL;
6499
6500+ /* Note that it would be useless to store domainbinding in domain_file
6501+ because domainbinding might be == NULL now but != NULL later (after
6502+ a call to bind_textdomain_codeset). */
6503+
6504 /* If the record does not represent a valid locale the FILENAME
6505 might be NULL. This can happen when according to the given
6506 specification the locale file name is different for XPG and CEN
6507@@ -320,22 +1027,353 @@
6508 domain->use_mmap = use_mmap;
6509 domain->mmap_size = size;
6510 domain->must_swap = data->magic != _MAGIC;
6511+ domain->malloced = NULL;
6512
6513 /* Fill in the information about the available tables. */
6514- switch (W (domain->must_swap, data->revision))
6515+ revision = W (domain->must_swap, data->revision);
6516+ /* We support only the major revisions 0 and 1. */
6517+ switch (revision >> 16)
6518 {
6519 case 0:
6520+ case 1:
6521 domain->nstrings = W (domain->must_swap, data->nstrings);
6522- domain->orig_tab = (struct string_desc *)
6523+ domain->orig_tab = (const struct string_desc *)
6524 ((char *) data + W (domain->must_swap, data->orig_tab_offset));
6525- domain->trans_tab = (struct string_desc *)
6526+ domain->trans_tab = (const struct string_desc *)
6527 ((char *) data + W (domain->must_swap, data->trans_tab_offset));
6528 domain->hash_size = W (domain->must_swap, data->hash_tab_size);
6529- domain->hash_tab = (nls_uint32 *)
6530- ((char *) data + W (domain->must_swap, data->hash_tab_offset));
6531+ domain->hash_tab =
6532+ (domain->hash_size > 2
6533+ ? (const nls_uint32 *)
6534+ ((char *) data + W (domain->must_swap, data->hash_tab_offset))
6535+ : NULL);
6536+ domain->must_swap_hash_tab = domain->must_swap;
6537+
6538+ /* Now dispatch on the minor revision. */
6539+ switch (revision & 0xffff)
6540+ {
6541+ case 0:
6542+ domain->n_sysdep_strings = 0;
6543+ domain->orig_sysdep_tab = NULL;
6544+ domain->trans_sysdep_tab = NULL;
6545+ break;
6546+ case 1:
6547+ default:
6548+ {
6549+ nls_uint32 n_sysdep_strings;
6550+
6551+ if (domain->hash_tab == NULL)
6552+ /* This is invalid. These minor revisions need a hash table. */
6553+ goto invalid;
6554+
6555+ n_sysdep_strings =
6556+ W (domain->must_swap, data->n_sysdep_strings);
6557+ if (n_sysdep_strings > 0)
6558+ {
6559+ nls_uint32 n_sysdep_segments;
6560+ const struct sysdep_segment *sysdep_segments;
6561+ const char **sysdep_segment_values;
6562+ const nls_uint32 *orig_sysdep_tab;
6563+ const nls_uint32 *trans_sysdep_tab;
6564+ nls_uint32 n_inmem_sysdep_strings;
6565+ size_t memneed;
6566+ char *mem;
6567+ struct sysdep_string_desc *inmem_orig_sysdep_tab;
6568+ struct sysdep_string_desc *inmem_trans_sysdep_tab;
6569+ nls_uint32 *inmem_hash_tab;
6570+ unsigned int i, j;
6571+
6572+ /* Get the values of the system dependent segments. */
6573+ n_sysdep_segments =
6574+ W (domain->must_swap, data->n_sysdep_segments);
6575+ sysdep_segments = (const struct sysdep_segment *)
6576+ ((char *) data
6577+ + W (domain->must_swap, data->sysdep_segments_offset));
6578+ sysdep_segment_values =
6579+ alloca (n_sysdep_segments * sizeof (const char *));
6580+ for (i = 0; i < n_sysdep_segments; i++)
6581+ {
6582+ const char *name =
6583+ (char *) data
6584+ + W (domain->must_swap, sysdep_segments[i].offset);
6585+ nls_uint32 namelen =
6586+ W (domain->must_swap, sysdep_segments[i].length);
6587+
6588+ if (!(namelen > 0 && name[namelen - 1] == '\0'))
6589+ {
6590+ freea (sysdep_segment_values);
6591+ goto invalid;
6592+ }
6593+
6594+ sysdep_segment_values[i] = get_sysdep_segment_value (name);
6595+ }
6596+
6597+ orig_sysdep_tab = (const nls_uint32 *)
6598+ ((char *) data
6599+ + W (domain->must_swap, data->orig_sysdep_tab_offset));
6600+ trans_sysdep_tab = (const nls_uint32 *)
6601+ ((char *) data
6602+ + W (domain->must_swap, data->trans_sysdep_tab_offset));
6603+
6604+ /* Compute the amount of additional memory needed for the
6605+ system dependent strings and the augmented hash table.
6606+ At the same time, also drop string pairs which refer to
6607+ an undefined system dependent segment. */
6608+ n_inmem_sysdep_strings = 0;
6609+ memneed = domain->hash_size * sizeof (nls_uint32);
6610+ for (i = 0; i < n_sysdep_strings; i++)
6611+ {
6612+ int valid = 1;
6613+ size_t needs[2];
6614+
6615+ for (j = 0; j < 2; j++)
6616+ {
6617+ const struct sysdep_string *sysdep_string =
6618+ (const struct sysdep_string *)
6619+ ((char *) data
6620+ + W (domain->must_swap,
6621+ j == 0
6622+ ? orig_sysdep_tab[i]
6623+ : trans_sysdep_tab[i]));
6624+ size_t need = 0;
6625+ const struct segment_pair *p = sysdep_string->segments;
6626+
6627+ if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END)
6628+ for (p = sysdep_string->segments;; p++)
6629+ {
6630+ nls_uint32 sysdepref;
6631+
6632+ need += W (domain->must_swap, p->segsize);
6633+
6634+ sysdepref = W (domain->must_swap, p->sysdepref);
6635+ if (sysdepref == SEGMENTS_END)
6636+ break;
6637+
6638+ if (sysdepref >= n_sysdep_segments)
6639+ {
6640+ /* Invalid. */
6641+ freea (sysdep_segment_values);
6642+ goto invalid;
6643+ }
6644+
6645+ if (sysdep_segment_values[sysdepref] == NULL)
6646+ {
6647+ /* This particular string pair is invalid. */
6648+ valid = 0;
6649+ break;
6650+ }
6651+
6652+ need += strlen (sysdep_segment_values[sysdepref]);
6653+ }
6654+
6655+ needs[j] = need;
6656+ if (!valid)
6657+ break;
6658+ }
6659+
6660+ if (valid)
6661+ {
6662+ n_inmem_sysdep_strings++;
6663+ memneed += needs[0] + needs[1];
6664+ }
6665+ }
6666+ memneed += 2 * n_inmem_sysdep_strings
6667+ * sizeof (struct sysdep_string_desc);
6668+
6669+ if (n_inmem_sysdep_strings > 0)
6670+ {
6671+ unsigned int k;
6672+
6673+ /* Allocate additional memory. */
6674+ mem = (char *) malloc (memneed);
6675+ if (mem == NULL)
6676+ goto invalid;
6677+
6678+ domain->malloced = mem;
6679+ inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem;
6680+ mem += n_inmem_sysdep_strings
6681+ * sizeof (struct sysdep_string_desc);
6682+ inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem;
6683+ mem += n_inmem_sysdep_strings
6684+ * sizeof (struct sysdep_string_desc);
6685+ inmem_hash_tab = (nls_uint32 *) mem;
6686+ mem += domain->hash_size * sizeof (nls_uint32);
6687+
6688+ /* Compute the system dependent strings. */
6689+ k = 0;
6690+ for (i = 0; i < n_sysdep_strings; i++)
6691+ {
6692+ int valid = 1;
6693+
6694+ for (j = 0; j < 2; j++)
6695+ {
6696+ const struct sysdep_string *sysdep_string =
6697+ (const struct sysdep_string *)
6698+ ((char *) data
6699+ + W (domain->must_swap,
6700+ j == 0
6701+ ? orig_sysdep_tab[i]
6702+ : trans_sysdep_tab[i]));
6703+ const struct segment_pair *p =
6704+ sysdep_string->segments;
6705+
6706+ if (W (domain->must_swap, p->sysdepref)
6707+ != SEGMENTS_END)
6708+ for (p = sysdep_string->segments;; p++)
6709+ {
6710+ nls_uint32 sysdepref;
6711+
6712+ sysdepref =
6713+ W (domain->must_swap, p->sysdepref);
6714+ if (sysdepref == SEGMENTS_END)
6715+ break;
6716+
6717+ if (sysdep_segment_values[sysdepref] == NULL)
6718+ {
6719+ /* This particular string pair is
6720+ invalid. */
6721+ valid = 0;
6722+ break;
6723+ }
6724+ }
6725+
6726+ if (!valid)
6727+ break;
6728+ }
6729+
6730+ if (valid)
6731+ {
6732+ for (j = 0; j < 2; j++)
6733+ {
6734+ const struct sysdep_string *sysdep_string =
6735+ (const struct sysdep_string *)
6736+ ((char *) data
6737+ + W (domain->must_swap,
6738+ j == 0
6739+ ? orig_sysdep_tab[i]
6740+ : trans_sysdep_tab[i]));
6741+ const char *static_segments =
6742+ (char *) data
6743+ + W (domain->must_swap, sysdep_string->offset);
6744+ const struct segment_pair *p =
6745+ sysdep_string->segments;
6746+
6747+ /* Concatenate the segments, and fill
6748+ inmem_orig_sysdep_tab[k] (for j == 0) and
6749+ inmem_trans_sysdep_tab[k] (for j == 1). */
6750+
6751+ struct sysdep_string_desc *inmem_tab_entry =
6752+ (j == 0
6753+ ? inmem_orig_sysdep_tab
6754+ : inmem_trans_sysdep_tab)
6755+ + k;
6756+
6757+ if (W (domain->must_swap, p->sysdepref)
6758+ == SEGMENTS_END)
6759+ {
6760+ /* Only one static segment. */
6761+ inmem_tab_entry->length =
6762+ W (domain->must_swap, p->segsize);
6763+ inmem_tab_entry->pointer = static_segments;
6764+ }
6765+ else
6766+ {
6767+ inmem_tab_entry->pointer = mem;
6768+
6769+ for (p = sysdep_string->segments;; p++)
6770+ {
6771+ nls_uint32 segsize =
6772+ W (domain->must_swap, p->segsize);
6773+ nls_uint32 sysdepref =
6774+ W (domain->must_swap, p->sysdepref);
6775+ size_t n;
6776+
6777+ if (segsize > 0)
6778+ {
6779+ memcpy (mem, static_segments, segsize);
6780+ mem += segsize;
6781+ static_segments += segsize;
6782+ }
6783+
6784+ if (sysdepref == SEGMENTS_END)
6785+ break;
6786+
6787+ n = strlen (sysdep_segment_values[sysdepref]);
6788+ memcpy (mem, sysdep_segment_values[sysdepref], n);
6789+ mem += n;
6790+ }
6791+
6792+ inmem_tab_entry->length =
6793+ mem - inmem_tab_entry->pointer;
6794+ }
6795+ }
6796+
6797+ k++;
6798+ }
6799+ }
6800+ if (k != n_inmem_sysdep_strings)
6801+ abort ();
6802+
6803+ /* Compute the augmented hash table. */
6804+ for (i = 0; i < domain->hash_size; i++)
6805+ inmem_hash_tab[i] =
6806+ W (domain->must_swap_hash_tab, domain->hash_tab[i]);
6807+ for (i = 0; i < n_inmem_sysdep_strings; i++)
6808+ {
6809+ const char *msgid = inmem_orig_sysdep_tab[i].pointer;
6810+ nls_uint32 hash_val = hash_string (msgid);
6811+ nls_uint32 idx = hash_val % domain->hash_size;
6812+ nls_uint32 incr =
6813+ 1 + (hash_val % (domain->hash_size - 2));
6814+
6815+ for (;;)
6816+ {
6817+ if (inmem_hash_tab[idx] == 0)
6818+ {
6819+ /* Hash table entry is empty. Use it. */
6820+ inmem_hash_tab[idx] = 1 + domain->nstrings + i;
6821+ break;
6822+ }
6823+
6824+ if (idx >= domain->hash_size - incr)
6825+ idx -= domain->hash_size - incr;
6826+ else
6827+ idx += incr;
6828+ }
6829+ }
6830+
6831+ domain->n_sysdep_strings = n_inmem_sysdep_strings;
6832+ domain->orig_sysdep_tab = inmem_orig_sysdep_tab;
6833+ domain->trans_sysdep_tab = inmem_trans_sysdep_tab;
6834+
6835+ domain->hash_tab = inmem_hash_tab;
6836+ domain->must_swap_hash_tab = 0;
6837+ }
6838+ else
6839+ {
6840+ domain->n_sysdep_strings = 0;
6841+ domain->orig_sysdep_tab = NULL;
6842+ domain->trans_sysdep_tab = NULL;
6843+ }
6844+
6845+ freea (sysdep_segment_values);
6846+ }
6847+ else
6848+ {
6849+ domain->n_sysdep_strings = 0;
6850+ domain->orig_sysdep_tab = NULL;
6851+ domain->trans_sysdep_tab = NULL;
6852+ }
6853+ }
6854+ break;
6855+ }
6856 break;
6857 default:
6858 /* This is an invalid revision. */
6859+ invalid:
6860+ /* This is an invalid .mo file. */
6861+ if (domain->malloced)
6862+ free (domain->malloced);
6863 #ifdef HAVE_MMAP
6864 if (use_mmap)
6865 munmap ((caddr_t) data, size);
6866@@ -347,154 +1385,28 @@
6867 return;
6868 }
6869
6870- /* Now find out about the character set the file is encoded with.
6871- This can be found (in textual form) in the entry "". If this
6872- entry does not exist or if this does not contain the `charset='
6873- information, we will assume the charset matches the one the
6874- current locale and we don't have to perform any conversion. */
6875-#ifdef _LIBC
6876- domain->conv = (__gconv_t) -1;
6877-#else
6878-# if HAVE_ICONV
6879- domain->conv = (iconv_t) -1;
6880-# endif
6881-#endif
6882- domain->conv_tab = NULL;
6883- nullentry = _nl_find_msg (domain_file, "", &nullentrylen);
6884- if (nullentry != NULL)
6885- {
6886-#if defined _LIBC || HAVE_ICONV
6887- const char *charsetstr;
6888-
6889- charsetstr = strstr (nullentry, "charset=");
6890- if (charsetstr != NULL)
6891- {
6892- size_t len;
6893- char *charset;
6894- const char *outcharset;
6895-
6896- charsetstr += strlen ("charset=");
6897- len = strcspn (charsetstr, " \t\n");
6898-
6899- charset = (char *) alloca (len + 1);
6900-# if defined _LIBC || HAVE_MEMPCPY
6901- *((char *) mempcpy (charset, charsetstr, len)) = '\0';
6902-# else
6903- memcpy (charset, charsetstr, len);
6904- charset[len] = '\0';
6905-# endif
6906-
6907- /* The output charset should normally be determined by the
6908- locale. But sometimes the locale is not used or not correctly
6909- set up, so we provide a possibility for the user to override
6910- this. Moreover, the value specified through
6911- bind_textdomain_codeset overrides both. */
6912- if (domain_file->domainbinding != NULL
6913- && domain_file->domainbinding->codeset != NULL)
6914- outcharset = domain_file->domainbinding->codeset;
6915- else
6916- {
6917- outcharset = getenv ("OUTPUT_CHARSET");
6918- if (outcharset == NULL || outcharset[0] == '\0')
6919- {
6920-# ifdef _LIBC
6921- outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
6922-# else
6923-# if HAVE_ICONV
6924- extern const char *locale_charset (void);
6925- outcharset = locale_charset ();
6926-# endif
6927-# endif
6928- }
6929- }
6930-
6931-# ifdef _LIBC
6932- /* We always want to use transliteration. */
6933- outcharset = norm_add_slashes (outcharset, "TRANSLIT");
6934- charset = norm_add_slashes (charset, NULL);
6935- if (__gconv_open (outcharset, charset, &domain->conv,
6936- GCONV_AVOID_NOCONV)
6937- != __GCONV_OK)
6938- domain->conv = (__gconv_t) -1;
6939-# else
6940-# if HAVE_ICONV
6941- domain->conv = iconv_open (outcharset, charset);
6942-# endif
6943-# endif
6944-
6945- freea (charset);
6946- }
6947-#endif /* _LIBC || HAVE_ICONV */
6948- }
6949+ /* Now initialize the character set converter from the character set
6950+ the file is encoded with (found in the header entry) to the domain's
6951+ specified character set or the locale's character set. */
6952+ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding);
6953
6954 /* Also look for a plural specification. */
6955- if (nullentry != NULL)
6956- {
6957- const char *plural;
6958- const char *nplurals;
6959-
6960- plural = strstr (nullentry, "plural=");
6961- nplurals = strstr (nullentry, "nplurals=");
6962- if (plural == NULL || nplurals == NULL)
6963- goto no_plural;
6964- else
6965- {
6966- /* First get the number. */
6967- char *endp;
6968- unsigned long int n;
6969- struct parse_args args;
6970-
6971- nplurals += 9;
6972- while (*nplurals != '\0' && isspace (*nplurals))
6973- ++nplurals;
6974-#if defined HAVE_STRTOUL || defined _LIBC
6975- n = strtoul (nplurals, &endp, 10);
6976-#else
6977- for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
6978- n = n * 10 + (*endp - '0');
6979-#endif
6980- domain->nplurals = n;
6981- if (nplurals == endp)
6982- goto no_plural;
6983-
6984- /* Due to the restrictions bison imposes onto the interface of the
6985- scanner function we have to put the input string and the result
6986- passed up from the parser into the same structure which address
6987- is passed down to the parser. */
6988- plural += 7;
6989- args.cp = plural;
6990- if (PLURAL_PARSE (&args) != 0)
6991- goto no_plural;
6992- domain->plural = args.res;
6993- }
6994- }
6995- else
6996- {
6997- /* By default we are using the Germanic form: singular form only
6998- for `one', the plural form otherwise. Yes, this is also what
6999- English is using since English is a Germanic language. */
7000- no_plural:
7001- INIT_GERMANIC_PLURAL ();
7002- domain->plural = &germanic_plural;
7003- domain->nplurals = 2;
7004- }
7005+ EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals);
7006 }
7007
7008
7009 #ifdef _LIBC
7010 void
7011 internal_function
7012-_nl_unload_domain (domain)
7013- struct loaded_domain *domain;
7014+_nl_unload_domain (struct loaded_domain *domain)
7015 {
7016- if (domain->plural != &germanic_plural)
7017+ if (domain->plural != &__gettext_germanic_plural)
7018 __gettext_free_exp (domain->plural);
7019
7020- if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
7021- free (domain->conv_tab);
7022+ _nl_free_domain_conv (domain);
7023
7024- if (domain->conv != (__gconv_t) -1)
7025- __gconv_close (domain->conv);
7026+ if (domain->malloced)
7027+ free (domain->malloced);
7028
7029 # ifdef _POSIX_MAPPED_FILES
7030 if (domain->use_mmap)
7031diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localcharset.c psmisc-20.2.works.clean/intl/localcharset.c
7032--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localcharset.c 2001-04-13 23:00:43.000000000 -0500
7033+++ psmisc-20.2.works.clean/intl/localcharset.c 2004-10-13 15:18:41.000000000 -0500
7034@@ -1,6 +1,6 @@
7035 /* Determine a canonical name for the current locale's character encoding.
7036
7037- Copyright (C) 2000-2001 Free Software Foundation, Inc.
7038+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
7039
7040 This program is free software; you can redistribute it and/or modify it
7041 under the terms of the GNU Library General Public License as published
7042@@ -17,12 +17,15 @@
7043 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
7044 USA. */
7045
7046-/* Written by Bruno Haible <haible@clisp.cons.org>. */
7047+/* Written by Bruno Haible <bruno@clisp.org>. */
7048
7049 #ifdef HAVE_CONFIG_H
7050 # include <config.h>
7051 #endif
7052
7053+/* Specification. */
7054+#include "localcharset.h"
7055+
7056 #if HAVE_STDDEF_H
7057 # include <stddef.h>
7058 #endif
7059@@ -42,7 +45,12 @@
7060 # define WIN32
7061 #endif
7062
7063-#ifndef WIN32
7064+#if defined __EMX__
7065+/* Assume EMX program runs on OS/2, even if compiled under DOS. */
7066+# define OS2
7067+#endif
7068+
7069+#if !defined WIN32
7070 # if HAVE_LANGINFO_CODESET
7071 # include <langinfo.h>
7072 # else
7073@@ -50,10 +58,25 @@
7074 # include <locale.h>
7075 # endif
7076 # endif
7077-#else /* WIN32 */
7078+#elif defined WIN32
7079 # define WIN32_LEAN_AND_MEAN
7080 # include <windows.h>
7081 #endif
7082+#if defined OS2
7083+# define INCL_DOS
7084+# include <os2.h>
7085+#endif
7086+
7087+#if ENABLE_RELOCATABLE
7088+# include "relocatable.h"
7089+#else
7090+# define relocate(pathname) (pathname)
7091+#endif
7092+
7093+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
7094+ /* Win32, OS/2, DOS */
7095+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
7096+#endif
7097
7098 #ifndef DIRECTORY_SEPARATOR
7099 # define DIRECTORY_SEPARATOR '/'
7100@@ -63,6 +86,11 @@
7101 # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
7102 #endif
7103
7104+#if HAVE_DECL_GETC_UNLOCKED
7105+# undef getc
7106+# define getc getc_unlocked
7107+#endif
7108+
7109 /* The following static variable is declared 'volatile' to avoid a
7110 possible multithread problem in the function get_charset_aliases. If we
7111 are running in a threaded environment, and if two threads initialize
7112@@ -75,20 +103,20 @@
7113 /* Pointer to the contents of the charset.alias file, if it has already been
7114 read, else NULL. Its format is:
7115 ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
7116-static char * volatile charset_aliases;
7117+static const char * volatile charset_aliases;
7118
7119 /* Return a pointer to the contents of the charset.alias file. */
7120 static const char *
7121 get_charset_aliases ()
7122 {
7123- char *cp;
7124+ const char *cp;
7125
7126 cp = charset_aliases;
7127 if (cp == NULL)
7128 {
7129-#ifndef WIN32
7130+#if !(defined VMS || defined WIN32)
7131 FILE *fp;
7132- const char *dir = LIBDIR;
7133+ const char *dir = relocate (LIBDIR);
7134 const char *base = "charset.alias";
7135 char *file_name;
7136
7137@@ -138,19 +166,19 @@
7138 continue;
7139 }
7140 ungetc (c, fp);
7141- if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
7142+ if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
7143 break;
7144 l1 = strlen (buf1);
7145 l2 = strlen (buf2);
7146 if (res_size == 0)
7147 {
7148 res_size = l1 + 1 + l2 + 1;
7149- res_ptr = malloc (res_size + 1);
7150+ res_ptr = (char *) malloc (res_size + 1);
7151 }
7152 else
7153 {
7154 res_size += l1 + 1 + l2 + 1;
7155- res_ptr = realloc (res_ptr, res_size + 1);
7156+ res_ptr = (char *) realloc (res_ptr, res_size + 1);
7157 }
7158 if (res_ptr == NULL)
7159 {
7160@@ -174,14 +202,54 @@
7161 if (file_name != NULL)
7162 free (file_name);
7163
7164-#else /* WIN32 */
7165+#else
7166+
7167+# if defined VMS
7168+ /* To avoid the troubles of an extra file charset.alias_vms in the
7169+ sources of many GNU packages, simply inline the aliases here. */
7170+ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
7171+ "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
7172+ section 10.7 "Handling Different Character Sets". */
7173+ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
7174+ "ISO8859-2" "\0" "ISO-8859-2" "\0"
7175+ "ISO8859-5" "\0" "ISO-8859-5" "\0"
7176+ "ISO8859-7" "\0" "ISO-8859-7" "\0"
7177+ "ISO8859-8" "\0" "ISO-8859-8" "\0"
7178+ "ISO8859-9" "\0" "ISO-8859-9" "\0"
7179+ /* Japanese */
7180+ "eucJP" "\0" "EUC-JP" "\0"
7181+ "SJIS" "\0" "SHIFT_JIS" "\0"
7182+ "DECKANJI" "\0" "DEC-KANJI" "\0"
7183+ "SDECKANJI" "\0" "EUC-JP" "\0"
7184+ /* Chinese */
7185+ "eucTW" "\0" "EUC-TW" "\0"
7186+ "DECHANYU" "\0" "DEC-HANYU" "\0"
7187+ "DECHANZI" "\0" "GB2312" "\0"
7188+ /* Korean */
7189+ "DECKOREAN" "\0" "EUC-KR" "\0";
7190+# endif
7191
7192+# if defined WIN32
7193 /* To avoid the troubles of installing a separate file in the same
7194 directory as the DLL and of retrieving the DLL's directory at
7195 runtime, simply inline the aliases here. */
7196
7197 cp = "CP936" "\0" "GBK" "\0"
7198- "CP1361" "\0" "JOHAB" "\0";
7199+ "CP1361" "\0" "JOHAB" "\0"
7200+ "CP20127" "\0" "ASCII" "\0"
7201+ "CP20866" "\0" "KOI8-R" "\0"
7202+ "CP21866" "\0" "KOI8-RU" "\0"
7203+ "CP28591" "\0" "ISO-8859-1" "\0"
7204+ "CP28592" "\0" "ISO-8859-2" "\0"
7205+ "CP28593" "\0" "ISO-8859-3" "\0"
7206+ "CP28594" "\0" "ISO-8859-4" "\0"
7207+ "CP28595" "\0" "ISO-8859-5" "\0"
7208+ "CP28596" "\0" "ISO-8859-6" "\0"
7209+ "CP28597" "\0" "ISO-8859-7" "\0"
7210+ "CP28598" "\0" "ISO-8859-8" "\0"
7211+ "CP28599" "\0" "ISO-8859-9" "\0"
7212+ "CP28605" "\0" "ISO-8859-15" "\0";
7213+# endif
7214 #endif
7215
7216 charset_aliases = cp;
7217@@ -205,7 +273,7 @@
7218 const char *codeset;
7219 const char *aliases;
7220
7221-#ifndef WIN32
7222+#if !(defined WIN32 || defined OS2)
7223
7224 # if HAVE_LANGINFO_CODESET
7225
7226@@ -242,14 +310,67 @@
7227
7228 # endif
7229
7230-#else /* WIN32 */
7231+#elif defined WIN32
7232
7233 static char buf[2 + 10 + 1];
7234
7235- /* Win32 has a function returning the locale's codepage as a number. */
7236+ /* Woe32 has a function returning the locale's codepage as a number. */
7237 sprintf (buf, "CP%u", GetACP ());
7238 codeset = buf;
7239
7240+#elif defined OS2
7241+
7242+ const char *locale;
7243+ static char buf[2 + 10 + 1];
7244+ ULONG cp[3];
7245+ ULONG cplen;
7246+
7247+ /* Allow user to override the codeset, as set in the operating system,
7248+ with standard language environment variables. */
7249+ locale = getenv ("LC_ALL");
7250+ if (locale == NULL || locale[0] == '\0')
7251+ {
7252+ locale = getenv ("LC_CTYPE");
7253+ if (locale == NULL || locale[0] == '\0')
7254+ locale = getenv ("LANG");
7255+ }
7256+ if (locale != NULL && locale[0] != '\0')
7257+ {
7258+ /* If the locale name contains an encoding after the dot, return it. */
7259+ const char *dot = strchr (locale, '.');
7260+
7261+ if (dot != NULL)
7262+ {
7263+ const char *modifier;
7264+
7265+ dot++;
7266+ /* Look for the possible @... trailer and remove it, if any. */
7267+ modifier = strchr (dot, '@');
7268+ if (modifier == NULL)
7269+ return dot;
7270+ if (modifier - dot < sizeof (buf))
7271+ {
7272+ memcpy (buf, dot, modifier - dot);
7273+ buf [modifier - dot] = '\0';
7274+ return buf;
7275+ }
7276+ }
7277+
7278+ /* Resolve through the charset.alias file. */
7279+ codeset = locale;
7280+ }
7281+ else
7282+ {
7283+ /* OS/2 has a function returning the locale's codepage as a number. */
7284+ if (DosQueryCp (sizeof (cp), cp, &cplen))
7285+ codeset = "";
7286+ else
7287+ {
7288+ sprintf (buf, "CP%u", cp[0]);
7289+ codeset = buf;
7290+ }
7291+ }
7292+
7293 #endif
7294
7295 if (codeset == NULL)
7296@@ -267,5 +388,11 @@
7297 break;
7298 }
7299
7300+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
7301+ the empty string as denoting "the locale's character encoding",
7302+ thus GNU libiconv would call this function a second time. */
7303+ if (codeset[0] == '\0')
7304+ codeset = "ASCII";
7305+
7306 return codeset;
7307 }
7308diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localcharset.h psmisc-20.2.works.clean/intl/localcharset.h
7309--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localcharset.h 1969-12-31 18:00:00.000000000 -0600
7310+++ psmisc-20.2.works.clean/intl/localcharset.h 2004-10-13 15:18:41.000000000 -0500
7311@@ -0,0 +1,42 @@
7312+/* Determine a canonical name for the current locale's character encoding.
7313+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
7314+ This file is part of the GNU CHARSET Library.
7315+
7316+ This program is free software; you can redistribute it and/or modify it
7317+ under the terms of the GNU Library General Public License as published
7318+ by the Free Software Foundation; either version 2, or (at your option)
7319+ any later version.
7320+
7321+ This program is distributed in the hope that it will be useful,
7322+ but WITHOUT ANY WARRANTY; without even the implied warranty of
7323+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7324+ Library General Public License for more details.
7325+
7326+ You should have received a copy of the GNU Library General Public
7327+ License along with this program; if not, write to the Free Software
7328+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
7329+ USA. */
7330+
7331+#ifndef _LOCALCHARSET_H
7332+#define _LOCALCHARSET_H
7333+
7334+
7335+#ifdef __cplusplus
7336+extern "C" {
7337+#endif
7338+
7339+
7340+/* Determine the current locale's character encoding, and canonicalize it
7341+ into one of the canonical names listed in config.charset.
7342+ The result must not be freed; it is statically allocated.
7343+ If the canonical name cannot be determined, the result is a non-canonical
7344+ name. */
7345+extern const char * locale_charset (void);
7346+
7347+
7348+#ifdef __cplusplus
7349+}
7350+#endif
7351+
7352+
7353+#endif /* _LOCALCHARSET_H */
7354diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/locale.alias psmisc-20.2.works.clean/intl/locale.alias
7355--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/locale.alias 2001-04-13 23:00:42.000000000 -0500
7356+++ psmisc-20.2.works.clean/intl/locale.alias 2004-10-13 15:18:41.000000000 -0500
7357@@ -1,19 +1,20 @@
7358 # Locale name alias data base.
7359-# Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
7360+# Copyright (C) 1996-2001,2003 Free Software Foundation, Inc.
7361 #
7362-# This program is free software; you can redistribute it and/or modify
7363-# it under the terms of the GNU General Public License as published by
7364-# the Free Software Foundation; either version 2, or (at your option)
7365+# This program is free software; you can redistribute it and/or modify it
7366+# under the terms of the GNU Library General Public License as published
7367+# by the Free Software Foundation; either version 2, or (at your option)
7368 # any later version.
7369 #
7370 # This program is distributed in the hope that it will be useful,
7371 # but WITHOUT ANY WARRANTY; without even the implied warranty of
7372-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7373-# GNU General Public License for more details.
7374+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7375+# Library General Public License for more details.
7376 #
7377-# You should have received a copy of the GNU General Public License
7378-# along with this program; if not, write to the Free Software
7379-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7380+# You should have received a copy of the GNU Library General Public
7381+# License along with this program; if not, write to the Free Software
7382+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
7383+# USA.
7384
7385 # The format of this file is the same as for the corresponding file of
7386 # the X Window System, which normally can be found in
7387@@ -28,8 +29,8 @@
7388
7389 # Packages using this file:
7390
7391-bokmal no_NO.ISO-8859-1
7392-bokml no_NO.ISO-8859-1
7393+bokmal nb_NO.ISO-8859-1
7394+bokml nb_NO.ISO-8859-1
7395 catalan ca_ES.ISO-8859-1
7396 croatian hr_HR.ISO-8859-2
7397 czech cs_CZ.ISO-8859-2
7398@@ -46,7 +47,7 @@
7399 galician gl_ES.ISO-8859-1
7400 german de_DE.ISO-8859-1
7401 greek el_GR.ISO-8859-7
7402-hebrew iw_IL.ISO-8859-8
7403+hebrew he_IL.ISO-8859-8
7404 hrvatski hr_HR.ISO-8859-2
7405 hungarian hu_HU.ISO-8859-2
7406 icelandic is_IS.ISO-8859-1
7407@@ -60,9 +61,9 @@
7408 korean.euc ko_KR.eucKR
7409 ko_KR ko_KR.eucKR
7410 lithuanian lt_LT.ISO-8859-13
7411-nb_NO no_NO.ISO-8859-1
7412-nb_NO.ISO-8859-1 no_NO.ISO-8859-1
7413-norwegian no_NO.ISO-8859-1
7414+no_NO nb_NO.ISO-8859-1
7415+no_NO.ISO-8859-1 nb_NO.ISO-8859-1
7416+norwegian nb_NO.ISO-8859-1
7417 nynorsk nn_NO.ISO-8859-1
7418 polish pl_PL.ISO-8859-2
7419 portuguese pt_PT.ISO-8859-1
7420diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localealias.c psmisc-20.2.works.clean/intl/localealias.c
7421--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localealias.c 2001-04-13 23:00:42.000000000 -0500
7422+++ psmisc-20.2.works.clean/intl/localealias.c 2004-10-13 15:18:41.000000000 -0500
7423@@ -1,19 +1,20 @@
7424 /* Handle aliases for locale names.
7425- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
7426+ Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
7427
7428- This program is free software; you can redistribute it and/or modify
7429- it under the terms of the GNU General Public License as published by
7430- the Free Software Foundation; either version 2, or (at your option)
7431+ This program is free software; you can redistribute it and/or modify it
7432+ under the terms of the GNU Library General Public License as published
7433+ by the Free Software Foundation; either version 2, or (at your option)
7434 any later version.
7435
7436 This program is distributed in the hope that it will be useful,
7437 but WITHOUT ANY WARRANTY; without even the implied warranty of
7438- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7439- GNU General Public License for more details.
7440+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7441+ Library General Public License for more details.
7442
7443- You should have received a copy of the GNU General Public License
7444- along with this program; if not, write to the Free Software Foundation,
7445- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
7446+ You should have received a copy of the GNU Library General Public
7447+ License along with this program; if not, write to the Free Software
7448+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
7449+ USA. */
7450
7451 /* Tell glibc's <string.h> to provide a prototype for mempcpy().
7452 This must come before <config.h> because <config.h> may include
7453@@ -28,36 +29,45 @@
7454
7455 #include <ctype.h>
7456 #include <stdio.h>
7457+#if defined _LIBC || defined HAVE___FSETLOCKING
7458+# include <stdio_ext.h>
7459+#endif
7460 #include <sys/types.h>
7461
7462 #ifdef __GNUC__
7463+# undef alloca
7464 # define alloca __builtin_alloca
7465 # define HAVE_ALLOCA 1
7466 #else
7467-# if defined HAVE_ALLOCA_H || defined _LIBC
7468-# include <alloca.h>
7469+# ifdef _MSC_VER
7470+# include <malloc.h>
7471+# define alloca _alloca
7472 # else
7473-# ifdef _AIX
7474- #pragma alloca
7475+# if defined HAVE_ALLOCA_H || defined _LIBC
7476+# include <alloca.h>
7477 # else
7478-# ifndef alloca
7479+# ifdef _AIX
7480+ #pragma alloca
7481+# else
7482+# ifndef alloca
7483 char *alloca ();
7484+# endif
7485 # endif
7486 # endif
7487 # endif
7488 #endif
7489
7490 #include <stdlib.h>
7491-
7492 #include <string.h>
7493-#if !HAVE_STRCHR && !defined _LIBC
7494-# ifndef strchr
7495-# define strchr index
7496-# endif
7497-#endif
7498
7499 #include "gettextP.h"
7500
7501+#if ENABLE_RELOCATABLE
7502+# include "relocatable.h"
7503+#else
7504+# define relocate(pathname) (pathname)
7505+#endif
7506+
7507 /* @@ end of prolog @@ */
7508
7509 #ifdef _LIBC
7510@@ -70,6 +80,7 @@
7511 # define mempcpy __mempcpy
7512 # endif
7513 # define HAVE_MEMPCPY 1
7514+# define HAVE___FSETLOCKING 1
7515
7516 /* We need locking here since we can be called from different places. */
7517 # include <bits/libc-lock.h>
7518@@ -81,6 +92,15 @@
7519 # define internal_function
7520 #endif
7521
7522+/* Some optimizations for glibc. */
7523+#ifdef _LIBC
7524+# define FEOF(fp) feof_unlocked (fp)
7525+# define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp)
7526+#else
7527+# define FEOF(fp) feof (fp)
7528+# define FGETS(buf, n, fp) fgets (buf, n, fp)
7529+#endif
7530+
7531 /* For those losing systems which don't have `alloca' we have to add
7532 some additional code emulating it. */
7533 #ifdef HAVE_ALLOCA
7534@@ -90,11 +110,11 @@
7535 # define freea(p) free (p)
7536 #endif
7537
7538-#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED
7539+#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED
7540 # undef fgets
7541 # define fgets(buf, len, s) fgets_unlocked (buf, len, s)
7542 #endif
7543-#if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED
7544+#if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED
7545 # undef feof
7546 # define feof(s) feof_unlocked (s)
7547 #endif
7548@@ -107,27 +127,30 @@
7549 };
7550
7551
7552-static char *string_space;
7553+#ifndef _LIBC
7554+# define libc_freeres_ptr(decl) decl
7555+#endif
7556+
7557+libc_freeres_ptr (static char *string_space);
7558 static size_t string_space_act;
7559 static size_t string_space_max;
7560-static struct alias_map *map;
7561+libc_freeres_ptr (static struct alias_map *map);
7562 static size_t nmap;
7563 static size_t maxmap;
7564
7565
7566 /* Prototypes for local functions. */
7567-static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
7568+static size_t read_alias_file (const char *fname, int fname_len)
7569 internal_function;
7570-static int extend_alias_table PARAMS ((void));
7571-static int alias_compare PARAMS ((const struct alias_map *map1,
7572- const struct alias_map *map2));
7573+static int extend_alias_table (void);
7574+static int alias_compare (const struct alias_map *map1,
7575+ const struct alias_map *map2);
7576
7577
7578 const char *
7579-_nl_expand_alias (name)
7580- const char *name;
7581+_nl_expand_alias (const char *name)
7582 {
7583- static const char *locale_alias_path = LOCALE_ALIAS_PATH;
7584+ static const char *locale_alias_path;
7585 struct alias_map *retval;
7586 const char *result = NULL;
7587 size_t added;
7588@@ -136,6 +159,9 @@
7589 __libc_lock_lock (lock);
7590 #endif
7591
7592+ if (locale_alias_path == NULL)
7593+ locale_alias_path = LOCALE_ALIAS_PATH;
7594+
7595 do
7596 {
7597 struct alias_map item;
7598@@ -145,8 +171,8 @@
7599 if (nmap > 0)
7600 retval = (struct alias_map *) bsearch (&item, map, nmap,
7601 sizeof (struct alias_map),
7602- (int (*) PARAMS ((const void *,
7603- const void *))
7604+ (int (*) (const void *,
7605+ const void *)
7606 ) alias_compare);
7607 else
7608 retval = NULL;
7609@@ -188,9 +214,7 @@
7610
7611 static size_t
7612 internal_function
7613-read_alias_file (fname, fname_len)
7614- const char *fname;
7615- int fname_len;
7616+read_alias_file (const char *fname, int fname_len)
7617 {
7618 FILE *fp;
7619 char *full_fname;
7620@@ -206,58 +230,52 @@
7621 memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
7622 #endif
7623
7624- fp = fopen (full_fname, "r");
7625+ fp = fopen (relocate (full_fname), "r");
7626 freea (full_fname);
7627 if (fp == NULL)
7628 return 0;
7629
7630+#ifdef HAVE___FSETLOCKING
7631+ /* No threads present. */
7632+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
7633+#endif
7634+
7635 added = 0;
7636- while (!feof (fp))
7637+ while (!FEOF (fp))
7638 {
7639 /* It is a reasonable approach to use a fix buffer here because
7640 a) we are only interested in the first two fields
7641 b) these fields must be usable as file names and so must not
7642 be that long
7643- */
7644- char buf[BUFSIZ];
7645+ We avoid a multi-kilobyte buffer here since this would use up
7646+ stack space which we might not have if the program ran out of
7647+ memory. */
7648+ char buf[400];
7649 char *alias;
7650 char *value;
7651 char *cp;
7652
7653- if (fgets (buf, sizeof buf, fp) == NULL)
7654+ if (FGETS (buf, sizeof buf, fp) == NULL)
7655 /* EOF reached. */
7656 break;
7657
7658- /* Possibly not the whole line fits into the buffer. Ignore
7659- the rest of the line. */
7660- if (strchr (buf, '\n') == NULL)
7661- {
7662- char altbuf[BUFSIZ];
7663- do
7664- if (fgets (altbuf, sizeof altbuf, fp) == NULL)
7665- /* Make sure the inner loop will be left. The outer loop
7666- will exit at the `feof' test. */
7667- break;
7668- while (strchr (altbuf, '\n') == NULL);
7669- }
7670-
7671 cp = buf;
7672 /* Ignore leading white space. */
7673- while (isspace (cp[0]))
7674+ while (isspace ((unsigned char) cp[0]))
7675 ++cp;
7676
7677 /* A leading '#' signals a comment line. */
7678 if (cp[0] != '\0' && cp[0] != '#')
7679 {
7680 alias = cp++;
7681- while (cp[0] != '\0' && !isspace (cp[0]))
7682+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
7683 ++cp;
7684 /* Terminate alias name. */
7685 if (cp[0] != '\0')
7686 *cp++ = '\0';
7687
7688 /* Now look for the beginning of the value. */
7689- while (isspace (cp[0]))
7690+ while (isspace ((unsigned char) cp[0]))
7691 ++cp;
7692
7693 if (cp[0] != '\0')
7694@@ -266,7 +284,7 @@
7695 size_t value_len;
7696
7697 value = cp++;
7698- while (cp[0] != '\0' && !isspace (cp[0]))
7699+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
7700 ++cp;
7701 /* Terminate value. */
7702 if (cp[0] == '\n')
7703@@ -324,6 +342,14 @@
7704 ++added;
7705 }
7706 }
7707+
7708+ /* Possibly not the whole line fits into the buffer. Ignore
7709+ the rest of the line. */
7710+ while (strchr (buf, '\n') == NULL)
7711+ if (FGETS (buf, sizeof buf, fp) == NULL)
7712+ /* Make sure the inner loop will be left. The outer loop
7713+ will exit at the `feof' test. */
7714+ break;
7715 }
7716
7717 /* Should we test for ferror()? I think we have to silently ignore
7718@@ -332,7 +358,7 @@
7719
7720 if (added > 0)
7721 qsort (map, nmap, sizeof (struct alias_map),
7722- (int (*) PARAMS ((const void *, const void *))) alias_compare);
7723+ (int (*) (const void *, const void *)) alias_compare);
7724
7725 return added;
7726 }
7727@@ -357,23 +383,8 @@
7728 }
7729
7730
7731-#ifdef _LIBC
7732-static void __attribute__ ((unused))
7733-free_mem (void)
7734-{
7735- if (string_space != NULL)
7736- free (string_space);
7737- if (map != NULL)
7738- free (map);
7739-}
7740-text_set_element (__libc_subfreeres, free_mem);
7741-#endif
7742-
7743-
7744 static int
7745-alias_compare (map1, map2)
7746- const struct alias_map *map1;
7747- const struct alias_map *map2;
7748+alias_compare (const struct alias_map *map1, const struct alias_map *map2)
7749 {
7750 #if defined _LIBC || defined HAVE_STRCASECMP
7751 return strcasecmp (map1->alias, map2->alias);
7752diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localename.c psmisc-20.2.works.clean/intl/localename.c
7753--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/localename.c 1969-12-31 18:00:00.000000000 -0600
7754+++ psmisc-20.2.works.clean/intl/localename.c 2004-10-13 15:18:41.000000000 -0500
7755@@ -0,0 +1,1142 @@
7756+/* Determine the current selected locale.
7757+ Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
7758+
7759+ This program is free software; you can redistribute it and/or modify it
7760+ under the terms of the GNU Library General Public License as published
7761+ by the Free Software Foundation; either version 2, or (at your option)
7762+ any later version.
7763+
7764+ This program is distributed in the hope that it will be useful,
7765+ but WITHOUT ANY WARRANTY; without even the implied warranty of
7766+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7767+ Library General Public License for more details.
7768+
7769+ You should have received a copy of the GNU Library General Public
7770+ License along with this program; if not, write to the Free Software
7771+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
7772+ USA. */
7773+
7774+/* Written by Ulrich Drepper <drepper@gnu.org>, 1995. */
7775+/* Win32 code written by Tor Lillqvist <tml@iki.fi>. */
7776+
7777+#ifdef HAVE_CONFIG_H
7778+# include <config.h>
7779+#endif
7780+
7781+#include <stdlib.h>
7782+#include <locale.h>
7783+
7784+#if defined _WIN32 || defined __WIN32__
7785+# undef WIN32 /* avoid warning on mingw32 */
7786+# define WIN32
7787+#endif
7788+
7789+#ifdef WIN32
7790+# define WIN32_LEAN_AND_MEAN
7791+# include <windows.h>
7792+/* List of language codes, sorted by value:
7793+ 0x01 LANG_ARABIC
7794+ 0x02 LANG_BULGARIAN
7795+ 0x03 LANG_CATALAN
7796+ 0x04 LANG_CHINESE
7797+ 0x05 LANG_CZECH
7798+ 0x06 LANG_DANISH
7799+ 0x07 LANG_GERMAN
7800+ 0x08 LANG_GREEK
7801+ 0x09 LANG_ENGLISH
7802+ 0x0a LANG_SPANISH
7803+ 0x0b LANG_FINNISH
7804+ 0x0c LANG_FRENCH
7805+ 0x0d LANG_HEBREW
7806+ 0x0e LANG_HUNGARIAN
7807+ 0x0f LANG_ICELANDIC
7808+ 0x10 LANG_ITALIAN
7809+ 0x11 LANG_JAPANESE
7810+ 0x12 LANG_KOREAN
7811+ 0x13 LANG_DUTCH
7812+ 0x14 LANG_NORWEGIAN
7813+ 0x15 LANG_POLISH
7814+ 0x16 LANG_PORTUGUESE
7815+ 0x17 LANG_RHAETO_ROMANCE
7816+ 0x18 LANG_ROMANIAN
7817+ 0x19 LANG_RUSSIAN
7818+ 0x1a LANG_CROATIAN == LANG_SERBIAN
7819+ 0x1b LANG_SLOVAK
7820+ 0x1c LANG_ALBANIAN
7821+ 0x1d LANG_SWEDISH
7822+ 0x1e LANG_THAI
7823+ 0x1f LANG_TURKISH
7824+ 0x20 LANG_URDU
7825+ 0x21 LANG_INDONESIAN
7826+ 0x22 LANG_UKRAINIAN
7827+ 0x23 LANG_BELARUSIAN
7828+ 0x24 LANG_SLOVENIAN
7829+ 0x25 LANG_ESTONIAN
7830+ 0x26 LANG_LATVIAN
7831+ 0x27 LANG_LITHUANIAN
7832+ 0x28 LANG_TAJIK
7833+ 0x29 LANG_FARSI
7834+ 0x2a LANG_VIETNAMESE
7835+ 0x2b LANG_ARMENIAN
7836+ 0x2c LANG_AZERI
7837+ 0x2d LANG_BASQUE
7838+ 0x2e LANG_SORBIAN
7839+ 0x2f LANG_MACEDONIAN
7840+ 0x30 LANG_SUTU
7841+ 0x31 LANG_TSONGA
7842+ 0x32 LANG_TSWANA
7843+ 0x33 LANG_VENDA
7844+ 0x34 LANG_XHOSA
7845+ 0x35 LANG_ZULU
7846+ 0x36 LANG_AFRIKAANS
7847+ 0x37 LANG_GEORGIAN
7848+ 0x38 LANG_FAEROESE
7849+ 0x39 LANG_HINDI
7850+ 0x3a LANG_MALTESE
7851+ 0x3b LANG_SAAMI
7852+ 0x3c LANG_GAELIC
7853+ 0x3d LANG_YIDDISH
7854+ 0x3e LANG_MALAY
7855+ 0x3f LANG_KAZAK
7856+ 0x40 LANG_KYRGYZ
7857+ 0x41 LANG_SWAHILI
7858+ 0x42 LANG_TURKMEN
7859+ 0x43 LANG_UZBEK
7860+ 0x44 LANG_TATAR
7861+ 0x45 LANG_BENGALI
7862+ 0x46 LANG_PUNJABI
7863+ 0x47 LANG_GUJARATI
7864+ 0x48 LANG_ORIYA
7865+ 0x49 LANG_TAMIL
7866+ 0x4a LANG_TELUGU
7867+ 0x4b LANG_KANNADA
7868+ 0x4c LANG_MALAYALAM
7869+ 0x4d LANG_ASSAMESE
7870+ 0x4e LANG_MARATHI
7871+ 0x4f LANG_SANSKRIT
7872+ 0x50 LANG_MONGOLIAN
7873+ 0x51 LANG_TIBETAN
7874+ 0x52 LANG_WELSH
7875+ 0x53 LANG_CAMBODIAN
7876+ 0x54 LANG_LAO
7877+ 0x55 LANG_BURMESE
7878+ 0x56 LANG_GALICIAN
7879+ 0x57 LANG_KONKANI
7880+ 0x58 LANG_MANIPURI
7881+ 0x59 LANG_SINDHI
7882+ 0x5a LANG_SYRIAC
7883+ 0x5b LANG_SINHALESE
7884+ 0x5c LANG_CHEROKEE
7885+ 0x5d LANG_INUKTITUT
7886+ 0x5e LANG_AMHARIC
7887+ 0x5f LANG_TAMAZIGHT
7888+ 0x60 LANG_KASHMIRI
7889+ 0x61 LANG_NEPALI
7890+ 0x62 LANG_FRISIAN
7891+ 0x63 LANG_PASHTO
7892+ 0x64 LANG_TAGALOG
7893+ 0x65 LANG_DIVEHI
7894+ 0x66 LANG_EDO
7895+ 0x67 LANG_FULFULDE
7896+ 0x68 LANG_HAUSA
7897+ 0x69 LANG_IBIBIO
7898+ 0x6a LANG_YORUBA
7899+ 0x70 LANG_IGBO
7900+ 0x71 LANG_KANURI
7901+ 0x72 LANG_OROMO
7902+ 0x73 LANG_TIGRINYA
7903+ 0x74 LANG_GUARANI
7904+ 0x75 LANG_HAWAIIAN
7905+ 0x76 LANG_LATIN
7906+ 0x77 LANG_SOMALI
7907+ 0x78 LANG_YI
7908+ 0x79 LANG_PAPIAMENTU
7909+*/
7910+/* Mingw headers don't have latest language and sublanguage codes. */
7911+# ifndef LANG_AFRIKAANS
7912+# define LANG_AFRIKAANS 0x36
7913+# endif
7914+# ifndef LANG_ALBANIAN
7915+# define LANG_ALBANIAN 0x1c
7916+# endif
7917+# ifndef LANG_AMHARIC
7918+# define LANG_AMHARIC 0x5e
7919+# endif
7920+# ifndef LANG_ARABIC
7921+# define LANG_ARABIC 0x01
7922+# endif
7923+# ifndef LANG_ARMENIAN
7924+# define LANG_ARMENIAN 0x2b
7925+# endif
7926+# ifndef LANG_ASSAMESE
7927+# define LANG_ASSAMESE 0x4d
7928+# endif
7929+# ifndef LANG_AZERI
7930+# define LANG_AZERI 0x2c
7931+# endif
7932+# ifndef LANG_BASQUE
7933+# define LANG_BASQUE 0x2d
7934+# endif
7935+# ifndef LANG_BELARUSIAN
7936+# define LANG_BELARUSIAN 0x23
7937+# endif
7938+# ifndef LANG_BENGALI
7939+# define LANG_BENGALI 0x45
7940+# endif
7941+# ifndef LANG_BURMESE
7942+# define LANG_BURMESE 0x55
7943+# endif
7944+# ifndef LANG_CAMBODIAN
7945+# define LANG_CAMBODIAN 0x53
7946+# endif
7947+# ifndef LANG_CATALAN
7948+# define LANG_CATALAN 0x03
7949+# endif
7950+# ifndef LANG_CHEROKEE
7951+# define LANG_CHEROKEE 0x5c
7952+# endif
7953+# ifndef LANG_DIVEHI
7954+# define LANG_DIVEHI 0x65
7955+# endif
7956+# ifndef LANG_EDO
7957+# define LANG_EDO 0x66
7958+# endif
7959+# ifndef LANG_ESTONIAN
7960+# define LANG_ESTONIAN 0x25
7961+# endif
7962+# ifndef LANG_FAEROESE
7963+# define LANG_FAEROESE 0x38
7964+# endif
7965+# ifndef LANG_FARSI
7966+# define LANG_FARSI 0x29
7967+# endif
7968+# ifndef LANG_FRISIAN
7969+# define LANG_FRISIAN 0x62
7970+# endif
7971+# ifndef LANG_FULFULDE
7972+# define LANG_FULFULDE 0x67
7973+# endif
7974+# ifndef LANG_GAELIC
7975+# define LANG_GAELIC 0x3c
7976+# endif
7977+# ifndef LANG_GALICIAN
7978+# define LANG_GALICIAN 0x56
7979+# endif
7980+# ifndef LANG_GEORGIAN
7981+# define LANG_GEORGIAN 0x37
7982+# endif
7983+# ifndef LANG_GUARANI
7984+# define LANG_GUARANI 0x74
7985+# endif
7986+# ifndef LANG_GUJARATI
7987+# define LANG_GUJARATI 0x47
7988+# endif
7989+# ifndef LANG_HAUSA
7990+# define LANG_HAUSA 0x68
7991+# endif
7992+# ifndef LANG_HAWAIIAN
7993+# define LANG_HAWAIIAN 0x75
7994+# endif
7995+# ifndef LANG_HEBREW
7996+# define LANG_HEBREW 0x0d
7997+# endif
7998+# ifndef LANG_HINDI
7999+# define LANG_HINDI 0x39
8000+# endif
8001+# ifndef LANG_IBIBIO
8002+# define LANG_IBIBIO 0x69
8003+# endif
8004+# ifndef LANG_IGBO
8005+# define LANG_IGBO 0x70
8006+# endif
8007+# ifndef LANG_INDONESIAN
8008+# define LANG_INDONESIAN 0x21
8009+# endif
8010+# ifndef LANG_INUKTITUT
8011+# define LANG_INUKTITUT 0x5d
8012+# endif
8013+# ifndef LANG_KANNADA
8014+# define LANG_KANNADA 0x4b
8015+# endif
8016+# ifndef LANG_KANURI
8017+# define LANG_KANURI 0x71
8018+# endif
8019+# ifndef LANG_KASHMIRI
8020+# define LANG_KASHMIRI 0x60
8021+# endif
8022+# ifndef LANG_KAZAK
8023+# define LANG_KAZAK 0x3f
8024+# endif
8025+# ifndef LANG_KONKANI
8026+# define LANG_KONKANI 0x57
8027+# endif
8028+# ifndef LANG_KYRGYZ
8029+# define LANG_KYRGYZ 0x40
8030+# endif
8031+# ifndef LANG_LAO
8032+# define LANG_LAO 0x54
8033+# endif
8034+# ifndef LANG_LATIN
8035+# define LANG_LATIN 0x76
8036+# endif
8037+# ifndef LANG_LATVIAN
8038+# define LANG_LATVIAN 0x26
8039+# endif
8040+# ifndef LANG_LITHUANIAN
8041+# define LANG_LITHUANIAN 0x27
8042+# endif
8043+# ifndef LANG_MACEDONIAN
8044+# define LANG_MACEDONIAN 0x2f
8045+# endif
8046+# ifndef LANG_MALAY
8047+# define LANG_MALAY 0x3e
8048+# endif
8049+# ifndef LANG_MALAYALAM
8050+# define LANG_MALAYALAM 0x4c
8051+# endif
8052+# ifndef LANG_MALTESE
8053+# define LANG_MALTESE 0x3a
8054+# endif
8055+# ifndef LANG_MANIPURI
8056+# define LANG_MANIPURI 0x58
8057+# endif
8058+# ifndef LANG_MARATHI
8059+# define LANG_MARATHI 0x4e
8060+# endif
8061+# ifndef LANG_MONGOLIAN
8062+# define LANG_MONGOLIAN 0x50
8063+# endif
8064+# ifndef LANG_NEPALI
8065+# define LANG_NEPALI 0x61
8066+# endif
8067+# ifndef LANG_ORIYA
8068+# define LANG_ORIYA 0x48
8069+# endif
8070+# ifndef LANG_OROMO
8071+# define LANG_OROMO 0x72
8072+# endif
8073+# ifndef LANG_PAPIAMENTU
8074+# define LANG_PAPIAMENTU 0x79
8075+# endif
8076+# ifndef LANG_PASHTO
8077+# define LANG_PASHTO 0x63
8078+# endif
8079+# ifndef LANG_PUNJABI
8080+# define LANG_PUNJABI 0x46
8081+# endif
8082+# ifndef LANG_RHAETO_ROMANCE
8083+# define LANG_RHAETO_ROMANCE 0x17
8084+# endif
8085+# ifndef LANG_SAAMI
8086+# define LANG_SAAMI 0x3b
8087+# endif
8088+# ifndef LANG_SANSKRIT
8089+# define LANG_SANSKRIT 0x4f
8090+# endif
8091+# ifndef LANG_SERBIAN
8092+# define LANG_SERBIAN 0x1a
8093+# endif
8094+# ifndef LANG_SINDHI
8095+# define LANG_SINDHI 0x59
8096+# endif
8097+# ifndef LANG_SINHALESE
8098+# define LANG_SINHALESE 0x5b
8099+# endif
8100+# ifndef LANG_SLOVAK
8101+# define LANG_SLOVAK 0x1b
8102+# endif
8103+# ifndef LANG_SOMALI
8104+# define LANG_SOMALI 0x77
8105+# endif
8106+# ifndef LANG_SORBIAN
8107+# define LANG_SORBIAN 0x2e
8108+# endif
8109+# ifndef LANG_SUTU
8110+# define LANG_SUTU 0x30
8111+# endif
8112+# ifndef LANG_SWAHILI
8113+# define LANG_SWAHILI 0x41
8114+# endif
8115+# ifndef LANG_SYRIAC
8116+# define LANG_SYRIAC 0x5a
8117+# endif
8118+# ifndef LANG_TAGALOG
8119+# define LANG_TAGALOG 0x64
8120+# endif
8121+# ifndef LANG_TAJIK
8122+# define LANG_TAJIK 0x28
8123+# endif
8124+# ifndef LANG_TAMAZIGHT
8125+# define LANG_TAMAZIGHT 0x5f
8126+# endif
8127+# ifndef LANG_TAMIL
8128+# define LANG_TAMIL 0x49
8129+# endif
8130+# ifndef LANG_TATAR
8131+# define LANG_TATAR 0x44
8132+# endif
8133+# ifndef LANG_TELUGU
8134+# define LANG_TELUGU 0x4a
8135+# endif
8136+# ifndef LANG_THAI
8137+# define LANG_THAI 0x1e
8138+# endif
8139+# ifndef LANG_TIBETAN
8140+# define LANG_TIBETAN 0x51
8141+# endif
8142+# ifndef LANG_TIGRINYA
8143+# define LANG_TIGRINYA 0x73
8144+# endif
8145+# ifndef LANG_TSONGA
8146+# define LANG_TSONGA 0x31
8147+# endif
8148+# ifndef LANG_TSWANA
8149+# define LANG_TSWANA 0x32
8150+# endif
8151+# ifndef LANG_TURKMEN
8152+# define LANG_TURKMEN 0x42
8153+# endif
8154+# ifndef LANG_UKRAINIAN
8155+# define LANG_UKRAINIAN 0x22
8156+# endif
8157+# ifndef LANG_URDU
8158+# define LANG_URDU 0x20
8159+# endif
8160+# ifndef LANG_UZBEK
8161+# define LANG_UZBEK 0x43
8162+# endif
8163+# ifndef LANG_VENDA
8164+# define LANG_VENDA 0x33
8165+# endif
8166+# ifndef LANG_VIETNAMESE
8167+# define LANG_VIETNAMESE 0x2a
8168+# endif
8169+# ifndef LANG_WELSH
8170+# define LANG_WELSH 0x52
8171+# endif
8172+# ifndef LANG_XHOSA
8173+# define LANG_XHOSA 0x34
8174+# endif
8175+# ifndef LANG_YI
8176+# define LANG_YI 0x78
8177+# endif
8178+# ifndef LANG_YIDDISH
8179+# define LANG_YIDDISH 0x3d
8180+# endif
8181+# ifndef LANG_YORUBA
8182+# define LANG_YORUBA 0x6a
8183+# endif
8184+# ifndef LANG_ZULU
8185+# define LANG_ZULU 0x35
8186+# endif
8187+# ifndef SUBLANG_ARABIC_SAUDI_ARABIA
8188+# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
8189+# endif
8190+# ifndef SUBLANG_ARABIC_IRAQ
8191+# define SUBLANG_ARABIC_IRAQ 0x02
8192+# endif
8193+# ifndef SUBLANG_ARABIC_EGYPT
8194+# define SUBLANG_ARABIC_EGYPT 0x03
8195+# endif
8196+# ifndef SUBLANG_ARABIC_LIBYA
8197+# define SUBLANG_ARABIC_LIBYA 0x04
8198+# endif
8199+# ifndef SUBLANG_ARABIC_ALGERIA
8200+# define SUBLANG_ARABIC_ALGERIA 0x05
8201+# endif
8202+# ifndef SUBLANG_ARABIC_MOROCCO
8203+# define SUBLANG_ARABIC_MOROCCO 0x06
8204+# endif
8205+# ifndef SUBLANG_ARABIC_TUNISIA
8206+# define SUBLANG_ARABIC_TUNISIA 0x07
8207+# endif
8208+# ifndef SUBLANG_ARABIC_OMAN
8209+# define SUBLANG_ARABIC_OMAN 0x08
8210+# endif
8211+# ifndef SUBLANG_ARABIC_YEMEN
8212+# define SUBLANG_ARABIC_YEMEN 0x09
8213+# endif
8214+# ifndef SUBLANG_ARABIC_SYRIA
8215+# define SUBLANG_ARABIC_SYRIA 0x0a
8216+# endif
8217+# ifndef SUBLANG_ARABIC_JORDAN
8218+# define SUBLANG_ARABIC_JORDAN 0x0b
8219+# endif
8220+# ifndef SUBLANG_ARABIC_LEBANON
8221+# define SUBLANG_ARABIC_LEBANON 0x0c
8222+# endif
8223+# ifndef SUBLANG_ARABIC_KUWAIT
8224+# define SUBLANG_ARABIC_KUWAIT 0x0d
8225+# endif
8226+# ifndef SUBLANG_ARABIC_UAE
8227+# define SUBLANG_ARABIC_UAE 0x0e
8228+# endif
8229+# ifndef SUBLANG_ARABIC_BAHRAIN
8230+# define SUBLANG_ARABIC_BAHRAIN 0x0f
8231+# endif
8232+# ifndef SUBLANG_ARABIC_QATAR
8233+# define SUBLANG_ARABIC_QATAR 0x10
8234+# endif
8235+# ifndef SUBLANG_AZERI_LATIN
8236+# define SUBLANG_AZERI_LATIN 0x01
8237+# endif
8238+# ifndef SUBLANG_AZERI_CYRILLIC
8239+# define SUBLANG_AZERI_CYRILLIC 0x02
8240+# endif
8241+# ifndef SUBLANG_BENGALI_INDIA
8242+# define SUBLANG_BENGALI_INDIA 0x00
8243+# endif
8244+# ifndef SUBLANG_BENGALI_BANGLADESH
8245+# define SUBLANG_BENGALI_BANGLADESH 0x01
8246+# endif
8247+# ifndef SUBLANG_CHINESE_MACAU
8248+# define SUBLANG_CHINESE_MACAU 0x05
8249+# endif
8250+# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
8251+# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
8252+# endif
8253+# ifndef SUBLANG_ENGLISH_JAMAICA
8254+# define SUBLANG_ENGLISH_JAMAICA 0x08
8255+# endif
8256+# ifndef SUBLANG_ENGLISH_CARIBBEAN
8257+# define SUBLANG_ENGLISH_CARIBBEAN 0x09
8258+# endif
8259+# ifndef SUBLANG_ENGLISH_BELIZE
8260+# define SUBLANG_ENGLISH_BELIZE 0x0a
8261+# endif
8262+# ifndef SUBLANG_ENGLISH_TRINIDAD
8263+# define SUBLANG_ENGLISH_TRINIDAD 0x0b
8264+# endif
8265+# ifndef SUBLANG_ENGLISH_ZIMBABWE
8266+# define SUBLANG_ENGLISH_ZIMBABWE 0x0c
8267+# endif
8268+# ifndef SUBLANG_ENGLISH_PHILIPPINES
8269+# define SUBLANG_ENGLISH_PHILIPPINES 0x0d
8270+# endif
8271+# ifndef SUBLANG_ENGLISH_INDONESIA
8272+# define SUBLANG_ENGLISH_INDONESIA 0x0e
8273+# endif
8274+# ifndef SUBLANG_ENGLISH_HONGKONG
8275+# define SUBLANG_ENGLISH_HONGKONG 0x0f
8276+# endif
8277+# ifndef SUBLANG_ENGLISH_INDIA
8278+# define SUBLANG_ENGLISH_INDIA 0x10
8279+# endif
8280+# ifndef SUBLANG_ENGLISH_MALAYSIA
8281+# define SUBLANG_ENGLISH_MALAYSIA 0x11
8282+# endif
8283+# ifndef SUBLANG_ENGLISH_SINGAPORE
8284+# define SUBLANG_ENGLISH_SINGAPORE 0x12
8285+# endif
8286+# ifndef SUBLANG_FRENCH_LUXEMBOURG
8287+# define SUBLANG_FRENCH_LUXEMBOURG 0x05
8288+# endif
8289+# ifndef SUBLANG_FRENCH_MONACO
8290+# define SUBLANG_FRENCH_MONACO 0x06
8291+# endif
8292+# ifndef SUBLANG_FRENCH_WESTINDIES
8293+# define SUBLANG_FRENCH_WESTINDIES 0x07
8294+# endif
8295+# ifndef SUBLANG_FRENCH_REUNION
8296+# define SUBLANG_FRENCH_REUNION 0x08
8297+# endif
8298+# ifndef SUBLANG_FRENCH_CONGO
8299+# define SUBLANG_FRENCH_CONGO 0x09
8300+# endif
8301+# ifndef SUBLANG_FRENCH_SENEGAL
8302+# define SUBLANG_FRENCH_SENEGAL 0x0a
8303+# endif
8304+# ifndef SUBLANG_FRENCH_CAMEROON
8305+# define SUBLANG_FRENCH_CAMEROON 0x0b
8306+# endif
8307+# ifndef SUBLANG_FRENCH_COTEDIVOIRE
8308+# define SUBLANG_FRENCH_COTEDIVOIRE 0x0c
8309+# endif
8310+# ifndef SUBLANG_FRENCH_MALI
8311+# define SUBLANG_FRENCH_MALI 0x0d
8312+# endif
8313+# ifndef SUBLANG_FRENCH_MOROCCO
8314+# define SUBLANG_FRENCH_MOROCCO 0x0e
8315+# endif
8316+# ifndef SUBLANG_FRENCH_HAITI
8317+# define SUBLANG_FRENCH_HAITI 0x0f
8318+# endif
8319+# ifndef SUBLANG_GERMAN_LUXEMBOURG
8320+# define SUBLANG_GERMAN_LUXEMBOURG 0x04
8321+# endif
8322+# ifndef SUBLANG_GERMAN_LIECHTENSTEIN
8323+# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
8324+# endif
8325+# ifndef SUBLANG_KASHMIRI_INDIA
8326+# define SUBLANG_KASHMIRI_INDIA 0x02
8327+# endif
8328+# ifndef SUBLANG_MALAY_MALAYSIA
8329+# define SUBLANG_MALAY_MALAYSIA 0x01
8330+# endif
8331+# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
8332+# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
8333+# endif
8334+# ifndef SUBLANG_NEPALI_INDIA
8335+# define SUBLANG_NEPALI_INDIA 0x02
8336+# endif
8337+# ifndef SUBLANG_PUNJABI_INDIA
8338+# define SUBLANG_PUNJABI_INDIA 0x00
8339+# endif
8340+# ifndef SUBLANG_PUNJABI_PAKISTAN
8341+# define SUBLANG_PUNJABI_PAKISTAN 0x01
8342+# endif
8343+# ifndef SUBLANG_ROMANIAN_ROMANIA
8344+# define SUBLANG_ROMANIAN_ROMANIA 0x00
8345+# endif
8346+# ifndef SUBLANG_ROMANIAN_MOLDOVA
8347+# define SUBLANG_ROMANIAN_MOLDOVA 0x01
8348+# endif
8349+# ifndef SUBLANG_SERBIAN_LATIN
8350+# define SUBLANG_SERBIAN_LATIN 0x02
8351+# endif
8352+# ifndef SUBLANG_SERBIAN_CYRILLIC
8353+# define SUBLANG_SERBIAN_CYRILLIC 0x03
8354+# endif
8355+# ifndef SUBLANG_SINDHI_INDIA
8356+# define SUBLANG_SINDHI_INDIA 0x00
8357+# endif
8358+# ifndef SUBLANG_SINDHI_PAKISTAN
8359+# define SUBLANG_SINDHI_PAKISTAN 0x01
8360+# endif
8361+# ifndef SUBLANG_SPANISH_GUATEMALA
8362+# define SUBLANG_SPANISH_GUATEMALA 0x04
8363+# endif
8364+# ifndef SUBLANG_SPANISH_COSTA_RICA
8365+# define SUBLANG_SPANISH_COSTA_RICA 0x05
8366+# endif
8367+# ifndef SUBLANG_SPANISH_PANAMA
8368+# define SUBLANG_SPANISH_PANAMA 0x06
8369+# endif
8370+# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
8371+# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
8372+# endif
8373+# ifndef SUBLANG_SPANISH_VENEZUELA
8374+# define SUBLANG_SPANISH_VENEZUELA 0x08
8375+# endif
8376+# ifndef SUBLANG_SPANISH_COLOMBIA
8377+# define SUBLANG_SPANISH_COLOMBIA 0x09
8378+# endif
8379+# ifndef SUBLANG_SPANISH_PERU
8380+# define SUBLANG_SPANISH_PERU 0x0a
8381+# endif
8382+# ifndef SUBLANG_SPANISH_ARGENTINA
8383+# define SUBLANG_SPANISH_ARGENTINA 0x0b
8384+# endif
8385+# ifndef SUBLANG_SPANISH_ECUADOR
8386+# define SUBLANG_SPANISH_ECUADOR 0x0c
8387+# endif
8388+# ifndef SUBLANG_SPANISH_CHILE
8389+# define SUBLANG_SPANISH_CHILE 0x0d
8390+# endif
8391+# ifndef SUBLANG_SPANISH_URUGUAY
8392+# define SUBLANG_SPANISH_URUGUAY 0x0e
8393+# endif
8394+# ifndef SUBLANG_SPANISH_PARAGUAY
8395+# define SUBLANG_SPANISH_PARAGUAY 0x0f
8396+# endif
8397+# ifndef SUBLANG_SPANISH_BOLIVIA
8398+# define SUBLANG_SPANISH_BOLIVIA 0x10
8399+# endif
8400+# ifndef SUBLANG_SPANISH_EL_SALVADOR
8401+# define SUBLANG_SPANISH_EL_SALVADOR 0x11
8402+# endif
8403+# ifndef SUBLANG_SPANISH_HONDURAS
8404+# define SUBLANG_SPANISH_HONDURAS 0x12
8405+# endif
8406+# ifndef SUBLANG_SPANISH_NICARAGUA
8407+# define SUBLANG_SPANISH_NICARAGUA 0x13
8408+# endif
8409+# ifndef SUBLANG_SPANISH_PUERTO_RICO
8410+# define SUBLANG_SPANISH_PUERTO_RICO 0x14
8411+# endif
8412+# ifndef SUBLANG_SWEDISH_FINLAND
8413+# define SUBLANG_SWEDISH_FINLAND 0x02
8414+# endif
8415+# ifndef SUBLANG_TAMAZIGHT_ARABIC
8416+# define SUBLANG_TAMAZIGHT_ARABIC 0x01
8417+# endif
8418+# ifndef SUBLANG_TAMAZIGHT_LATIN
8419+# define SUBLANG_TAMAZIGHT_LATIN 0x02
8420+# endif
8421+# ifndef SUBLANG_TIGRINYA_ETHIOPIA
8422+# define SUBLANG_TIGRINYA_ETHIOPIA 0x00
8423+# endif
8424+# ifndef SUBLANG_TIGRINYA_ERITREA
8425+# define SUBLANG_TIGRINYA_ERITREA 0x01
8426+# endif
8427+# ifndef SUBLANG_URDU_PAKISTAN
8428+# define SUBLANG_URDU_PAKISTAN 0x01
8429+# endif
8430+# ifndef SUBLANG_URDU_INDIA
8431+# define SUBLANG_URDU_INDIA 0x02
8432+# endif
8433+# ifndef SUBLANG_UZBEK_LATIN
8434+# define SUBLANG_UZBEK_LATIN 0x01
8435+# endif
8436+# ifndef SUBLANG_UZBEK_CYRILLIC
8437+# define SUBLANG_UZBEK_CYRILLIC 0x02
8438+# endif
8439+#endif
8440+
8441+/* XPG3 defines the result of 'setlocale (category, NULL)' as:
8442+ "Directs 'setlocale()' to query 'category' and return the current
8443+ setting of 'local'."
8444+ However it does not specify the exact format. Neither do SUSV2 and
8445+ ISO C 99. So we can use this feature only on selected systems (e.g.
8446+ those using GNU C Library). */
8447+#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
8448+# define HAVE_LOCALE_NULL
8449+#endif
8450+
8451+/* Determine the current locale's name, and canonicalize it into XPG syntax
8452+ language[_territory[.codeset]][@modifier]
8453+ The codeset part in the result is not reliable; the locale_charset()
8454+ should be used for codeset information instead.
8455+ The result must not be freed; it is statically allocated. */
8456+
8457+const char *
8458+_nl_locale_name (int category, const char *categoryname)
8459+{
8460+ const char *retval;
8461+
8462+#ifndef WIN32
8463+
8464+ /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
8465+ On some systems this can be done by the 'setlocale' function itself. */
8466+# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
8467+ retval = setlocale (category, NULL);
8468+# else
8469+ /* Setting of LC_ALL overwrites all other. */
8470+ retval = getenv ("LC_ALL");
8471+ if (retval == NULL || retval[0] == '\0')
8472+ {
8473+ /* Next comes the name of the desired category. */
8474+ retval = getenv (categoryname);
8475+ if (retval == NULL || retval[0] == '\0')
8476+ {
8477+ /* Last possibility is the LANG environment variable. */
8478+ retval = getenv ("LANG");
8479+ if (retval == NULL || retval[0] == '\0')
8480+ /* We use C as the default domain. POSIX says this is
8481+ implementation defined. */
8482+ retval = "C";
8483+ }
8484+ }
8485+# endif
8486+
8487+ return retval;
8488+
8489+#else /* WIN32 */
8490+
8491+ /* Return an XPG style locale name language[_territory][@modifier].
8492+ Don't even bother determining the codeset; it's not useful in this
8493+ context, because message catalogs are not specific to a single
8494+ codeset. */
8495+
8496+ LCID lcid;
8497+ LANGID langid;
8498+ int primary, sub;
8499+
8500+ /* Let the user override the system settings through environment
8501+ variables, as on POSIX systems. */
8502+ retval = getenv ("LC_ALL");
8503+ if (retval != NULL && retval[0] != '\0')
8504+ return retval;
8505+ retval = getenv (categoryname);
8506+ if (retval != NULL && retval[0] != '\0')
8507+ return retval;
8508+ retval = getenv ("LANG");
8509+ if (retval != NULL && retval[0] != '\0')
8510+ return retval;
8511+
8512+ /* Use native Win32 API locale ID. */
8513+ lcid = GetThreadLocale ();
8514+
8515+ /* Strip off the sorting rules, keep only the language part. */
8516+ langid = LANGIDFROMLCID (lcid);
8517+
8518+ /* Split into language and territory part. */
8519+ primary = PRIMARYLANGID (langid);
8520+ sub = SUBLANGID (langid);
8521+
8522+ /* Dispatch on language.
8523+ See also http://www.unicode.org/unicode/onlinedat/languages.html .
8524+ For details about languages, see http://www.ethnologue.com/ . */
8525+ switch (primary)
8526+ {
8527+ case LANG_AFRIKAANS: return "af_ZA";
8528+ case LANG_ALBANIAN: return "sq_AL";
8529+ case LANG_AMHARIC: return "am_ET";
8530+ case LANG_ARABIC:
8531+ switch (sub)
8532+ {
8533+ case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
8534+ case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
8535+ case SUBLANG_ARABIC_EGYPT: return "ar_EG";
8536+ case SUBLANG_ARABIC_LIBYA: return "ar_LY";
8537+ case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
8538+ case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
8539+ case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
8540+ case SUBLANG_ARABIC_OMAN: return "ar_OM";
8541+ case SUBLANG_ARABIC_YEMEN: return "ar_YE";
8542+ case SUBLANG_ARABIC_SYRIA: return "ar_SY";
8543+ case SUBLANG_ARABIC_JORDAN: return "ar_JO";
8544+ case SUBLANG_ARABIC_LEBANON: return "ar_LB";
8545+ case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
8546+ case SUBLANG_ARABIC_UAE: return "ar_AE";
8547+ case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
8548+ case SUBLANG_ARABIC_QATAR: return "ar_QA";
8549+ }
8550+ return "ar";
8551+ case LANG_ARMENIAN: return "hy_AM";
8552+ case LANG_ASSAMESE: return "as_IN";
8553+ case LANG_AZERI:
8554+ switch (sub)
8555+ {
8556+ /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
8557+ case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
8558+ case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
8559+ }
8560+ return "az";
8561+ case LANG_BASQUE:
8562+ return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
8563+ case LANG_BELARUSIAN: return "be_BY";
8564+ case LANG_BENGALI:
8565+ switch (sub)
8566+ {
8567+ case SUBLANG_BENGALI_INDIA: return "bn_IN";
8568+ case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
8569+ }
8570+ return "bn";
8571+ case LANG_BULGARIAN: return "bg_BG";
8572+ case LANG_BURMESE: return "my_MM";
8573+ case LANG_CAMBODIAN: return "km_KH";
8574+ case LANG_CATALAN: return "ca_ES";
8575+ case LANG_CHEROKEE: return "chr_US";
8576+ case LANG_CHINESE:
8577+ switch (sub)
8578+ {
8579+ case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
8580+ case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
8581+ case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
8582+ case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
8583+ case SUBLANG_CHINESE_MACAU: return "zh_MO";
8584+ }
8585+ return "zh";
8586+ case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN
8587+ * What used to be called Serbo-Croatian
8588+ * should really now be two separate
8589+ * languages because of political reasons.
8590+ * (Says tml, who knows nothing about Serbian
8591+ * or Croatian.)
8592+ * (I can feel those flames coming already.)
8593+ */
8594+ switch (sub)
8595+ {
8596+ case SUBLANG_DEFAULT: return "hr_HR";
8597+ case SUBLANG_SERBIAN_LATIN: return "sr_CS";
8598+ case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
8599+ }
8600+ return "hr";
8601+ case LANG_CZECH: return "cs_CZ";
8602+ case LANG_DANISH: return "da_DK";
8603+ case LANG_DIVEHI: return "dv_MV";
8604+ case LANG_DUTCH:
8605+ switch (sub)
8606+ {
8607+ case SUBLANG_DUTCH: return "nl_NL";
8608+ case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
8609+ }
8610+ return "nl";
8611+ case LANG_EDO: return "bin_NG";
8612+ case LANG_ENGLISH:
8613+ switch (sub)
8614+ {
8615+ /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
8616+ * English was the language spoken in England.
8617+ * Oh well.
8618+ */
8619+ case SUBLANG_ENGLISH_US: return "en_US";
8620+ case SUBLANG_ENGLISH_UK: return "en_GB";
8621+ case SUBLANG_ENGLISH_AUS: return "en_AU";
8622+ case SUBLANG_ENGLISH_CAN: return "en_CA";
8623+ case SUBLANG_ENGLISH_NZ: return "en_NZ";
8624+ case SUBLANG_ENGLISH_EIRE: return "en_IE";
8625+ case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
8626+ case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
8627+ case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
8628+ case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
8629+ case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
8630+ case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
8631+ case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
8632+ case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
8633+ case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
8634+ case SUBLANG_ENGLISH_INDIA: return "en_IN";
8635+ case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
8636+ case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
8637+ }
8638+ return "en";
8639+ case LANG_ESTONIAN: return "et_EE";
8640+ case LANG_FAEROESE: return "fo_FO";
8641+ case LANG_FARSI: return "fa_IR";
8642+ case LANG_FINNISH: return "fi_FI";
8643+ case LANG_FRENCH:
8644+ switch (sub)
8645+ {
8646+ case SUBLANG_FRENCH: return "fr_FR";
8647+ case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
8648+ case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
8649+ case SUBLANG_FRENCH_SWISS: return "fr_CH";
8650+ case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
8651+ case SUBLANG_FRENCH_MONACO: return "fr_MC";
8652+ case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
8653+ case SUBLANG_FRENCH_REUNION: return "fr_RE";
8654+ case SUBLANG_FRENCH_CONGO: return "fr_CG";
8655+ case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
8656+ case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
8657+ case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
8658+ case SUBLANG_FRENCH_MALI: return "fr_ML";
8659+ case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
8660+ case SUBLANG_FRENCH_HAITI: return "fr_HT";
8661+ }
8662+ return "fr";
8663+ case LANG_FRISIAN: return "fy_NL";
8664+ case LANG_FULFULDE:
8665+ /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */
8666+ return "ff_NG";
8667+ case LANG_GAELIC:
8668+ switch (sub)
8669+ {
8670+ case 0x01: /* SCOTTISH */ return "gd_GB";
8671+ case 0x02: /* IRISH */ return "ga_IE";
8672+ }
8673+ return "C";
8674+ case LANG_GALICIAN: return "gl_ES";
8675+ case LANG_GEORGIAN: return "ka_GE";
8676+ case LANG_GERMAN:
8677+ switch (sub)
8678+ {
8679+ case SUBLANG_GERMAN: return "de_DE";
8680+ case SUBLANG_GERMAN_SWISS: return "de_CH";
8681+ case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
8682+ case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
8683+ case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
8684+ }
8685+ return "de";
8686+ case LANG_GREEK: return "el_GR";
8687+ case LANG_GUARANI: return "gn_PY";
8688+ case LANG_GUJARATI: return "gu_IN";
8689+ case LANG_HAUSA: return "ha_NG";
8690+ case LANG_HAWAIIAN:
8691+ /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
8692+ or Hawaii Creole English ("cpe_US", 600000 speakers)? */
8693+ return "cpe_US";
8694+ case LANG_HEBREW: return "he_IL";
8695+ case LANG_HINDI: return "hi_IN";
8696+ case LANG_HUNGARIAN: return "hu_HU";
8697+ case LANG_IBIBIO: return "nic_NG";
8698+ case LANG_ICELANDIC: return "is_IS";
8699+ case LANG_IGBO: return "ig_NG";
8700+ case LANG_INDONESIAN: return "id_ID";
8701+ case LANG_INUKTITUT: return "iu_CA";
8702+ case LANG_ITALIAN:
8703+ switch (sub)
8704+ {
8705+ case SUBLANG_ITALIAN: return "it_IT";
8706+ case SUBLANG_ITALIAN_SWISS: return "it_CH";
8707+ }
8708+ return "it";
8709+ case LANG_JAPANESE: return "ja_JP";
8710+ case LANG_KANNADA: return "kn_IN";
8711+ case LANG_KANURI: return "kr_NG";
8712+ case LANG_KASHMIRI:
8713+ switch (sub)
8714+ {
8715+ case SUBLANG_DEFAULT: return "ks_PK";
8716+ case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
8717+ }
8718+ return "ks";
8719+ case LANG_KAZAK: return "kk_KZ";
8720+ case LANG_KONKANI:
8721+ /* FIXME: Adjust this when such locales appear on Unix. */
8722+ return "kok_IN";
8723+ case LANG_KOREAN: return "ko_KR";
8724+ case LANG_KYRGYZ: return "ky_KG";
8725+ case LANG_LAO: return "lo_LA";
8726+ case LANG_LATIN: return "la_VA";
8727+ case LANG_LATVIAN: return "lv_LV";
8728+ case LANG_LITHUANIAN: return "lt_LT";
8729+ case LANG_MACEDONIAN: return "mk_MK";
8730+ case LANG_MALAY:
8731+ switch (sub)
8732+ {
8733+ case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
8734+ case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
8735+ }
8736+ return "ms";
8737+ case LANG_MALAYALAM: return "ml_IN";
8738+ case LANG_MALTESE: return "mt_MT";
8739+ case LANG_MANIPURI:
8740+ /* FIXME: Adjust this when such locales appear on Unix. */
8741+ return "mni_IN";
8742+ case LANG_MARATHI: return "mr_IN";
8743+ case LANG_MONGOLIAN:
8744+ return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
8745+ case LANG_NEPALI:
8746+ switch (sub)
8747+ {
8748+ case SUBLANG_DEFAULT: return "ne_NP";
8749+ case SUBLANG_NEPALI_INDIA: return "ne_IN";
8750+ }
8751+ return "ne";
8752+ case LANG_NORWEGIAN:
8753+ switch (sub)
8754+ {
8755+ case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO";
8756+ case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
8757+ }
8758+ return "no";
8759+ case LANG_ORIYA: return "or_IN";
8760+ case LANG_OROMO: return "om_ET";
8761+ case LANG_PAPIAMENTU: return "pap_AN";
8762+ case LANG_PASHTO:
8763+ return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
8764+ case LANG_POLISH: return "pl_PL";
8765+ case LANG_PORTUGUESE:
8766+ switch (sub)
8767+ {
8768+ case SUBLANG_PORTUGUESE: return "pt_PT";
8769+ /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
8770+ Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
8771+ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
8772+ }
8773+ return "pt";
8774+ case LANG_PUNJABI:
8775+ switch (sub)
8776+ {
8777+ case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
8778+ case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
8779+ }
8780+ return "pa";
8781+ case LANG_RHAETO_ROMANCE: return "rm_CH";
8782+ case LANG_ROMANIAN:
8783+ switch (sub)
8784+ {
8785+ case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
8786+ case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
8787+ }
8788+ return "ro";
8789+ case LANG_RUSSIAN:
8790+ return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */
8791+ case LANG_SAAMI: /* actually Northern Sami */ return "se_NO";
8792+ case LANG_SANSKRIT: return "sa_IN";
8793+ case LANG_SINDHI:
8794+ switch (sub)
8795+ {
8796+ case SUBLANG_SINDHI_INDIA: return "sd_IN";
8797+ case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
8798+ }
8799+ return "sd";
8800+ case LANG_SINHALESE: return "si_LK";
8801+ case LANG_SLOVAK: return "sk_SK";
8802+ case LANG_SLOVENIAN: return "sl_SI";
8803+ case LANG_SOMALI: return "so_SO";
8804+ case LANG_SORBIAN:
8805+ /* FIXME: Adjust this when such locales appear on Unix. */
8806+ return "wen_DE";
8807+ case LANG_SPANISH:
8808+ switch (sub)
8809+ {
8810+ case SUBLANG_SPANISH: return "es_ES";
8811+ case SUBLANG_SPANISH_MEXICAN: return "es_MX";
8812+ case SUBLANG_SPANISH_MODERN:
8813+ return "es_ES@modern"; /* not seen on Unix */
8814+ case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
8815+ case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
8816+ case SUBLANG_SPANISH_PANAMA: return "es_PA";
8817+ case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
8818+ case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
8819+ case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
8820+ case SUBLANG_SPANISH_PERU: return "es_PE";
8821+ case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
8822+ case SUBLANG_SPANISH_ECUADOR: return "es_EC";
8823+ case SUBLANG_SPANISH_CHILE: return "es_CL";
8824+ case SUBLANG_SPANISH_URUGUAY: return "es_UY";
8825+ case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
8826+ case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
8827+ case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
8828+ case SUBLANG_SPANISH_HONDURAS: return "es_HN";
8829+ case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
8830+ case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
8831+ }
8832+ return "es";
8833+ case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
8834+ case LANG_SWAHILI: return "sw_KE";
8835+ case LANG_SWEDISH:
8836+ switch (sub)
8837+ {
8838+ case SUBLANG_DEFAULT: return "sv_SE";
8839+ case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
8840+ }
8841+ return "sv";
8842+ case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */
8843+ case LANG_TAGALOG: return "tl_PH";
8844+ case LANG_TAJIK: return "tg_TJ";
8845+ case LANG_TAMAZIGHT:
8846+ switch (sub)
8847+ {
8848+ /* FIXME: Adjust this when Tamazight locales appear on Unix. */
8849+ case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
8850+ case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin";
8851+ }
8852+ return "ber_MA";
8853+ case LANG_TAMIL:
8854+ return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
8855+ case LANG_TATAR: return "tt_RU";
8856+ case LANG_TELUGU: return "te_IN";
8857+ case LANG_THAI: return "th_TH";
8858+ case LANG_TIBETAN: return "bo_CN";
8859+ case LANG_TIGRINYA:
8860+ switch (sub)
8861+ {
8862+ case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
8863+ case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
8864+ }
8865+ return "ti";
8866+ case LANG_TSONGA: return "ts_ZA";
8867+ case LANG_TSWANA: return "tn_BW";
8868+ case LANG_TURKISH: return "tr_TR";
8869+ case LANG_TURKMEN: return "tk_TM";
8870+ case LANG_UKRAINIAN: return "uk_UA";
8871+ case LANG_URDU:
8872+ switch (sub)
8873+ {
8874+ case SUBLANG_URDU_PAKISTAN: return "ur_PK";
8875+ case SUBLANG_URDU_INDIA: return "ur_IN";
8876+ }
8877+ return "ur";
8878+ case LANG_UZBEK:
8879+ switch (sub)
8880+ {
8881+ case SUBLANG_UZBEK_LATIN: return "uz_UZ";
8882+ case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
8883+ }
8884+ return "uz";
8885+ case LANG_VENDA: return "ve_ZA";
8886+ case LANG_VIETNAMESE: return "vi_VN";
8887+ case LANG_WELSH: return "cy_GB";
8888+ case LANG_XHOSA: return "xh_ZA";
8889+ case LANG_YI: return "sit_CN";
8890+ case LANG_YIDDISH: return "yi_IL";
8891+ case LANG_YORUBA: return "yo_NG";
8892+ case LANG_ZULU: return "zu_ZA";
8893+ default: return "C";
8894+ }
8895+
8896+#endif
8897+}
8898diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/log.c psmisc-20.2.works.clean/intl/log.c
8899--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/log.c 1969-12-31 18:00:00.000000000 -0600
8900+++ psmisc-20.2.works.clean/intl/log.c 2004-10-13 15:18:41.000000000 -0500
8901@@ -0,0 +1,98 @@
8902+/* Log file output.
8903+ Copyright (C) 2003 Free Software Foundation, Inc.
8904+
8905+ This program is free software; you can redistribute it and/or modify it
8906+ under the terms of the GNU Library General Public License as published
8907+ by the Free Software Foundation; either version 2, or (at your option)
8908+ any later version.
8909+
8910+ This program is distributed in the hope that it will be useful,
8911+ but WITHOUT ANY WARRANTY; without even the implied warranty of
8912+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8913+ Library General Public License for more details.
8914+
8915+ You should have received a copy of the GNU Library General Public
8916+ License along with this program; if not, write to the Free Software
8917+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
8918+ USA. */
8919+
8920+/* Written by Bruno Haible <bruno@clisp.org>. */
8921+
8922+#ifdef HAVE_CONFIG_H
8923+# include <config.h>
8924+#endif
8925+
8926+#include <stdio.h>
8927+#include <stdlib.h>
8928+#include <string.h>
8929+
8930+/* Print an ASCII string with quotes and escape sequences where needed. */
8931+static void
8932+print_escaped (FILE *stream, const char *str)
8933+{
8934+ putc ('"', stream);
8935+ for (; *str != '\0'; str++)
8936+ if (*str == '\n')
8937+ {
8938+ fputs ("\\n\"", stream);
8939+ if (str[1] == '\0')
8940+ return;
8941+ fputs ("\n\"", stream);
8942+ }
8943+ else
8944+ {
8945+ if (*str == '"' || *str == '\\')
8946+ putc ('\\', stream);
8947+ putc (*str, stream);
8948+ }
8949+ putc ('"', stream);
8950+}
8951+
8952+/* Add to the log file an entry denoting a failed translation. */
8953+void
8954+_nl_log_untranslated (const char *logfilename, const char *domainname,
8955+ const char *msgid1, const char *msgid2, int plural)
8956+{
8957+ static char *last_logfilename = NULL;
8958+ static FILE *last_logfile = NULL;
8959+ FILE *logfile;
8960+
8961+ /* Can we reuse the last opened logfile? */
8962+ if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
8963+ {
8964+ /* Close the last used logfile. */
8965+ if (last_logfilename != NULL)
8966+ {
8967+ if (last_logfile != NULL)
8968+ {
8969+ fclose (last_logfile);
8970+ last_logfile = NULL;
8971+ }
8972+ free (last_logfilename);
8973+ last_logfilename = NULL;
8974+ }
8975+ /* Open the logfile. */
8976+ last_logfilename = (char *) malloc (strlen (logfilename) + 1);
8977+ if (last_logfilename == NULL)
8978+ return;
8979+ strcpy (last_logfilename, logfilename);
8980+ last_logfile = fopen (logfilename, "a");
8981+ if (last_logfile == NULL)
8982+ return;
8983+ }
8984+ logfile = last_logfile;
8985+
8986+ fprintf (logfile, "domain ");
8987+ print_escaped (logfile, domainname);
8988+ fprintf (logfile, "\nmsgid ");
8989+ print_escaped (logfile, msgid1);
8990+ if (plural)
8991+ {
8992+ fprintf (logfile, "\nmsgid_plural ");
8993+ print_escaped (logfile, msgid2);
8994+ fprintf (logfile, "\nmsgstr[0] \"\"\n");
8995+ }
8996+ else
8997+ fprintf (logfile, "\nmsgstr \"\"\n");
8998+ putc ('\n', logfile);
8999+}
9000diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/ngettext.c psmisc-20.2.works.clean/intl/ngettext.c
9001--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/ngettext.c 2001-04-13 23:00:43.000000000 -0500
9002+++ psmisc-20.2.works.clean/intl/ngettext.c 2004-10-13 15:18:41.000000000 -0500
9003@@ -1,19 +1,20 @@
9004 /* Implementation of ngettext(3) function.
9005- Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
9006+ Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
9007
9008- This program is free software; you can redistribute it and/or modify
9009- it under the terms of the GNU General Public License as published by
9010- the Free Software Foundation; either version 2, or (at your option)
9011+ This program is free software; you can redistribute it and/or modify it
9012+ under the terms of the GNU Library General Public License as published
9013+ by the Free Software Foundation; either version 2, or (at your option)
9014 any later version.
9015
9016 This program is distributed in the hope that it will be useful,
9017 but WITHOUT ANY WARRANTY; without even the implied warranty of
9018- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9019- GNU General Public License for more details.
9020+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9021+ Library General Public License for more details.
9022
9023- You should have received a copy of the GNU General Public License
9024- along with this program; if not, write to the Free Software Foundation,
9025- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
9026+ You should have received a copy of the GNU Library General Public
9027+ License along with this program; if not, write to the Free Software
9028+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9029+ USA. */
9030
9031 #ifdef HAVE_CONFIG_H
9032 # include <config.h>
9033@@ -45,18 +46,15 @@
9034 # define NGETTEXT __ngettext
9035 # define DCNGETTEXT __dcngettext
9036 #else
9037-# define NGETTEXT ngettext__
9038-# define DCNGETTEXT dcngettext__
9039+# define NGETTEXT libintl_ngettext
9040+# define DCNGETTEXT libintl_dcngettext
9041 #endif
9042
9043 /* Look up MSGID in the current default message catalog for the current
9044 LC_MESSAGES locale. If not found, returns MSGID itself (the default
9045 text). */
9046 char *
9047-NGETTEXT (msgid1, msgid2, n)
9048- const char *msgid1;
9049- const char *msgid2;
9050- unsigned long int n;
9051+NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n)
9052 {
9053 return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
9054 }
9055diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/os2compat.c psmisc-20.2.works.clean/intl/os2compat.c
9056--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/os2compat.c 1969-12-31 18:00:00.000000000 -0600
9057+++ psmisc-20.2.works.clean/intl/os2compat.c 2004-10-13 15:18:41.000000000 -0500
9058@@ -0,0 +1,98 @@
9059+/* OS/2 compatibility functions.
9060+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
9061+
9062+ This program is free software; you can redistribute it and/or modify it
9063+ under the terms of the GNU Library General Public License as published
9064+ by the Free Software Foundation; either version 2, or (at your option)
9065+ any later version.
9066+
9067+ This program is distributed in the hope that it will be useful,
9068+ but WITHOUT ANY WARRANTY; without even the implied warranty of
9069+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9070+ Library General Public License for more details.
9071+
9072+ You should have received a copy of the GNU Library General Public
9073+ License along with this program; if not, write to the Free Software
9074+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9075+ USA. */
9076+
9077+#define OS2_AWARE
9078+#ifdef HAVE_CONFIG_H
9079+#include <config.h>
9080+#endif
9081+
9082+#include <stdlib.h>
9083+#include <string.h>
9084+#include <sys/param.h>
9085+
9086+/* A version of getenv() that works from DLLs */
9087+extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue);
9088+
9089+char *
9090+_nl_getenv (const char *name)
9091+{
9092+ unsigned char *value;
9093+ if (DosScanEnv (name, &value))
9094+ return NULL;
9095+ else
9096+ return value;
9097+}
9098+
9099+/* A fixed size buffer. */
9100+char libintl_nl_default_dirname[MAXPATHLEN+1];
9101+
9102+char *_nlos2_libdir = NULL;
9103+char *_nlos2_localealiaspath = NULL;
9104+char *_nlos2_localedir = NULL;
9105+
9106+static __attribute__((constructor)) void
9107+nlos2_initialize ()
9108+{
9109+ char *root = getenv ("UNIXROOT");
9110+ char *gnulocaledir = getenv ("GNULOCALEDIR");
9111+
9112+ _nlos2_libdir = gnulocaledir;
9113+ if (!_nlos2_libdir)
9114+ {
9115+ if (root)
9116+ {
9117+ size_t sl = strlen (root);
9118+ _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
9119+ memcpy (_nlos2_libdir, root, sl);
9120+ memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
9121+ }
9122+ else
9123+ _nlos2_libdir = LIBDIR;
9124+ }
9125+
9126+ _nlos2_localealiaspath = gnulocaledir;
9127+ if (!_nlos2_localealiaspath)
9128+ {
9129+ if (root)
9130+ {
9131+ size_t sl = strlen (root);
9132+ _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
9133+ memcpy (_nlos2_localealiaspath, root, sl);
9134+ memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
9135+ }
9136+ else
9137+ _nlos2_localealiaspath = LOCALE_ALIAS_PATH;
9138+ }
9139+
9140+ _nlos2_localedir = gnulocaledir;
9141+ if (!_nlos2_localedir)
9142+ {
9143+ if (root)
9144+ {
9145+ size_t sl = strlen (root);
9146+ _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
9147+ memcpy (_nlos2_localedir, root, sl);
9148+ memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
9149+ }
9150+ else
9151+ _nlos2_localedir = LOCALEDIR;
9152+ }
9153+
9154+ if (strlen (_nlos2_localedir) <= MAXPATHLEN)
9155+ strcpy (libintl_nl_default_dirname, _nlos2_localedir);
9156+}
9157diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/os2compat.h psmisc-20.2.works.clean/intl/os2compat.h
9158--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/os2compat.h 1969-12-31 18:00:00.000000000 -0600
9159+++ psmisc-20.2.works.clean/intl/os2compat.h 2004-10-13 15:18:41.000000000 -0500
9160@@ -0,0 +1,46 @@
9161+/* OS/2 compatibility defines.
9162+ This file is intended to be included from config.h
9163+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
9164+
9165+ This program is free software; you can redistribute it and/or modify it
9166+ under the terms of the GNU Library General Public License as published
9167+ by the Free Software Foundation; either version 2, or (at your option)
9168+ any later version.
9169+
9170+ This program is distributed in the hope that it will be useful,
9171+ but WITHOUT ANY WARRANTY; without even the implied warranty of
9172+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9173+ Library General Public License for more details.
9174+
9175+ You should have received a copy of the GNU Library General Public
9176+ License along with this program; if not, write to the Free Software
9177+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9178+ USA. */
9179+
9180+/* When included from os2compat.h we need all the original definitions */
9181+#ifndef OS2_AWARE
9182+
9183+#undef LIBDIR
9184+#define LIBDIR _nlos2_libdir
9185+extern char *_nlos2_libdir;
9186+
9187+#undef LOCALEDIR
9188+#define LOCALEDIR _nlos2_localedir
9189+extern char *_nlos2_localedir;
9190+
9191+#undef LOCALE_ALIAS_PATH
9192+#define LOCALE_ALIAS_PATH _nlos2_localealiaspath
9193+extern char *_nlos2_localealiaspath;
9194+
9195+#endif
9196+
9197+#undef HAVE_STRCASECMP
9198+#define HAVE_STRCASECMP 1
9199+#define strcasecmp stricmp
9200+#define strncasecmp strnicmp
9201+
9202+/* We have our own getenv() which works even if library is compiled as DLL */
9203+#define getenv _nl_getenv
9204+
9205+/* Older versions of gettext used -1 as the value of LC_MESSAGES */
9206+#define LC_MESSAGES_COMPAT (-1)
9207diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/osdep.c psmisc-20.2.works.clean/intl/osdep.c
9208--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/osdep.c 1969-12-31 18:00:00.000000000 -0600
9209+++ psmisc-20.2.works.clean/intl/osdep.c 2004-10-13 15:18:41.000000000 -0500
9210@@ -0,0 +1,24 @@
9211+/* OS dependent parts of libintl.
9212+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
9213+
9214+ This program is free software; you can redistribute it and/or modify it
9215+ under the terms of the GNU Library General Public License as published
9216+ by the Free Software Foundation; either version 2, or (at your option)
9217+ any later version.
9218+
9219+ This program is distributed in the hope that it will be useful,
9220+ but WITHOUT ANY WARRANTY; without even the implied warranty of
9221+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9222+ Library General Public License for more details.
9223+
9224+ You should have received a copy of the GNU Library General Public
9225+ License along with this program; if not, write to the Free Software
9226+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9227+ USA. */
9228+
9229+#if defined __EMX__
9230+# include "os2compat.c"
9231+#else
9232+/* Avoid AIX compiler warning. */
9233+typedef int dummy;
9234+#endif
9235diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural-exp.c psmisc-20.2.works.clean/intl/plural-exp.c
9236--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural-exp.c 1969-12-31 18:00:00.000000000 -0600
9237+++ psmisc-20.2.works.clean/intl/plural-exp.c 2004-10-13 15:18:41.000000000 -0500
9238@@ -0,0 +1,154 @@
9239+/* Expression parsing for plural form selection.
9240+ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
9241+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
9242+
9243+ This program is free software; you can redistribute it and/or modify it
9244+ under the terms of the GNU Library General Public License as published
9245+ by the Free Software Foundation; either version 2, or (at your option)
9246+ any later version.
9247+
9248+ This program is distributed in the hope that it will be useful,
9249+ but WITHOUT ANY WARRANTY; without even the implied warranty of
9250+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9251+ Library General Public License for more details.
9252+
9253+ You should have received a copy of the GNU Library General Public
9254+ License along with this program; if not, write to the Free Software
9255+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9256+ USA. */
9257+
9258+#ifdef HAVE_CONFIG_H
9259+# include <config.h>
9260+#endif
9261+
9262+#include <ctype.h>
9263+#include <stdlib.h>
9264+#include <string.h>
9265+
9266+#include "plural-exp.h"
9267+
9268+#if (defined __GNUC__ && !defined __APPLE_CC__) \
9269+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
9270+
9271+/* These structs are the constant expression for the germanic plural
9272+ form determination. It represents the expression "n != 1". */
9273+static const struct expression plvar =
9274+{
9275+ .nargs = 0,
9276+ .operation = var,
9277+};
9278+static const struct expression plone =
9279+{
9280+ .nargs = 0,
9281+ .operation = num,
9282+ .val =
9283+ {
9284+ .num = 1
9285+ }
9286+};
9287+struct expression GERMANIC_PLURAL =
9288+{
9289+ .nargs = 2,
9290+ .operation = not_equal,
9291+ .val =
9292+ {
9293+ .args =
9294+ {
9295+ [0] = (struct expression *) &plvar,
9296+ [1] = (struct expression *) &plone
9297+ }
9298+ }
9299+};
9300+
9301+# define INIT_GERMANIC_PLURAL()
9302+
9303+#else
9304+
9305+/* For compilers without support for ISO C 99 struct/union initializers:
9306+ Initialization at run-time. */
9307+
9308+static struct expression plvar;
9309+static struct expression plone;
9310+struct expression GERMANIC_PLURAL;
9311+
9312+static void
9313+init_germanic_plural ()
9314+{
9315+ if (plone.val.num == 0)
9316+ {
9317+ plvar.nargs = 0;
9318+ plvar.operation = var;
9319+
9320+ plone.nargs = 0;
9321+ plone.operation = num;
9322+ plone.val.num = 1;
9323+
9324+ GERMANIC_PLURAL.nargs = 2;
9325+ GERMANIC_PLURAL.operation = not_equal;
9326+ GERMANIC_PLURAL.val.args[0] = &plvar;
9327+ GERMANIC_PLURAL.val.args[1] = &plone;
9328+ }
9329+}
9330+
9331+# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
9332+
9333+#endif
9334+
9335+void
9336+internal_function
9337+EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp,
9338+ unsigned long int *npluralsp)
9339+{
9340+ if (nullentry != NULL)
9341+ {
9342+ const char *plural;
9343+ const char *nplurals;
9344+
9345+ plural = strstr (nullentry, "plural=");
9346+ nplurals = strstr (nullentry, "nplurals=");
9347+ if (plural == NULL || nplurals == NULL)
9348+ goto no_plural;
9349+ else
9350+ {
9351+ char *endp;
9352+ unsigned long int n;
9353+ struct parse_args args;
9354+
9355+ /* First get the number. */
9356+ nplurals += 9;
9357+ while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
9358+ ++nplurals;
9359+ if (!(*nplurals >= '0' && *nplurals <= '9'))
9360+ goto no_plural;
9361+#if defined HAVE_STRTOUL || defined _LIBC
9362+ n = strtoul (nplurals, &endp, 10);
9363+#else
9364+ for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
9365+ n = n * 10 + (*endp - '0');
9366+#endif
9367+ if (nplurals == endp)
9368+ goto no_plural;
9369+ *npluralsp = n;
9370+
9371+ /* Due to the restrictions bison imposes onto the interface of the
9372+ scanner function we have to put the input string and the result
9373+ passed up from the parser into the same structure which address
9374+ is passed down to the parser. */
9375+ plural += 7;
9376+ args.cp = plural;
9377+ if (PLURAL_PARSE (&args) != 0)
9378+ goto no_plural;
9379+ *pluralp = args.res;
9380+ }
9381+ }
9382+ else
9383+ {
9384+ /* By default we are using the Germanic form: singular form only
9385+ for `one', the plural form otherwise. Yes, this is also what
9386+ English is using since English is a Germanic language. */
9387+ no_plural:
9388+ INIT_GERMANIC_PLURAL ();
9389+ *pluralp = &GERMANIC_PLURAL;
9390+ *npluralsp = 2;
9391+ }
9392+}
9393diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural-exp.h psmisc-20.2.works.clean/intl/plural-exp.h
9394--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural-exp.h 1969-12-31 18:00:00.000000000 -0600
9395+++ psmisc-20.2.works.clean/intl/plural-exp.h 2004-10-13 15:18:41.000000000 -0500
9396@@ -0,0 +1,118 @@
9397+/* Expression parsing and evaluation for plural form selection.
9398+ Copyright (C) 2000-2003 Free Software Foundation, Inc.
9399+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
9400+
9401+ This program is free software; you can redistribute it and/or modify it
9402+ under the terms of the GNU Library General Public License as published
9403+ by the Free Software Foundation; either version 2, or (at your option)
9404+ any later version.
9405+
9406+ This program is distributed in the hope that it will be useful,
9407+ but WITHOUT ANY WARRANTY; without even the implied warranty of
9408+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9409+ Library General Public License for more details.
9410+
9411+ You should have received a copy of the GNU Library General Public
9412+ License along with this program; if not, write to the Free Software
9413+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9414+ USA. */
9415+
9416+#ifndef _PLURAL_EXP_H
9417+#define _PLURAL_EXP_H
9418+
9419+#ifndef internal_function
9420+# define internal_function
9421+#endif
9422+
9423+#ifndef attribute_hidden
9424+# define attribute_hidden
9425+#endif
9426+
9427+
9428+/* This is the representation of the expressions to determine the
9429+ plural form. */
9430+struct expression
9431+{
9432+ int nargs; /* Number of arguments. */
9433+ enum operator
9434+ {
9435+ /* Without arguments: */
9436+ var, /* The variable "n". */
9437+ num, /* Decimal number. */
9438+ /* Unary operators: */
9439+ lnot, /* Logical NOT. */
9440+ /* Binary operators: */
9441+ mult, /* Multiplication. */
9442+ divide, /* Division. */
9443+ module, /* Modulo operation. */
9444+ plus, /* Addition. */
9445+ minus, /* Subtraction. */
9446+ less_than, /* Comparison. */
9447+ greater_than, /* Comparison. */
9448+ less_or_equal, /* Comparison. */
9449+ greater_or_equal, /* Comparison. */
9450+ equal, /* Comparison for equality. */
9451+ not_equal, /* Comparison for inequality. */
9452+ land, /* Logical AND. */
9453+ lor, /* Logical OR. */
9454+ /* Ternary operators: */
9455+ qmop /* Question mark operator. */
9456+ } operation;
9457+ union
9458+ {
9459+ unsigned long int num; /* Number value for `num'. */
9460+ struct expression *args[3]; /* Up to three arguments. */
9461+ } val;
9462+};
9463+
9464+/* This is the data structure to pass information to the parser and get
9465+ the result in a thread-safe way. */
9466+struct parse_args
9467+{
9468+ const char *cp;
9469+ struct expression *res;
9470+};
9471+
9472+
9473+/* Names for the libintl functions are a problem. This source code is used
9474+ 1. in the GNU C Library library,
9475+ 2. in the GNU libintl library,
9476+ 3. in the GNU gettext tools.
9477+ The function names in each situation must be different, to allow for
9478+ binary incompatible changes in 'struct expression'. Furthermore,
9479+ 1. in the GNU C Library library, the names have a __ prefix,
9480+ 2.+3. in the GNU libintl library and in the GNU gettext tools, the names
9481+ must follow ANSI C and not start with __.
9482+ So we have to distinguish the three cases. */
9483+#ifdef _LIBC
9484+# define FREE_EXPRESSION __gettext_free_exp
9485+# define PLURAL_PARSE __gettextparse
9486+# define GERMANIC_PLURAL __gettext_germanic_plural
9487+# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
9488+#elif defined (IN_LIBINTL)
9489+# define FREE_EXPRESSION libintl_gettext_free_exp
9490+# define PLURAL_PARSE libintl_gettextparse
9491+# define GERMANIC_PLURAL libintl_gettext_germanic_plural
9492+# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
9493+#else
9494+# define FREE_EXPRESSION free_plural_expression
9495+# define PLURAL_PARSE parse_plural_expression
9496+# define GERMANIC_PLURAL germanic_plural
9497+# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
9498+#endif
9499+
9500+extern void FREE_EXPRESSION (struct expression *exp)
9501+ internal_function;
9502+extern int PLURAL_PARSE (void *arg);
9503+extern struct expression GERMANIC_PLURAL attribute_hidden;
9504+extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
9505+ struct expression **pluralp,
9506+ unsigned long int *npluralsp)
9507+ internal_function;
9508+
9509+#if !defined (_LIBC) && !defined (IN_LIBINTL)
9510+extern unsigned long int plural_eval (struct expression *pexp,
9511+ unsigned long int n);
9512+#endif
9513+
9514+#endif /* _PLURAL_EXP_H */
9515diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural.c psmisc-20.2.works.clean/intl/plural.c
9516--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural.c 2001-10-17 17:05:25.000000000 -0500
9517+++ psmisc-20.2.works.clean/intl/plural.c 2004-10-13 15:18:43.000000000 -0500
9518@@ -1,6 +1,5 @@
9519-
9520-/* A Bison parser, made from plural.y
9521- by GNU Bison version 1.28 */
9522+/* A Bison parser, made from plural.y
9523+ by GNU bison 1.35. */
9524
9525 #define YYBISON 1 /* Identify Bison output. */
9526
9527@@ -11,31 +10,32 @@
9528 #define yychar __gettextchar
9529 #define yydebug __gettextdebug
9530 #define yynerrs __gettextnerrs
9531-#define EQUOP2 257
9532-#define CMPOP2 258
9533-#define ADDOP2 259
9534-#define MULOP2 260
9535-#define NUMBER 261
9536+# define EQUOP2 257
9537+# define CMPOP2 258
9538+# define ADDOP2 259
9539+# define MULOP2 260
9540+# define NUMBER 261
9541
9542 #line 1 "plural.y"
9543
9544 /* Expression parsing for plural form selection.
9545- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
9546+ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
9547 Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
9548
9549- This program is free software; you can redistribute it and/or modify
9550- it under the terms of the GNU General Public License as published by
9551- the Free Software Foundation; either version 2, or (at your option)
9552+ This program is free software; you can redistribute it and/or modify it
9553+ under the terms of the GNU Library General Public License as published
9554+ by the Free Software Foundation; either version 2, or (at your option)
9555 any later version.
9556
9557 This program is distributed in the hope that it will be useful,
9558 but WITHOUT ANY WARRANTY; without even the implied warranty of
9559- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9560- GNU General Public License for more details.
9561+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9562+ Library General Public License for more details.
9563
9564- You should have received a copy of the GNU General Public License
9565- along with this program; if not, write to the Free Software Foundation,
9566- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
9567+ You should have received a copy of the GNU Library General Public
9568+ License along with this program; if not, write to the Free Software
9569+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9570+ USA. */
9571
9572 /* The bison generated parser uses alloca. AIX 3 forces us to put this
9573 declaration at the beginning of the file. The declaration in bison's
9574@@ -49,54 +49,39 @@
9575 # include <config.h>
9576 #endif
9577
9578+#include <stddef.h>
9579 #include <stdlib.h>
9580-#include "gettextP.h"
9581+#include "plural-exp.h"
9582
9583-/* Names for the libintl functions are a problem. They must not clash
9584- with existing names and they should follow ANSI C. But this source
9585- code is also used in GNU C Library where the names have a __
9586- prefix. So we have to make a difference here. */
9587-#ifdef _LIBC
9588-# define FREE_EXPRESSION __gettext_free_exp
9589-#else
9590-# define FREE_EXPRESSION gettext_free_exp__
9591-# define __gettextparse gettextparse__
9592+/* The main function generated by the parser is called __gettextparse,
9593+ but we want it to be called PLURAL_PARSE. */
9594+#ifndef _LIBC
9595+# define __gettextparse PLURAL_PARSE
9596 #endif
9597
9598 #define YYLEX_PARAM &((struct parse_args *) arg)->cp
9599 #define YYPARSE_PARAM arg
9600
9601-#line 52 "plural.y"
9602+#line 49 "plural.y"
9603+#ifndef YYSTYPE
9604 typedef union {
9605 unsigned long int num;
9606 enum operator op;
9607 struct expression *exp;
9608-} YYSTYPE;
9609-#line 58 "plural.y"
9610+} yystype;
9611+# define YYSTYPE yystype
9612+# define YYSTYPE_IS_TRIVIAL 1
9613+#endif
9614+#line 55 "plural.y"
9615
9616 /* Prototypes for local functions. */
9617-static struct expression *new_exp PARAMS ((int nargs, enum operator op,
9618- struct expression * const *args));
9619-static inline struct expression *new_exp_0 PARAMS ((enum operator op));
9620-static inline struct expression *new_exp_1 PARAMS ((enum operator op,
9621- struct expression *right));
9622-static struct expression *new_exp_2 PARAMS ((enum operator op,
9623- struct expression *left,
9624- struct expression *right));
9625-static inline struct expression *new_exp_3 PARAMS ((enum operator op,
9626- struct expression *bexp,
9627- struct expression *tbranch,
9628- struct expression *fbranch));
9629-static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
9630-static void yyerror PARAMS ((const char *str));
9631+static int yylex (YYSTYPE *lval, const char **pexp);
9632+static void yyerror (const char *str);
9633
9634 /* Allocation of expressions. */
9635
9636 static struct expression *
9637-new_exp (nargs, op, args)
9638- int nargs;
9639- enum operator op;
9640- struct expression * const *args;
9641+new_exp (int nargs, enum operator op, struct expression * const *args)
9642 {
9643 int i;
9644 struct expression *newp;
9645@@ -125,16 +110,13 @@
9646 }
9647
9648 static inline struct expression *
9649-new_exp_0 (op)
9650- enum operator op;
9651+new_exp_0 (enum operator op)
9652 {
9653 return new_exp (0, op, NULL);
9654 }
9655
9656 static inline struct expression *
9657-new_exp_1 (op, right)
9658- enum operator op;
9659- struct expression *right;
9660+new_exp_1 (enum operator op, struct expression *right)
9661 {
9662 struct expression *args[1];
9663
9664@@ -143,10 +125,7 @@
9665 }
9666
9667 static struct expression *
9668-new_exp_2 (op, left, right)
9669- enum operator op;
9670- struct expression *left;
9671- struct expression *right;
9672+new_exp_2 (enum operator op, struct expression *left, struct expression *right)
9673 {
9674 struct expression *args[2];
9675
9676@@ -156,11 +135,8 @@
9677 }
9678
9679 static inline struct expression *
9680-new_exp_3 (op, bexp, tbranch, fbranch)
9681- enum operator op;
9682- struct expression *bexp;
9683- struct expression *tbranch;
9684- struct expression *fbranch;
9685+new_exp_3 (enum operator op, struct expression *bexp,
9686+ struct expression *tbranch, struct expression *fbranch)
9687 {
9688 struct expression *args[3];
9689
9690@@ -170,12 +146,8 @@
9691 return new_exp (3, op, args);
9692 }
9693
9694-#include <stdio.h>
9695-
9696-#ifndef __cplusplus
9697-#ifndef __STDC__
9698-#define const
9699-#endif
9700+#ifndef YYDEBUG
9701+# define YYDEBUG 0
9702 #endif
9703
9704
9705@@ -184,129 +156,152 @@
9706 #define YYFLAG -32768
9707 #define YYNTBASE 16
9708
9709+/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
9710 #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
9711
9712-static const char yytranslate[] = { 0,
9713- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9714- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9715- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9716- 2, 2, 10, 2, 2, 2, 2, 5, 2, 14,
9717- 15, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9718- 2, 2, 2, 2, 2, 2, 2, 12, 2, 2,
9719- 2, 2, 3, 2, 2, 2, 2, 2, 2, 2,
9720- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9721- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9722- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9723- 2, 2, 2, 2, 2, 2, 2, 2, 2, 13,
9724- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9725- 2, 2, 2, 4, 2, 2, 2, 2, 2, 2,
9726- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9727- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9728- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9729- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9730- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9731- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9732- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9733- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9734- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9735- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9736- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9737- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9738- 2, 2, 2, 2, 2, 1, 6, 7, 8, 9,
9739- 11
9740+/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
9741+static const char yytranslate[] =
9742+{
9743+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9744+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9745+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9746+ 2, 2, 2, 10, 2, 2, 2, 2, 5, 2,
9747+ 14, 15, 2, 2, 2, 2, 2, 2, 2, 2,
9748+ 2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
9749+ 2, 2, 2, 3, 2, 2, 2, 2, 2, 2,
9750+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9751+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9752+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9753+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9754+ 13, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9755+ 2, 2, 2, 2, 4, 2, 2, 2, 2, 2,
9756+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9757+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9758+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9759+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9760+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9761+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9762+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9763+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9764+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9765+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9766+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9767+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
9768+ 2, 2, 2, 2, 2, 2, 1, 6, 7, 8,
9769+ 9, 11
9770 };
9771
9772-#if YYDEBUG != 0
9773-static const short yyprhs[] = { 0,
9774- 0, 2, 8, 12, 16, 20, 24, 28, 32, 35,
9775- 37, 39
9776+#if YYDEBUG
9777+static const short yyprhs[] =
9778+{
9779+ 0, 0, 2, 8, 12, 16, 20, 24, 28, 32,
9780+ 35, 37, 39
9781 };
9782-
9783-static const short yyrhs[] = { 17,
9784- 0, 17, 3, 17, 12, 17, 0, 17, 4, 17,
9785- 0, 17, 5, 17, 0, 17, 6, 17, 0, 17,
9786- 7, 17, 0, 17, 8, 17, 0, 17, 9, 17,
9787- 0, 10, 17, 0, 13, 0, 11, 0, 14, 17,
9788- 15, 0
9789+static const short yyrhs[] =
9790+{
9791+ 17, 0, 17, 3, 17, 12, 17, 0, 17, 4,
9792+ 17, 0, 17, 5, 17, 0, 17, 6, 17, 0,
9793+ 17, 7, 17, 0, 17, 8, 17, 0, 17, 9,
9794+ 17, 0, 10, 17, 0, 13, 0, 11, 0, 14,
9795+ 17, 15, 0
9796 };
9797
9798 #endif
9799
9800-#if YYDEBUG != 0
9801-static const short yyrline[] = { 0,
9802- 177, 185, 189, 193, 197, 201, 205, 209, 213, 217,
9803- 221, 226
9804+#if YYDEBUG
9805+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
9806+static const short yyrline[] =
9807+{
9808+ 0, 150, 158, 162, 166, 170, 174, 178, 182, 186,
9809+ 190, 194, 199
9810 };
9811 #endif
9812
9813
9814-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
9815+#if (YYDEBUG) || defined YYERROR_VERBOSE
9816
9817-static const char * const yytname[] = { "$","error","$undefined.","'?'","'|'",
9818-"'&'","EQUOP2","CMPOP2","ADDOP2","MULOP2","'!'","NUMBER","':'","'n'","'('","')'",
9819-"start","exp", NULL
9820+/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
9821+static const char *const yytname[] =
9822+{
9823+ "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
9824+ "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
9825+ "start", "exp", 0
9826 };
9827 #endif
9828
9829-static const short yyr1[] = { 0,
9830- 16, 17, 17, 17, 17, 17, 17, 17, 17, 17,
9831- 17, 17
9832+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
9833+static const short yyr1[] =
9834+{
9835+ 0, 16, 17, 17, 17, 17, 17, 17, 17, 17,
9836+ 17, 17, 17
9837 };
9838
9839-static const short yyr2[] = { 0,
9840- 1, 5, 3, 3, 3, 3, 3, 3, 2, 1,
9841- 1, 3
9842+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
9843+static const short yyr2[] =
9844+{
9845+ 0, 1, 5, 3, 3, 3, 3, 3, 3, 2,
9846+ 1, 1, 3
9847 };
9848
9849-static const short yydefact[] = { 0,
9850- 0, 11, 10, 0, 1, 9, 0, 0, 0, 0,
9851- 0, 0, 0, 0, 12, 0, 3, 4, 5, 6,
9852- 7, 8, 0, 2, 0, 0, 0
9853+/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
9854+ doesn't specify something else to do. Zero means the default is an
9855+ error. */
9856+static const short yydefact[] =
9857+{
9858+ 0, 0, 11, 10, 0, 1, 9, 0, 0, 0,
9859+ 0, 0, 0, 0, 0, 12, 0, 3, 4, 5,
9860+ 6, 7, 8, 0, 2, 0, 0, 0
9861 };
9862
9863-static const short yydefgoto[] = { 25,
9864- 5
9865+static const short yydefgoto[] =
9866+{
9867+ 25, 5
9868 };
9869
9870-static const short yypact[] = { -9,
9871- -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9,
9872- -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26,
9873- -3,-32768, -9, 34, 21, 53,-32768
9874+static const short yypact[] =
9875+{
9876+ -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9,
9877+ -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16,
9878+ 26, -3,-32768, -9, 34, 21, 53,-32768
9879 };
9880
9881-static const short yypgoto[] = {-32768,
9882- -1
9883+static const short yypgoto[] =
9884+{
9885+ -32768, -1
9886 };
9887
9888
9889 #define YYLAST 53
9890
9891
9892-static const short yytable[] = { 6,
9893- 1, 2, 7, 3, 4, 14, 16, 17, 18, 19,
9894- 20, 21, 22, 8, 9, 10, 11, 12, 13, 14,
9895- 26, 24, 12, 13, 14, 15, 8, 9, 10, 11,
9896- 12, 13, 14, 13, 14, 23, 8, 9, 10, 11,
9897- 12, 13, 14, 10, 11, 12, 13, 14, 11, 12,
9898- 13, 14, 27
9899+static const short yytable[] =
9900+{
9901+ 6, 1, 2, 7, 3, 4, 14, 16, 17, 18,
9902+ 19, 20, 21, 22, 8, 9, 10, 11, 12, 13,
9903+ 14, 26, 24, 12, 13, 14, 15, 8, 9, 10,
9904+ 11, 12, 13, 14, 13, 14, 23, 8, 9, 10,
9905+ 11, 12, 13, 14, 10, 11, 12, 13, 14, 11,
9906+ 12, 13, 14, 27
9907 };
9908
9909-static const short yycheck[] = { 1,
9910- 10, 11, 4, 13, 14, 9, 8, 9, 10, 11,
9911- 12, 13, 14, 3, 4, 5, 6, 7, 8, 9,
9912- 0, 23, 7, 8, 9, 15, 3, 4, 5, 6,
9913- 7, 8, 9, 8, 9, 12, 3, 4, 5, 6,
9914- 7, 8, 9, 5, 6, 7, 8, 9, 6, 7,
9915- 8, 9, 0
9916+static const short yycheck[] =
9917+{
9918+ 1, 10, 11, 4, 13, 14, 9, 8, 9, 10,
9919+ 11, 12, 13, 14, 3, 4, 5, 6, 7, 8,
9920+ 9, 0, 23, 7, 8, 9, 15, 3, 4, 5,
9921+ 6, 7, 8, 9, 8, 9, 12, 3, 4, 5,
9922+ 6, 7, 8, 9, 5, 6, 7, 8, 9, 6,
9923+ 7, 8, 9, 0
9924 };
9925 #define YYPURE 1
9926
9927 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
9928-#line 3 "/usr/share/bison/bison.simple"
9929-/* This file comes from bison-1.28. */
9930+#line 3 "/usr/local/share/bison/bison.simple"
9931
9932 /* Skeleton output parser for bison,
9933- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
9934+
9935+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
9936+ Foundation, Inc.
9937
9938 This program is free software; you can redistribute it and/or modify
9939 it under the terms of the GNU General Public License as published by
9940@@ -328,62 +323,131 @@
9941 This special exception was added by the Free Software Foundation
9942 in version 1.24 of Bison. */
9943
9944-/* This is the parser code that is written into each bison parser
9945- when the %semantic_parser declaration is not specified in the grammar.
9946- It was written by Richard Stallman by simplifying the hairy parser
9947- used when %semantic_parser is specified. */
9948+/* This is the parser code that is written into each bison parser when
9949+ the %semantic_parser declaration is not specified in the grammar.
9950+ It was written by Richard Stallman by simplifying the hairy parser
9951+ used when %semantic_parser is specified. */
9952
9953-#ifndef YYSTACK_USE_ALLOCA
9954-#ifdef alloca
9955-#define YYSTACK_USE_ALLOCA
9956-#else /* alloca not defined */
9957-#ifdef __GNUC__
9958-#define YYSTACK_USE_ALLOCA
9959-#define alloca __builtin_alloca
9960-#else /* not GNU C. */
9961-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
9962-#define YYSTACK_USE_ALLOCA
9963-#include <alloca.h>
9964-#else /* not sparc */
9965-/* We think this test detects Watcom and Microsoft C. */
9966-/* This used to test MSDOS, but that is a bad idea
9967- since that symbol is in the user namespace. */
9968-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
9969-#if 0 /* No need for malloc.h, which pollutes the namespace;
9970- instead, just don't use alloca. */
9971-#include <malloc.h>
9972-#endif
9973-#else /* not MSDOS, or __TURBOC__ */
9974-#if defined(_AIX)
9975-/* I don't know what this was needed for, but it pollutes the namespace.
9976- So I turned it off. rms, 2 May 1997. */
9977-/* #include <malloc.h> */
9978- #pragma alloca
9979-#define YYSTACK_USE_ALLOCA
9980-#else /* not MSDOS, or __TURBOC__, or _AIX */
9981-#if 0
9982-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
9983- and on HPUX 10. Eventually we can turn this on. */
9984-#define YYSTACK_USE_ALLOCA
9985-#define alloca __builtin_alloca
9986-#endif /* __hpux */
9987-#endif
9988-#endif /* not _AIX */
9989-#endif /* not MSDOS, or __TURBOC__ */
9990-#endif /* not sparc */
9991-#endif /* not GNU C */
9992-#endif /* alloca not defined */
9993-#endif /* YYSTACK_USE_ALLOCA not defined */
9994+/* All symbols defined below should begin with yy or YY, to avoid
9995+ infringing on user name space. This should be done even for local
9996+ variables, as they might otherwise be expanded by user macros.
9997+ There are some unavoidable exceptions within include files to
9998+ define necessary library symbols; they are noted "INFRINGES ON
9999+ USER NAME SPACE" below. */
10000+
10001+#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
10002+
10003+/* The parser invokes alloca or malloc; define the necessary symbols. */
10004+
10005+# if YYSTACK_USE_ALLOCA
10006+# define YYSTACK_ALLOC alloca
10007+# else
10008+# ifndef YYSTACK_USE_ALLOCA
10009+# if defined (alloca) || defined (_ALLOCA_H)
10010+# define YYSTACK_ALLOC alloca
10011+# else
10012+# ifdef __GNUC__
10013+# define YYSTACK_ALLOC __builtin_alloca
10014+# endif
10015+# endif
10016+# endif
10017+# endif
10018+
10019+# ifdef YYSTACK_ALLOC
10020+ /* Pacify GCC's `empty if-body' warning. */
10021+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
10022+# else
10023+# if defined (__STDC__) || defined (__cplusplus)
10024+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
10025+# define YYSIZE_T size_t
10026+# endif
10027+# define YYSTACK_ALLOC malloc
10028+# define YYSTACK_FREE free
10029+# endif
10030+#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
10031+
10032+
10033+#if (! defined (yyoverflow) \
10034+ && (! defined (__cplusplus) \
10035+ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
10036+
10037+/* A type that is properly aligned for any stack member. */
10038+union yyalloc
10039+{
10040+ short yyss;
10041+ YYSTYPE yyvs;
10042+# if YYLSP_NEEDED
10043+ YYLTYPE yyls;
10044+# endif
10045+};
10046+
10047+/* The size of the maximum gap between one aligned stack and the next. */
10048+# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
10049+
10050+/* The size of an array large to enough to hold all stacks, each with
10051+ N elements. */
10052+# if YYLSP_NEEDED
10053+# define YYSTACK_BYTES(N) \
10054+ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
10055+ + 2 * YYSTACK_GAP_MAX)
10056+# else
10057+# define YYSTACK_BYTES(N) \
10058+ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
10059+ + YYSTACK_GAP_MAX)
10060+# endif
10061+
10062+/* Copy COUNT objects from FROM to TO. The source and destination do
10063+ not overlap. */
10064+# ifndef YYCOPY
10065+# if 1 < __GNUC__
10066+# define YYCOPY(To, From, Count) \
10067+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
10068+# else
10069+# define YYCOPY(To, From, Count) \
10070+ do \
10071+ { \
10072+ register YYSIZE_T yyi; \
10073+ for (yyi = 0; yyi < (Count); yyi++) \
10074+ (To)[yyi] = (From)[yyi]; \
10075+ } \
10076+ while (0)
10077+# endif
10078+# endif
10079+
10080+/* Relocate STACK from its old location to the new one. The
10081+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
10082+ elements in the stack, and YYPTR gives the new location of the
10083+ stack. Advance YYPTR to a properly aligned location for the next
10084+ stack. */
10085+# define YYSTACK_RELOCATE(Stack) \
10086+ do \
10087+ { \
10088+ YYSIZE_T yynewbytes; \
10089+ YYCOPY (&yyptr->Stack, Stack, yysize); \
10090+ Stack = &yyptr->Stack; \
10091+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
10092+ yyptr += yynewbytes / sizeof (*yyptr); \
10093+ } \
10094+ while (0)
10095
10096-#ifdef YYSTACK_USE_ALLOCA
10097-#define YYSTACK_ALLOC alloca
10098-#else
10099-#define YYSTACK_ALLOC malloc
10100 #endif
10101
10102-/* Note: there must be only one dollar sign in this file.
10103- It is replaced by the list of actions, each action
10104- as one case of the switch. */
10105+
10106+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
10107+# define YYSIZE_T __SIZE_TYPE__
10108+#endif
10109+#if ! defined (YYSIZE_T) && defined (size_t)
10110+# define YYSIZE_T size_t
10111+#endif
10112+#if ! defined (YYSIZE_T)
10113+# if defined (__STDC__) || defined (__cplusplus)
10114+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
10115+# define YYSIZE_T size_t
10116+# endif
10117+#endif
10118+#if ! defined (YYSIZE_T)
10119+# define YYSIZE_T unsigned int
10120+#endif
10121
10122 #define yyerrok (yyerrstatus = 0)
10123 #define yyclearin (yychar = YYEMPTY)
10124@@ -392,131 +456,161 @@
10125 #define YYACCEPT goto yyacceptlab
10126 #define YYABORT goto yyabortlab
10127 #define YYERROR goto yyerrlab1
10128-/* Like YYERROR except do call yyerror.
10129- This remains here temporarily to ease the
10130- transition to the new meaning of YYERROR, for GCC.
10131+/* Like YYERROR except do call yyerror. This remains here temporarily
10132+ to ease the transition to the new meaning of YYERROR, for GCC.
10133 Once GCC version 2 has supplanted version 1, this can go. */
10134 #define YYFAIL goto yyerrlab
10135 #define YYRECOVERING() (!!yyerrstatus)
10136-#define YYBACKUP(token, value) \
10137+#define YYBACKUP(Token, Value) \
10138 do \
10139 if (yychar == YYEMPTY && yylen == 1) \
10140- { yychar = (token), yylval = (value); \
10141+ { \
10142+ yychar = (Token); \
10143+ yylval = (Value); \
10144 yychar1 = YYTRANSLATE (yychar); \
10145 YYPOPSTACK; \
10146 goto yybackup; \
10147 } \
10148 else \
10149- { yyerror ("syntax error: cannot back up"); YYERROR; } \
10150+ { \
10151+ yyerror ("syntax error: cannot back up"); \
10152+ YYERROR; \
10153+ } \
10154 while (0)
10155
10156 #define YYTERROR 1
10157 #define YYERRCODE 256
10158
10159-#ifndef YYPURE
10160-#define YYLEX yylex()
10161-#endif
10162
10163-#ifdef YYPURE
10164-#ifdef YYLSP_NEEDED
10165-#ifdef YYLEX_PARAM
10166-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
10167-#else
10168-#define YYLEX yylex(&yylval, &yylloc)
10169-#endif
10170-#else /* not YYLSP_NEEDED */
10171-#ifdef YYLEX_PARAM
10172-#define YYLEX yylex(&yylval, YYLEX_PARAM)
10173-#else
10174-#define YYLEX yylex(&yylval)
10175-#endif
10176-#endif /* not YYLSP_NEEDED */
10177+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
10178+ are run).
10179+
10180+ When YYLLOC_DEFAULT is run, CURRENT is set the location of the
10181+ first token. By default, to implement support for ranges, extend
10182+ its range to the last symbol. */
10183+
10184+#ifndef YYLLOC_DEFAULT
10185+# define YYLLOC_DEFAULT(Current, Rhs, N) \
10186+ Current.last_line = Rhs[N].last_line; \
10187+ Current.last_column = Rhs[N].last_column;
10188 #endif
10189
10190-/* If nonreentrant, generate the variables here */
10191
10192-#ifndef YYPURE
10193+/* YYLEX -- calling `yylex' with the right arguments. */
10194
10195-int yychar; /* the lookahead symbol */
10196-YYSTYPE yylval; /* the semantic value of the */
10197- /* lookahead symbol */
10198+#if YYPURE
10199+# if YYLSP_NEEDED
10200+# ifdef YYLEX_PARAM
10201+# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
10202+# else
10203+# define YYLEX yylex (&yylval, &yylloc)
10204+# endif
10205+# else /* !YYLSP_NEEDED */
10206+# ifdef YYLEX_PARAM
10207+# define YYLEX yylex (&yylval, YYLEX_PARAM)
10208+# else
10209+# define YYLEX yylex (&yylval)
10210+# endif
10211+# endif /* !YYLSP_NEEDED */
10212+#else /* !YYPURE */
10213+# define YYLEX yylex ()
10214+#endif /* !YYPURE */
10215
10216-#ifdef YYLSP_NEEDED
10217-YYLTYPE yylloc; /* location data for the lookahead */
10218- /* symbol */
10219-#endif
10220
10221-int yynerrs; /* number of parse errors so far */
10222-#endif /* not YYPURE */
10223+/* Enable debugging if requested. */
10224+#if YYDEBUG
10225
10226-#if YYDEBUG != 0
10227-int yydebug; /* nonzero means print parse trace */
10228-/* Since this is uninitialized, it does not stop multiple parsers
10229- from coexisting. */
10230-#endif
10231+# ifndef YYFPRINTF
10232+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
10233+# define YYFPRINTF fprintf
10234+# endif
10235
10236-/* YYINITDEPTH indicates the initial size of the parser's stacks */
10237+# define YYDPRINTF(Args) \
10238+do { \
10239+ if (yydebug) \
10240+ YYFPRINTF Args; \
10241+} while (0)
10242+/* Nonzero means print parse trace. It is left uninitialized so that
10243+ multiple parsers can coexist. */
10244+int yydebug;
10245+#else /* !YYDEBUG */
10246+# define YYDPRINTF(Args)
10247+#endif /* !YYDEBUG */
10248
10249+/* YYINITDEPTH -- initial size of the parser's stacks. */
10250 #ifndef YYINITDEPTH
10251-#define YYINITDEPTH 200
10252+# define YYINITDEPTH 200
10253 #endif
10254
10255-/* YYMAXDEPTH is the maximum size the stacks can grow to
10256- (effective only if the built-in stack extension method is used). */
10257+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
10258+ if the built-in stack extension method is used).
10259+
10260+ Do not make this value too large; the results are undefined if
10261+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
10262+ evaluated with infinite-precision integer arithmetic. */
10263
10264 #if YYMAXDEPTH == 0
10265-#undef YYMAXDEPTH
10266+# undef YYMAXDEPTH
10267 #endif
10268
10269 #ifndef YYMAXDEPTH
10270-#define YYMAXDEPTH 10000
10271+# define YYMAXDEPTH 10000
10272 #endif
10273
10274-/* Define __yy_memcpy. Note that the size argument
10275- should be passed with type unsigned int, because that is what the non-GCC
10276- definitions require. With GCC, __builtin_memcpy takes an arg
10277- of type size_t, but it can handle unsigned int. */
10278-
10279-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
10280-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
10281-#else /* not GNU C or C++ */
10282-#ifndef __cplusplus
10283+#ifdef YYERROR_VERBOSE
10284
10285-/* This is the most reliable way to avoid incompatibilities
10286- in available built-in functions on various systems. */
10287-static void
10288-__yy_memcpy (to, from, count)
10289- char *to;
10290- char *from;
10291- unsigned int count;
10292+# ifndef yystrlen
10293+# if defined (__GLIBC__) && defined (_STRING_H)
10294+# define yystrlen strlen
10295+# else
10296+/* Return the length of YYSTR. */
10297+static YYSIZE_T
10298+# if defined (__STDC__) || defined (__cplusplus)
10299+yystrlen (const char *yystr)
10300+# else
10301+yystrlen (yystr)
10302+ const char *yystr;
10303+# endif
10304 {
10305- register char *f = from;
10306- register char *t = to;
10307- register int i = count;
10308+ register const char *yys = yystr;
10309
10310- while (i-- > 0)
10311- *t++ = *f++;
10312-}
10313+ while (*yys++ != '\0')
10314+ continue;
10315
10316-#else /* __cplusplus */
10317+ return yys - yystr - 1;
10318+}
10319+# endif
10320+# endif
10321
10322-/* This is the most reliable way to avoid incompatibilities
10323- in available built-in functions on various systems. */
10324-static void
10325-__yy_memcpy (char *to, char *from, unsigned int count)
10326+# ifndef yystpcpy
10327+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
10328+# define yystpcpy stpcpy
10329+# else
10330+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
10331+ YYDEST. */
10332+static char *
10333+# if defined (__STDC__) || defined (__cplusplus)
10334+yystpcpy (char *yydest, const char *yysrc)
10335+# else
10336+yystpcpy (yydest, yysrc)
10337+ char *yydest;
10338+ const char *yysrc;
10339+# endif
10340 {
10341- register char *t = to;
10342- register char *f = from;
10343- register int i = count;
10344+ register char *yyd = yydest;
10345+ register const char *yys = yysrc;
10346
10347- while (i-- > 0)
10348- *t++ = *f++;
10349-}
10350+ while ((*yyd++ = *yys++) != '\0')
10351+ continue;
10352
10353-#endif
10354+ return yyd - 1;
10355+}
10356+# endif
10357+# endif
10358 #endif
10359
10360-#line 217 "/usr/share/bison/bison.simple"
10361+#line 315 "/usr/local/share/bison/bison.simple"
10362+
10363
10364 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
10365 into yyparse. The argument should have type void *.
10366@@ -525,76 +619,121 @@
10367 to the proper pointer type. */
10368
10369 #ifdef YYPARSE_PARAM
10370-#ifdef __cplusplus
10371-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
10372-#define YYPARSE_PARAM_DECL
10373-#else /* not __cplusplus */
10374-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
10375-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
10376-#endif /* not __cplusplus */
10377-#else /* not YYPARSE_PARAM */
10378-#define YYPARSE_PARAM_ARG
10379-#define YYPARSE_PARAM_DECL
10380-#endif /* not YYPARSE_PARAM */
10381+# if defined (__STDC__) || defined (__cplusplus)
10382+# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
10383+# define YYPARSE_PARAM_DECL
10384+# else
10385+# define YYPARSE_PARAM_ARG YYPARSE_PARAM
10386+# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
10387+# endif
10388+#else /* !YYPARSE_PARAM */
10389+# define YYPARSE_PARAM_ARG
10390+# define YYPARSE_PARAM_DECL
10391+#endif /* !YYPARSE_PARAM */
10392
10393 /* Prevent warning if -Wstrict-prototypes. */
10394 #ifdef __GNUC__
10395-#ifdef YYPARSE_PARAM
10396+# ifdef YYPARSE_PARAM
10397 int yyparse (void *);
10398-#else
10399+# else
10400 int yyparse (void);
10401+# endif
10402 #endif
10403+
10404+/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
10405+ variables are global, or local to YYPARSE. */
10406+
10407+#define YY_DECL_NON_LSP_VARIABLES \
10408+/* The lookahead symbol. */ \
10409+int yychar; \
10410+ \
10411+/* The semantic value of the lookahead symbol. */ \
10412+YYSTYPE yylval; \
10413+ \
10414+/* Number of parse errors so far. */ \
10415+int yynerrs;
10416+
10417+#if YYLSP_NEEDED
10418+# define YY_DECL_VARIABLES \
10419+YY_DECL_NON_LSP_VARIABLES \
10420+ \
10421+/* Location data for the lookahead symbol. */ \
10422+YYLTYPE yylloc;
10423+#else
10424+# define YY_DECL_VARIABLES \
10425+YY_DECL_NON_LSP_VARIABLES
10426 #endif
10427
10428+
10429+/* If nonreentrant, generate the variables here. */
10430+
10431+#if !YYPURE
10432+YY_DECL_VARIABLES
10433+#endif /* !YYPURE */
10434+
10435 int
10436-yyparse(YYPARSE_PARAM_ARG)
10437+yyparse (YYPARSE_PARAM_ARG)
10438 YYPARSE_PARAM_DECL
10439 {
10440+ /* If reentrant, generate the variables here. */
10441+#if YYPURE
10442+ YY_DECL_VARIABLES
10443+#endif /* !YYPURE */
10444+
10445 register int yystate;
10446 register int yyn;
10447- register short *yyssp;
10448- register YYSTYPE *yyvsp;
10449- int yyerrstatus; /* number of tokens to shift before error messages enabled */
10450- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
10451+ int yyresult;
10452+ /* Number of tokens to shift before error messages enabled. */
10453+ int yyerrstatus;
10454+ /* Lookahead token as an internal (translated) token number. */
10455+ int yychar1 = 0;
10456
10457- short yyssa[YYINITDEPTH]; /* the state stack */
10458- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
10459+ /* Three stacks and their tools:
10460+ `yyss': related to states,
10461+ `yyvs': related to semantic values,
10462+ `yyls': related to locations.
10463
10464- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
10465- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
10466+ Refer to the stacks thru separate pointers, to allow yyoverflow
10467+ to reallocate them elsewhere. */
10468
10469-#ifdef YYLSP_NEEDED
10470- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
10471+ /* The state stack. */
10472+ short yyssa[YYINITDEPTH];
10473+ short *yyss = yyssa;
10474+ register short *yyssp;
10475+
10476+ /* The semantic value stack. */
10477+ YYSTYPE yyvsa[YYINITDEPTH];
10478+ YYSTYPE *yyvs = yyvsa;
10479+ register YYSTYPE *yyvsp;
10480+
10481+#if YYLSP_NEEDED
10482+ /* The location stack. */
10483+ YYLTYPE yylsa[YYINITDEPTH];
10484 YYLTYPE *yyls = yylsa;
10485 YYLTYPE *yylsp;
10486+#endif
10487
10488-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
10489+#if YYLSP_NEEDED
10490+# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
10491 #else
10492-#define YYPOPSTACK (yyvsp--, yyssp--)
10493+# define YYPOPSTACK (yyvsp--, yyssp--)
10494 #endif
10495
10496- int yystacksize = YYINITDEPTH;
10497- int yyfree_stacks = 0;
10498+ YYSIZE_T yystacksize = YYINITDEPTH;
10499
10500-#ifdef YYPURE
10501- int yychar;
10502- YYSTYPE yylval;
10503- int yynerrs;
10504-#ifdef YYLSP_NEEDED
10505- YYLTYPE yylloc;
10506-#endif
10507-#endif
10508
10509- YYSTYPE yyval; /* the variable used to return */
10510- /* semantic values from the action */
10511- /* routines */
10512+ /* The variables used to return semantic value and location from the
10513+ action routines. */
10514+ YYSTYPE yyval;
10515+#if YYLSP_NEEDED
10516+ YYLTYPE yyloc;
10517+#endif
10518
10519+ /* When reducing, the number of symbols on the RHS of the reduced
10520+ rule. */
10521 int yylen;
10522
10523-#if YYDEBUG != 0
10524- if (yydebug)
10525- fprintf(stderr, "Starting parse\n");
10526-#endif
10527+ YYDPRINTF ((stderr, "Starting parse\n"));
10528
10529 yystate = 0;
10530 yyerrstatus = 0;
10531@@ -606,110 +745,110 @@
10532 so that they stay on the same level as the state stack.
10533 The wasted elements are never initialized. */
10534
10535- yyssp = yyss - 1;
10536+ yyssp = yyss;
10537 yyvsp = yyvs;
10538-#ifdef YYLSP_NEEDED
10539+#if YYLSP_NEEDED
10540 yylsp = yyls;
10541 #endif
10542+ goto yysetstate;
10543
10544-/* Push a new state, which is found in yystate . */
10545-/* In all cases, when you get here, the value and location stacks
10546- have just been pushed. so pushing a state here evens the stacks. */
10547-yynewstate:
10548+/*------------------------------------------------------------.
10549+| yynewstate -- Push a new state, which is found in yystate. |
10550+`------------------------------------------------------------*/
10551+ yynewstate:
10552+ /* In all cases, when you get here, the value and location stacks
10553+ have just been pushed. so pushing a state here evens the stacks.
10554+ */
10555+ yyssp++;
10556
10557- *++yyssp = yystate;
10558+ yysetstate:
10559+ *yyssp = yystate;
10560
10561 if (yyssp >= yyss + yystacksize - 1)
10562 {
10563- /* Give user a chance to reallocate the stack */
10564- /* Use copies of these so that the &'s don't force the real ones into memory. */
10565- YYSTYPE *yyvs1 = yyvs;
10566- short *yyss1 = yyss;
10567-#ifdef YYLSP_NEEDED
10568- YYLTYPE *yyls1 = yyls;
10569-#endif
10570-
10571 /* Get the current used size of the three stacks, in elements. */
10572- int size = yyssp - yyss + 1;
10573+ YYSIZE_T yysize = yyssp - yyss + 1;
10574
10575 #ifdef yyoverflow
10576- /* Each stack pointer address is followed by the size of
10577- the data in use in that stack, in bytes. */
10578-#ifdef YYLSP_NEEDED
10579- /* This used to be a conditional around just the two extra args,
10580- but that might be undefined if yyoverflow is a macro. */
10581- yyoverflow("parser stack overflow",
10582- &yyss1, size * sizeof (*yyssp),
10583- &yyvs1, size * sizeof (*yyvsp),
10584- &yyls1, size * sizeof (*yylsp),
10585- &yystacksize);
10586-#else
10587- yyoverflow("parser stack overflow",
10588- &yyss1, size * sizeof (*yyssp),
10589- &yyvs1, size * sizeof (*yyvsp),
10590- &yystacksize);
10591-#endif
10592+ {
10593+ /* Give user a chance to reallocate the stack. Use copies of
10594+ these so that the &'s don't force the real ones into
10595+ memory. */
10596+ YYSTYPE *yyvs1 = yyvs;
10597+ short *yyss1 = yyss;
10598
10599- yyss = yyss1; yyvs = yyvs1;
10600-#ifdef YYLSP_NEEDED
10601- yyls = yyls1;
10602-#endif
10603+ /* Each stack pointer address is followed by the size of the
10604+ data in use in that stack, in bytes. */
10605+# if YYLSP_NEEDED
10606+ YYLTYPE *yyls1 = yyls;
10607+ /* This used to be a conditional around just the two extra args,
10608+ but that might be undefined if yyoverflow is a macro. */
10609+ yyoverflow ("parser stack overflow",
10610+ &yyss1, yysize * sizeof (*yyssp),
10611+ &yyvs1, yysize * sizeof (*yyvsp),
10612+ &yyls1, yysize * sizeof (*yylsp),
10613+ &yystacksize);
10614+ yyls = yyls1;
10615+# else
10616+ yyoverflow ("parser stack overflow",
10617+ &yyss1, yysize * sizeof (*yyssp),
10618+ &yyvs1, yysize * sizeof (*yyvsp),
10619+ &yystacksize);
10620+# endif
10621+ yyss = yyss1;
10622+ yyvs = yyvs1;
10623+ }
10624 #else /* no yyoverflow */
10625+# ifndef YYSTACK_RELOCATE
10626+ goto yyoverflowlab;
10627+# else
10628 /* Extend the stack our own way. */
10629 if (yystacksize >= YYMAXDEPTH)
10630- {
10631- yyerror("parser stack overflow");
10632- if (yyfree_stacks)
10633- {
10634- free (yyss);
10635- free (yyvs);
10636-#ifdef YYLSP_NEEDED
10637- free (yyls);
10638-#endif
10639- }
10640- return 2;
10641- }
10642+ goto yyoverflowlab;
10643 yystacksize *= 2;
10644 if (yystacksize > YYMAXDEPTH)
10645 yystacksize = YYMAXDEPTH;
10646-#ifndef YYSTACK_USE_ALLOCA
10647- yyfree_stacks = 1;
10648-#endif
10649- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
10650- __yy_memcpy ((char *)yyss, (char *)yyss1,
10651- size * (unsigned int) sizeof (*yyssp));
10652- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
10653- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
10654- size * (unsigned int) sizeof (*yyvsp));
10655-#ifdef YYLSP_NEEDED
10656- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
10657- __yy_memcpy ((char *)yyls, (char *)yyls1,
10658- size * (unsigned int) sizeof (*yylsp));
10659-#endif
10660+
10661+ {
10662+ short *yyss1 = yyss;
10663+ union yyalloc *yyptr =
10664+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
10665+ if (! yyptr)
10666+ goto yyoverflowlab;
10667+ YYSTACK_RELOCATE (yyss);
10668+ YYSTACK_RELOCATE (yyvs);
10669+# if YYLSP_NEEDED
10670+ YYSTACK_RELOCATE (yyls);
10671+# endif
10672+# undef YYSTACK_RELOCATE
10673+ if (yyss1 != yyssa)
10674+ YYSTACK_FREE (yyss1);
10675+ }
10676+# endif
10677 #endif /* no yyoverflow */
10678
10679- yyssp = yyss + size - 1;
10680- yyvsp = yyvs + size - 1;
10681-#ifdef YYLSP_NEEDED
10682- yylsp = yyls + size - 1;
10683+ yyssp = yyss + yysize - 1;
10684+ yyvsp = yyvs + yysize - 1;
10685+#if YYLSP_NEEDED
10686+ yylsp = yyls + yysize - 1;
10687 #endif
10688
10689-#if YYDEBUG != 0
10690- if (yydebug)
10691- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
10692-#endif
10693+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
10694+ (unsigned long int) yystacksize));
10695
10696 if (yyssp >= yyss + yystacksize - 1)
10697 YYABORT;
10698 }
10699
10700-#if YYDEBUG != 0
10701- if (yydebug)
10702- fprintf(stderr, "Entering state %d\n", yystate);
10703-#endif
10704+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
10705
10706 goto yybackup;
10707- yybackup:
10708+
10709+
10710+/*-----------.
10711+| yybackup. |
10712+`-----------*/
10713+yybackup:
10714
10715 /* Do appropriate processing given the current state. */
10716 /* Read a lookahead token if we need one and don't already have one. */
10717@@ -728,10 +867,7 @@
10718
10719 if (yychar == YYEMPTY)
10720 {
10721-#if YYDEBUG != 0
10722- if (yydebug)
10723- fprintf(stderr, "Reading a token: ");
10724-#endif
10725+ YYDPRINTF ((stderr, "Reading a token: "));
10726 yychar = YYLEX;
10727 }
10728
10729@@ -742,25 +878,25 @@
10730 yychar1 = 0;
10731 yychar = YYEOF; /* Don't call YYLEX any more */
10732
10733-#if YYDEBUG != 0
10734- if (yydebug)
10735- fprintf(stderr, "Now at end of input.\n");
10736-#endif
10737+ YYDPRINTF ((stderr, "Now at end of input.\n"));
10738 }
10739 else
10740 {
10741- yychar1 = YYTRANSLATE(yychar);
10742+ yychar1 = YYTRANSLATE (yychar);
10743
10744-#if YYDEBUG != 0
10745+#if YYDEBUG
10746+ /* We have to keep this `#if YYDEBUG', since we use variables
10747+ which are defined only if `YYDEBUG' is set. */
10748 if (yydebug)
10749 {
10750- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
10751- /* Give the individual parser a way to print the precise meaning
10752- of a token, for further debugging info. */
10753-#ifdef YYPRINT
10754+ YYFPRINTF (stderr, "Next token is %d (%s",
10755+ yychar, yytname[yychar1]);
10756+ /* Give the individual parser a way to print the precise
10757+ meaning of a token, for further debugging info. */
10758+# ifdef YYPRINT
10759 YYPRINT (stderr, yychar, yylval);
10760-#endif
10761- fprintf (stderr, ")\n");
10762+# endif
10763+ YYFPRINTF (stderr, ")\n");
10764 }
10765 #endif
10766 }
10767@@ -792,177 +928,185 @@
10768 YYACCEPT;
10769
10770 /* Shift the lookahead token. */
10771-
10772-#if YYDEBUG != 0
10773- if (yydebug)
10774- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
10775-#endif
10776+ YYDPRINTF ((stderr, "Shifting token %d (%s), ",
10777+ yychar, yytname[yychar1]));
10778
10779 /* Discard the token being shifted unless it is eof. */
10780 if (yychar != YYEOF)
10781 yychar = YYEMPTY;
10782
10783 *++yyvsp = yylval;
10784-#ifdef YYLSP_NEEDED
10785+#if YYLSP_NEEDED
10786 *++yylsp = yylloc;
10787 #endif
10788
10789- /* count tokens shifted since error; after three, turn off error status. */
10790- if (yyerrstatus) yyerrstatus--;
10791+ /* Count tokens shifted since error; after three, turn off error
10792+ status. */
10793+ if (yyerrstatus)
10794+ yyerrstatus--;
10795
10796 yystate = yyn;
10797 goto yynewstate;
10798
10799-/* Do the default action for the current state. */
10800-yydefault:
10801
10802+/*-----------------------------------------------------------.
10803+| yydefault -- do the default action for the current state. |
10804+`-----------------------------------------------------------*/
10805+yydefault:
10806 yyn = yydefact[yystate];
10807 if (yyn == 0)
10808 goto yyerrlab;
10809+ goto yyreduce;
10810
10811-/* Do a reduction. yyn is the number of a rule to reduce with. */
10812+
10813+/*-----------------------------.
10814+| yyreduce -- Do a reduction. |
10815+`-----------------------------*/
10816 yyreduce:
10817+ /* yyn is the number of a rule to reduce with. */
10818 yylen = yyr2[yyn];
10819- if (yylen > 0)
10820- yyval = yyvsp[1-yylen]; /* implement default value of the action */
10821
10822-#if YYDEBUG != 0
10823+ /* If YYLEN is nonzero, implement the default value of the action:
10824+ `$$ = $1'.
10825+
10826+ Otherwise, the following line sets YYVAL to the semantic value of
10827+ the lookahead token. This behavior is undocumented and Bison
10828+ users should not rely upon it. Assigning to YYVAL
10829+ unconditionally makes the parser a bit smaller, and it avoids a
10830+ GCC warning that YYVAL may be used uninitialized. */
10831+ yyval = yyvsp[1-yylen];
10832+
10833+#if YYLSP_NEEDED
10834+ /* Similarly for the default location. Let the user run additional
10835+ commands if for instance locations are ranges. */
10836+ yyloc = yylsp[1-yylen];
10837+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
10838+#endif
10839+
10840+#if YYDEBUG
10841+ /* We have to keep this `#if YYDEBUG', since we use variables which
10842+ are defined only if `YYDEBUG' is set. */
10843 if (yydebug)
10844 {
10845- int i;
10846+ int yyi;
10847
10848- fprintf (stderr, "Reducing via rule %d (line %d), ",
10849- yyn, yyrline[yyn]);
10850+ YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
10851+ yyn, yyrline[yyn]);
10852
10853 /* Print the symbols being reduced, and their result. */
10854- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
10855- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
10856- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
10857+ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
10858+ YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
10859+ YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
10860 }
10861 #endif
10862
10863-
10864 switch (yyn) {
10865
10866 case 1:
10867-#line 178 "plural.y"
10868+#line 151 "plural.y"
10869 {
10870 if (yyvsp[0].exp == NULL)
10871 YYABORT;
10872 ((struct parse_args *) arg)->res = yyvsp[0].exp;
10873- ;
10874- break;}
10875+ }
10876+ break;
10877 case 2:
10878-#line 186 "plural.y"
10879+#line 159 "plural.y"
10880 {
10881 yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
10882- ;
10883- break;}
10884+ }
10885+ break;
10886 case 3:
10887-#line 190 "plural.y"
10888+#line 163 "plural.y"
10889 {
10890 yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
10891- ;
10892- break;}
10893+ }
10894+ break;
10895 case 4:
10896-#line 194 "plural.y"
10897+#line 167 "plural.y"
10898 {
10899 yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
10900- ;
10901- break;}
10902+ }
10903+ break;
10904 case 5:
10905-#line 198 "plural.y"
10906+#line 171 "plural.y"
10907 {
10908 yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
10909- ;
10910- break;}
10911+ }
10912+ break;
10913 case 6:
10914-#line 202 "plural.y"
10915+#line 175 "plural.y"
10916 {
10917 yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
10918- ;
10919- break;}
10920+ }
10921+ break;
10922 case 7:
10923-#line 206 "plural.y"
10924+#line 179 "plural.y"
10925 {
10926 yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
10927- ;
10928- break;}
10929+ }
10930+ break;
10931 case 8:
10932-#line 210 "plural.y"
10933+#line 183 "plural.y"
10934 {
10935 yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
10936- ;
10937- break;}
10938+ }
10939+ break;
10940 case 9:
10941-#line 214 "plural.y"
10942+#line 187 "plural.y"
10943 {
10944 yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
10945- ;
10946- break;}
10947+ }
10948+ break;
10949 case 10:
10950-#line 218 "plural.y"
10951+#line 191 "plural.y"
10952 {
10953 yyval.exp = new_exp_0 (var);
10954- ;
10955- break;}
10956+ }
10957+ break;
10958 case 11:
10959-#line 222 "plural.y"
10960+#line 195 "plural.y"
10961 {
10962 if ((yyval.exp = new_exp_0 (num)) != NULL)
10963 yyval.exp->val.num = yyvsp[0].num;
10964- ;
10965- break;}
10966+ }
10967+ break;
10968 case 12:
10969-#line 227 "plural.y"
10970+#line 200 "plural.y"
10971 {
10972 yyval.exp = yyvsp[-1].exp;
10973- ;
10974- break;}
10975+ }
10976+ break;
10977 }
10978- /* the action file gets copied in in place of this dollarsign */
10979-#line 543 "/usr/share/bison/bison.simple"
10980+
10981+#line 705 "/usr/local/share/bison/bison.simple"
10982+
10983
10984 yyvsp -= yylen;
10985 yyssp -= yylen;
10986-#ifdef YYLSP_NEEDED
10987+#if YYLSP_NEEDED
10988 yylsp -= yylen;
10989 #endif
10990
10991-#if YYDEBUG != 0
10992+#if YYDEBUG
10993 if (yydebug)
10994 {
10995- short *ssp1 = yyss - 1;
10996- fprintf (stderr, "state stack now");
10997- while (ssp1 != yyssp)
10998- fprintf (stderr, " %d", *++ssp1);
10999- fprintf (stderr, "\n");
11000+ short *yyssp1 = yyss - 1;
11001+ YYFPRINTF (stderr, "state stack now");
11002+ while (yyssp1 != yyssp)
11003+ YYFPRINTF (stderr, " %d", *++yyssp1);
11004+ YYFPRINTF (stderr, "\n");
11005 }
11006 #endif
11007
11008 *++yyvsp = yyval;
11009-
11010-#ifdef YYLSP_NEEDED
11011- yylsp++;
11012- if (yylen == 0)
11013- {
11014- yylsp->first_line = yylloc.first_line;
11015- yylsp->first_column = yylloc.first_column;
11016- yylsp->last_line = (yylsp-1)->last_line;
11017- yylsp->last_column = (yylsp-1)->last_column;
11018- yylsp->text = 0;
11019- }
11020- else
11021- {
11022- yylsp->last_line = (yylsp+yylen-1)->last_line;
11023- yylsp->last_column = (yylsp+yylen-1)->last_column;
11024- }
11025+#if YYLSP_NEEDED
11026+ *++yylsp = yyloc;
11027 #endif
11028
11029- /* Now "shift" the result of the reduction.
11030- Determine what state that goes to,
11031- based on the state we popped back to
11032- and the rule number reduced by. */
11033+ /* Now `shift' the result of the reduction. Determine what state
11034+ that goes to, based on the state we popped back to and the rule
11035+ number reduced by. */
11036
11037 yyn = yyr1[yyn];
11038
11039@@ -974,10 +1118,13 @@
11040
11041 goto yynewstate;
11042
11043-yyerrlab: /* here on detecting error */
11044
11045- if (! yyerrstatus)
11046- /* If not already recovering from an error, report this error. */
11047+/*------------------------------------.
11048+| yyerrlab -- here on detecting error |
11049+`------------------------------------*/
11050+yyerrlab:
11051+ /* If not already recovering from an error, report this error. */
11052+ if (!yyerrstatus)
11053 {
11054 ++yynerrs;
11055
11056@@ -986,102 +1133,121 @@
11057
11058 if (yyn > YYFLAG && yyn < YYLAST)
11059 {
11060- int size = 0;
11061- char *msg;
11062- int x, count;
11063+ YYSIZE_T yysize = 0;
11064+ char *yymsg;
11065+ int yyx, yycount;
11066
11067- count = 0;
11068- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
11069- for (x = (yyn < 0 ? -yyn : 0);
11070- x < (sizeof(yytname) / sizeof(char *)); x++)
11071- if (yycheck[x + yyn] == x)
11072- size += strlen(yytname[x]) + 15, count++;
11073- msg = (char *) malloc(size + 15);
11074- if (msg != 0)
11075+ yycount = 0;
11076+ /* Start YYX at -YYN if negative to avoid negative indexes in
11077+ YYCHECK. */
11078+ for (yyx = yyn < 0 ? -yyn : 0;
11079+ yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
11080+ if (yycheck[yyx + yyn] == yyx)
11081+ yysize += yystrlen (yytname[yyx]) + 15, yycount++;
11082+ yysize += yystrlen ("parse error, unexpected ") + 1;
11083+ yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
11084+ yymsg = (char *) YYSTACK_ALLOC (yysize);
11085+ if (yymsg != 0)
11086 {
11087- strcpy(msg, "parse error");
11088+ char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
11089+ yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
11090
11091- if (count < 5)
11092+ if (yycount < 5)
11093 {
11094- count = 0;
11095- for (x = (yyn < 0 ? -yyn : 0);
11096- x < (sizeof(yytname) / sizeof(char *)); x++)
11097- if (yycheck[x + yyn] == x)
11098+ yycount = 0;
11099+ for (yyx = yyn < 0 ? -yyn : 0;
11100+ yyx < (int) (sizeof (yytname) / sizeof (char *));
11101+ yyx++)
11102+ if (yycheck[yyx + yyn] == yyx)
11103 {
11104- strcat(msg, count == 0 ? ", expecting `" : " or `");
11105- strcat(msg, yytname[x]);
11106- strcat(msg, "'");
11107- count++;
11108+ const char *yyq = ! yycount ? ", expecting " : " or ";
11109+ yyp = yystpcpy (yyp, yyq);
11110+ yyp = yystpcpy (yyp, yytname[yyx]);
11111+ yycount++;
11112 }
11113 }
11114- yyerror(msg);
11115- free(msg);
11116+ yyerror (yymsg);
11117+ YYSTACK_FREE (yymsg);
11118 }
11119 else
11120- yyerror ("parse error; also virtual memory exceeded");
11121+ yyerror ("parse error; also virtual memory exhausted");
11122 }
11123 else
11124-#endif /* YYERROR_VERBOSE */
11125- yyerror("parse error");
11126+#endif /* defined (YYERROR_VERBOSE) */
11127+ yyerror ("parse error");
11128 }
11129-
11130 goto yyerrlab1;
11131-yyerrlab1: /* here on error raised explicitly by an action */
11132
11133+
11134+/*--------------------------------------------------.
11135+| yyerrlab1 -- error raised explicitly by an action |
11136+`--------------------------------------------------*/
11137+yyerrlab1:
11138 if (yyerrstatus == 3)
11139 {
11140- /* if just tried and failed to reuse lookahead token after an error, discard it. */
11141+ /* If just tried and failed to reuse lookahead token after an
11142+ error, discard it. */
11143
11144 /* return failure if at end of input */
11145 if (yychar == YYEOF)
11146 YYABORT;
11147-
11148-#if YYDEBUG != 0
11149- if (yydebug)
11150- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
11151-#endif
11152-
11153+ YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
11154+ yychar, yytname[yychar1]));
11155 yychar = YYEMPTY;
11156 }
11157
11158- /* Else will try to reuse lookahead token
11159- after shifting the error token. */
11160+ /* Else will try to reuse lookahead token after shifting the error
11161+ token. */
11162
11163 yyerrstatus = 3; /* Each real token shifted decrements this */
11164
11165 goto yyerrhandle;
11166
11167-yyerrdefault: /* current state does not do anything special for the error token. */
11168
11169+/*-------------------------------------------------------------------.
11170+| yyerrdefault -- current state does not do anything special for the |
11171+| error token. |
11172+`-------------------------------------------------------------------*/
11173+yyerrdefault:
11174 #if 0
11175 /* This is wrong; only states that explicitly want error tokens
11176 should shift them. */
11177- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
11178- if (yyn) goto yydefault;
11179+
11180+ /* If its default is to accept any token, ok. Otherwise pop it. */
11181+ yyn = yydefact[yystate];
11182+ if (yyn)
11183+ goto yydefault;
11184 #endif
11185
11186-yyerrpop: /* pop the current state because it cannot handle the error token */
11187
11188- if (yyssp == yyss) YYABORT;
11189+/*---------------------------------------------------------------.
11190+| yyerrpop -- pop the current state because it cannot handle the |
11191+| error token |
11192+`---------------------------------------------------------------*/
11193+yyerrpop:
11194+ if (yyssp == yyss)
11195+ YYABORT;
11196 yyvsp--;
11197 yystate = *--yyssp;
11198-#ifdef YYLSP_NEEDED
11199+#if YYLSP_NEEDED
11200 yylsp--;
11201 #endif
11202
11203-#if YYDEBUG != 0
11204+#if YYDEBUG
11205 if (yydebug)
11206 {
11207- short *ssp1 = yyss - 1;
11208- fprintf (stderr, "Error: state stack now");
11209- while (ssp1 != yyssp)
11210- fprintf (stderr, " %d", *++ssp1);
11211- fprintf (stderr, "\n");
11212+ short *yyssp1 = yyss - 1;
11213+ YYFPRINTF (stderr, "Error: state stack now");
11214+ while (yyssp1 != yyssp)
11215+ YYFPRINTF (stderr, " %d", *++yyssp1);
11216+ YYFPRINTF (stderr, "\n");
11217 }
11218 #endif
11219
11220+/*--------------.
11221+| yyerrhandle. |
11222+`--------------*/
11223 yyerrhandle:
11224-
11225 yyn = yypact[yystate];
11226 if (yyn == YYFLAG)
11227 goto yyerrdefault;
11228@@ -1104,50 +1270,52 @@
11229 if (yyn == YYFINAL)
11230 YYACCEPT;
11231
11232-#if YYDEBUG != 0
11233- if (yydebug)
11234- fprintf(stderr, "Shifting error token, ");
11235-#endif
11236+ YYDPRINTF ((stderr, "Shifting error token, "));
11237
11238 *++yyvsp = yylval;
11239-#ifdef YYLSP_NEEDED
11240+#if YYLSP_NEEDED
11241 *++yylsp = yylloc;
11242 #endif
11243
11244 yystate = yyn;
11245 goto yynewstate;
11246
11247- yyacceptlab:
11248- /* YYACCEPT comes here. */
11249- if (yyfree_stacks)
11250- {
11251- free (yyss);
11252- free (yyvs);
11253-#ifdef YYLSP_NEEDED
11254- free (yyls);
11255-#endif
11256- }
11257- return 0;
11258
11259- yyabortlab:
11260- /* YYABORT comes here. */
11261- if (yyfree_stacks)
11262- {
11263- free (yyss);
11264- free (yyvs);
11265-#ifdef YYLSP_NEEDED
11266- free (yyls);
11267+/*-------------------------------------.
11268+| yyacceptlab -- YYACCEPT comes here. |
11269+`-------------------------------------*/
11270+yyacceptlab:
11271+ yyresult = 0;
11272+ goto yyreturn;
11273+
11274+/*-----------------------------------.
11275+| yyabortlab -- YYABORT comes here. |
11276+`-----------------------------------*/
11277+yyabortlab:
11278+ yyresult = 1;
11279+ goto yyreturn;
11280+
11281+/*---------------------------------------------.
11282+| yyoverflowab -- parser overflow comes here. |
11283+`---------------------------------------------*/
11284+yyoverflowlab:
11285+ yyerror ("parser stack overflow");
11286+ yyresult = 2;
11287+ /* Fall through. */
11288+
11289+yyreturn:
11290+#ifndef yyoverflow
11291+ if (yyss != yyssa)
11292+ YYSTACK_FREE (yyss);
11293 #endif
11294- }
11295- return 1;
11296+ return yyresult;
11297 }
11298-#line 232 "plural.y"
11299+#line 205 "plural.y"
11300
11301
11302 void
11303 internal_function
11304-FREE_EXPRESSION (exp)
11305- struct expression *exp;
11306+FREE_EXPRESSION (struct expression *exp)
11307 {
11308 if (exp == NULL)
11309 return;
11310@@ -1173,9 +1341,7 @@
11311
11312
11313 static int
11314-yylex (lval, pexp)
11315- YYSTYPE *lval;
11316- const char **pexp;
11317+yylex (YYSTYPE *lval, const char **pexp)
11318 {
11319 const char *exp = *pexp;
11320 int result;
11321@@ -1318,8 +1484,7 @@
11322
11323
11324 static void
11325-yyerror (str)
11326- const char *str;
11327+yyerror (const char *str)
11328 {
11329 /* Do nothing. We don't print error messages here. */
11330 }
11331diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural.y psmisc-20.2.works.clean/intl/plural.y
11332--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/plural.y 2001-04-13 23:00:43.000000000 -0500
11333+++ psmisc-20.2.works.clean/intl/plural.y 2004-10-13 15:18:41.000000000 -0500
11334@@ -1,21 +1,22 @@
11335 %{
11336 /* Expression parsing for plural form selection.
11337- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
11338+ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
11339 Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
11340
11341- This program is free software; you can redistribute it and/or modify
11342- it under the terms of the GNU General Public License as published by
11343- the Free Software Foundation; either version 2, or (at your option)
11344+ This program is free software; you can redistribute it and/or modify it
11345+ under the terms of the GNU Library General Public License as published
11346+ by the Free Software Foundation; either version 2, or (at your option)
11347 any later version.
11348
11349 This program is distributed in the hope that it will be useful,
11350 but WITHOUT ANY WARRANTY; without even the implied warranty of
11351- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11352- GNU General Public License for more details.
11353+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11354+ Library General Public License for more details.
11355
11356- You should have received a copy of the GNU General Public License
11357- along with this program; if not, write to the Free Software Foundation,
11358- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
11359+ You should have received a copy of the GNU Library General Public
11360+ License along with this program; if not, write to the Free Software
11361+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
11362+ USA. */
11363
11364 /* The bison generated parser uses alloca. AIX 3 forces us to put this
11365 declaration at the beginning of the file. The declaration in bison's
11366@@ -29,25 +30,21 @@
11367 # include <config.h>
11368 #endif
11369
11370+#include <stddef.h>
11371 #include <stdlib.h>
11372-#include "gettextP.h"
11373+#include "plural-exp.h"
11374
11375-/* Names for the libintl functions are a problem. They must not clash
11376- with existing names and they should follow ANSI C. But this source
11377- code is also used in GNU C Library where the names have a __
11378- prefix. So we have to make a difference here. */
11379-#ifdef _LIBC
11380-# define FREE_EXPRESSION __gettext_free_exp
11381-#else
11382-# define FREE_EXPRESSION gettext_free_exp__
11383-# define __gettextparse gettextparse__
11384+/* The main function generated by the parser is called __gettextparse,
11385+ but we want it to be called PLURAL_PARSE. */
11386+#ifndef _LIBC
11387+# define __gettextparse PLURAL_PARSE
11388 #endif
11389
11390 #define YYLEX_PARAM &((struct parse_args *) arg)->cp
11391 #define YYPARSE_PARAM arg
11392 %}
11393 %pure_parser
11394-%expect 10
11395+%expect 7
11396
11397 %union {
11398 unsigned long int num;
11399@@ -57,28 +54,13 @@
11400
11401 %{
11402 /* Prototypes for local functions. */
11403-static struct expression *new_exp PARAMS ((int nargs, enum operator op,
11404- struct expression * const *args));
11405-static inline struct expression *new_exp_0 PARAMS ((enum operator op));
11406-static inline struct expression *new_exp_1 PARAMS ((enum operator op,
11407- struct expression *right));
11408-static struct expression *new_exp_2 PARAMS ((enum operator op,
11409- struct expression *left,
11410- struct expression *right));
11411-static inline struct expression *new_exp_3 PARAMS ((enum operator op,
11412- struct expression *bexp,
11413- struct expression *tbranch,
11414- struct expression *fbranch));
11415-static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
11416-static void yyerror PARAMS ((const char *str));
11417+static int yylex (YYSTYPE *lval, const char **pexp);
11418+static void yyerror (const char *str);
11419
11420 /* Allocation of expressions. */
11421
11422 static struct expression *
11423-new_exp (nargs, op, args)
11424- int nargs;
11425- enum operator op;
11426- struct expression * const *args;
11427+new_exp (int nargs, enum operator op, struct expression * const *args)
11428 {
11429 int i;
11430 struct expression *newp;
11431@@ -107,16 +89,13 @@
11432 }
11433
11434 static inline struct expression *
11435-new_exp_0 (op)
11436- enum operator op;
11437+new_exp_0 (enum operator op)
11438 {
11439 return new_exp (0, op, NULL);
11440 }
11441
11442 static inline struct expression *
11443-new_exp_1 (op, right)
11444- enum operator op;
11445- struct expression *right;
11446+new_exp_1 (enum operator op, struct expression *right)
11447 {
11448 struct expression *args[1];
11449
11450@@ -125,10 +104,7 @@
11451 }
11452
11453 static struct expression *
11454-new_exp_2 (op, left, right)
11455- enum operator op;
11456- struct expression *left;
11457- struct expression *right;
11458+new_exp_2 (enum operator op, struct expression *left, struct expression *right)
11459 {
11460 struct expression *args[2];
11461
11462@@ -138,11 +114,8 @@
11463 }
11464
11465 static inline struct expression *
11466-new_exp_3 (op, bexp, tbranch, fbranch)
11467- enum operator op;
11468- struct expression *bexp;
11469- struct expression *tbranch;
11470- struct expression *fbranch;
11471+new_exp_3 (enum operator op, struct expression *bexp,
11472+ struct expression *tbranch, struct expression *fbranch)
11473 {
11474 struct expression *args[3];
11475
11476@@ -233,8 +206,7 @@
11477
11478 void
11479 internal_function
11480-FREE_EXPRESSION (exp)
11481- struct expression *exp;
11482+FREE_EXPRESSION (struct expression *exp)
11483 {
11484 if (exp == NULL)
11485 return;
11486@@ -260,9 +232,7 @@
11487
11488
11489 static int
11490-yylex (lval, pexp)
11491- YYSTYPE *lval;
11492- const char **pexp;
11493+yylex (YYSTYPE *lval, const char **pexp)
11494 {
11495 const char *exp = *pexp;
11496 int result;
11497@@ -405,8 +375,7 @@
11498
11499
11500 static void
11501-yyerror (str)
11502- const char *str;
11503+yyerror (const char *str)
11504 {
11505 /* Do nothing. We don't print error messages here. */
11506 }
11507diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-args.c psmisc-20.2.works.clean/intl/printf-args.c
11508--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-args.c 1969-12-31 18:00:00.000000000 -0600
11509+++ psmisc-20.2.works.clean/intl/printf-args.c 2004-10-13 15:18:41.000000000 -0500
11510@@ -0,0 +1,119 @@
11511+/* Decomposed printf argument list.
11512+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
11513+
11514+ This program is free software; you can redistribute it and/or modify it
11515+ under the terms of the GNU Library General Public License as published
11516+ by the Free Software Foundation; either version 2, or (at your option)
11517+ any later version.
11518+
11519+ This program is distributed in the hope that it will be useful,
11520+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11521+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11522+ Library General Public License for more details.
11523+
11524+ You should have received a copy of the GNU Library General Public
11525+ License along with this program; if not, write to the Free Software
11526+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
11527+ USA. */
11528+
11529+#ifdef HAVE_CONFIG_H
11530+# include <config.h>
11531+#endif
11532+
11533+/* Specification. */
11534+#include "printf-args.h"
11535+
11536+#ifdef STATIC
11537+STATIC
11538+#endif
11539+int
11540+printf_fetchargs (va_list args, arguments *a)
11541+{
11542+ size_t i;
11543+ argument *ap;
11544+
11545+ for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
11546+ switch (ap->type)
11547+ {
11548+ case TYPE_SCHAR:
11549+ ap->a.a_schar = va_arg (args, /*signed char*/ int);
11550+ break;
11551+ case TYPE_UCHAR:
11552+ ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
11553+ break;
11554+ case TYPE_SHORT:
11555+ ap->a.a_short = va_arg (args, /*short*/ int);
11556+ break;
11557+ case TYPE_USHORT:
11558+ ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
11559+ break;
11560+ case TYPE_INT:
11561+ ap->a.a_int = va_arg (args, int);
11562+ break;
11563+ case TYPE_UINT:
11564+ ap->a.a_uint = va_arg (args, unsigned int);
11565+ break;
11566+ case TYPE_LONGINT:
11567+ ap->a.a_longint = va_arg (args, long int);
11568+ break;
11569+ case TYPE_ULONGINT:
11570+ ap->a.a_ulongint = va_arg (args, unsigned long int);
11571+ break;
11572+#ifdef HAVE_LONG_LONG
11573+ case TYPE_LONGLONGINT:
11574+ ap->a.a_longlongint = va_arg (args, long long int);
11575+ break;
11576+ case TYPE_ULONGLONGINT:
11577+ ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
11578+ break;
11579+#endif
11580+ case TYPE_DOUBLE:
11581+ ap->a.a_double = va_arg (args, double);
11582+ break;
11583+#ifdef HAVE_LONG_DOUBLE
11584+ case TYPE_LONGDOUBLE:
11585+ ap->a.a_longdouble = va_arg (args, long double);
11586+ break;
11587+#endif
11588+ case TYPE_CHAR:
11589+ ap->a.a_char = va_arg (args, int);
11590+ break;
11591+#ifdef HAVE_WINT_T
11592+ case TYPE_WIDE_CHAR:
11593+ ap->a.a_wide_char = va_arg (args, wint_t);
11594+ break;
11595+#endif
11596+ case TYPE_STRING:
11597+ ap->a.a_string = va_arg (args, const char *);
11598+ break;
11599+#ifdef HAVE_WCHAR_T
11600+ case TYPE_WIDE_STRING:
11601+ ap->a.a_wide_string = va_arg (args, const wchar_t *);
11602+ break;
11603+#endif
11604+ case TYPE_POINTER:
11605+ ap->a.a_pointer = va_arg (args, void *);
11606+ break;
11607+ case TYPE_COUNT_SCHAR_POINTER:
11608+ ap->a.a_count_schar_pointer = va_arg (args, signed char *);
11609+ break;
11610+ case TYPE_COUNT_SHORT_POINTER:
11611+ ap->a.a_count_short_pointer = va_arg (args, short *);
11612+ break;
11613+ case TYPE_COUNT_INT_POINTER:
11614+ ap->a.a_count_int_pointer = va_arg (args, int *);
11615+ break;
11616+ case TYPE_COUNT_LONGINT_POINTER:
11617+ ap->a.a_count_longint_pointer = va_arg (args, long int *);
11618+ break;
11619+#ifdef HAVE_LONG_LONG
11620+ case TYPE_COUNT_LONGLONGINT_POINTER:
11621+ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
11622+ break;
11623+#endif
11624+ default:
11625+ /* Unknown type. */
11626+ return -1;
11627+ }
11628+ return 0;
11629+}
11630diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-args.h psmisc-20.2.works.clean/intl/printf-args.h
11631--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-args.h 1969-12-31 18:00:00.000000000 -0600
11632+++ psmisc-20.2.works.clean/intl/printf-args.h 2004-10-13 15:18:41.000000000 -0500
11633@@ -0,0 +1,137 @@
11634+/* Decomposed printf argument list.
11635+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
11636+
11637+ This program is free software; you can redistribute it and/or modify it
11638+ under the terms of the GNU Library General Public License as published
11639+ by the Free Software Foundation; either version 2, or (at your option)
11640+ any later version.
11641+
11642+ This program is distributed in the hope that it will be useful,
11643+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11644+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11645+ Library General Public License for more details.
11646+
11647+ You should have received a copy of the GNU Library General Public
11648+ License along with this program; if not, write to the Free Software
11649+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
11650+ USA. */
11651+
11652+#ifndef _PRINTF_ARGS_H
11653+#define _PRINTF_ARGS_H
11654+
11655+/* Get size_t. */
11656+#include <stddef.h>
11657+
11658+/* Get wchar_t. */
11659+#ifdef HAVE_WCHAR_T
11660+# include <stddef.h>
11661+#endif
11662+
11663+/* Get wint_t. */
11664+#ifdef HAVE_WINT_T
11665+# include <wchar.h>
11666+#endif
11667+
11668+/* Get va_list. */
11669+#include <stdarg.h>
11670+
11671+
11672+/* Argument types */
11673+typedef enum
11674+{
11675+ TYPE_NONE,
11676+ TYPE_SCHAR,
11677+ TYPE_UCHAR,
11678+ TYPE_SHORT,
11679+ TYPE_USHORT,
11680+ TYPE_INT,
11681+ TYPE_UINT,
11682+ TYPE_LONGINT,
11683+ TYPE_ULONGINT,
11684+#ifdef HAVE_LONG_LONG
11685+ TYPE_LONGLONGINT,
11686+ TYPE_ULONGLONGINT,
11687+#endif
11688+ TYPE_DOUBLE,
11689+#ifdef HAVE_LONG_DOUBLE
11690+ TYPE_LONGDOUBLE,
11691+#endif
11692+ TYPE_CHAR,
11693+#ifdef HAVE_WINT_T
11694+ TYPE_WIDE_CHAR,
11695+#endif
11696+ TYPE_STRING,
11697+#ifdef HAVE_WCHAR_T
11698+ TYPE_WIDE_STRING,
11699+#endif
11700+ TYPE_POINTER,
11701+ TYPE_COUNT_SCHAR_POINTER,
11702+ TYPE_COUNT_SHORT_POINTER,
11703+ TYPE_COUNT_INT_POINTER,
11704+ TYPE_COUNT_LONGINT_POINTER
11705+#ifdef HAVE_LONG_LONG
11706+, TYPE_COUNT_LONGLONGINT_POINTER
11707+#endif
11708+} arg_type;
11709+
11710+/* Polymorphic argument */
11711+typedef struct
11712+{
11713+ arg_type type;
11714+ union
11715+ {
11716+ signed char a_schar;
11717+ unsigned char a_uchar;
11718+ short a_short;
11719+ unsigned short a_ushort;
11720+ int a_int;
11721+ unsigned int a_uint;
11722+ long int a_longint;
11723+ unsigned long int a_ulongint;
11724+#ifdef HAVE_LONG_LONG
11725+ long long int a_longlongint;
11726+ unsigned long long int a_ulonglongint;
11727+#endif
11728+ float a_float;
11729+ double a_double;
11730+#ifdef HAVE_LONG_DOUBLE
11731+ long double a_longdouble;
11732+#endif
11733+ int a_char;
11734+#ifdef HAVE_WINT_T
11735+ wint_t a_wide_char;
11736+#endif
11737+ const char* a_string;
11738+#ifdef HAVE_WCHAR_T
11739+ const wchar_t* a_wide_string;
11740+#endif
11741+ void* a_pointer;
11742+ signed char * a_count_schar_pointer;
11743+ short * a_count_short_pointer;
11744+ int * a_count_int_pointer;
11745+ long int * a_count_longint_pointer;
11746+#ifdef HAVE_LONG_LONG
11747+ long long int * a_count_longlongint_pointer;
11748+#endif
11749+ }
11750+ a;
11751+}
11752+argument;
11753+
11754+typedef struct
11755+{
11756+ size_t count;
11757+ argument *arg;
11758+}
11759+arguments;
11760+
11761+
11762+/* Fetch the arguments, putting them into a. */
11763+#ifdef STATIC
11764+STATIC
11765+#else
11766+extern
11767+#endif
11768+int printf_fetchargs (va_list args, arguments *a);
11769+
11770+#endif /* _PRINTF_ARGS_H */
11771diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-parse.c psmisc-20.2.works.clean/intl/printf-parse.c
11772--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-parse.c 1969-12-31 18:00:00.000000000 -0600
11773+++ psmisc-20.2.works.clean/intl/printf-parse.c 2004-10-13 15:18:41.000000000 -0500
11774@@ -0,0 +1,537 @@
11775+/* Formatted output to strings.
11776+ Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
11777+
11778+ This program is free software; you can redistribute it and/or modify it
11779+ under the terms of the GNU Library General Public License as published
11780+ by the Free Software Foundation; either version 2, or (at your option)
11781+ any later version.
11782+
11783+ This program is distributed in the hope that it will be useful,
11784+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11785+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11786+ Library General Public License for more details.
11787+
11788+ You should have received a copy of the GNU Library General Public
11789+ License along with this program; if not, write to the Free Software
11790+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
11791+ USA. */
11792+
11793+#ifdef HAVE_CONFIG_H
11794+# include <config.h>
11795+#endif
11796+
11797+/* Specification. */
11798+#if WIDE_CHAR_VERSION
11799+# include "wprintf-parse.h"
11800+#else
11801+# include "printf-parse.h"
11802+#endif
11803+
11804+/* Get size_t, NULL. */
11805+#include <stddef.h>
11806+
11807+/* Get intmax_t. */
11808+#if HAVE_STDINT_H_WITH_UINTMAX
11809+# include <stdint.h>
11810+#endif
11811+#if HAVE_INTTYPES_H_WITH_UINTMAX
11812+# include <inttypes.h>
11813+#endif
11814+
11815+/* malloc(), realloc(), free(). */
11816+#include <stdlib.h>
11817+
11818+/* Checked size_t computations. */
11819+#include "xsize.h"
11820+
11821+#if WIDE_CHAR_VERSION
11822+# define PRINTF_PARSE wprintf_parse
11823+# define CHAR_T wchar_t
11824+# define DIRECTIVE wchar_t_directive
11825+# define DIRECTIVES wchar_t_directives
11826+#else
11827+# define PRINTF_PARSE printf_parse
11828+# define CHAR_T char
11829+# define DIRECTIVE char_directive
11830+# define DIRECTIVES char_directives
11831+#endif
11832+
11833+#ifdef STATIC
11834+STATIC
11835+#endif
11836+int
11837+PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
11838+{
11839+ const CHAR_T *cp = format; /* pointer into format */
11840+ size_t arg_posn = 0; /* number of regular arguments consumed */
11841+ size_t d_allocated; /* allocated elements of d->dir */
11842+ size_t a_allocated; /* allocated elements of a->arg */
11843+ size_t max_width_length = 0;
11844+ size_t max_precision_length = 0;
11845+
11846+ d->count = 0;
11847+ d_allocated = 1;
11848+ d->dir = malloc (d_allocated * sizeof (DIRECTIVE));
11849+ if (d->dir == NULL)
11850+ /* Out of memory. */
11851+ return -1;
11852+
11853+ a->count = 0;
11854+ a_allocated = 0;
11855+ a->arg = NULL;
11856+
11857+#define REGISTER_ARG(_index_,_type_) \
11858+ { \
11859+ size_t n = (_index_); \
11860+ if (n >= a_allocated) \
11861+ { \
11862+ size_t memory_size; \
11863+ argument *memory; \
11864+ \
11865+ a_allocated = xtimes (a_allocated, 2); \
11866+ if (a_allocated <= n) \
11867+ a_allocated = xsum (n, 1); \
11868+ memory_size = xtimes (a_allocated, sizeof (argument)); \
11869+ if (size_overflow_p (memory_size)) \
11870+ /* Overflow, would lead to out of memory. */ \
11871+ goto error; \
11872+ memory = (a->arg \
11873+ ? realloc (a->arg, memory_size) \
11874+ : malloc (memory_size)); \
11875+ if (memory == NULL) \
11876+ /* Out of memory. */ \
11877+ goto error; \
11878+ a->arg = memory; \
11879+ } \
11880+ while (a->count <= n) \
11881+ a->arg[a->count++].type = TYPE_NONE; \
11882+ if (a->arg[n].type == TYPE_NONE) \
11883+ a->arg[n].type = (_type_); \
11884+ else if (a->arg[n].type != (_type_)) \
11885+ /* Ambiguous type for positional argument. */ \
11886+ goto error; \
11887+ }
11888+
11889+ while (*cp != '\0')
11890+ {
11891+ CHAR_T c = *cp++;
11892+ if (c == '%')
11893+ {
11894+ size_t arg_index = ARG_NONE;
11895+ DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
11896+
11897+ /* Initialize the next directive. */
11898+ dp->dir_start = cp - 1;
11899+ dp->flags = 0;
11900+ dp->width_start = NULL;
11901+ dp->width_end = NULL;
11902+ dp->width_arg_index = ARG_NONE;
11903+ dp->precision_start = NULL;
11904+ dp->precision_end = NULL;
11905+ dp->precision_arg_index = ARG_NONE;
11906+ dp->arg_index = ARG_NONE;
11907+
11908+ /* Test for positional argument. */
11909+ if (*cp >= '0' && *cp <= '9')
11910+ {
11911+ const CHAR_T *np;
11912+
11913+ for (np = cp; *np >= '0' && *np <= '9'; np++)
11914+ ;
11915+ if (*np == '$')
11916+ {
11917+ size_t n = 0;
11918+
11919+ for (np = cp; *np >= '0' && *np <= '9'; np++)
11920+ n = xsum (xtimes (n, 10), *np - '0');
11921+ if (n == 0)
11922+ /* Positional argument 0. */
11923+ goto error;
11924+ if (size_overflow_p (n))
11925+ /* n too large, would lead to out of memory later. */
11926+ goto error;
11927+ arg_index = n - 1;
11928+ cp = np + 1;
11929+ }
11930+ }
11931+
11932+ /* Read the flags. */
11933+ for (;;)
11934+ {
11935+ if (*cp == '\'')
11936+ {
11937+ dp->flags |= FLAG_GROUP;
11938+ cp++;
11939+ }
11940+ else if (*cp == '-')
11941+ {
11942+ dp->flags |= FLAG_LEFT;
11943+ cp++;
11944+ }
11945+ else if (*cp == '+')
11946+ {
11947+ dp->flags |= FLAG_SHOWSIGN;
11948+ cp++;
11949+ }
11950+ else if (*cp == ' ')
11951+ {
11952+ dp->flags |= FLAG_SPACE;
11953+ cp++;
11954+ }
11955+ else if (*cp == '#')
11956+ {
11957+ dp->flags |= FLAG_ALT;
11958+ cp++;
11959+ }
11960+ else if (*cp == '0')
11961+ {
11962+ dp->flags |= FLAG_ZERO;
11963+ cp++;
11964+ }
11965+ else
11966+ break;
11967+ }
11968+
11969+ /* Parse the field width. */
11970+ if (*cp == '*')
11971+ {
11972+ dp->width_start = cp;
11973+ cp++;
11974+ dp->width_end = cp;
11975+ if (max_width_length < 1)
11976+ max_width_length = 1;
11977+
11978+ /* Test for positional argument. */
11979+ if (*cp >= '0' && *cp <= '9')
11980+ {
11981+ const CHAR_T *np;
11982+
11983+ for (np = cp; *np >= '0' && *np <= '9'; np++)
11984+ ;
11985+ if (*np == '$')
11986+ {
11987+ size_t n = 0;
11988+
11989+ for (np = cp; *np >= '0' && *np <= '9'; np++)
11990+ n = xsum (xtimes (n, 10), *np - '0');
11991+ if (n == 0)
11992+ /* Positional argument 0. */
11993+ goto error;
11994+ if (size_overflow_p (n))
11995+ /* n too large, would lead to out of memory later. */
11996+ goto error;
11997+ dp->width_arg_index = n - 1;
11998+ cp = np + 1;
11999+ }
12000+ }
12001+ if (dp->width_arg_index == ARG_NONE)
12002+ {
12003+ dp->width_arg_index = arg_posn++;
12004+ if (dp->width_arg_index == ARG_NONE)
12005+ /* arg_posn wrapped around. */
12006+ goto error;
12007+ }
12008+ REGISTER_ARG (dp->width_arg_index, TYPE_INT);
12009+ }
12010+ else if (*cp >= '0' && *cp <= '9')
12011+ {
12012+ size_t width_length;
12013+
12014+ dp->width_start = cp;
12015+ for (; *cp >= '0' && *cp <= '9'; cp++)
12016+ ;
12017+ dp->width_end = cp;
12018+ width_length = dp->width_end - dp->width_start;
12019+ if (max_width_length < width_length)
12020+ max_width_length = width_length;
12021+ }
12022+
12023+ /* Parse the precision. */
12024+ if (*cp == '.')
12025+ {
12026+ cp++;
12027+ if (*cp == '*')
12028+ {
12029+ dp->precision_start = cp - 1;
12030+ cp++;
12031+ dp->precision_end = cp;
12032+ if (max_precision_length < 2)
12033+ max_precision_length = 2;
12034+
12035+ /* Test for positional argument. */
12036+ if (*cp >= '0' && *cp <= '9')
12037+ {
12038+ const CHAR_T *np;
12039+
12040+ for (np = cp; *np >= '0' && *np <= '9'; np++)
12041+ ;
12042+ if (*np == '$')
12043+ {
12044+ size_t n = 0;
12045+
12046+ for (np = cp; *np >= '0' && *np <= '9'; np++)
12047+ n = xsum (xtimes (n, 10), *np - '0');
12048+ if (n == 0)
12049+ /* Positional argument 0. */
12050+ goto error;
12051+ if (size_overflow_p (n))
12052+ /* n too large, would lead to out of memory
12053+ later. */
12054+ goto error;
12055+ dp->precision_arg_index = n - 1;
12056+ cp = np + 1;
12057+ }
12058+ }
12059+ if (dp->precision_arg_index == ARG_NONE)
12060+ {
12061+ dp->precision_arg_index = arg_posn++;
12062+ if (dp->precision_arg_index == ARG_NONE)
12063+ /* arg_posn wrapped around. */
12064+ goto error;
12065+ }
12066+ REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
12067+ }
12068+ else
12069+ {
12070+ size_t precision_length;
12071+
12072+ dp->precision_start = cp - 1;
12073+ for (; *cp >= '0' && *cp <= '9'; cp++)
12074+ ;
12075+ dp->precision_end = cp;
12076+ precision_length = dp->precision_end - dp->precision_start;
12077+ if (max_precision_length < precision_length)
12078+ max_precision_length = precision_length;
12079+ }
12080+ }
12081+
12082+ {
12083+ arg_type type;
12084+
12085+ /* Parse argument type/size specifiers. */
12086+ {
12087+ int flags = 0;
12088+
12089+ for (;;)
12090+ {
12091+ if (*cp == 'h')
12092+ {
12093+ flags |= (1 << (flags & 1));
12094+ cp++;
12095+ }
12096+ else if (*cp == 'L')
12097+ {
12098+ flags |= 4;
12099+ cp++;
12100+ }
12101+ else if (*cp == 'l')
12102+ {
12103+ flags += 8;
12104+ cp++;
12105+ }
12106+#ifdef HAVE_INTMAX_T
12107+ else if (*cp == 'j')
12108+ {
12109+ if (sizeof (intmax_t) > sizeof (long))
12110+ {
12111+ /* intmax_t = long long */
12112+ flags += 16;
12113+ }
12114+ else if (sizeof (intmax_t) > sizeof (int))
12115+ {
12116+ /* intmax_t = long */
12117+ flags += 8;
12118+ }
12119+ cp++;
12120+ }
12121+#endif
12122+ else if (*cp == 'z' || *cp == 'Z')
12123+ {
12124+ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
12125+ because the warning facility in gcc-2.95.2 understands
12126+ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
12127+ if (sizeof (size_t) > sizeof (long))
12128+ {
12129+ /* size_t = long long */
12130+ flags += 16;
12131+ }
12132+ else if (sizeof (size_t) > sizeof (int))
12133+ {
12134+ /* size_t = long */
12135+ flags += 8;
12136+ }
12137+ cp++;
12138+ }
12139+ else if (*cp == 't')
12140+ {
12141+ if (sizeof (ptrdiff_t) > sizeof (long))
12142+ {
12143+ /* ptrdiff_t = long long */
12144+ flags += 16;
12145+ }
12146+ else if (sizeof (ptrdiff_t) > sizeof (int))
12147+ {
12148+ /* ptrdiff_t = long */
12149+ flags += 8;
12150+ }
12151+ cp++;
12152+ }
12153+ else
12154+ break;
12155+ }
12156+
12157+ /* Read the conversion character. */
12158+ c = *cp++;
12159+ switch (c)
12160+ {
12161+ case 'd': case 'i':
12162+#ifdef HAVE_LONG_LONG
12163+ if (flags >= 16 || (flags & 4))
12164+ type = TYPE_LONGLONGINT;
12165+ else
12166+#endif
12167+ if (flags >= 8)
12168+ type = TYPE_LONGINT;
12169+ else if (flags & 2)
12170+ type = TYPE_SCHAR;
12171+ else if (flags & 1)
12172+ type = TYPE_SHORT;
12173+ else
12174+ type = TYPE_INT;
12175+ break;
12176+ case 'o': case 'u': case 'x': case 'X':
12177+#ifdef HAVE_LONG_LONG
12178+ if (flags >= 16 || (flags & 4))
12179+ type = TYPE_ULONGLONGINT;
12180+ else
12181+#endif
12182+ if (flags >= 8)
12183+ type = TYPE_ULONGINT;
12184+ else if (flags & 2)
12185+ type = TYPE_UCHAR;
12186+ else if (flags & 1)
12187+ type = TYPE_USHORT;
12188+ else
12189+ type = TYPE_UINT;
12190+ break;
12191+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
12192+ case 'a': case 'A':
12193+#ifdef HAVE_LONG_DOUBLE
12194+ if (flags >= 16 || (flags & 4))
12195+ type = TYPE_LONGDOUBLE;
12196+ else
12197+#endif
12198+ type = TYPE_DOUBLE;
12199+ break;
12200+ case 'c':
12201+ if (flags >= 8)
12202+#ifdef HAVE_WINT_T
12203+ type = TYPE_WIDE_CHAR;
12204+#else
12205+ goto error;
12206+#endif
12207+ else
12208+ type = TYPE_CHAR;
12209+ break;
12210+#ifdef HAVE_WINT_T
12211+ case 'C':
12212+ type = TYPE_WIDE_CHAR;
12213+ c = 'c';
12214+ break;
12215+#endif
12216+ case 's':
12217+ if (flags >= 8)
12218+#ifdef HAVE_WCHAR_T
12219+ type = TYPE_WIDE_STRING;
12220+#else
12221+ goto error;
12222+#endif
12223+ else
12224+ type = TYPE_STRING;
12225+ break;
12226+#ifdef HAVE_WCHAR_T
12227+ case 'S':
12228+ type = TYPE_WIDE_STRING;
12229+ c = 's';
12230+ break;
12231+#endif
12232+ case 'p':
12233+ type = TYPE_POINTER;
12234+ break;
12235+ case 'n':
12236+#ifdef HAVE_LONG_LONG
12237+ if (flags >= 16 || (flags & 4))
12238+ type = TYPE_COUNT_LONGLONGINT_POINTER;
12239+ else
12240+#endif
12241+ if (flags >= 8)
12242+ type = TYPE_COUNT_LONGINT_POINTER;
12243+ else if (flags & 2)
12244+ type = TYPE_COUNT_SCHAR_POINTER;
12245+ else if (flags & 1)
12246+ type = TYPE_COUNT_SHORT_POINTER;
12247+ else
12248+ type = TYPE_COUNT_INT_POINTER;
12249+ break;
12250+ case '%':
12251+ type = TYPE_NONE;
12252+ break;
12253+ default:
12254+ /* Unknown conversion character. */
12255+ goto error;
12256+ }
12257+ }
12258+
12259+ if (type != TYPE_NONE)
12260+ {
12261+ dp->arg_index = arg_index;
12262+ if (dp->arg_index == ARG_NONE)
12263+ {
12264+ dp->arg_index = arg_posn++;
12265+ if (dp->arg_index == ARG_NONE)
12266+ /* arg_posn wrapped around. */
12267+ goto error;
12268+ }
12269+ REGISTER_ARG (dp->arg_index, type);
12270+ }
12271+ dp->conversion = c;
12272+ dp->dir_end = cp;
12273+ }
12274+
12275+ d->count++;
12276+ if (d->count >= d_allocated)
12277+ {
12278+ size_t memory_size;
12279+ DIRECTIVE *memory;
12280+
12281+ d_allocated = xtimes (d_allocated, 2);
12282+ memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
12283+ if (size_overflow_p (memory_size))
12284+ /* Overflow, would lead to out of memory. */
12285+ goto error;
12286+ memory = realloc (d->dir, memory_size);
12287+ if (memory == NULL)
12288+ /* Out of memory. */
12289+ goto error;
12290+ d->dir = memory;
12291+ }
12292+ }
12293+ }
12294+ d->dir[d->count].dir_start = cp;
12295+
12296+ d->max_width_length = max_width_length;
12297+ d->max_precision_length = max_precision_length;
12298+ return 0;
12299+
12300+error:
12301+ if (a->arg)
12302+ free (a->arg);
12303+ if (d->dir)
12304+ free (d->dir);
12305+ return -1;
12306+}
12307+
12308+#undef DIRECTIVES
12309+#undef DIRECTIVE
12310+#undef CHAR_T
12311+#undef PRINTF_PARSE
12312diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-parse.h psmisc-20.2.works.clean/intl/printf-parse.h
12313--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf-parse.h 1969-12-31 18:00:00.000000000 -0600
12314+++ psmisc-20.2.works.clean/intl/printf-parse.h 2004-10-13 15:18:41.000000000 -0500
12315@@ -0,0 +1,75 @@
12316+/* Parse printf format string.
12317+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
12318+
12319+ This program is free software; you can redistribute it and/or modify it
12320+ under the terms of the GNU Library General Public License as published
12321+ by the Free Software Foundation; either version 2, or (at your option)
12322+ any later version.
12323+
12324+ This program is distributed in the hope that it will be useful,
12325+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12326+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12327+ Library General Public License for more details.
12328+
12329+ You should have received a copy of the GNU Library General Public
12330+ License along with this program; if not, write to the Free Software
12331+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
12332+ USA. */
12333+
12334+#ifndef _PRINTF_PARSE_H
12335+#define _PRINTF_PARSE_H
12336+
12337+#include "printf-args.h"
12338+
12339+
12340+/* Flags */
12341+#define FLAG_GROUP 1 /* ' flag */
12342+#define FLAG_LEFT 2 /* - flag */
12343+#define FLAG_SHOWSIGN 4 /* + flag */
12344+#define FLAG_SPACE 8 /* space flag */
12345+#define FLAG_ALT 16 /* # flag */
12346+#define FLAG_ZERO 32
12347+
12348+/* arg_index value indicating that no argument is consumed. */
12349+#define ARG_NONE (~(size_t)0)
12350+
12351+/* A parsed directive. */
12352+typedef struct
12353+{
12354+ const char* dir_start;
12355+ const char* dir_end;
12356+ int flags;
12357+ const char* width_start;
12358+ const char* width_end;
12359+ size_t width_arg_index;
12360+ const char* precision_start;
12361+ const char* precision_end;
12362+ size_t precision_arg_index;
12363+ char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
12364+ size_t arg_index;
12365+}
12366+char_directive;
12367+
12368+/* A parsed format string. */
12369+typedef struct
12370+{
12371+ size_t count;
12372+ char_directive *dir;
12373+ size_t max_width_length;
12374+ size_t max_precision_length;
12375+}
12376+char_directives;
12377+
12378+
12379+/* Parses the format string. Fills in the number N of directives, and fills
12380+ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
12381+ to the end of the format string. Also fills in the arg_type fields of the
12382+ arguments and the needed count of arguments. */
12383+#ifdef STATIC
12384+STATIC
12385+#else
12386+extern
12387+#endif
12388+int printf_parse (const char *format, char_directives *d, arguments *a);
12389+
12390+#endif /* _PRINTF_PARSE_H */
12391diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf.c psmisc-20.2.works.clean/intl/printf.c
12392--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/printf.c 1969-12-31 18:00:00.000000000 -0600
12393+++ psmisc-20.2.works.clean/intl/printf.c 2004-10-13 15:18:42.000000000 -0500
12394@@ -0,0 +1,371 @@
12395+/* Formatted output to strings, using POSIX/XSI format strings with positions.
12396+ Copyright (C) 2003 Free Software Foundation, Inc.
12397+ Written by Bruno Haible <bruno@clisp.org>, 2003.
12398+
12399+ This program is free software; you can redistribute it and/or modify it
12400+ under the terms of the GNU Library General Public License as published
12401+ by the Free Software Foundation; either version 2, or (at your option)
12402+ any later version.
12403+
12404+ This program is distributed in the hope that it will be useful,
12405+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12406+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12407+ Library General Public License for more details.
12408+
12409+ You should have received a copy of the GNU Library General Public
12410+ License along with this program; if not, write to the Free Software
12411+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
12412+ USA. */
12413+
12414+#ifdef HAVE_CONFIG_H
12415+# include <config.h>
12416+#endif
12417+
12418+#ifdef __GNUC__
12419+# define alloca __builtin_alloca
12420+# define HAVE_ALLOCA 1
12421+#else
12422+# ifdef _MSC_VER
12423+# include <malloc.h>
12424+# define alloca _alloca
12425+# else
12426+# if defined HAVE_ALLOCA_H || defined _LIBC
12427+# include <alloca.h>
12428+# else
12429+# ifdef _AIX
12430+ #pragma alloca
12431+# else
12432+# ifndef alloca
12433+char *alloca ();
12434+# endif
12435+# endif
12436+# endif
12437+# endif
12438+#endif
12439+
12440+#include <stdio.h>
12441+
12442+#if !HAVE_POSIX_PRINTF
12443+
12444+#include <stdlib.h>
12445+#include <string.h>
12446+
12447+/* When building a DLL, we must export some functions. Note that because
12448+ the functions are only defined for binary backward compatibility, we
12449+ don't need to use __declspec(dllimport) in any case. */
12450+#if defined _MSC_VER && BUILDING_DLL
12451+# define DLL_EXPORTED __declspec(dllexport)
12452+#else
12453+# define DLL_EXPORTED
12454+#endif
12455+
12456+#define STATIC static
12457+
12458+/* Define auxiliary functions declared in "printf-args.h". */
12459+#include "printf-args.c"
12460+
12461+/* Define auxiliary functions declared in "printf-parse.h". */
12462+#include "printf-parse.c"
12463+
12464+/* Define functions declared in "vasnprintf.h". */
12465+#define vasnprintf libintl_vasnprintf
12466+#include "vasnprintf.c"
12467+#if 0 /* not needed */
12468+#define asnprintf libintl_asnprintf
12469+#include "asnprintf.c"
12470+#endif
12471+
12472+DLL_EXPORTED
12473+int
12474+libintl_vfprintf (FILE *stream, const char *format, va_list args)
12475+{
12476+ if (strchr (format, '$') == NULL)
12477+ return vfprintf (stream, format, args);
12478+ else
12479+ {
12480+ size_t length;
12481+ char *result = libintl_vasnprintf (NULL, &length, format, args);
12482+ int retval = -1;
12483+ if (result != NULL)
12484+ {
12485+ if (fwrite (result, 1, length, stream) == length)
12486+ retval = length;
12487+ free (result);
12488+ }
12489+ return retval;
12490+ }
12491+}
12492+
12493+DLL_EXPORTED
12494+int
12495+libintl_fprintf (FILE *stream, const char *format, ...)
12496+{
12497+ va_list args;
12498+ int retval;
12499+
12500+ va_start (args, format);
12501+ retval = libintl_vfprintf (stream, format, args);
12502+ va_end (args);
12503+ return retval;
12504+}
12505+
12506+DLL_EXPORTED
12507+int
12508+libintl_vprintf (const char *format, va_list args)
12509+{
12510+ return libintl_vfprintf (stdout, format, args);
12511+}
12512+
12513+DLL_EXPORTED
12514+int
12515+libintl_printf (const char *format, ...)
12516+{
12517+ va_list args;
12518+ int retval;
12519+
12520+ va_start (args, format);
12521+ retval = libintl_vprintf (format, args);
12522+ va_end (args);
12523+ return retval;
12524+}
12525+
12526+DLL_EXPORTED
12527+int
12528+libintl_vsprintf (char *resultbuf, const char *format, va_list args)
12529+{
12530+ if (strchr (format, '$') == NULL)
12531+ return vsprintf (resultbuf, format, args);
12532+ else
12533+ {
12534+ size_t length = (size_t) ~0 / (4 * sizeof (char));
12535+ char *result = libintl_vasnprintf (resultbuf, &length, format, args);
12536+ if (result != resultbuf)
12537+ {
12538+ free (result);
12539+ return -1;
12540+ }
12541+ else
12542+ return length;
12543+ }
12544+}
12545+
12546+DLL_EXPORTED
12547+int
12548+libintl_sprintf (char *resultbuf, const char *format, ...)
12549+{
12550+ va_list args;
12551+ int retval;
12552+
12553+ va_start (args, format);
12554+ retval = libintl_vsprintf (resultbuf, format, args);
12555+ va_end (args);
12556+ return retval;
12557+}
12558+
12559+#if HAVE_SNPRINTF
12560+
12561+# if HAVE_DECL__SNPRINTF
12562+ /* Windows. */
12563+# define system_vsnprintf _vsnprintf
12564+# else
12565+ /* Unix. */
12566+# define system_vsnprintf vsnprintf
12567+# endif
12568+
12569+DLL_EXPORTED
12570+int
12571+libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args)
12572+{
12573+ if (strchr (format, '$') == NULL)
12574+ return system_vsnprintf (resultbuf, length, format, args);
12575+ else
12576+ {
12577+ size_t maxlength = length;
12578+ char *result = libintl_vasnprintf (resultbuf, &length, format, args);
12579+ if (result != resultbuf)
12580+ {
12581+ if (maxlength > 0)
12582+ {
12583+ if (length < maxlength)
12584+ abort ();
12585+ memcpy (resultbuf, result, maxlength - 1);
12586+ resultbuf[maxlength - 1] = '\0';
12587+ }
12588+ free (result);
12589+ return -1;
12590+ }
12591+ else
12592+ return length;
12593+ }
12594+}
12595+
12596+DLL_EXPORTED
12597+int
12598+libintl_snprintf (char *resultbuf, size_t length, const char *format, ...)
12599+{
12600+ va_list args;
12601+ int retval;
12602+
12603+ va_start (args, format);
12604+ retval = libintl_vsnprintf (resultbuf, length, format, args);
12605+ va_end (args);
12606+ return retval;
12607+}
12608+
12609+#endif
12610+
12611+#if HAVE_ASPRINTF
12612+
12613+DLL_EXPORTED
12614+int
12615+libintl_vasprintf (char **resultp, const char *format, va_list args)
12616+{
12617+ size_t length;
12618+ char *result = libintl_vasnprintf (NULL, &length, format, args);
12619+ if (result == NULL)
12620+ return -1;
12621+ *resultp = result;
12622+ return length;
12623+}
12624+
12625+DLL_EXPORTED
12626+int
12627+libintl_asprintf (char **resultp, const char *format, ...)
12628+{
12629+ va_list args;
12630+ int retval;
12631+
12632+ va_start (args, format);
12633+ retval = libintl_vasprintf (resultp, format, args);
12634+ va_end (args);
12635+ return retval;
12636+}
12637+
12638+#endif
12639+
12640+#if HAVE_FWPRINTF
12641+
12642+#include <wchar.h>
12643+
12644+#define WIDE_CHAR_VERSION 1
12645+
12646+/* Define auxiliary functions declared in "wprintf-parse.h". */
12647+#include "printf-parse.c"
12648+
12649+/* Define functions declared in "vasnprintf.h". */
12650+#define vasnwprintf libintl_vasnwprintf
12651+#include "vasnprintf.c"
12652+#if 0 /* not needed */
12653+#define asnwprintf libintl_asnwprintf
12654+#include "asnprintf.c"
12655+#endif
12656+
12657+# if HAVE_DECL__SNWPRINTF
12658+ /* Windows. */
12659+# define system_vswprintf _vsnwprintf
12660+# else
12661+ /* Unix. */
12662+# define system_vswprintf vswprintf
12663+# endif
12664+
12665+DLL_EXPORTED
12666+int
12667+libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args)
12668+{
12669+ if (wcschr (format, '$') == NULL)
12670+ return vfwprintf (stream, format, args);
12671+ else
12672+ {
12673+ size_t length;
12674+ wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args);
12675+ int retval = -1;
12676+ if (result != NULL)
12677+ {
12678+ size_t i;
12679+ for (i = 0; i < length; i++)
12680+ if (fputwc (result[i], stream) == WEOF)
12681+ break;
12682+ if (i == length)
12683+ retval = length;
12684+ free (result);
12685+ }
12686+ return retval;
12687+ }
12688+}
12689+
12690+DLL_EXPORTED
12691+int
12692+libintl_fwprintf (FILE *stream, const wchar_t *format, ...)
12693+{
12694+ va_list args;
12695+ int retval;
12696+
12697+ va_start (args, format);
12698+ retval = libintl_vfwprintf (stream, format, args);
12699+ va_end (args);
12700+ return retval;
12701+}
12702+
12703+DLL_EXPORTED
12704+int
12705+libintl_vwprintf (const wchar_t *format, va_list args)
12706+{
12707+ return libintl_vfwprintf (stdout, format, args);
12708+}
12709+
12710+DLL_EXPORTED
12711+int
12712+libintl_wprintf (const wchar_t *format, ...)
12713+{
12714+ va_list args;
12715+ int retval;
12716+
12717+ va_start (args, format);
12718+ retval = libintl_vwprintf (format, args);
12719+ va_end (args);
12720+ return retval;
12721+}
12722+
12723+DLL_EXPORTED
12724+int
12725+libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args)
12726+{
12727+ if (wcschr (format, '$') == NULL)
12728+ return system_vswprintf (resultbuf, length, format, args);
12729+ else
12730+ {
12731+ size_t maxlength = length;
12732+ wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args);
12733+ if (result != resultbuf)
12734+ {
12735+ if (maxlength > 0)
12736+ {
12737+ if (length < maxlength)
12738+ abort ();
12739+ memcpy (resultbuf, result, (maxlength - 1) * sizeof (wchar_t));
12740+ resultbuf[maxlength - 1] = 0;
12741+ }
12742+ free (result);
12743+ return -1;
12744+ }
12745+ else
12746+ return length;
12747+ }
12748+}
12749+
12750+DLL_EXPORTED
12751+int
12752+libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...)
12753+{
12754+ va_list args;
12755+ int retval;
12756+
12757+ va_start (args, format);
12758+ retval = libintl_vswprintf (resultbuf, length, format, args);
12759+ va_end (args);
12760+ return retval;
12761+}
12762+
12763+#endif
12764+
12765+#endif
12766diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/relocatable.c psmisc-20.2.works.clean/intl/relocatable.c
12767--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/relocatable.c 1969-12-31 18:00:00.000000000 -0600
12768+++ psmisc-20.2.works.clean/intl/relocatable.c 2004-10-13 15:18:42.000000000 -0500
12769@@ -0,0 +1,449 @@
12770+/* Provide relocatable packages.
12771+ Copyright (C) 2003 Free Software Foundation, Inc.
12772+ Written by Bruno Haible <bruno@clisp.org>, 2003.
12773+
12774+ This program is free software; you can redistribute it and/or modify it
12775+ under the terms of the GNU Library General Public License as published
12776+ by the Free Software Foundation; either version 2, or (at your option)
12777+ any later version.
12778+
12779+ This program is distributed in the hope that it will be useful,
12780+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12781+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12782+ Library General Public License for more details.
12783+
12784+ You should have received a copy of the GNU Library General Public
12785+ License along with this program; if not, write to the Free Software
12786+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
12787+ USA. */
12788+
12789+
12790+/* Tell glibc's <stdio.h> to provide a prototype for getline().
12791+ This must come before <config.h> because <config.h> may include
12792+ <features.h>, and once <features.h> has been included, it's too late. */
12793+#ifndef _GNU_SOURCE
12794+# define _GNU_SOURCE 1
12795+#endif
12796+
12797+#ifdef HAVE_CONFIG_H
12798+# include "config.h"
12799+#endif
12800+
12801+/* Specification. */
12802+#include "relocatable.h"
12803+
12804+#if ENABLE_RELOCATABLE
12805+
12806+#include <stddef.h>
12807+#include <stdio.h>
12808+#include <stdlib.h>
12809+#include <string.h>
12810+
12811+#ifdef NO_XMALLOC
12812+# define xmalloc malloc
12813+#else
12814+# include "xalloc.h"
12815+#endif
12816+
12817+#if defined _WIN32 || defined __WIN32__
12818+# define WIN32_LEAN_AND_MEAN
12819+# include <windows.h>
12820+#endif
12821+
12822+#if DEPENDS_ON_LIBCHARSET
12823+# include <libcharset.h>
12824+#endif
12825+#if DEPENDS_ON_LIBICONV && HAVE_ICONV
12826+# include <iconv.h>
12827+#endif
12828+#if DEPENDS_ON_LIBINTL && ENABLE_NLS
12829+# include <libintl.h>
12830+#endif
12831+
12832+/* Faked cheap 'bool'. */
12833+#undef bool
12834+#undef false
12835+#undef true
12836+#define bool int
12837+#define false 0
12838+#define true 1
12839+
12840+/* Pathname support.
12841+ ISSLASH(C) tests whether C is a directory separator character.
12842+ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
12843+ */
12844+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
12845+ /* Win32, OS/2, DOS */
12846+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
12847+# define HAS_DEVICE(P) \
12848+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
12849+ && (P)[1] == ':')
12850+# define IS_PATH_WITH_DIR(P) \
12851+ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
12852+# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
12853+#else
12854+ /* Unix */
12855+# define ISSLASH(C) ((C) == '/')
12856+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
12857+# define FILESYSTEM_PREFIX_LEN(P) 0
12858+#endif
12859+
12860+/* Original installation prefix. */
12861+static char *orig_prefix;
12862+static size_t orig_prefix_len;
12863+/* Current installation prefix. */
12864+static char *curr_prefix;
12865+static size_t curr_prefix_len;
12866+/* These prefixes do not end in a slash. Anything that will be concatenated
12867+ to them must start with a slash. */
12868+
12869+/* Sets the original and the current installation prefix of this module.
12870+ Relocation simply replaces a pathname starting with the original prefix
12871+ by the corresponding pathname with the current prefix instead. Both
12872+ prefixes should be directory names without trailing slash (i.e. use ""
12873+ instead of "/"). */
12874+static void
12875+set_this_relocation_prefix (const char *orig_prefix_arg,
12876+ const char *curr_prefix_arg)
12877+{
12878+ if (orig_prefix_arg != NULL && curr_prefix_arg != NULL
12879+ /* Optimization: if orig_prefix and curr_prefix are equal, the
12880+ relocation is a nop. */
12881+ && strcmp (orig_prefix_arg, curr_prefix_arg) != 0)
12882+ {
12883+ /* Duplicate the argument strings. */
12884+ char *memory;
12885+
12886+ orig_prefix_len = strlen (orig_prefix_arg);
12887+ curr_prefix_len = strlen (curr_prefix_arg);
12888+ memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1);
12889+#ifdef NO_XMALLOC
12890+ if (memory != NULL)
12891+#endif
12892+ {
12893+ memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
12894+ orig_prefix = memory;
12895+ memory += orig_prefix_len + 1;
12896+ memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
12897+ curr_prefix = memory;
12898+ return;
12899+ }
12900+ }
12901+ orig_prefix = NULL;
12902+ curr_prefix = NULL;
12903+ /* Don't worry about wasted memory here - this function is usually only
12904+ called once. */
12905+}
12906+
12907+/* Sets the original and the current installation prefix of the package.
12908+ Relocation simply replaces a pathname starting with the original prefix
12909+ by the corresponding pathname with the current prefix instead. Both
12910+ prefixes should be directory names without trailing slash (i.e. use ""
12911+ instead of "/"). */
12912+void
12913+set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
12914+{
12915+ set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
12916+
12917+ /* Now notify all dependent libraries. */
12918+#if DEPENDS_ON_LIBCHARSET
12919+ libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
12920+#endif
12921+#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
12922+ libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
12923+#endif
12924+#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
12925+ libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
12926+#endif
12927+}
12928+
12929+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
12930+
12931+/* Convenience function:
12932+ Computes the current installation prefix, based on the original
12933+ installation prefix, the original installation directory of a particular
12934+ file, and the current pathname of this file. Returns NULL upon failure. */
12935+#ifdef IN_LIBRARY
12936+#define compute_curr_prefix local_compute_curr_prefix
12937+static
12938+#endif
12939+const char *
12940+compute_curr_prefix (const char *orig_installprefix,
12941+ const char *orig_installdir,
12942+ const char *curr_pathname)
12943+{
12944+ const char *curr_installdir;
12945+ const char *rel_installdir;
12946+
12947+ if (curr_pathname == NULL)
12948+ return NULL;
12949+
12950+ /* Determine the relative installation directory, relative to the prefix.
12951+ This is simply the difference between orig_installprefix and
12952+ orig_installdir. */
12953+ if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix))
12954+ != 0)
12955+ /* Shouldn't happen - nothing should be installed outside $(prefix). */
12956+ return NULL;
12957+ rel_installdir = orig_installdir + strlen (orig_installprefix);
12958+
12959+ /* Determine the current installation directory. */
12960+ {
12961+ const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname);
12962+ const char *p = curr_pathname + strlen (curr_pathname);
12963+ char *q;
12964+
12965+ while (p > p_base)
12966+ {
12967+ p--;
12968+ if (ISSLASH (*p))
12969+ break;
12970+ }
12971+
12972+ q = (char *) xmalloc (p - curr_pathname + 1);
12973+#ifdef NO_XMALLOC
12974+ if (q == NULL)
12975+ return NULL;
12976+#endif
12977+ memcpy (q, curr_pathname, p - curr_pathname);
12978+ q[p - curr_pathname] = '\0';
12979+ curr_installdir = q;
12980+ }
12981+
12982+ /* Compute the current installation prefix by removing the trailing
12983+ rel_installdir from it. */
12984+ {
12985+ const char *rp = rel_installdir + strlen (rel_installdir);
12986+ const char *cp = curr_installdir + strlen (curr_installdir);
12987+ const char *cp_base =
12988+ curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir);
12989+
12990+ while (rp > rel_installdir && cp > cp_base)
12991+ {
12992+ bool same = false;
12993+ const char *rpi = rp;
12994+ const char *cpi = cp;
12995+
12996+ while (rpi > rel_installdir && cpi > cp_base)
12997+ {
12998+ rpi--;
12999+ cpi--;
13000+ if (ISSLASH (*rpi) || ISSLASH (*cpi))
13001+ {
13002+ if (ISSLASH (*rpi) && ISSLASH (*cpi))
13003+ same = true;
13004+ break;
13005+ }
13006+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
13007+ /* Win32, OS/2, DOS - case insignificant filesystem */
13008+ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
13009+ != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
13010+ break;
13011+#else
13012+ if (*rpi != *cpi)
13013+ break;
13014+#endif
13015+ }
13016+ if (!same)
13017+ break;
13018+ /* The last pathname component was the same. opi and cpi now point
13019+ to the slash before it. */
13020+ rp = rpi;
13021+ cp = cpi;
13022+ }
13023+
13024+ if (rp > rel_installdir)
13025+ /* Unexpected: The curr_installdir does not end with rel_installdir. */
13026+ return NULL;
13027+
13028+ {
13029+ size_t curr_prefix_len = cp - curr_installdir;
13030+ char *curr_prefix;
13031+
13032+ curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
13033+#ifdef NO_XMALLOC
13034+ if (curr_prefix == NULL)
13035+ return NULL;
13036+#endif
13037+ memcpy (curr_prefix, curr_installdir, curr_prefix_len);
13038+ curr_prefix[curr_prefix_len] = '\0';
13039+
13040+ return curr_prefix;
13041+ }
13042+ }
13043+}
13044+
13045+#endif /* !IN_LIBRARY || PIC */
13046+
13047+#if defined PIC && defined INSTALLDIR
13048+
13049+/* Full pathname of shared library, or NULL. */
13050+static char *shared_library_fullname;
13051+
13052+#if defined _WIN32 || defined __WIN32__
13053+
13054+/* Determine the full pathname of the shared library when it is loaded. */
13055+
13056+BOOL WINAPI
13057+DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
13058+{
13059+ (void) reserved;
13060+
13061+ if (event == DLL_PROCESS_ATTACH)
13062+ {
13063+ /* The DLL is being loaded into an application's address range. */
13064+ static char location[MAX_PATH];
13065+
13066+ if (!GetModuleFileName (module_handle, location, sizeof (location)))
13067+ /* Shouldn't happen. */
13068+ return FALSE;
13069+
13070+ if (!IS_PATH_WITH_DIR (location))
13071+ /* Shouldn't happen. */
13072+ return FALSE;
13073+
13074+ shared_library_fullname = strdup (location);
13075+ }
13076+
13077+ return TRUE;
13078+}
13079+
13080+#else /* Unix */
13081+
13082+static void
13083+find_shared_library_fullname ()
13084+{
13085+#if defined __linux__ && __GLIBC__ >= 2
13086+ /* Linux has /proc/self/maps. glibc 2 has the getline() function. */
13087+ FILE *fp;
13088+
13089+ /* Open the current process' maps file. It describes one VMA per line. */
13090+ fp = fopen ("/proc/self/maps", "r");
13091+ if (fp)
13092+ {
13093+ unsigned long address = (unsigned long) &find_shared_library_fullname;
13094+ for (;;)
13095+ {
13096+ unsigned long start, end;
13097+ int c;
13098+
13099+ if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
13100+ break;
13101+ if (address >= start && address <= end - 1)
13102+ {
13103+ /* Found it. Now see if this line contains a filename. */
13104+ while (c = getc (fp), c != EOF && c != '\n' && c != '/')
13105+ continue;
13106+ if (c == '/')
13107+ {
13108+ size_t size;
13109+ int len;
13110+
13111+ ungetc (c, fp);
13112+ shared_library_fullname = NULL; size = 0;
13113+ len = getline (&shared_library_fullname, &size, fp);
13114+ if (len >= 0)
13115+ {
13116+ /* Success: filled shared_library_fullname. */
13117+ if (len > 0 && shared_library_fullname[len - 1] == '\n')
13118+ shared_library_fullname[len - 1] = '\0';
13119+ }
13120+ }
13121+ break;
13122+ }
13123+ while (c = getc (fp), c != EOF && c != '\n')
13124+ continue;
13125+ }
13126+ fclose (fp);
13127+ }
13128+#endif
13129+}
13130+
13131+#endif /* WIN32 / Unix */
13132+
13133+/* Return the full pathname of the current shared library.
13134+ Return NULL if unknown.
13135+ Guaranteed to work only on Linux and Woe32. */
13136+static char *
13137+get_shared_library_fullname ()
13138+{
13139+#if !(defined _WIN32 || defined __WIN32__)
13140+ static bool tried_find_shared_library_fullname;
13141+ if (!tried_find_shared_library_fullname)
13142+ {
13143+ find_shared_library_fullname ();
13144+ tried_find_shared_library_fullname = true;
13145+ }
13146+#endif
13147+ return shared_library_fullname;
13148+}
13149+
13150+#endif /* PIC */
13151+
13152+/* Returns the pathname, relocated according to the current installation
13153+ directory. */
13154+const char *
13155+relocate (const char *pathname)
13156+{
13157+#if defined PIC && defined INSTALLDIR
13158+ static int initialized;
13159+
13160+ /* Initialization code for a shared library. */
13161+ if (!initialized)
13162+ {
13163+ /* At this point, orig_prefix and curr_prefix likely have already been
13164+ set through the main program's set_program_name_and_installdir
13165+ function. This is sufficient in the case that the library has
13166+ initially been installed in the same orig_prefix. But we can do
13167+ better, to also cover the cases that 1. it has been installed
13168+ in a different prefix before being moved to orig_prefix and (later)
13169+ to curr_prefix, 2. unlike the program, it has not moved away from
13170+ orig_prefix. */
13171+ const char *orig_installprefix = INSTALLPREFIX;
13172+ const char *orig_installdir = INSTALLDIR;
13173+ const char *curr_prefix_better;
13174+
13175+ curr_prefix_better =
13176+ compute_curr_prefix (orig_installprefix, orig_installdir,
13177+ get_shared_library_fullname ());
13178+ if (curr_prefix_better == NULL)
13179+ curr_prefix_better = curr_prefix;
13180+
13181+ set_relocation_prefix (orig_installprefix, curr_prefix_better);
13182+
13183+ initialized = 1;
13184+ }
13185+#endif
13186+
13187+ /* Note: It is not necessary to perform case insensitive comparison here,
13188+ even for DOS-like filesystems, because the pathname argument was
13189+ typically created from the same Makefile variable as orig_prefix came
13190+ from. */
13191+ if (orig_prefix != NULL && curr_prefix != NULL
13192+ && strncmp (pathname, orig_prefix, orig_prefix_len) == 0)
13193+ {
13194+ if (pathname[orig_prefix_len] == '\0')
13195+ /* pathname equals orig_prefix. */
13196+ return curr_prefix;
13197+ if (ISSLASH (pathname[orig_prefix_len]))
13198+ {
13199+ /* pathname starts with orig_prefix. */
13200+ const char *pathname_tail = &pathname[orig_prefix_len];
13201+ char *result =
13202+ (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
13203+
13204+#ifdef NO_XMALLOC
13205+ if (result != NULL)
13206+#endif
13207+ {
13208+ memcpy (result, curr_prefix, curr_prefix_len);
13209+ strcpy (result + curr_prefix_len, pathname_tail);
13210+ return result;
13211+ }
13212+ }
13213+ }
13214+ /* Nothing to relocate. */
13215+ return pathname;
13216+}
13217+
13218+#endif
13219diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/relocatable.h psmisc-20.2.works.clean/intl/relocatable.h
13220--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/relocatable.h 1969-12-31 18:00:00.000000000 -0600
13221+++ psmisc-20.2.works.clean/intl/relocatable.h 2004-10-13 15:18:42.000000000 -0500
13222@@ -0,0 +1,77 @@
13223+/* Provide relocatable packages.
13224+ Copyright (C) 2003 Free Software Foundation, Inc.
13225+ Written by Bruno Haible <bruno@clisp.org>, 2003.
13226+
13227+ This program is free software; you can redistribute it and/or modify it
13228+ under the terms of the GNU Library General Public License as published
13229+ by the Free Software Foundation; either version 2, or (at your option)
13230+ any later version.
13231+
13232+ This program is distributed in the hope that it will be useful,
13233+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13234+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13235+ Library General Public License for more details.
13236+
13237+ You should have received a copy of the GNU Library General Public
13238+ License along with this program; if not, write to the Free Software
13239+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
13240+ USA. */
13241+
13242+#ifndef _RELOCATABLE_H
13243+#define _RELOCATABLE_H
13244+
13245+#ifdef __cplusplus
13246+extern "C" {
13247+#endif
13248+
13249+
13250+/* This can be enabled through the configure --enable-relocatable option. */
13251+#if ENABLE_RELOCATABLE
13252+
13253+/* When building a DLL, we must export some functions. Note that because
13254+ this is a private .h file, we don't need to use __declspec(dllimport)
13255+ in any case. */
13256+#if defined _MSC_VER && BUILDING_DLL
13257+# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
13258+#else
13259+# define RELOCATABLE_DLL_EXPORTED
13260+#endif
13261+
13262+/* Sets the original and the current installation prefix of the package.
13263+ Relocation simply replaces a pathname starting with the original prefix
13264+ by the corresponding pathname with the current prefix instead. Both
13265+ prefixes should be directory names without trailing slash (i.e. use ""
13266+ instead of "/"). */
13267+extern RELOCATABLE_DLL_EXPORTED void
13268+ set_relocation_prefix (const char *orig_prefix,
13269+ const char *curr_prefix);
13270+
13271+/* Returns the pathname, relocated according to the current installation
13272+ directory. */
13273+extern const char * relocate (const char *pathname);
13274+
13275+/* Memory management: relocate() leaks memory, because it has to construct
13276+ a fresh pathname. If this is a problem because your program calls
13277+ relocate() frequently, think about caching the result. */
13278+
13279+/* Convenience function:
13280+ Computes the current installation prefix, based on the original
13281+ installation prefix, the original installation directory of a particular
13282+ file, and the current pathname of this file. Returns NULL upon failure. */
13283+extern const char * compute_curr_prefix (const char *orig_installprefix,
13284+ const char *orig_installdir,
13285+ const char *curr_pathname);
13286+
13287+#else
13288+
13289+/* By default, we use the hardwired pathnames. */
13290+#define relocate(pathname) (pathname)
13291+
13292+#endif
13293+
13294+
13295+#ifdef __cplusplus
13296+}
13297+#endif
13298+
13299+#endif /* _RELOCATABLE_H */
13300diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/textdomain.c psmisc-20.2.works.clean/intl/textdomain.c
13301--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/textdomain.c 2001-04-13 23:00:42.000000000 -0500
13302+++ psmisc-20.2.works.clean/intl/textdomain.c 2004-10-13 15:18:42.000000000 -0500
13303@@ -1,19 +1,20 @@
13304 /* Implementation of the textdomain(3) function.
13305- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
13306+ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
13307
13308- This program is free software; you can redistribute it and/or modify
13309- it under the terms of the GNU General Public License as published by
13310- the Free Software Foundation; either version 2, or (at your option)
13311+ This program is free software; you can redistribute it and/or modify it
13312+ under the terms of the GNU Library General Public License as published
13313+ by the Free Software Foundation; either version 2, or (at your option)
13314 any later version.
13315
13316 This program is distributed in the hope that it will be useful,
13317 but WITHOUT ANY WARRANTY; without even the implied warranty of
13318- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13319- GNU General Public License for more details.
13320+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13321+ Library General Public License for more details.
13322
13323- You should have received a copy of the GNU General Public License
13324- along with this program; if not, write to the Free Software Foundation,
13325- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
13326+ You should have received a copy of the GNU Library General Public
13327+ License along with this program; if not, write to the Free Software
13328+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
13329+ USA. */
13330
13331 #ifdef HAVE_CONFIG_H
13332 # include <config.h>
13333@@ -43,17 +44,17 @@
13334 names than the internal variables in GNU libc, otherwise programs
13335 using libintl.a cannot be linked statically. */
13336 #if !defined _LIBC
13337-# define _nl_default_default_domain _nl_default_default_domain__
13338-# define _nl_current_default_domain _nl_current_default_domain__
13339+# define _nl_default_default_domain libintl_nl_default_default_domain
13340+# define _nl_current_default_domain libintl_nl_current_default_domain
13341 #endif
13342
13343 /* @@ end of prolog @@ */
13344
13345 /* Name of the default text domain. */
13346-extern const char _nl_default_default_domain[];
13347+extern const char _nl_default_default_domain[] attribute_hidden;
13348
13349 /* Default text domain in which entries for gettext(3) are to be found. */
13350-extern const char *_nl_current_default_domain;
13351+extern const char *_nl_current_default_domain attribute_hidden;
13352
13353
13354 /* Names for the libintl functions are a problem. They must not clash
13355@@ -66,18 +67,17 @@
13356 # define strdup(str) __strdup (str)
13357 # endif
13358 #else
13359-# define TEXTDOMAIN textdomain__
13360+# define TEXTDOMAIN libintl_textdomain
13361 #endif
13362
13363 /* Lock variable to protect the global data in the gettext implementation. */
13364-__libc_rwlock_define (extern, _nl_state_lock)
13365+__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
13366
13367 /* Set the current default message catalog to DOMAINNAME.
13368 If DOMAINNAME is null, return the current default.
13369 If DOMAINNAME is "", reset to the default of "messages". */
13370 char *
13371-TEXTDOMAIN (domainname)
13372- const char *domainname;
13373+TEXTDOMAIN (const char *domainname)
13374 {
13375 char *new_domain;
13376 char *old_domain;
13377diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/vasnprintf.c psmisc-20.2.works.clean/intl/vasnprintf.c
13378--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/vasnprintf.c 1969-12-31 18:00:00.000000000 -0600
13379+++ psmisc-20.2.works.clean/intl/vasnprintf.c 2004-10-13 15:18:42.000000000 -0500
13380@@ -0,0 +1,887 @@
13381+/* vsprintf with automatic memory allocation.
13382+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
13383+
13384+ This program is free software; you can redistribute it and/or modify it
13385+ under the terms of the GNU Library General Public License as published
13386+ by the Free Software Foundation; either version 2, or (at your option)
13387+ any later version.
13388+
13389+ This program is distributed in the hope that it will be useful,
13390+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13391+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13392+ Library General Public License for more details.
13393+
13394+ You should have received a copy of the GNU Library General Public
13395+ License along with this program; if not, write to the Free Software
13396+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
13397+ USA. */
13398+
13399+/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
13400+ This must come before <config.h> because <config.h> may include
13401+ <features.h>, and once <features.h> has been included, it's too late. */
13402+#ifndef _GNU_SOURCE
13403+# define _GNU_SOURCE 1
13404+#endif
13405+
13406+#ifdef HAVE_CONFIG_H
13407+# include <config.h>
13408+#endif
13409+#ifndef IN_LIBINTL
13410+# include <alloca.h>
13411+#endif
13412+
13413+/* Specification. */
13414+#if WIDE_CHAR_VERSION
13415+# include "vasnwprintf.h"
13416+#else
13417+# include "vasnprintf.h"
13418+#endif
13419+
13420+#include <stdio.h> /* snprintf(), sprintf() */
13421+#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
13422+#include <string.h> /* memcpy(), strlen() */
13423+#include <errno.h> /* errno */
13424+#include <limits.h> /* CHAR_BIT */
13425+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
13426+#if WIDE_CHAR_VERSION
13427+# include "wprintf-parse.h"
13428+#else
13429+# include "printf-parse.h"
13430+#endif
13431+
13432+/* Checked size_t computations. */
13433+#include "xsize.h"
13434+
13435+#ifdef HAVE_WCHAR_T
13436+# ifdef HAVE_WCSLEN
13437+# define local_wcslen wcslen
13438+# else
13439+ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
13440+ a dependency towards this library, here is a local substitute.
13441+ Define this substitute only once, even if this file is included
13442+ twice in the same compilation unit. */
13443+# ifndef local_wcslen_defined
13444+# define local_wcslen_defined 1
13445+static size_t
13446+local_wcslen (const wchar_t *s)
13447+{
13448+ const wchar_t *ptr;
13449+
13450+ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
13451+ ;
13452+ return ptr - s;
13453+}
13454+# endif
13455+# endif
13456+#endif
13457+
13458+#if WIDE_CHAR_VERSION
13459+# define VASNPRINTF vasnwprintf
13460+# define CHAR_T wchar_t
13461+# define DIRECTIVE wchar_t_directive
13462+# define DIRECTIVES wchar_t_directives
13463+# define PRINTF_PARSE wprintf_parse
13464+# define USE_SNPRINTF 1
13465+# if HAVE_DECL__SNWPRINTF
13466+ /* On Windows, the function swprintf() has a different signature than
13467+ on Unix; we use the _snwprintf() function instead. */
13468+# define SNPRINTF _snwprintf
13469+# else
13470+ /* Unix. */
13471+# define SNPRINTF swprintf
13472+# endif
13473+#else
13474+# define VASNPRINTF vasnprintf
13475+# define CHAR_T char
13476+# define DIRECTIVE char_directive
13477+# define DIRECTIVES char_directives
13478+# define PRINTF_PARSE printf_parse
13479+# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
13480+# if HAVE_DECL__SNPRINTF
13481+ /* Windows. */
13482+# define SNPRINTF _snprintf
13483+# else
13484+ /* Unix. */
13485+# define SNPRINTF snprintf
13486+# endif
13487+#endif
13488+
13489+CHAR_T *
13490+VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
13491+{
13492+ DIRECTIVES d;
13493+ arguments a;
13494+
13495+ if (PRINTF_PARSE (format, &d, &a) < 0)
13496+ {
13497+ errno = EINVAL;
13498+ return NULL;
13499+ }
13500+
13501+#define CLEANUP() \
13502+ free (d.dir); \
13503+ if (a.arg) \
13504+ free (a.arg);
13505+
13506+ if (printf_fetchargs (args, &a) < 0)
13507+ {
13508+ CLEANUP ();
13509+ errno = EINVAL;
13510+ return NULL;
13511+ }
13512+
13513+ {
13514+ size_t buf_neededlength;
13515+ CHAR_T *buf;
13516+ CHAR_T *buf_malloced;
13517+ const CHAR_T *cp;
13518+ size_t i;
13519+ DIRECTIVE *dp;
13520+ /* Output string accumulator. */
13521+ CHAR_T *result;
13522+ size_t allocated;
13523+ size_t length;
13524+
13525+ /* Allocate a small buffer that will hold a directive passed to
13526+ sprintf or snprintf. */
13527+ buf_neededlength =
13528+ xsum4 (7, d.max_width_length, d.max_precision_length, 6);
13529+#if HAVE_ALLOCA
13530+ if (buf_neededlength < 4000 / sizeof (CHAR_T))
13531+ {
13532+ buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T));
13533+ buf_malloced = NULL;
13534+ }
13535+ else
13536+#endif
13537+ {
13538+ size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T));
13539+ if (size_overflow_p (buf_memsize))
13540+ goto out_of_memory_1;
13541+ buf = (CHAR_T *) malloc (buf_memsize);
13542+ if (buf == NULL)
13543+ goto out_of_memory_1;
13544+ buf_malloced = buf;
13545+ }
13546+
13547+ if (resultbuf != NULL)
13548+ {
13549+ result = resultbuf;
13550+ allocated = *lengthp;
13551+ }
13552+ else
13553+ {
13554+ result = NULL;
13555+ allocated = 0;
13556+ }
13557+ length = 0;
13558+ /* Invariants:
13559+ result is either == resultbuf or == NULL or malloc-allocated.
13560+ If length > 0, then result != NULL. */
13561+
13562+ /* Ensures that allocated >= needed. Aborts through a jump to
13563+ out_of_memory if needed is SIZE_MAX or otherwise too big. */
13564+#define ENSURE_ALLOCATION(needed) \
13565+ if ((needed) > allocated) \
13566+ { \
13567+ size_t memory_size; \
13568+ CHAR_T *memory; \
13569+ \
13570+ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
13571+ if ((needed) > allocated) \
13572+ allocated = (needed); \
13573+ memory_size = xtimes (allocated, sizeof (CHAR_T)); \
13574+ if (size_overflow_p (memory_size)) \
13575+ goto out_of_memory; \
13576+ if (result == resultbuf || result == NULL) \
13577+ memory = (CHAR_T *) malloc (memory_size); \
13578+ else \
13579+ memory = (CHAR_T *) realloc (result, memory_size); \
13580+ if (memory == NULL) \
13581+ goto out_of_memory; \
13582+ if (result == resultbuf && length > 0) \
13583+ memcpy (memory, result, length * sizeof (CHAR_T)); \
13584+ result = memory; \
13585+ }
13586+
13587+ for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
13588+ {
13589+ if (cp != dp->dir_start)
13590+ {
13591+ size_t n = dp->dir_start - cp;
13592+ size_t augmented_length = xsum (length, n);
13593+
13594+ ENSURE_ALLOCATION (augmented_length);
13595+ memcpy (result + length, cp, n * sizeof (CHAR_T));
13596+ length = augmented_length;
13597+ }
13598+ if (i == d.count)
13599+ break;
13600+
13601+ /* Execute a single directive. */
13602+ if (dp->conversion == '%')
13603+ {
13604+ size_t augmented_length;
13605+
13606+ if (!(dp->arg_index == ARG_NONE))
13607+ abort ();
13608+ augmented_length = xsum (length, 1);
13609+ ENSURE_ALLOCATION (augmented_length);
13610+ result[length] = '%';
13611+ length = augmented_length;
13612+ }
13613+ else
13614+ {
13615+ if (!(dp->arg_index != ARG_NONE))
13616+ abort ();
13617+
13618+ if (dp->conversion == 'n')
13619+ {
13620+ switch (a.arg[dp->arg_index].type)
13621+ {
13622+ case TYPE_COUNT_SCHAR_POINTER:
13623+ *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
13624+ break;
13625+ case TYPE_COUNT_SHORT_POINTER:
13626+ *a.arg[dp->arg_index].a.a_count_short_pointer = length;
13627+ break;
13628+ case TYPE_COUNT_INT_POINTER:
13629+ *a.arg[dp->arg_index].a.a_count_int_pointer = length;
13630+ break;
13631+ case TYPE_COUNT_LONGINT_POINTER:
13632+ *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
13633+ break;
13634+#ifdef HAVE_LONG_LONG
13635+ case TYPE_COUNT_LONGLONGINT_POINTER:
13636+ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
13637+ break;
13638+#endif
13639+ default:
13640+ abort ();
13641+ }
13642+ }
13643+ else
13644+ {
13645+ arg_type type = a.arg[dp->arg_index].type;
13646+ CHAR_T *p;
13647+ unsigned int prefix_count;
13648+ int prefixes[2];
13649+#if !USE_SNPRINTF
13650+ size_t tmp_length;
13651+ CHAR_T tmpbuf[700];
13652+ CHAR_T *tmp;
13653+
13654+ /* Allocate a temporary buffer of sufficient size for calling
13655+ sprintf. */
13656+ {
13657+ size_t width;
13658+ size_t precision;
13659+
13660+ width = 0;
13661+ if (dp->width_start != dp->width_end)
13662+ {
13663+ if (dp->width_arg_index != ARG_NONE)
13664+ {
13665+ int arg;
13666+
13667+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
13668+ abort ();
13669+ arg = a.arg[dp->width_arg_index].a.a_int;
13670+ width = (arg < 0 ? (unsigned int) (-arg) : arg);
13671+ }
13672+ else
13673+ {
13674+ const CHAR_T *digitp = dp->width_start;
13675+
13676+ do
13677+ width = xsum (xtimes (width, 10), *digitp++ - '0');
13678+ while (digitp != dp->width_end);
13679+ }
13680+ }
13681+
13682+ precision = 6;
13683+ if (dp->precision_start != dp->precision_end)
13684+ {
13685+ if (dp->precision_arg_index != ARG_NONE)
13686+ {
13687+ int arg;
13688+
13689+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
13690+ abort ();
13691+ arg = a.arg[dp->precision_arg_index].a.a_int;
13692+ precision = (arg < 0 ? 0 : arg);
13693+ }
13694+ else
13695+ {
13696+ const CHAR_T *digitp = dp->precision_start + 1;
13697+
13698+ precision = 0;
13699+ do
13700+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
13701+ while (digitp != dp->precision_end);
13702+ }
13703+ }
13704+
13705+ switch (dp->conversion)
13706+ {
13707+
13708+ case 'd': case 'i': case 'u':
13709+# ifdef HAVE_LONG_LONG
13710+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
13711+ tmp_length =
13712+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
13713+ * 0.30103 /* binary -> decimal */
13714+ * 2 /* estimate for FLAG_GROUP */
13715+ )
13716+ + 1 /* turn floor into ceil */
13717+ + 1; /* account for leading sign */
13718+ else
13719+# endif
13720+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
13721+ tmp_length =
13722+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
13723+ * 0.30103 /* binary -> decimal */
13724+ * 2 /* estimate for FLAG_GROUP */
13725+ )
13726+ + 1 /* turn floor into ceil */
13727+ + 1; /* account for leading sign */
13728+ else
13729+ tmp_length =
13730+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
13731+ * 0.30103 /* binary -> decimal */
13732+ * 2 /* estimate for FLAG_GROUP */
13733+ )
13734+ + 1 /* turn floor into ceil */
13735+ + 1; /* account for leading sign */
13736+ break;
13737+
13738+ case 'o':
13739+# ifdef HAVE_LONG_LONG
13740+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
13741+ tmp_length =
13742+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
13743+ * 0.333334 /* binary -> octal */
13744+ )
13745+ + 1 /* turn floor into ceil */
13746+ + 1; /* account for leading sign */
13747+ else
13748+# endif
13749+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
13750+ tmp_length =
13751+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
13752+ * 0.333334 /* binary -> octal */
13753+ )
13754+ + 1 /* turn floor into ceil */
13755+ + 1; /* account for leading sign */
13756+ else
13757+ tmp_length =
13758+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
13759+ * 0.333334 /* binary -> octal */
13760+ )
13761+ + 1 /* turn floor into ceil */
13762+ + 1; /* account for leading sign */
13763+ break;
13764+
13765+ case 'x': case 'X':
13766+# ifdef HAVE_LONG_LONG
13767+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
13768+ tmp_length =
13769+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
13770+ * 0.25 /* binary -> hexadecimal */
13771+ )
13772+ + 1 /* turn floor into ceil */
13773+ + 2; /* account for leading sign or alternate form */
13774+ else
13775+# endif
13776+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
13777+ tmp_length =
13778+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
13779+ * 0.25 /* binary -> hexadecimal */
13780+ )
13781+ + 1 /* turn floor into ceil */
13782+ + 2; /* account for leading sign or alternate form */
13783+ else
13784+ tmp_length =
13785+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
13786+ * 0.25 /* binary -> hexadecimal */
13787+ )
13788+ + 1 /* turn floor into ceil */
13789+ + 2; /* account for leading sign or alternate form */
13790+ break;
13791+
13792+ case 'f': case 'F':
13793+# ifdef HAVE_LONG_DOUBLE
13794+ if (type == TYPE_LONGDOUBLE)
13795+ tmp_length =
13796+ (unsigned int) (LDBL_MAX_EXP
13797+ * 0.30103 /* binary -> decimal */
13798+ * 2 /* estimate for FLAG_GROUP */
13799+ )
13800+ + 1 /* turn floor into ceil */
13801+ + 10; /* sign, decimal point etc. */
13802+ else
13803+# endif
13804+ tmp_length =
13805+ (unsigned int) (DBL_MAX_EXP
13806+ * 0.30103 /* binary -> decimal */
13807+ * 2 /* estimate for FLAG_GROUP */
13808+ )
13809+ + 1 /* turn floor into ceil */
13810+ + 10; /* sign, decimal point etc. */
13811+ tmp_length = xsum (tmp_length, precision);
13812+ break;
13813+
13814+ case 'e': case 'E': case 'g': case 'G':
13815+ case 'a': case 'A':
13816+ tmp_length =
13817+ 12; /* sign, decimal point, exponent etc. */
13818+ tmp_length = xsum (tmp_length, precision);
13819+ break;
13820+
13821+ case 'c':
13822+# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION
13823+ if (type == TYPE_WIDE_CHAR)
13824+ tmp_length = MB_CUR_MAX;
13825+ else
13826+# endif
13827+ tmp_length = 1;
13828+ break;
13829+
13830+ case 's':
13831+# ifdef HAVE_WCHAR_T
13832+ if (type == TYPE_WIDE_STRING)
13833+ {
13834+ tmp_length =
13835+ local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
13836+
13837+# if !WIDE_CHAR_VERSION
13838+ tmp_length = xtimes (tmp_length, MB_CUR_MAX);
13839+# endif
13840+ }
13841+ else
13842+# endif
13843+ tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
13844+ break;
13845+
13846+ case 'p':
13847+ tmp_length =
13848+ (unsigned int) (sizeof (void *) * CHAR_BIT
13849+ * 0.25 /* binary -> hexadecimal */
13850+ )
13851+ + 1 /* turn floor into ceil */
13852+ + 2; /* account for leading 0x */
13853+ break;
13854+
13855+ default:
13856+ abort ();
13857+ }
13858+
13859+ if (tmp_length < width)
13860+ tmp_length = width;
13861+
13862+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
13863+ }
13864+
13865+ if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
13866+ tmp = tmpbuf;
13867+ else
13868+ {
13869+ size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T));
13870+
13871+ if (size_overflow_p (tmp_memsize))
13872+ /* Overflow, would lead to out of memory. */
13873+ goto out_of_memory;
13874+ tmp = (CHAR_T *) malloc (tmp_memsize);
13875+ if (tmp == NULL)
13876+ /* Out of memory. */
13877+ goto out_of_memory;
13878+ }
13879+#endif
13880+
13881+ /* Construct the format string for calling snprintf or
13882+ sprintf. */
13883+ p = buf;
13884+ *p++ = '%';
13885+ if (dp->flags & FLAG_GROUP)
13886+ *p++ = '\'';
13887+ if (dp->flags & FLAG_LEFT)
13888+ *p++ = '-';
13889+ if (dp->flags & FLAG_SHOWSIGN)
13890+ *p++ = '+';
13891+ if (dp->flags & FLAG_SPACE)
13892+ *p++ = ' ';
13893+ if (dp->flags & FLAG_ALT)
13894+ *p++ = '#';
13895+ if (dp->flags & FLAG_ZERO)
13896+ *p++ = '0';
13897+ if (dp->width_start != dp->width_end)
13898+ {
13899+ size_t n = dp->width_end - dp->width_start;
13900+ memcpy (p, dp->width_start, n * sizeof (CHAR_T));
13901+ p += n;
13902+ }
13903+ if (dp->precision_start != dp->precision_end)
13904+ {
13905+ size_t n = dp->precision_end - dp->precision_start;
13906+ memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
13907+ p += n;
13908+ }
13909+
13910+ switch (type)
13911+ {
13912+#ifdef HAVE_LONG_LONG
13913+ case TYPE_LONGLONGINT:
13914+ case TYPE_ULONGLONGINT:
13915+ *p++ = 'l';
13916+ /*FALLTHROUGH*/
13917+#endif
13918+ case TYPE_LONGINT:
13919+ case TYPE_ULONGINT:
13920+#ifdef HAVE_WINT_T
13921+ case TYPE_WIDE_CHAR:
13922+#endif
13923+#ifdef HAVE_WCHAR_T
13924+ case TYPE_WIDE_STRING:
13925+#endif
13926+ *p++ = 'l';
13927+ break;
13928+#ifdef HAVE_LONG_DOUBLE
13929+ case TYPE_LONGDOUBLE:
13930+ *p++ = 'L';
13931+ break;
13932+#endif
13933+ default:
13934+ break;
13935+ }
13936+ *p = dp->conversion;
13937+#if USE_SNPRINTF
13938+ p[1] = '%';
13939+ p[2] = 'n';
13940+ p[3] = '\0';
13941+#else
13942+ p[1] = '\0';
13943+#endif
13944+
13945+ /* Construct the arguments for calling snprintf or sprintf. */
13946+ prefix_count = 0;
13947+ if (dp->width_arg_index != ARG_NONE)
13948+ {
13949+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
13950+ abort ();
13951+ prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
13952+ }
13953+ if (dp->precision_arg_index != ARG_NONE)
13954+ {
13955+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
13956+ abort ();
13957+ prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
13958+ }
13959+
13960+#if USE_SNPRINTF
13961+ /* Prepare checking whether snprintf returns the count
13962+ via %n. */
13963+ ENSURE_ALLOCATION (xsum (length, 1));
13964+ result[length] = '\0';
13965+#endif
13966+
13967+ for (;;)
13968+ {
13969+ size_t maxlen;
13970+ int count;
13971+ int retcount;
13972+
13973+ maxlen = allocated - length;
13974+ count = -1;
13975+ retcount = 0;
13976+
13977+#if USE_SNPRINTF
13978+# define SNPRINTF_BUF(arg) \
13979+ switch (prefix_count) \
13980+ { \
13981+ case 0: \
13982+ retcount = SNPRINTF (result + length, maxlen, buf, \
13983+ arg, &count); \
13984+ break; \
13985+ case 1: \
13986+ retcount = SNPRINTF (result + length, maxlen, buf, \
13987+ prefixes[0], arg, &count); \
13988+ break; \
13989+ case 2: \
13990+ retcount = SNPRINTF (result + length, maxlen, buf, \
13991+ prefixes[0], prefixes[1], arg, \
13992+ &count); \
13993+ break; \
13994+ default: \
13995+ abort (); \
13996+ }
13997+#else
13998+# define SNPRINTF_BUF(arg) \
13999+ switch (prefix_count) \
14000+ { \
14001+ case 0: \
14002+ count = sprintf (tmp, buf, arg); \
14003+ break; \
14004+ case 1: \
14005+ count = sprintf (tmp, buf, prefixes[0], arg); \
14006+ break; \
14007+ case 2: \
14008+ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
14009+ arg); \
14010+ break; \
14011+ default: \
14012+ abort (); \
14013+ }
14014+#endif
14015+
14016+ switch (type)
14017+ {
14018+ case TYPE_SCHAR:
14019+ {
14020+ int arg = a.arg[dp->arg_index].a.a_schar;
14021+ SNPRINTF_BUF (arg);
14022+ }
14023+ break;
14024+ case TYPE_UCHAR:
14025+ {
14026+ unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
14027+ SNPRINTF_BUF (arg);
14028+ }
14029+ break;
14030+ case TYPE_SHORT:
14031+ {
14032+ int arg = a.arg[dp->arg_index].a.a_short;
14033+ SNPRINTF_BUF (arg);
14034+ }
14035+ break;
14036+ case TYPE_USHORT:
14037+ {
14038+ unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
14039+ SNPRINTF_BUF (arg);
14040+ }
14041+ break;
14042+ case TYPE_INT:
14043+ {
14044+ int arg = a.arg[dp->arg_index].a.a_int;
14045+ SNPRINTF_BUF (arg);
14046+ }
14047+ break;
14048+ case TYPE_UINT:
14049+ {
14050+ unsigned int arg = a.arg[dp->arg_index].a.a_uint;
14051+ SNPRINTF_BUF (arg);
14052+ }
14053+ break;
14054+ case TYPE_LONGINT:
14055+ {
14056+ long int arg = a.arg[dp->arg_index].a.a_longint;
14057+ SNPRINTF_BUF (arg);
14058+ }
14059+ break;
14060+ case TYPE_ULONGINT:
14061+ {
14062+ unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
14063+ SNPRINTF_BUF (arg);
14064+ }
14065+ break;
14066+#ifdef HAVE_LONG_LONG
14067+ case TYPE_LONGLONGINT:
14068+ {
14069+ long long int arg = a.arg[dp->arg_index].a.a_longlongint;
14070+ SNPRINTF_BUF (arg);
14071+ }
14072+ break;
14073+ case TYPE_ULONGLONGINT:
14074+ {
14075+ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
14076+ SNPRINTF_BUF (arg);
14077+ }
14078+ break;
14079+#endif
14080+ case TYPE_DOUBLE:
14081+ {
14082+ double arg = a.arg[dp->arg_index].a.a_double;
14083+ SNPRINTF_BUF (arg);
14084+ }
14085+ break;
14086+#ifdef HAVE_LONG_DOUBLE
14087+ case TYPE_LONGDOUBLE:
14088+ {
14089+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
14090+ SNPRINTF_BUF (arg);
14091+ }
14092+ break;
14093+#endif
14094+ case TYPE_CHAR:
14095+ {
14096+ int arg = a.arg[dp->arg_index].a.a_char;
14097+ SNPRINTF_BUF (arg);
14098+ }
14099+ break;
14100+#ifdef HAVE_WINT_T
14101+ case TYPE_WIDE_CHAR:
14102+ {
14103+ wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
14104+ SNPRINTF_BUF (arg);
14105+ }
14106+ break;
14107+#endif
14108+ case TYPE_STRING:
14109+ {
14110+ const char *arg = a.arg[dp->arg_index].a.a_string;
14111+ SNPRINTF_BUF (arg);
14112+ }
14113+ break;
14114+#ifdef HAVE_WCHAR_T
14115+ case TYPE_WIDE_STRING:
14116+ {
14117+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
14118+ SNPRINTF_BUF (arg);
14119+ }
14120+ break;
14121+#endif
14122+ case TYPE_POINTER:
14123+ {
14124+ void *arg = a.arg[dp->arg_index].a.a_pointer;
14125+ SNPRINTF_BUF (arg);
14126+ }
14127+ break;
14128+ default:
14129+ abort ();
14130+ }
14131+
14132+#if USE_SNPRINTF
14133+ /* Portability: Not all implementations of snprintf()
14134+ are ISO C 99 compliant. Determine the number of
14135+ bytes that snprintf() has produced or would have
14136+ produced. */
14137+ if (count >= 0)
14138+ {
14139+ /* Verify that snprintf() has NUL-terminated its
14140+ result. */
14141+ if (count < maxlen && result[length + count] != '\0')
14142+ abort ();
14143+ /* Portability hack. */
14144+ if (retcount > count)
14145+ count = retcount;
14146+ }
14147+ else
14148+ {
14149+ /* snprintf() doesn't understand the '%n'
14150+ directive. */
14151+ if (p[1] != '\0')
14152+ {
14153+ /* Don't use the '%n' directive; instead, look
14154+ at the snprintf() return value. */
14155+ p[1] = '\0';
14156+ continue;
14157+ }
14158+ else
14159+ {
14160+ /* Look at the snprintf() return value. */
14161+ if (retcount < 0)
14162+ {
14163+ /* HP-UX 10.20 snprintf() is doubly deficient:
14164+ It doesn't understand the '%n' directive,
14165+ *and* it returns -1 (rather than the length
14166+ that would have been required) when the
14167+ buffer is too small. */
14168+ size_t bigger_need =
14169+ xsum (xtimes (allocated, 2), 12);
14170+ ENSURE_ALLOCATION (bigger_need);
14171+ continue;
14172+ }
14173+ else
14174+ count = retcount;
14175+ }
14176+ }
14177+#endif
14178+
14179+ /* Attempt to handle failure. */
14180+ if (count < 0)
14181+ {
14182+ if (!(result == resultbuf || result == NULL))
14183+ free (result);
14184+ if (buf_malloced != NULL)
14185+ free (buf_malloced);
14186+ CLEANUP ();
14187+ errno = EINVAL;
14188+ return NULL;
14189+ }
14190+
14191+#if !USE_SNPRINTF
14192+ if (count >= tmp_length)
14193+ /* tmp_length was incorrectly calculated - fix the
14194+ code above! */
14195+ abort ();
14196+#endif
14197+
14198+ /* Make room for the result. */
14199+ if (count >= maxlen)
14200+ {
14201+ /* Need at least count bytes. But allocate
14202+ proportionally, to avoid looping eternally if
14203+ snprintf() reports a too small count. */
14204+ size_t n =
14205+ xmax (xsum (length, count), xtimes (allocated, 2));
14206+
14207+ ENSURE_ALLOCATION (n);
14208+#if USE_SNPRINTF
14209+ continue;
14210+#endif
14211+ }
14212+
14213+#if USE_SNPRINTF
14214+ /* The snprintf() result did fit. */
14215+#else
14216+ /* Append the sprintf() result. */
14217+ memcpy (result + length, tmp, count * sizeof (CHAR_T));
14218+ if (tmp != tmpbuf)
14219+ free (tmp);
14220+#endif
14221+
14222+ length += count;
14223+ break;
14224+ }
14225+ }
14226+ }
14227+ }
14228+
14229+ /* Add the final NUL. */
14230+ ENSURE_ALLOCATION (xsum (length, 1));
14231+ result[length] = '\0';
14232+
14233+ if (result != resultbuf && length + 1 < allocated)
14234+ {
14235+ /* Shrink the allocated memory if possible. */
14236+ CHAR_T *memory;
14237+
14238+ memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
14239+ if (memory != NULL)
14240+ result = memory;
14241+ }
14242+
14243+ if (buf_malloced != NULL)
14244+ free (buf_malloced);
14245+ CLEANUP ();
14246+ *lengthp = length;
14247+ return result;
14248+
14249+ out_of_memory:
14250+ if (!(result == resultbuf || result == NULL))
14251+ free (result);
14252+ if (buf_malloced != NULL)
14253+ free (buf_malloced);
14254+ out_of_memory_1:
14255+ CLEANUP ();
14256+ errno = ENOMEM;
14257+ return NULL;
14258+ }
14259+}
14260+
14261+#undef SNPRINTF
14262+#undef USE_SNPRINTF
14263+#undef PRINTF_PARSE
14264+#undef DIRECTIVES
14265+#undef DIRECTIVE
14266+#undef CHAR_T
14267+#undef VASNPRINTF
14268diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/vasnprintf.h psmisc-20.2.works.clean/intl/vasnprintf.h
14269--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/vasnprintf.h 1969-12-31 18:00:00.000000000 -0600
14270+++ psmisc-20.2.works.clean/intl/vasnprintf.h 2004-10-13 15:18:42.000000000 -0500
14271@@ -0,0 +1,61 @@
14272+/* vsprintf with automatic memory allocation.
14273+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
14274+
14275+ This program is free software; you can redistribute it and/or modify it
14276+ under the terms of the GNU Library General Public License as published
14277+ by the Free Software Foundation; either version 2, or (at your option)
14278+ any later version.
14279+
14280+ This program is distributed in the hope that it will be useful,
14281+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14282+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14283+ Library General Public License for more details.
14284+
14285+ You should have received a copy of the GNU Library General Public
14286+ License along with this program; if not, write to the Free Software
14287+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
14288+ USA. */
14289+
14290+#ifndef _VASNPRINTF_H
14291+#define _VASNPRINTF_H
14292+
14293+/* Get va_list. */
14294+#include <stdarg.h>
14295+
14296+/* Get size_t. */
14297+#include <stddef.h>
14298+
14299+#ifndef __attribute__
14300+/* This feature is available in gcc versions 2.5 and later. */
14301+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
14302+# define __attribute__(Spec) /* empty */
14303+# endif
14304+/* The __-protected variants of `format' and `printf' attributes
14305+ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
14306+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
14307+# define __format__ format
14308+# define __printf__ printf
14309+# endif
14310+#endif
14311+
14312+#ifdef __cplusplus
14313+extern "C" {
14314+#endif
14315+
14316+/* Write formatted output to a string dynamically allocated with malloc().
14317+ You can pass a preallocated buffer for the result in RESULTBUF and its
14318+ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
14319+ If successful, return the address of the string (this may be = RESULTBUF
14320+ if no dynamic memory allocation was necessary) and set *LENGTHP to the
14321+ number of resulting bytes, excluding the trailing NUL. Upon error, set
14322+ errno and return NULL. */
14323+extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
14324+ __attribute__ ((__format__ (__printf__, 3, 4)));
14325+extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
14326+ __attribute__ ((__format__ (__printf__, 3, 0)));
14327+
14328+#ifdef __cplusplus
14329+}
14330+#endif
14331+
14332+#endif /* _VASNPRINTF_H */
14333diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/vasnwprintf.h psmisc-20.2.works.clean/intl/vasnwprintf.h
14334--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/vasnwprintf.h 1969-12-31 18:00:00.000000000 -0600
14335+++ psmisc-20.2.works.clean/intl/vasnwprintf.h 2004-10-13 15:18:42.000000000 -0500
14336@@ -0,0 +1,46 @@
14337+/* vswprintf with automatic memory allocation.
14338+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
14339+
14340+ This program is free software; you can redistribute it and/or modify it
14341+ under the terms of the GNU Library General Public License as published
14342+ by the Free Software Foundation; either version 2, or (at your option)
14343+ any later version.
14344+
14345+ This program is distributed in the hope that it will be useful,
14346+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14347+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14348+ Library General Public License for more details.
14349+
14350+ You should have received a copy of the GNU Library General Public
14351+ License along with this program; if not, write to the Free Software
14352+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
14353+ USA. */
14354+
14355+#ifndef _VASNWPRINTF_H
14356+#define _VASNWPRINTF_H
14357+
14358+/* Get va_list. */
14359+#include <stdarg.h>
14360+
14361+/* Get wchar_t, size_t. */
14362+#include <stddef.h>
14363+
14364+#ifdef __cplusplus
14365+extern "C" {
14366+#endif
14367+
14368+/* Write formatted output to a string dynamically allocated with malloc().
14369+ You can pass a preallocated buffer for the result in RESULTBUF and its
14370+ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
14371+ If successful, return the address of the string (this may be = RESULTBUF
14372+ if no dynamic memory allocation was necessary) and set *LENGTHP to the
14373+ number of resulting bytes, excluding the trailing NUL. Upon error, set
14374+ errno and return NULL. */
14375+extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
14376+extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
14377+
14378+#ifdef __cplusplus
14379+}
14380+#endif
14381+
14382+#endif /* _VASNWPRINTF_H */
14383diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/wprintf-parse.h psmisc-20.2.works.clean/intl/wprintf-parse.h
14384--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/wprintf-parse.h 1969-12-31 18:00:00.000000000 -0600
14385+++ psmisc-20.2.works.clean/intl/wprintf-parse.h 2004-10-13 15:18:42.000000000 -0500
14386@@ -0,0 +1,75 @@
14387+/* Parse printf format string.
14388+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
14389+
14390+ This program is free software; you can redistribute it and/or modify it
14391+ under the terms of the GNU Library General Public License as published
14392+ by the Free Software Foundation; either version 2, or (at your option)
14393+ any later version.
14394+
14395+ This program is distributed in the hope that it will be useful,
14396+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14397+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14398+ Library General Public License for more details.
14399+
14400+ You should have received a copy of the GNU Library General Public
14401+ License along with this program; if not, write to the Free Software
14402+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
14403+ USA. */
14404+
14405+#ifndef _WPRINTF_PARSE_H
14406+#define _WPRINTF_PARSE_H
14407+
14408+#include "printf-args.h"
14409+
14410+
14411+/* Flags */
14412+#define FLAG_GROUP 1 /* ' flag */
14413+#define FLAG_LEFT 2 /* - flag */
14414+#define FLAG_SHOWSIGN 4 /* + flag */
14415+#define FLAG_SPACE 8 /* space flag */
14416+#define FLAG_ALT 16 /* # flag */
14417+#define FLAG_ZERO 32
14418+
14419+/* arg_index value indicating that no argument is consumed. */
14420+#define ARG_NONE (~(size_t)0)
14421+
14422+/* A parsed directive. */
14423+typedef struct
14424+{
14425+ const wchar_t* dir_start;
14426+ const wchar_t* dir_end;
14427+ int flags;
14428+ const wchar_t* width_start;
14429+ const wchar_t* width_end;
14430+ size_t width_arg_index;
14431+ const wchar_t* precision_start;
14432+ const wchar_t* precision_end;
14433+ size_t precision_arg_index;
14434+ wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */
14435+ size_t arg_index;
14436+}
14437+wchar_t_directive;
14438+
14439+/* A parsed format string. */
14440+typedef struct
14441+{
14442+ size_t count;
14443+ wchar_t_directive *dir;
14444+ size_t max_width_length;
14445+ size_t max_precision_length;
14446+}
14447+wchar_t_directives;
14448+
14449+
14450+/* Parses the format string. Fills in the number N of directives, and fills
14451+ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
14452+ to the end of the format string. Also fills in the arg_type fields of the
14453+ arguments and the needed count of arguments. */
14454+#ifdef STATIC
14455+STATIC
14456+#else
14457+extern
14458+#endif
14459+int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a);
14460+
14461+#endif /* _WPRINTF_PARSE_H */
14462diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/xsize.h psmisc-20.2.works.clean/intl/xsize.h
14463--- tmp/work/psmisc-20.2-r0/psmisc-20.2/intl/xsize.h 1969-12-31 18:00:00.000000000 -0600
14464+++ psmisc-20.2.works.clean/intl/xsize.h 2004-10-13 15:18:42.000000000 -0500
14465@@ -0,0 +1,109 @@
14466+/* xsize.h -- Checked size_t computations.
14467+
14468+ Copyright (C) 2003 Free Software Foundation, Inc.
14469+
14470+ This program is free software; you can redistribute it and/or modify it
14471+ under the terms of the GNU Library General Public License as published
14472+ by the Free Software Foundation; either version 2, or (at your option)
14473+ any later version.
14474+
14475+ This program is distributed in the hope that it will be useful,
14476+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14477+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14478+ Library General Public License for more details.
14479+
14480+ You should have received a copy of the GNU Library General Public
14481+ License along with this program; if not, write to the Free Software
14482+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
14483+ USA. */
14484+
14485+#ifndef _XSIZE_H
14486+#define _XSIZE_H
14487+
14488+/* Get size_t. */
14489+#include <stddef.h>
14490+
14491+/* Get SIZE_MAX. */
14492+#include <limits.h>
14493+#if HAVE_STDINT_H
14494+# include <stdint.h>
14495+#endif
14496+
14497+/* The size of memory objects is often computed through expressions of
14498+ type size_t. Example:
14499+ void* p = malloc (header_size + n * element_size).
14500+ These computations can lead to overflow. When this happens, malloc()
14501+ returns a piece of memory that is way too small, and the program then
14502+ crashes while attempting to fill the memory.
14503+ To avoid this, the functions and macros in this file check for overflow.
14504+ The convention is that SIZE_MAX represents overflow.
14505+ malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
14506+ implementation that uses mmap --, it's recommended to use size_overflow_p()
14507+ or size_in_bounds_p() before invoking malloc().
14508+ The example thus becomes:
14509+ size_t size = xsum (header_size, xtimes (n, element_size));
14510+ void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
14511+*/
14512+
14513+/* Convert an arbitrary value >= 0 to type size_t. */
14514+#define xcast_size_t(N) \
14515+ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
14516+
14517+/* Sum of two sizes, with overflow check. */
14518+static inline size_t
14519+#if __GNUC__ >= 3
14520+__attribute__ ((__pure__))
14521+#endif
14522+xsum (size_t size1, size_t size2)
14523+{
14524+ size_t sum = size1 + size2;
14525+ return (sum >= size1 ? sum : SIZE_MAX);
14526+}
14527+
14528+/* Sum of three sizes, with overflow check. */
14529+static inline size_t
14530+#if __GNUC__ >= 3
14531+__attribute__ ((__pure__))
14532+#endif
14533+xsum3 (size_t size1, size_t size2, size_t size3)
14534+{
14535+ return xsum (xsum (size1, size2), size3);
14536+}
14537+
14538+/* Sum of four sizes, with overflow check. */
14539+static inline size_t
14540+#if __GNUC__ >= 3
14541+__attribute__ ((__pure__))
14542+#endif
14543+xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
14544+{
14545+ return xsum (xsum (xsum (size1, size2), size3), size4);
14546+}
14547+
14548+/* Maximum of two sizes, with overflow check. */
14549+static inline size_t
14550+#if __GNUC__ >= 3
14551+__attribute__ ((__pure__))
14552+#endif
14553+xmax (size_t size1, size_t size2)
14554+{
14555+ /* No explicit check is needed here, because for any n:
14556+ max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
14557+ return (size1 >= size2 ? size1 : size2);
14558+}
14559+
14560+/* Multiplication of a count with an element size, with overflow check.
14561+ The count must be >= 0 and the element size must be > 0.
14562+ This is a macro, not an inline function, so that it works correctly even
14563+ when N is of a wider tupe and N > SIZE_MAX. */
14564+#define xtimes(N, ELSIZE) \
14565+ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
14566+
14567+/* Check for overflow. */
14568+#define size_overflow_p(SIZE) \
14569+ ((SIZE) == SIZE_MAX)
14570+/* Check against overflow. */
14571+#define size_in_bounds_p(SIZE) \
14572+ ((SIZE) != SIZE_MAX)
14573+
14574+#endif /* _XSIZE_H */
14575diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/ChangeLog psmisc-20.2.works.clean/m4/ChangeLog
14576--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/ChangeLog 1969-12-31 18:00:00.000000000 -0600
14577+++ psmisc-20.2.works.clean/m4/ChangeLog 2004-10-13 15:11:01.000000000 -0500
14578@@ -0,0 +1,25 @@
14579+2004-10-13 gettextize <bug-gnu-gettext@gnu.org>
14580+
14581+ * gettext.m4: Upgrade to gettext-0.14.1.
14582+ * intmax.m4: New file, from gettext-0.14.1.
14583+ * inttypes_h.m4: Upgrade to gettext-0.14.1.
14584+ * isc-posix.m4: New file, from gettext-0.14.1.
14585+ * lib-ld.m4: Upgrade to gettext-0.14.1.
14586+ * lib-link.m4: Upgrade to gettext-0.14.1.
14587+ * lib-prefix.m4: Upgrade to gettext-0.14.1.
14588+ * longdouble.m4: New file, from gettext-0.14.1.
14589+ * longlong.m4: New file, from gettext-0.14.1.
14590+ * nls.m4: New file, from gettext-0.14.1.
14591+ * po.m4: New file, from gettext-0.14.1.
14592+ * printf-posix.m4: New file, from gettext-0.14.1.
14593+ * progtest.m4: Upgrade to gettext-0.14.1.
14594+ * signed.m4: New file, from gettext-0.14.1.
14595+ * size_max.m4: New file, from gettext-0.14.1.
14596+ * stdint_h.m4: Upgrade to gettext-0.14.1.
14597+ * uintmax_t.m4: Upgrade to gettext-0.14.1.
14598+ * ulonglong.m4: Upgrade to gettext-0.14.1.
14599+ * wchar_t.m4: New file, from gettext-0.14.1.
14600+ * wint_t.m4: New file, from gettext-0.14.1.
14601+ * xsize.m4: New file, from gettext-0.14.1.
14602+ * Makefile.am: New file.
14603+
14604diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/Makefile psmisc-20.2.works.clean/m4/Makefile
14605diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/Makefile.am psmisc-20.2.works.clean/m4/Makefile.am
14606--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/Makefile.am 1969-12-31 18:00:00.000000000 -0600
14607+++ psmisc-20.2.works.clean/m4/Makefile.am 2004-10-13 15:11:01.000000000 -0500
14608@@ -0,0 +1 @@
14609+EXTRA_DIST = intmax.m4 isc-posix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 signed.m4 size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4
14610diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/Makefile.in psmisc-20.2.works.clean/m4/Makefile.in
14611diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/codeset.m4 psmisc-20.2.works.clean/m4/codeset.m4
14612--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/codeset.m4 1969-12-31 18:00:00.000000000 -0600
14613+++ psmisc-20.2.works.clean/m4/codeset.m4 2004-10-13 15:18:42.000000000 -0500
14614@@ -0,0 +1,23 @@
14615+# codeset.m4 serial AM1 (gettext-0.10.40)
14616+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
14617+dnl This file is free software, distributed under the terms of the GNU
14618+dnl General Public License. As a special exception to the GNU General
14619+dnl Public License, this file may be distributed as part of a program
14620+dnl that contains a configuration script generated by Autoconf, under
14621+dnl the same distribution terms as the rest of that program.
14622+
14623+dnl From Bruno Haible.
14624+
14625+AC_DEFUN([AM_LANGINFO_CODESET],
14626+[
14627+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
14628+ [AC_TRY_LINK([#include <langinfo.h>],
14629+ [char* cs = nl_langinfo(CODESET);],
14630+ am_cv_langinfo_codeset=yes,
14631+ am_cv_langinfo_codeset=no)
14632+ ])
14633+ if test $am_cv_langinfo_codeset = yes; then
14634+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
14635+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
14636+ fi
14637+])
14638diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/codeset.m4~ psmisc-20.2.works.clean/m4/codeset.m4~
14639diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/gettext.m4 psmisc-20.2.works.clean/m4/gettext.m4
14640--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/gettext.m4 1969-12-31 18:00:00.000000000 -0600
14641+++ psmisc-20.2.works.clean/m4/gettext.m4 2004-10-13 15:18:42.000000000 -0500
14642@@ -0,0 +1,487 @@
14643+# gettext.m4 serial 28 (gettext-0.13)
14644+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
14645+dnl This file is free software, distributed under the terms of the GNU
14646+dnl General Public License. As a special exception to the GNU General
14647+dnl Public License, this file may be distributed as part of a program
14648+dnl that contains a configuration script generated by Autoconf, under
14649+dnl the same distribution terms as the rest of that program.
14650+dnl
14651+dnl This file can can be used in projects which are not available under
14652+dnl the GNU General Public License or the GNU Library General Public
14653+dnl License but which still want to provide support for the GNU gettext
14654+dnl functionality.
14655+dnl Please note that the actual code of the GNU gettext library is covered
14656+dnl by the GNU Library General Public License, and the rest of the GNU
14657+dnl gettext package package is covered by the GNU General Public License.
14658+dnl They are *not* in the public domain.
14659+
14660+dnl Authors:
14661+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
14662+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
14663+
14664+dnl Macro to add for using GNU gettext.
14665+
14666+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
14667+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
14668+dnl default (if it is not specified or empty) is 'no-libtool'.
14669+dnl INTLSYMBOL should be 'external' for packages with no intl directory,
14670+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
14671+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
14672+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
14673+dnl depending on --{enable,disable}-{shared,static} and on the presence of
14674+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
14675+dnl $(top_builddir)/intl/libintl.a will be created.
14676+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
14677+dnl implementations (in libc or libintl) without the ngettext() function
14678+dnl will be ignored. If NEEDSYMBOL is specified and is
14679+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
14680+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
14681+dnl INTLDIR is used to find the intl libraries. If empty,
14682+dnl the value `$(top_builddir)/intl/' is used.
14683+dnl
14684+dnl The result of the configuration is one of three cases:
14685+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
14686+dnl and used.
14687+dnl Catalog format: GNU --> install in $(datadir)
14688+dnl Catalog extension: .mo after installation, .gmo in source tree
14689+dnl 2) GNU gettext has been found in the system's C library.
14690+dnl Catalog format: GNU --> install in $(datadir)
14691+dnl Catalog extension: .mo after installation, .gmo in source tree
14692+dnl 3) No internationalization, always use English msgid.
14693+dnl Catalog format: none
14694+dnl Catalog extension: none
14695+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
14696+dnl The use of .gmo is historical (it was needed to avoid overwriting the
14697+dnl GNU format catalogs when building on a platform with an X/Open gettext),
14698+dnl but we keep it in order not to force irrelevant filename changes on the
14699+dnl maintainers.
14700+dnl
14701+AC_DEFUN([AM_GNU_GETTEXT],
14702+[
14703+ dnl Argument checking.
14704+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
14705+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
14706+])])])])])
14707+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
14708+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
14709+])])])])
14710+ define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
14711+ define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
14712+
14713+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
14714+ ifelse(gt_included_intl, yes, [
14715+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
14716+ ])
14717+
14718+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
14719+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
14720+ AC_REQUIRE([AC_LIB_RPATH])
14721+
14722+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
14723+ dnl Ideally we would do this search only after the
14724+ dnl if test "$USE_NLS" = "yes"; then
14725+ dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
14726+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
14727+ dnl the configure script would need to contain the same shell code
14728+ dnl again, outside any 'if'. There are two solutions:
14729+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
14730+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
14731+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
14732+ dnl documented, we avoid it.
14733+ ifelse(gt_included_intl, yes, , [
14734+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
14735+ ])
14736+
14737+ dnl Set USE_NLS.
14738+ AM_NLS
14739+
14740+ ifelse(gt_included_intl, yes, [
14741+ BUILD_INCLUDED_LIBINTL=no
14742+ USE_INCLUDED_LIBINTL=no
14743+ ])
14744+ LIBINTL=
14745+ LTLIBINTL=
14746+ POSUB=
14747+
14748+ dnl If we use NLS figure out what method
14749+ if test "$USE_NLS" = "yes"; then
14750+ gt_use_preinstalled_gnugettext=no
14751+ ifelse(gt_included_intl, yes, [
14752+ AC_MSG_CHECKING([whether included gettext is requested])
14753+ AC_ARG_WITH(included-gettext,
14754+ [ --with-included-gettext use the GNU gettext library included here],
14755+ nls_cv_force_use_gnu_gettext=$withval,
14756+ nls_cv_force_use_gnu_gettext=no)
14757+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
14758+
14759+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
14760+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
14761+ ])
14762+ dnl User does not insist on using GNU NLS library. Figure out what
14763+ dnl to use. If GNU gettext is available we use this. Else we have
14764+ dnl to fall back to GNU NLS library.
14765+
14766+ dnl Add a version number to the cache macros.
14767+ define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
14768+ define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
14769+ define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
14770+
14771+ AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
14772+ [AC_TRY_LINK([#include <libintl.h>
14773+]ifelse([$2], [need-formatstring-macros],
14774+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
14775+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
14776+#endif
14777+changequote(,)dnl
14778+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
14779+changequote([,])dnl
14780+], [])[extern int _nl_msg_cat_cntr;
14781+extern int *_nl_domain_bindings;],
14782+ [bindtextdomain ("", "");
14783+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
14784+ gt_cv_func_gnugettext_libc=yes,
14785+ gt_cv_func_gnugettext_libc=no)])
14786+
14787+ if test "$gt_cv_func_gnugettext_libc" != "yes"; then
14788+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
14789+ ifelse(gt_included_intl, yes, , [
14790+ AM_ICONV_LINK
14791+ ])
14792+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
14793+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
14794+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
14795+ dnl even if libiconv doesn't exist.
14796+ AC_LIB_LINKFLAGS_BODY([intl])
14797+ AC_CACHE_CHECK([for GNU gettext in libintl],
14798+ gt_cv_func_gnugettext_libintl,
14799+ [gt_save_CPPFLAGS="$CPPFLAGS"
14800+ CPPFLAGS="$CPPFLAGS $INCINTL"
14801+ gt_save_LIBS="$LIBS"
14802+ LIBS="$LIBS $LIBINTL"
14803+ dnl Now see whether libintl exists and does not depend on libiconv.
14804+ AC_TRY_LINK([#include <libintl.h>
14805+]ifelse([$2], [need-formatstring-macros],
14806+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
14807+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
14808+#endif
14809+changequote(,)dnl
14810+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
14811+changequote([,])dnl
14812+], [])[extern int _nl_msg_cat_cntr;
14813+extern
14814+#ifdef __cplusplus
14815+"C"
14816+#endif
14817+const char *_nl_expand_alias ();],
14818+ [bindtextdomain ("", "");
14819+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
14820+ gt_cv_func_gnugettext_libintl=yes,
14821+ gt_cv_func_gnugettext_libintl=no)
14822+ dnl Now see whether libintl exists and depends on libiconv.
14823+ if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
14824+ LIBS="$LIBS $LIBICONV"
14825+ AC_TRY_LINK([#include <libintl.h>
14826+]ifelse([$2], [need-formatstring-macros],
14827+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
14828+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
14829+#endif
14830+changequote(,)dnl
14831+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
14832+changequote([,])dnl
14833+], [])[extern int _nl_msg_cat_cntr;
14834+extern
14835+#ifdef __cplusplus
14836+"C"
14837+#endif
14838+const char *_nl_expand_alias ();],
14839+ [bindtextdomain ("", "");
14840+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
14841+ [LIBINTL="$LIBINTL $LIBICONV"
14842+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
14843+ gt_cv_func_gnugettext_libintl=yes
14844+ ])
14845+ fi
14846+ CPPFLAGS="$gt_save_CPPFLAGS"
14847+ LIBS="$gt_save_LIBS"])
14848+ fi
14849+
14850+ dnl If an already present or preinstalled GNU gettext() is found,
14851+ dnl use it. But if this macro is used in GNU gettext, and GNU
14852+ dnl gettext is already preinstalled in libintl, we update this
14853+ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
14854+ if test "$gt_cv_func_gnugettext_libc" = "yes" \
14855+ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
14856+ && test "$PACKAGE" != gettext-runtime \
14857+ && test "$PACKAGE" != gettext-tools; }; then
14858+ gt_use_preinstalled_gnugettext=yes
14859+ else
14860+ dnl Reset the values set by searching for libintl.
14861+ LIBINTL=
14862+ LTLIBINTL=
14863+ INCINTL=
14864+ fi
14865+
14866+ ifelse(gt_included_intl, yes, [
14867+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
14868+ dnl GNU gettext is not found in the C library.
14869+ dnl Fall back on included GNU gettext library.
14870+ nls_cv_use_gnu_gettext=yes
14871+ fi
14872+ fi
14873+
14874+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
14875+ dnl Mark actions used to generate GNU NLS library.
14876+ BUILD_INCLUDED_LIBINTL=yes
14877+ USE_INCLUDED_LIBINTL=yes
14878+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
14879+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
14880+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
14881+ fi
14882+
14883+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
14884+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
14885+ dnl Mark actions to use GNU gettext tools.
14886+ CATOBJEXT=.gmo
14887+ fi
14888+ ])
14889+
14890+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
14891+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
14892+ AC_DEFINE(ENABLE_NLS, 1,
14893+ [Define to 1 if translation of program messages to the user's native language
14894+ is requested.])
14895+ else
14896+ USE_NLS=no
14897+ fi
14898+ fi
14899+
14900+ AC_MSG_CHECKING([whether to use NLS])
14901+ AC_MSG_RESULT([$USE_NLS])
14902+ if test "$USE_NLS" = "yes"; then
14903+ AC_MSG_CHECKING([where the gettext function comes from])
14904+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
14905+ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
14906+ gt_source="external libintl"
14907+ else
14908+ gt_source="libc"
14909+ fi
14910+ else
14911+ gt_source="included intl directory"
14912+ fi
14913+ AC_MSG_RESULT([$gt_source])
14914+ fi
14915+
14916+ if test "$USE_NLS" = "yes"; then
14917+
14918+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
14919+ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
14920+ AC_MSG_CHECKING([how to link with libintl])
14921+ AC_MSG_RESULT([$LIBINTL])
14922+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
14923+ fi
14924+
14925+ dnl For backward compatibility. Some packages may be using this.
14926+ AC_DEFINE(HAVE_GETTEXT, 1,
14927+ [Define if the GNU gettext() function is already present or preinstalled.])
14928+ AC_DEFINE(HAVE_DCGETTEXT, 1,
14929+ [Define if the GNU dcgettext() function is already present or preinstalled.])
14930+ fi
14931+
14932+ dnl We need to process the po/ directory.
14933+ POSUB=po
14934+ fi
14935+
14936+ ifelse(gt_included_intl, yes, [
14937+ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
14938+ dnl to 'yes' because some of the testsuite requires it.
14939+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
14940+ BUILD_INCLUDED_LIBINTL=yes
14941+ fi
14942+
14943+ dnl Make all variables we use known to autoconf.
14944+ AC_SUBST(BUILD_INCLUDED_LIBINTL)
14945+ AC_SUBST(USE_INCLUDED_LIBINTL)
14946+ AC_SUBST(CATOBJEXT)
14947+
14948+ dnl For backward compatibility. Some configure.ins may be using this.
14949+ nls_cv_header_intl=
14950+ nls_cv_header_libgt=
14951+
14952+ dnl For backward compatibility. Some Makefiles may be using this.
14953+ DATADIRNAME=share
14954+ AC_SUBST(DATADIRNAME)
14955+
14956+ dnl For backward compatibility. Some Makefiles may be using this.
14957+ INSTOBJEXT=.mo
14958+ AC_SUBST(INSTOBJEXT)
14959+
14960+ dnl For backward compatibility. Some Makefiles may be using this.
14961+ GENCAT=gencat
14962+ AC_SUBST(GENCAT)
14963+
14964+ dnl For backward compatibility. Some Makefiles may be using this.
14965+ if test "$USE_INCLUDED_LIBINTL" = yes; then
14966+ INTLOBJS="\$(GETTOBJS)"
14967+ fi
14968+ AC_SUBST(INTLOBJS)
14969+
14970+ dnl Enable libtool support if the surrounding package wishes it.
14971+ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
14972+ AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
14973+ ])
14974+
14975+ dnl For backward compatibility. Some Makefiles may be using this.
14976+ INTLLIBS="$LIBINTL"
14977+ AC_SUBST(INTLLIBS)
14978+
14979+ dnl Make all documented variables known to autoconf.
14980+ AC_SUBST(LIBINTL)
14981+ AC_SUBST(LTLIBINTL)
14982+ AC_SUBST(POSUB)
14983+])
14984+
14985+
14986+dnl Checks for all prerequisites of the intl subdirectory,
14987+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
14988+dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
14989+AC_DEFUN([AM_INTL_SUBDIR],
14990+[
14991+ AC_REQUIRE([AC_PROG_INSTALL])dnl
14992+ AC_REQUIRE([AM_MKINSTALLDIRS])dnl
14993+ AC_REQUIRE([AC_PROG_CC])dnl
14994+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
14995+ AC_REQUIRE([AC_PROG_RANLIB])dnl
14996+ AC_REQUIRE([AC_ISC_POSIX])dnl
14997+ AC_REQUIRE([AC_HEADER_STDC])dnl
14998+ AC_REQUIRE([AC_C_CONST])dnl
14999+ AC_REQUIRE([bh_C_SIGNED])dnl
15000+ AC_REQUIRE([AC_C_INLINE])dnl
15001+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
15002+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
15003+ AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
15004+ AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
15005+ AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
15006+ AC_REQUIRE([gt_TYPE_WINT_T])dnl
15007+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
15008+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
15009+ AC_REQUIRE([gt_TYPE_INTMAX_T])
15010+ AC_REQUIRE([gt_PRINTF_POSIX])
15011+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
15012+ AC_REQUIRE([AC_FUNC_MMAP])dnl
15013+ AC_REQUIRE([jm_GLIBC21])dnl
15014+ AC_REQUIRE([gt_INTDIV0])dnl
15015+ AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
15016+ AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
15017+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
15018+ AC_REQUIRE([gl_XSIZE])dnl
15019+
15020+ AC_CHECK_TYPE([ptrdiff_t], ,
15021+ [AC_DEFINE([ptrdiff_t], [long],
15022+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
15023+ ])
15024+ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
15025+stdlib.h string.h unistd.h sys/param.h])
15026+ AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
15027+mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
15028+strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
15029+__fsetlocking])
15030+
15031+ dnl Use the _snprintf function only if it is declared (because on NetBSD it
15032+ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
15033+ gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
15034+ gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
15035+
15036+ dnl Use the *_unlocked functions only if they are declared.
15037+ dnl (because some of them were defined without being declared in Solaris
15038+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
15039+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
15040+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
15041+ gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
15042+ gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
15043+ gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
15044+
15045+ case $gt_cv_func_printf_posix in
15046+ *yes) HAVE_POSIX_PRINTF=1 ;;
15047+ *) HAVE_POSIX_PRINTF=0 ;;
15048+ esac
15049+ AC_SUBST([HAVE_POSIX_PRINTF])
15050+ if test "$ac_cv_func_asprintf" = yes; then
15051+ HAVE_ASPRINTF=1
15052+ else
15053+ HAVE_ASPRINTF=0
15054+ fi
15055+ AC_SUBST([HAVE_ASPRINTF])
15056+ if test "$ac_cv_func_snprintf" = yes; then
15057+ HAVE_SNPRINTF=1
15058+ else
15059+ HAVE_SNPRINTF=0
15060+ fi
15061+ AC_SUBST([HAVE_SNPRINTF])
15062+ if test "$ac_cv_func_wprintf" = yes; then
15063+ HAVE_WPRINTF=1
15064+ else
15065+ HAVE_WPRINTF=0
15066+ fi
15067+ AC_SUBST([HAVE_WPRINTF])
15068+
15069+ AM_ICONV
15070+ AM_LANGINFO_CODESET
15071+ if test $ac_cv_header_locale_h = yes; then
15072+ AM_LC_MESSAGES
15073+ fi
15074+
15075+ dnl intl/plural.c is generated from intl/plural.y. It requires bison,
15076+ dnl because plural.y uses bison specific features. It requires at least
15077+ dnl bison-1.26 because earlier versions generate a plural.c that doesn't
15078+ dnl compile.
15079+ dnl bison is only needed for the maintainer (who touches plural.y). But in
15080+ dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
15081+ dnl the rule in general Makefile. Now, some people carelessly touch the
15082+ dnl files or have a broken "make" program, hence the plural.c rule will
15083+ dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
15084+ dnl present or too old.
15085+ AC_CHECK_PROGS([INTLBISON], [bison])
15086+ if test -z "$INTLBISON"; then
15087+ ac_verc_fail=yes
15088+ else
15089+ dnl Found it, now check the version.
15090+ AC_MSG_CHECKING([version of bison])
15091+changequote(<<,>>)dnl
15092+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
15093+ case $ac_prog_version in
15094+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
15095+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
15096+changequote([,])dnl
15097+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
15098+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
15099+ esac
15100+ AC_MSG_RESULT([$ac_prog_version])
15101+ fi
15102+ if test $ac_verc_fail = yes; then
15103+ INTLBISON=:
15104+ fi
15105+])
15106+
15107+
15108+dnl gt_CHECK_DECL(FUNC, INCLUDES)
15109+dnl Check whether a function is declared.
15110+AC_DEFUN([gt_CHECK_DECL],
15111+[
15112+ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
15113+ [AC_TRY_COMPILE([$2], [
15114+#ifndef $1
15115+ char *p = (char *) $1;
15116+#endif
15117+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
15118+ if test $ac_cv_have_decl_$1 = yes; then
15119+ gt_value=1
15120+ else
15121+ gt_value=0
15122+ fi
15123+ AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
15124+ [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
15125+])
15126+
15127+
15128+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
15129+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
15130diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/gettext.m4~ psmisc-20.2.works.clean/m4/gettext.m4~
15131diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/glibc21.m4 psmisc-20.2.works.clean/m4/glibc21.m4
15132--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/glibc21.m4 1969-12-31 18:00:00.000000000 -0600
15133+++ psmisc-20.2.works.clean/m4/glibc21.m4 2004-10-13 15:18:42.000000000 -0500
15134@@ -0,0 +1,32 @@
15135+# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
15136+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
15137+dnl This file is free software, distributed under the terms of the GNU
15138+dnl General Public License. As a special exception to the GNU General
15139+dnl Public License, this file may be distributed as part of a program
15140+dnl that contains a configuration script generated by Autoconf, under
15141+dnl the same distribution terms as the rest of that program.
15142+
15143+# Test for the GNU C Library, version 2.1 or newer.
15144+# From Bruno Haible.
15145+
15146+AC_DEFUN([jm_GLIBC21],
15147+ [
15148+ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
15149+ ac_cv_gnu_library_2_1,
15150+ [AC_EGREP_CPP([Lucky GNU user],
15151+ [
15152+#include <features.h>
15153+#ifdef __GNU_LIBRARY__
15154+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
15155+ Lucky GNU user
15156+ #endif
15157+#endif
15158+ ],
15159+ ac_cv_gnu_library_2_1=yes,
15160+ ac_cv_gnu_library_2_1=no)
15161+ ]
15162+ )
15163+ AC_SUBST(GLIBC21)
15164+ GLIBC21="$ac_cv_gnu_library_2_1"
15165+ ]
15166+)
15167diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/glibc21.m4~ psmisc-20.2.works.clean/m4/glibc21.m4~
15168diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/iconv.m4 psmisc-20.2.works.clean/m4/iconv.m4
15169--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/iconv.m4 1969-12-31 18:00:00.000000000 -0600
15170+++ psmisc-20.2.works.clean/m4/iconv.m4 2004-10-13 15:18:42.000000000 -0500
15171@@ -0,0 +1,103 @@
15172+# iconv.m4 serial AM4 (gettext-0.11.3)
15173+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
15174+dnl This file is free software, distributed under the terms of the GNU
15175+dnl General Public License. As a special exception to the GNU General
15176+dnl Public License, this file may be distributed as part of a program
15177+dnl that contains a configuration script generated by Autoconf, under
15178+dnl the same distribution terms as the rest of that program.
15179+
15180+dnl From Bruno Haible.
15181+
15182+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
15183+[
15184+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
15185+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
15186+ AC_REQUIRE([AC_LIB_RPATH])
15187+
15188+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
15189+ dnl accordingly.
15190+ AC_LIB_LINKFLAGS_BODY([iconv])
15191+])
15192+
15193+AC_DEFUN([AM_ICONV_LINK],
15194+[
15195+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
15196+ dnl those with the standalone portable GNU libiconv installed).
15197+
15198+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
15199+ dnl accordingly.
15200+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
15201+
15202+ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
15203+ dnl because if the user has installed libiconv and not disabled its use
15204+ dnl via --without-libiconv-prefix, he wants to use it. The first
15205+ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
15206+ am_save_CPPFLAGS="$CPPFLAGS"
15207+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
15208+
15209+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
15210+ am_cv_func_iconv="no, consider installing GNU libiconv"
15211+ am_cv_lib_iconv=no
15212+ AC_TRY_LINK([#include <stdlib.h>
15213+#include <iconv.h>],
15214+ [iconv_t cd = iconv_open("","");
15215+ iconv(cd,NULL,NULL,NULL,NULL);
15216+ iconv_close(cd);],
15217+ am_cv_func_iconv=yes)
15218+ if test "$am_cv_func_iconv" != yes; then
15219+ am_save_LIBS="$LIBS"
15220+ LIBS="$LIBS $LIBICONV"
15221+ AC_TRY_LINK([#include <stdlib.h>
15222+#include <iconv.h>],
15223+ [iconv_t cd = iconv_open("","");
15224+ iconv(cd,NULL,NULL,NULL,NULL);
15225+ iconv_close(cd);],
15226+ am_cv_lib_iconv=yes
15227+ am_cv_func_iconv=yes)
15228+ LIBS="$am_save_LIBS"
15229+ fi
15230+ ])
15231+ if test "$am_cv_func_iconv" = yes; then
15232+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
15233+ fi
15234+ if test "$am_cv_lib_iconv" = yes; then
15235+ AC_MSG_CHECKING([how to link with libiconv])
15236+ AC_MSG_RESULT([$LIBICONV])
15237+ else
15238+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
15239+ dnl either.
15240+ CPPFLAGS="$am_save_CPPFLAGS"
15241+ LIBICONV=
15242+ LTLIBICONV=
15243+ fi
15244+ AC_SUBST(LIBICONV)
15245+ AC_SUBST(LTLIBICONV)
15246+])
15247+
15248+AC_DEFUN([AM_ICONV],
15249+[
15250+ AM_ICONV_LINK
15251+ if test "$am_cv_func_iconv" = yes; then
15252+ AC_MSG_CHECKING([for iconv declaration])
15253+ AC_CACHE_VAL(am_cv_proto_iconv, [
15254+ AC_TRY_COMPILE([
15255+#include <stdlib.h>
15256+#include <iconv.h>
15257+extern
15258+#ifdef __cplusplus
15259+"C"
15260+#endif
15261+#if defined(__STDC__) || defined(__cplusplus)
15262+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
15263+#else
15264+size_t iconv();
15265+#endif
15266+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
15267+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
15268+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
15269+ AC_MSG_RESULT([$]{ac_t:-
15270+ }[$]am_cv_proto_iconv)
15271+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
15272+ [Define as const if the declaration of iconv() needs const.])
15273+ fi
15274+])
15275diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/iconv.m4~ psmisc-20.2.works.clean/m4/iconv.m4~
15276diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/intdiv0.m4 psmisc-20.2.works.clean/m4/intdiv0.m4
15277--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/intdiv0.m4 1969-12-31 18:00:00.000000000 -0600
15278+++ psmisc-20.2.works.clean/m4/intdiv0.m4 2004-10-13 15:18:42.000000000 -0500
15279@@ -0,0 +1,72 @@
15280+# intdiv0.m4 serial 1 (gettext-0.11.3)
15281+dnl Copyright (C) 2002 Free Software Foundation, Inc.
15282+dnl This file is free software, distributed under the terms of the GNU
15283+dnl General Public License. As a special exception to the GNU General
15284+dnl Public License, this file may be distributed as part of a program
15285+dnl that contains a configuration script generated by Autoconf, under
15286+dnl the same distribution terms as the rest of that program.
15287+
15288+dnl From Bruno Haible.
15289+
15290+AC_DEFUN([gt_INTDIV0],
15291+[
15292+ AC_REQUIRE([AC_PROG_CC])dnl
15293+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
15294+
15295+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
15296+ gt_cv_int_divbyzero_sigfpe,
15297+ [
15298+ AC_TRY_RUN([
15299+#include <stdlib.h>
15300+#include <signal.h>
15301+
15302+static void
15303+#ifdef __cplusplus
15304+sigfpe_handler (int sig)
15305+#else
15306+sigfpe_handler (sig) int sig;
15307+#endif
15308+{
15309+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
15310+ exit (sig != SIGFPE);
15311+}
15312+
15313+int x = 1;
15314+int y = 0;
15315+int z;
15316+int nan;
15317+
15318+int main ()
15319+{
15320+ signal (SIGFPE, sigfpe_handler);
15321+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
15322+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
15323+ signal (SIGTRAP, sigfpe_handler);
15324+#endif
15325+/* Linux/SPARC yields signal SIGILL. */
15326+#if defined (__sparc__) && defined (__linux__)
15327+ signal (SIGILL, sigfpe_handler);
15328+#endif
15329+
15330+ z = x / y;
15331+ nan = y / y;
15332+ exit (1);
15333+}
15334+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
15335+ [
15336+ # Guess based on the CPU.
15337+ case "$host_cpu" in
15338+ alpha* | i[34567]86 | m68k | s390*)
15339+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
15340+ *)
15341+ gt_cv_int_divbyzero_sigfpe="guessing no";;
15342+ esac
15343+ ])
15344+ ])
15345+ case "$gt_cv_int_divbyzero_sigfpe" in
15346+ *yes) value=1;;
15347+ *) value=0;;
15348+ esac
15349+ AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
15350+ [Define if integer division by zero raises signal SIGFPE.])
15351+])
15352diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/intdiv0.m4~ psmisc-20.2.works.clean/m4/intdiv0.m4~
15353diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/intmax.m4 psmisc-20.2.works.clean/m4/intmax.m4
15354--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/intmax.m4 1969-12-31 18:00:00.000000000 -0600
15355+++ psmisc-20.2.works.clean/m4/intmax.m4 2004-10-13 15:18:42.000000000 -0500
15356@@ -0,0 +1,32 @@
15357+# intmax.m4 serial 1 (gettext-0.12)
15358+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
15359+dnl This file is free software, distributed under the terms of the GNU
15360+dnl General Public License. As a special exception to the GNU General
15361+dnl Public License, this file may be distributed as part of a program
15362+dnl that contains a configuration script generated by Autoconf, under
15363+dnl the same distribution terms as the rest of that program.
15364+
15365+dnl From Bruno Haible.
15366+dnl Test whether the system has the 'intmax_t' type, but don't attempt to
15367+dnl find a replacement if it is lacking.
15368+
15369+AC_DEFUN([gt_TYPE_INTMAX_T],
15370+[
15371+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
15372+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
15373+ AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
15374+ [AC_TRY_COMPILE([
15375+#include <stddef.h>
15376+#include <stdlib.h>
15377+#if HAVE_STDINT_H_WITH_UINTMAX
15378+#include <stdint.h>
15379+#endif
15380+#if HAVE_INTTYPES_H_WITH_UINTMAX
15381+#include <inttypes.h>
15382+#endif
15383+], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
15384+ if test $gt_cv_c_intmax_t = yes; then
15385+ AC_DEFINE(HAVE_INTMAX_T, 1,
15386+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
15387+ fi
15388+])
15389diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/intmax.m4~ psmisc-20.2.works.clean/m4/intmax.m4~
15390diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes-pri.m4 psmisc-20.2.works.clean/m4/inttypes-pri.m4
15391--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes-pri.m4 1969-12-31 18:00:00.000000000 -0600
15392+++ psmisc-20.2.works.clean/m4/inttypes-pri.m4 2004-10-13 15:18:42.000000000 -0500
15393@@ -0,0 +1,32 @@
15394+# inttypes-pri.m4 serial 1 (gettext-0.11.4)
15395+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
15396+dnl This file is free software, distributed under the terms of the GNU
15397+dnl General Public License. As a special exception to the GNU General
15398+dnl Public License, this file may be distributed as part of a program
15399+dnl that contains a configuration script generated by Autoconf, under
15400+dnl the same distribution terms as the rest of that program.
15401+
15402+dnl From Bruno Haible.
15403+
15404+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
15405+# macros to non-string values. This is the case on AIX 4.3.3.
15406+
15407+AC_DEFUN([gt_INTTYPES_PRI],
15408+[
15409+ AC_REQUIRE([gt_HEADER_INTTYPES_H])
15410+ if test $gt_cv_header_inttypes_h = yes; then
15411+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
15412+ gt_cv_inttypes_pri_broken,
15413+ [
15414+ AC_TRY_COMPILE([#include <inttypes.h>
15415+#ifdef PRId32
15416+char *p = PRId32;
15417+#endif
15418+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
15419+ ])
15420+ fi
15421+ if test "$gt_cv_inttypes_pri_broken" = yes; then
15422+ AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
15423+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
15424+ fi
15425+])
15426diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes-pri.m4~ psmisc-20.2.works.clean/m4/inttypes-pri.m4~
15427diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes.m4 psmisc-20.2.works.clean/m4/inttypes.m4
15428--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes.m4 1969-12-31 18:00:00.000000000 -0600
15429+++ psmisc-20.2.works.clean/m4/inttypes.m4 2004-10-13 15:18:42.000000000 -0500
15430@@ -0,0 +1,27 @@
15431+# inttypes.m4 serial 1 (gettext-0.11.4)
15432+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
15433+dnl This file is free software, distributed under the terms of the GNU
15434+dnl General Public License. As a special exception to the GNU General
15435+dnl Public License, this file may be distributed as part of a program
15436+dnl that contains a configuration script generated by Autoconf, under
15437+dnl the same distribution terms as the rest of that program.
15438+
15439+dnl From Paul Eggert.
15440+
15441+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
15442+# <sys/types.h>.
15443+
15444+AC_DEFUN([gt_HEADER_INTTYPES_H],
15445+[
15446+ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
15447+ [
15448+ AC_TRY_COMPILE(
15449+ [#include <sys/types.h>
15450+#include <inttypes.h>],
15451+ [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
15452+ ])
15453+ if test $gt_cv_header_inttypes_h = yes; then
15454+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
15455+ [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
15456+ fi
15457+])
15458diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes.m4~ psmisc-20.2.works.clean/m4/inttypes.m4~
15459diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes_h.m4 psmisc-20.2.works.clean/m4/inttypes_h.m4
15460--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes_h.m4 1969-12-31 18:00:00.000000000 -0600
15461+++ psmisc-20.2.works.clean/m4/inttypes_h.m4 2004-10-13 15:18:42.000000000 -0500
15462@@ -0,0 +1,28 @@
15463+# inttypes_h.m4 serial 5 (gettext-0.12)
15464+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
15465+dnl This file is free software, distributed under the terms of the GNU
15466+dnl General Public License. As a special exception to the GNU General
15467+dnl Public License, this file may be distributed as part of a program
15468+dnl that contains a configuration script generated by Autoconf, under
15469+dnl the same distribution terms as the rest of that program.
15470+
15471+dnl From Paul Eggert.
15472+
15473+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
15474+# doesn't clash with <sys/types.h>, and declares uintmax_t.
15475+
15476+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
15477+[
15478+ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
15479+ [AC_TRY_COMPILE(
15480+ [#include <sys/types.h>
15481+#include <inttypes.h>],
15482+ [uintmax_t i = (uintmax_t) -1;],
15483+ jm_ac_cv_header_inttypes_h=yes,
15484+ jm_ac_cv_header_inttypes_h=no)])
15485+ if test $jm_ac_cv_header_inttypes_h = yes; then
15486+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
15487+ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
15488+ and declares uintmax_t. ])
15489+ fi
15490+])
15491diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/inttypes_h.m4~ psmisc-20.2.works.clean/m4/inttypes_h.m4~
15492diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/isc-posix.m4 psmisc-20.2.works.clean/m4/isc-posix.m4
15493--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/isc-posix.m4 1969-12-31 18:00:00.000000000 -0600
15494+++ psmisc-20.2.works.clean/m4/isc-posix.m4 2004-10-13 15:18:42.000000000 -0500
15495@@ -0,0 +1,26 @@
15496+# isc-posix.m4 serial 2 (gettext-0.11.2)
15497+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
15498+dnl This file is free software, distributed under the terms of the GNU
15499+dnl General Public License. As a special exception to the GNU General
15500+dnl Public License, this file may be distributed as part of a program
15501+dnl that contains a configuration script generated by Autoconf, under
15502+dnl the same distribution terms as the rest of that program.
15503+
15504+# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
15505+
15506+# This test replaces the one in autoconf.
15507+# Currently this macro should have the same name as the autoconf macro
15508+# because gettext's gettext.m4 (distributed in the automake package)
15509+# still uses it. Otherwise, the use in gettext.m4 makes autoheader
15510+# give these diagnostics:
15511+# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
15512+# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
15513+
15514+undefine([AC_ISC_POSIX])
15515+
15516+AC_DEFUN([AC_ISC_POSIX],
15517+ [
15518+ dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
15519+ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
15520+ ]
15521+)
15522diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/isc-posix.m4~ psmisc-20.2.works.clean/m4/isc-posix.m4~
15523diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lcmessage.m4 psmisc-20.2.works.clean/m4/lcmessage.m4
15524--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lcmessage.m4 1969-12-31 18:00:00.000000000 -0600
15525+++ psmisc-20.2.works.clean/m4/lcmessage.m4 2004-10-13 15:18:42.000000000 -0500
15526@@ -0,0 +1,32 @@
15527+# lcmessage.m4 serial 3 (gettext-0.11.3)
15528+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
15529+dnl This file is free software, distributed under the terms of the GNU
15530+dnl General Public License. As a special exception to the GNU General
15531+dnl Public License, this file may be distributed as part of a program
15532+dnl that contains a configuration script generated by Autoconf, under
15533+dnl the same distribution terms as the rest of that program.
15534+dnl
15535+dnl This file can can be used in projects which are not available under
15536+dnl the GNU General Public License or the GNU Library General Public
15537+dnl License but which still want to provide support for the GNU gettext
15538+dnl functionality.
15539+dnl Please note that the actual code of the GNU gettext library is covered
15540+dnl by the GNU Library General Public License, and the rest of the GNU
15541+dnl gettext package package is covered by the GNU General Public License.
15542+dnl They are *not* in the public domain.
15543+
15544+dnl Authors:
15545+dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
15546+
15547+# Check whether LC_MESSAGES is available in <locale.h>.
15548+
15549+AC_DEFUN([AM_LC_MESSAGES],
15550+[
15551+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
15552+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
15553+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
15554+ if test $am_cv_val_LC_MESSAGES = yes; then
15555+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
15556+ [Define if your <locale.h> file defines LC_MESSAGES.])
15557+ fi
15558+])
15559diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lcmessage.m4~ psmisc-20.2.works.clean/m4/lcmessage.m4~
15560diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-ld.m4 psmisc-20.2.works.clean/m4/lib-ld.m4
15561--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-ld.m4 1969-12-31 18:00:00.000000000 -0600
15562+++ psmisc-20.2.works.clean/m4/lib-ld.m4 2004-10-13 15:18:42.000000000 -0500
15563@@ -0,0 +1,112 @@
15564+# lib-ld.m4 serial 3 (gettext-0.13)
15565+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
15566+dnl This file is free software, distributed under the terms of the GNU
15567+dnl General Public License. As a special exception to the GNU General
15568+dnl Public License, this file may be distributed as part of a program
15569+dnl that contains a configuration script generated by Autoconf, under
15570+dnl the same distribution terms as the rest of that program.
15571+
15572+dnl Subroutines of libtool.m4,
15573+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
15574+dnl with libtool.m4.
15575+
15576+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
15577+AC_DEFUN([AC_LIB_PROG_LD_GNU],
15578+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
15579+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
15580+case `$LD -v 2>&1 </dev/null` in
15581+*GNU* | *'with BFD'*)
15582+ acl_cv_prog_gnu_ld=yes ;;
15583+*)
15584+ acl_cv_prog_gnu_ld=no ;;
15585+esac])
15586+with_gnu_ld=$acl_cv_prog_gnu_ld
15587+])
15588+
15589+dnl From libtool-1.4. Sets the variable LD.
15590+AC_DEFUN([AC_LIB_PROG_LD],
15591+[AC_ARG_WITH(gnu-ld,
15592+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
15593+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
15594+AC_REQUIRE([AC_PROG_CC])dnl
15595+AC_REQUIRE([AC_CANONICAL_HOST])dnl
15596+# Prepare PATH_SEPARATOR.
15597+# The user is always right.
15598+if test "${PATH_SEPARATOR+set}" != set; then
15599+ echo "#! /bin/sh" >conf$$.sh
15600+ echo "exit 0" >>conf$$.sh
15601+ chmod +x conf$$.sh
15602+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
15603+ PATH_SEPARATOR=';'
15604+ else
15605+ PATH_SEPARATOR=:
15606+ fi
15607+ rm -f conf$$.sh
15608+fi
15609+ac_prog=ld
15610+if test "$GCC" = yes; then
15611+ # Check if gcc -print-prog-name=ld gives a path.
15612+ AC_MSG_CHECKING([for ld used by GCC])
15613+ case $host in
15614+ *-*-mingw*)
15615+ # gcc leaves a trailing carriage return which upsets mingw
15616+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
15617+ *)
15618+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
15619+ esac
15620+ case $ac_prog in
15621+ # Accept absolute paths.
15622+ [[\\/]* | [A-Za-z]:[\\/]*)]
15623+ [re_direlt='/[^/][^/]*/\.\./']
15624+ # Canonicalize the path of ld
15625+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
15626+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
15627+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
15628+ done
15629+ test -z "$LD" && LD="$ac_prog"
15630+ ;;
15631+ "")
15632+ # If it fails, then pretend we aren't using GCC.
15633+ ac_prog=ld
15634+ ;;
15635+ *)
15636+ # If it is relative, then search for the first ld in PATH.
15637+ with_gnu_ld=unknown
15638+ ;;
15639+ esac
15640+elif test "$with_gnu_ld" = yes; then
15641+ AC_MSG_CHECKING([for GNU ld])
15642+else
15643+ AC_MSG_CHECKING([for non-GNU ld])
15644+fi
15645+AC_CACHE_VAL(acl_cv_path_LD,
15646+[if test -z "$LD"; then
15647+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
15648+ for ac_dir in $PATH; do
15649+ test -z "$ac_dir" && ac_dir=.
15650+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
15651+ acl_cv_path_LD="$ac_dir/$ac_prog"
15652+ # Check to see if the program is GNU ld. I'd rather use --version,
15653+ # but apparently some GNU ld's only accept -v.
15654+ # Break only if it was the GNU/non-GNU ld that we prefer.
15655+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
15656+ *GNU* | *'with BFD'*)
15657+ test "$with_gnu_ld" != no && break ;;
15658+ *)
15659+ test "$with_gnu_ld" != yes && break ;;
15660+ esac
15661+ fi
15662+ done
15663+ IFS="$ac_save_ifs"
15664+else
15665+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
15666+fi])
15667+LD="$acl_cv_path_LD"
15668+if test -n "$LD"; then
15669+ AC_MSG_RESULT($LD)
15670+else
15671+ AC_MSG_RESULT(no)
15672+fi
15673+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
15674+AC_LIB_PROG_LD_GNU
15675+])
15676diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-ld.m4~ psmisc-20.2.works.clean/m4/lib-ld.m4~
15677diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-link.m4 psmisc-20.2.works.clean/m4/lib-link.m4
15678--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-link.m4 1969-12-31 18:00:00.000000000 -0600
15679+++ psmisc-20.2.works.clean/m4/lib-link.m4 2004-10-13 15:18:42.000000000 -0500
15680@@ -0,0 +1,551 @@
15681+# lib-link.m4 serial 4 (gettext-0.12)
15682+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
15683+dnl This file is free software, distributed under the terms of the GNU
15684+dnl General Public License. As a special exception to the GNU General
15685+dnl Public License, this file may be distributed as part of a program
15686+dnl that contains a configuration script generated by Autoconf, under
15687+dnl the same distribution terms as the rest of that program.
15688+
15689+dnl From Bruno Haible.
15690+
15691+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
15692+dnl the libraries corresponding to explicit and implicit dependencies.
15693+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
15694+dnl augments the CPPFLAGS variable.
15695+AC_DEFUN([AC_LIB_LINKFLAGS],
15696+[
15697+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
15698+ AC_REQUIRE([AC_LIB_RPATH])
15699+ define([Name],[translit([$1],[./-], [___])])
15700+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
15701+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
15702+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
15703+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
15704+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
15705+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
15706+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
15707+ ])
15708+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
15709+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
15710+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
15711+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
15712+ AC_SUBST([LIB]NAME)
15713+ AC_SUBST([LTLIB]NAME)
15714+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
15715+ dnl results of this search when this library appears as a dependency.
15716+ HAVE_LIB[]NAME=yes
15717+ undefine([Name])
15718+ undefine([NAME])
15719+])
15720+
15721+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
15722+dnl searches for libname and the libraries corresponding to explicit and
15723+dnl implicit dependencies, together with the specified include files and
15724+dnl the ability to compile and link the specified testcode. If found, it
15725+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
15726+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
15727+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
15728+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
15729+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
15730+[
15731+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
15732+ AC_REQUIRE([AC_LIB_RPATH])
15733+ define([Name],[translit([$1],[./-], [___])])
15734+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
15735+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
15736+
15737+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
15738+ dnl accordingly.
15739+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
15740+
15741+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
15742+ dnl because if the user has installed lib[]Name and not disabled its use
15743+ dnl via --without-lib[]Name-prefix, he wants to use it.
15744+ ac_save_CPPFLAGS="$CPPFLAGS"
15745+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
15746+
15747+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
15748+ ac_save_LIBS="$LIBS"
15749+ LIBS="$LIBS $LIB[]NAME"
15750+ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
15751+ LIBS="$ac_save_LIBS"
15752+ ])
15753+ if test "$ac_cv_lib[]Name" = yes; then
15754+ HAVE_LIB[]NAME=yes
15755+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
15756+ AC_MSG_CHECKING([how to link with lib[]$1])
15757+ AC_MSG_RESULT([$LIB[]NAME])
15758+ else
15759+ HAVE_LIB[]NAME=no
15760+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
15761+ dnl $INC[]NAME either.
15762+ CPPFLAGS="$ac_save_CPPFLAGS"
15763+ LIB[]NAME=
15764+ LTLIB[]NAME=
15765+ fi
15766+ AC_SUBST([HAVE_LIB]NAME)
15767+ AC_SUBST([LIB]NAME)
15768+ AC_SUBST([LTLIB]NAME)
15769+ undefine([Name])
15770+ undefine([NAME])
15771+])
15772+
15773+dnl Determine the platform dependent parameters needed to use rpath:
15774+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
15775+dnl hardcode_direct, hardcode_minus_L.
15776+AC_DEFUN([AC_LIB_RPATH],
15777+[
15778+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
15779+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
15780+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
15781+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
15782+ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
15783+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
15784+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
15785+ . ./conftest.sh
15786+ rm -f ./conftest.sh
15787+ acl_cv_rpath=done
15788+ ])
15789+ wl="$acl_cv_wl"
15790+ libext="$acl_cv_libext"
15791+ shlibext="$acl_cv_shlibext"
15792+ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
15793+ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
15794+ hardcode_direct="$acl_cv_hardcode_direct"
15795+ hardcode_minus_L="$acl_cv_hardcode_minus_L"
15796+ dnl Determine whether the user wants rpath handling at all.
15797+ AC_ARG_ENABLE(rpath,
15798+ [ --disable-rpath do not hardcode runtime library paths],
15799+ :, enable_rpath=yes)
15800+])
15801+
15802+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
15803+dnl the libraries corresponding to explicit and implicit dependencies.
15804+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
15805+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
15806+[
15807+ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
15808+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
15809+ dnl By default, look in $includedir and $libdir.
15810+ use_additional=yes
15811+ AC_LIB_WITH_FINAL_PREFIX([
15812+ eval additional_includedir=\"$includedir\"
15813+ eval additional_libdir=\"$libdir\"
15814+ ])
15815+ AC_LIB_ARG_WITH([lib$1-prefix],
15816+[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
15817+ --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
15818+[
15819+ if test "X$withval" = "Xno"; then
15820+ use_additional=no
15821+ else
15822+ if test "X$withval" = "X"; then
15823+ AC_LIB_WITH_FINAL_PREFIX([
15824+ eval additional_includedir=\"$includedir\"
15825+ eval additional_libdir=\"$libdir\"
15826+ ])
15827+ else
15828+ additional_includedir="$withval/include"
15829+ additional_libdir="$withval/lib"
15830+ fi
15831+ fi
15832+])
15833+ dnl Search the library and its dependencies in $additional_libdir and
15834+ dnl $LDFLAGS. Using breadth-first-seach.
15835+ LIB[]NAME=
15836+ LTLIB[]NAME=
15837+ INC[]NAME=
15838+ rpathdirs=
15839+ ltrpathdirs=
15840+ names_already_handled=
15841+ names_next_round='$1 $2'
15842+ while test -n "$names_next_round"; do
15843+ names_this_round="$names_next_round"
15844+ names_next_round=
15845+ for name in $names_this_round; do
15846+ already_handled=
15847+ for n in $names_already_handled; do
15848+ if test "$n" = "$name"; then
15849+ already_handled=yes
15850+ break
15851+ fi
15852+ done
15853+ if test -z "$already_handled"; then
15854+ names_already_handled="$names_already_handled $name"
15855+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
15856+ dnl or AC_LIB_HAVE_LINKFLAGS call.
15857+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
15858+ eval value=\"\$HAVE_LIB$uppername\"
15859+ if test -n "$value"; then
15860+ if test "$value" = yes; then
15861+ eval value=\"\$LIB$uppername\"
15862+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
15863+ eval value=\"\$LTLIB$uppername\"
15864+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
15865+ else
15866+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
15867+ dnl that this library doesn't exist. So just drop it.
15868+ :
15869+ fi
15870+ else
15871+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
15872+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
15873+ found_dir=
15874+ found_la=
15875+ found_so=
15876+ found_a=
15877+ if test $use_additional = yes; then
15878+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
15879+ found_dir="$additional_libdir"
15880+ found_so="$additional_libdir/lib$name.$shlibext"
15881+ if test -f "$additional_libdir/lib$name.la"; then
15882+ found_la="$additional_libdir/lib$name.la"
15883+ fi
15884+ else
15885+ if test -f "$additional_libdir/lib$name.$libext"; then
15886+ found_dir="$additional_libdir"
15887+ found_a="$additional_libdir/lib$name.$libext"
15888+ if test -f "$additional_libdir/lib$name.la"; then
15889+ found_la="$additional_libdir/lib$name.la"
15890+ fi
15891+ fi
15892+ fi
15893+ fi
15894+ if test "X$found_dir" = "X"; then
15895+ for x in $LDFLAGS $LTLIB[]NAME; do
15896+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
15897+ case "$x" in
15898+ -L*)
15899+ dir=`echo "X$x" | sed -e 's/^X-L//'`
15900+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
15901+ found_dir="$dir"
15902+ found_so="$dir/lib$name.$shlibext"
15903+ if test -f "$dir/lib$name.la"; then
15904+ found_la="$dir/lib$name.la"
15905+ fi
15906+ else
15907+ if test -f "$dir/lib$name.$libext"; then
15908+ found_dir="$dir"
15909+ found_a="$dir/lib$name.$libext"
15910+ if test -f "$dir/lib$name.la"; then
15911+ found_la="$dir/lib$name.la"
15912+ fi
15913+ fi
15914+ fi
15915+ ;;
15916+ esac
15917+ if test "X$found_dir" != "X"; then
15918+ break
15919+ fi
15920+ done
15921+ fi
15922+ if test "X$found_dir" != "X"; then
15923+ dnl Found the library.
15924+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
15925+ if test "X$found_so" != "X"; then
15926+ dnl Linking with a shared library. We attempt to hardcode its
15927+ dnl directory into the executable's runpath, unless it's the
15928+ dnl standard /usr/lib.
15929+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
15930+ dnl No hardcoding is needed.
15931+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
15932+ else
15933+ dnl Use an explicit option to hardcode DIR into the resulting
15934+ dnl binary.
15935+ dnl Potentially add DIR to ltrpathdirs.
15936+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
15937+ haveit=
15938+ for x in $ltrpathdirs; do
15939+ if test "X$x" = "X$found_dir"; then
15940+ haveit=yes
15941+ break
15942+ fi
15943+ done
15944+ if test -z "$haveit"; then
15945+ ltrpathdirs="$ltrpathdirs $found_dir"
15946+ fi
15947+ dnl The hardcoding into $LIBNAME is system dependent.
15948+ if test "$hardcode_direct" = yes; then
15949+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
15950+ dnl resulting binary.
15951+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
15952+ else
15953+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
15954+ dnl Use an explicit option to hardcode DIR into the resulting
15955+ dnl binary.
15956+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
15957+ dnl Potentially add DIR to rpathdirs.
15958+ dnl The rpathdirs will be appended to $LIBNAME at the end.
15959+ haveit=
15960+ for x in $rpathdirs; do
15961+ if test "X$x" = "X$found_dir"; then
15962+ haveit=yes
15963+ break
15964+ fi
15965+ done
15966+ if test -z "$haveit"; then
15967+ rpathdirs="$rpathdirs $found_dir"
15968+ fi
15969+ else
15970+ dnl Rely on "-L$found_dir".
15971+ dnl But don't add it if it's already contained in the LDFLAGS
15972+ dnl or the already constructed $LIBNAME
15973+ haveit=
15974+ for x in $LDFLAGS $LIB[]NAME; do
15975+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
15976+ if test "X$x" = "X-L$found_dir"; then
15977+ haveit=yes
15978+ break
15979+ fi
15980+ done
15981+ if test -z "$haveit"; then
15982+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
15983+ fi
15984+ if test "$hardcode_minus_L" != no; then
15985+ dnl FIXME: Not sure whether we should use
15986+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
15987+ dnl here.
15988+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
15989+ else
15990+ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
15991+ dnl here, because this doesn't fit in flags passed to the
15992+ dnl compiler. So give up. No hardcoding. This affects only
15993+ dnl very old systems.
15994+ dnl FIXME: Not sure whether we should use
15995+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
15996+ dnl here.
15997+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
15998+ fi
15999+ fi
16000+ fi
16001+ fi
16002+ else
16003+ if test "X$found_a" != "X"; then
16004+ dnl Linking with a static library.
16005+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
16006+ else
16007+ dnl We shouldn't come here, but anyway it's good to have a
16008+ dnl fallback.
16009+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
16010+ fi
16011+ fi
16012+ dnl Assume the include files are nearby.
16013+ additional_includedir=
16014+ case "$found_dir" in
16015+ */lib | */lib/)
16016+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
16017+ additional_includedir="$basedir/include"
16018+ ;;
16019+ esac
16020+ if test "X$additional_includedir" != "X"; then
16021+ dnl Potentially add $additional_includedir to $INCNAME.
16022+ dnl But don't add it
16023+ dnl 1. if it's the standard /usr/include,
16024+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
16025+ dnl 3. if it's already present in $CPPFLAGS or the already
16026+ dnl constructed $INCNAME,
16027+ dnl 4. if it doesn't exist as a directory.
16028+ if test "X$additional_includedir" != "X/usr/include"; then
16029+ haveit=
16030+ if test "X$additional_includedir" = "X/usr/local/include"; then
16031+ if test -n "$GCC"; then
16032+ case $host_os in
16033+ linux*) haveit=yes;;
16034+ esac
16035+ fi
16036+ fi
16037+ if test -z "$haveit"; then
16038+ for x in $CPPFLAGS $INC[]NAME; do
16039+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
16040+ if test "X$x" = "X-I$additional_includedir"; then
16041+ haveit=yes
16042+ break
16043+ fi
16044+ done
16045+ if test -z "$haveit"; then
16046+ if test -d "$additional_includedir"; then
16047+ dnl Really add $additional_includedir to $INCNAME.
16048+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
16049+ fi
16050+ fi
16051+ fi
16052+ fi
16053+ fi
16054+ dnl Look for dependencies.
16055+ if test -n "$found_la"; then
16056+ dnl Read the .la file. It defines the variables
16057+ dnl dlname, library_names, old_library, dependency_libs, current,
16058+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
16059+ save_libdir="$libdir"
16060+ case "$found_la" in
16061+ */* | *\\*) . "$found_la" ;;
16062+ *) . "./$found_la" ;;
16063+ esac
16064+ libdir="$save_libdir"
16065+ dnl We use only dependency_libs.
16066+ for dep in $dependency_libs; do
16067+ case "$dep" in
16068+ -L*)
16069+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
16070+ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
16071+ dnl But don't add it
16072+ dnl 1. if it's the standard /usr/lib,
16073+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
16074+ dnl 3. if it's already present in $LDFLAGS or the already
16075+ dnl constructed $LIBNAME,
16076+ dnl 4. if it doesn't exist as a directory.
16077+ if test "X$additional_libdir" != "X/usr/lib"; then
16078+ haveit=
16079+ if test "X$additional_libdir" = "X/usr/local/lib"; then
16080+ if test -n "$GCC"; then
16081+ case $host_os in
16082+ linux*) haveit=yes;;
16083+ esac
16084+ fi
16085+ fi
16086+ if test -z "$haveit"; then
16087+ haveit=
16088+ for x in $LDFLAGS $LIB[]NAME; do
16089+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
16090+ if test "X$x" = "X-L$additional_libdir"; then
16091+ haveit=yes
16092+ break
16093+ fi
16094+ done
16095+ if test -z "$haveit"; then
16096+ if test -d "$additional_libdir"; then
16097+ dnl Really add $additional_libdir to $LIBNAME.
16098+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
16099+ fi
16100+ fi
16101+ haveit=
16102+ for x in $LDFLAGS $LTLIB[]NAME; do
16103+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
16104+ if test "X$x" = "X-L$additional_libdir"; then
16105+ haveit=yes
16106+ break
16107+ fi
16108+ done
16109+ if test -z "$haveit"; then
16110+ if test -d "$additional_libdir"; then
16111+ dnl Really add $additional_libdir to $LTLIBNAME.
16112+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
16113+ fi
16114+ fi
16115+ fi
16116+ fi
16117+ ;;
16118+ -R*)
16119+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
16120+ if test "$enable_rpath" != no; then
16121+ dnl Potentially add DIR to rpathdirs.
16122+ dnl The rpathdirs will be appended to $LIBNAME at the end.
16123+ haveit=
16124+ for x in $rpathdirs; do
16125+ if test "X$x" = "X$dir"; then
16126+ haveit=yes
16127+ break
16128+ fi
16129+ done
16130+ if test -z "$haveit"; then
16131+ rpathdirs="$rpathdirs $dir"
16132+ fi
16133+ dnl Potentially add DIR to ltrpathdirs.
16134+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
16135+ haveit=
16136+ for x in $ltrpathdirs; do
16137+ if test "X$x" = "X$dir"; then
16138+ haveit=yes
16139+ break
16140+ fi
16141+ done
16142+ if test -z "$haveit"; then
16143+ ltrpathdirs="$ltrpathdirs $dir"
16144+ fi
16145+ fi
16146+ ;;
16147+ -l*)
16148+ dnl Handle this in the next round.
16149+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
16150+ ;;
16151+ *.la)
16152+ dnl Handle this in the next round. Throw away the .la's
16153+ dnl directory; it is already contained in a preceding -L
16154+ dnl option.
16155+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
16156+ ;;
16157+ *)
16158+ dnl Most likely an immediate library name.
16159+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
16160+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
16161+ ;;
16162+ esac
16163+ done
16164+ fi
16165+ else
16166+ dnl Didn't find the library; assume it is in the system directories
16167+ dnl known to the linker and runtime loader. (All the system
16168+ dnl directories known to the linker should also be known to the
16169+ dnl runtime loader, otherwise the system is severely misconfigured.)
16170+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
16171+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
16172+ fi
16173+ fi
16174+ fi
16175+ done
16176+ done
16177+ if test "X$rpathdirs" != "X"; then
16178+ if test -n "$hardcode_libdir_separator"; then
16179+ dnl Weird platform: only the last -rpath option counts, the user must
16180+ dnl pass all path elements in one option. We can arrange that for a
16181+ dnl single library, but not when more than one $LIBNAMEs are used.
16182+ alldirs=
16183+ for found_dir in $rpathdirs; do
16184+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
16185+ done
16186+ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
16187+ acl_save_libdir="$libdir"
16188+ libdir="$alldirs"
16189+ eval flag=\"$hardcode_libdir_flag_spec\"
16190+ libdir="$acl_save_libdir"
16191+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
16192+ else
16193+ dnl The -rpath options are cumulative.
16194+ for found_dir in $rpathdirs; do
16195+ acl_save_libdir="$libdir"
16196+ libdir="$found_dir"
16197+ eval flag=\"$hardcode_libdir_flag_spec\"
16198+ libdir="$acl_save_libdir"
16199+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
16200+ done
16201+ fi
16202+ fi
16203+ if test "X$ltrpathdirs" != "X"; then
16204+ dnl When using libtool, the option that works for both libraries and
16205+ dnl executables is -R. The -R options are cumulative.
16206+ for found_dir in $ltrpathdirs; do
16207+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
16208+ done
16209+ fi
16210+])
16211+
16212+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
16213+dnl unless already present in VAR.
16214+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
16215+dnl contains two or three consecutive elements that belong together.
16216+AC_DEFUN([AC_LIB_APPENDTOVAR],
16217+[
16218+ for element in [$2]; do
16219+ haveit=
16220+ for x in $[$1]; do
16221+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
16222+ if test "X$x" = "X$element"; then
16223+ haveit=yes
16224+ break
16225+ fi
16226+ done
16227+ if test -z "$haveit"; then
16228+ [$1]="${[$1]}${[$1]:+ }$element"
16229+ fi
16230+ done
16231+])
16232diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-link.m4~ psmisc-20.2.works.clean/m4/lib-link.m4~
16233diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-prefix.m4 psmisc-20.2.works.clean/m4/lib-prefix.m4
16234--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-prefix.m4 1969-12-31 18:00:00.000000000 -0600
16235+++ psmisc-20.2.works.clean/m4/lib-prefix.m4 2004-10-13 15:18:42.000000000 -0500
16236@@ -0,0 +1,155 @@
16237+# lib-prefix.m4 serial 3 (gettext-0.13)
16238+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
16239+dnl This file is free software, distributed under the terms of the GNU
16240+dnl General Public License. As a special exception to the GNU General
16241+dnl Public License, this file may be distributed as part of a program
16242+dnl that contains a configuration script generated by Autoconf, under
16243+dnl the same distribution terms as the rest of that program.
16244+
16245+dnl From Bruno Haible.
16246+
16247+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
16248+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
16249+dnl require excessive bracketing.
16250+ifdef([AC_HELP_STRING],
16251+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
16252+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
16253+
16254+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
16255+dnl to access previously installed libraries. The basic assumption is that
16256+dnl a user will want packages to use other packages he previously installed
16257+dnl with the same --prefix option.
16258+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
16259+dnl libraries, but is otherwise very convenient.
16260+AC_DEFUN([AC_LIB_PREFIX],
16261+[
16262+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
16263+ AC_REQUIRE([AC_PROG_CC])
16264+ AC_REQUIRE([AC_CANONICAL_HOST])
16265+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
16266+ dnl By default, look in $includedir and $libdir.
16267+ use_additional=yes
16268+ AC_LIB_WITH_FINAL_PREFIX([
16269+ eval additional_includedir=\"$includedir\"
16270+ eval additional_libdir=\"$libdir\"
16271+ ])
16272+ AC_LIB_ARG_WITH([lib-prefix],
16273+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
16274+ --without-lib-prefix don't search for libraries in includedir and libdir],
16275+[
16276+ if test "X$withval" = "Xno"; then
16277+ use_additional=no
16278+ else
16279+ if test "X$withval" = "X"; then
16280+ AC_LIB_WITH_FINAL_PREFIX([
16281+ eval additional_includedir=\"$includedir\"
16282+ eval additional_libdir=\"$libdir\"
16283+ ])
16284+ else
16285+ additional_includedir="$withval/include"
16286+ additional_libdir="$withval/lib"
16287+ fi
16288+ fi
16289+])
16290+ if test $use_additional = yes; then
16291+ dnl Potentially add $additional_includedir to $CPPFLAGS.
16292+ dnl But don't add it
16293+ dnl 1. if it's the standard /usr/include,
16294+ dnl 2. if it's already present in $CPPFLAGS,
16295+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
16296+ dnl 4. if it doesn't exist as a directory.
16297+ if test "X$additional_includedir" != "X/usr/include"; then
16298+ haveit=
16299+ for x in $CPPFLAGS; do
16300+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
16301+ if test "X$x" = "X-I$additional_includedir"; then
16302+ haveit=yes
16303+ break
16304+ fi
16305+ done
16306+ if test -z "$haveit"; then
16307+ if test "X$additional_includedir" = "X/usr/local/include"; then
16308+ if test -n "$GCC"; then
16309+ case $host_os in
16310+ linux*) haveit=yes;;
16311+ esac
16312+ fi
16313+ fi
16314+ if test -z "$haveit"; then
16315+ if test -d "$additional_includedir"; then
16316+ dnl Really add $additional_includedir to $CPPFLAGS.
16317+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
16318+ fi
16319+ fi
16320+ fi
16321+ fi
16322+ dnl Potentially add $additional_libdir to $LDFLAGS.
16323+ dnl But don't add it
16324+ dnl 1. if it's the standard /usr/lib,
16325+ dnl 2. if it's already present in $LDFLAGS,
16326+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
16327+ dnl 4. if it doesn't exist as a directory.
16328+ if test "X$additional_libdir" != "X/usr/lib"; then
16329+ haveit=
16330+ for x in $LDFLAGS; do
16331+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
16332+ if test "X$x" = "X-L$additional_libdir"; then
16333+ haveit=yes
16334+ break
16335+ fi
16336+ done
16337+ if test -z "$haveit"; then
16338+ if test "X$additional_libdir" = "X/usr/local/lib"; then
16339+ if test -n "$GCC"; then
16340+ case $host_os in
16341+ linux*) haveit=yes;;
16342+ esac
16343+ fi
16344+ fi
16345+ if test -z "$haveit"; then
16346+ if test -d "$additional_libdir"; then
16347+ dnl Really add $additional_libdir to $LDFLAGS.
16348+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
16349+ fi
16350+ fi
16351+ fi
16352+ fi
16353+ fi
16354+])
16355+
16356+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
16357+dnl acl_final_exec_prefix, containing the values to which $prefix and
16358+dnl $exec_prefix will expand at the end of the configure script.
16359+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
16360+[
16361+ dnl Unfortunately, prefix and exec_prefix get only finally determined
16362+ dnl at the end of configure.
16363+ if test "X$prefix" = "XNONE"; then
16364+ acl_final_prefix="$ac_default_prefix"
16365+ else
16366+ acl_final_prefix="$prefix"
16367+ fi
16368+ if test "X$exec_prefix" = "XNONE"; then
16369+ acl_final_exec_prefix='${prefix}'
16370+ else
16371+ acl_final_exec_prefix="$exec_prefix"
16372+ fi
16373+ acl_save_prefix="$prefix"
16374+ prefix="$acl_final_prefix"
16375+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
16376+ prefix="$acl_save_prefix"
16377+])
16378+
16379+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
16380+dnl variables prefix and exec_prefix bound to the values they will have
16381+dnl at the end of the configure script.
16382+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
16383+[
16384+ acl_save_prefix="$prefix"
16385+ prefix="$acl_final_prefix"
16386+ acl_save_exec_prefix="$exec_prefix"
16387+ exec_prefix="$acl_final_exec_prefix"
16388+ $1
16389+ exec_prefix="$acl_save_exec_prefix"
16390+ prefix="$acl_save_prefix"
16391+])
16392diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/lib-prefix.m4~ psmisc-20.2.works.clean/m4/lib-prefix.m4~
16393diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/longdouble.m4 psmisc-20.2.works.clean/m4/longdouble.m4
16394--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/longdouble.m4 1969-12-31 18:00:00.000000000 -0600
16395+++ psmisc-20.2.works.clean/m4/longdouble.m4 2004-10-13 15:18:42.000000000 -0500
16396@@ -0,0 +1,30 @@
16397+# longdouble.m4 serial 1 (gettext-0.12)
16398+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
16399+dnl This file is free software, distributed under the terms of the GNU
16400+dnl General Public License. As a special exception to the GNU General
16401+dnl Public License, this file may be distributed as part of a program
16402+dnl that contains a configuration script generated by Autoconf, under
16403+dnl the same distribution terms as the rest of that program.
16404+
16405+dnl From Bruno Haible.
16406+dnl Test whether the compiler supports the 'long double' type.
16407+dnl Prerequisite: AC_PROG_CC
16408+
16409+AC_DEFUN([gt_TYPE_LONGDOUBLE],
16410+[
16411+ AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
16412+ [if test "$GCC" = yes; then
16413+ gt_cv_c_long_double=yes
16414+ else
16415+ AC_TRY_COMPILE([
16416+ /* The Stardent Vistra knows sizeof(long double), but does not support it. */
16417+ long double foo = 0.0;
16418+ /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
16419+ int array [2*(sizeof(long double) >= sizeof(double)) - 1];
16420+ ], ,
16421+ gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
16422+ fi])
16423+ if test $gt_cv_c_long_double = yes; then
16424+ AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
16425+ fi
16426+])
16427diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/longdouble.m4~ psmisc-20.2.works.clean/m4/longdouble.m4~
16428diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/longlong.m4 psmisc-20.2.works.clean/m4/longlong.m4
16429--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/longlong.m4 1969-12-31 18:00:00.000000000 -0600
16430+++ psmisc-20.2.works.clean/m4/longlong.m4 2004-10-13 15:18:42.000000000 -0500
16431@@ -0,0 +1,25 @@
16432+# longlong.m4 serial 4
16433+dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
16434+dnl This file is free software, distributed under the terms of the GNU
16435+dnl General Public License. As a special exception to the GNU General
16436+dnl Public License, this file may be distributed as part of a program
16437+dnl that contains a configuration script generated by Autoconf, under
16438+dnl the same distribution terms as the rest of that program.
16439+
16440+dnl From Paul Eggert.
16441+
16442+# Define HAVE_LONG_LONG if 'long long' works.
16443+
16444+AC_DEFUN([jm_AC_TYPE_LONG_LONG],
16445+[
16446+ AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
16447+ [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
16448+ [long long llmax = (long long) -1;
16449+ return ll << i | ll >> i | llmax / ll | llmax % ll;],
16450+ ac_cv_type_long_long=yes,
16451+ ac_cv_type_long_long=no)])
16452+ if test $ac_cv_type_long_long = yes; then
16453+ AC_DEFINE(HAVE_LONG_LONG, 1,
16454+ [Define if you have the 'long long' type.])
16455+ fi
16456+])
16457diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/longlong.m4~ psmisc-20.2.works.clean/m4/longlong.m4~
16458diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/nls.m4 psmisc-20.2.works.clean/m4/nls.m4
16459--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/nls.m4 1969-12-31 18:00:00.000000000 -0600
16460+++ psmisc-20.2.works.clean/m4/nls.m4 2004-10-13 15:18:42.000000000 -0500
16461@@ -0,0 +1,49 @@
16462+# nls.m4 serial 1 (gettext-0.12)
16463+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
16464+dnl This file is free software, distributed under the terms of the GNU
16465+dnl General Public License. As a special exception to the GNU General
16466+dnl Public License, this file may be distributed as part of a program
16467+dnl that contains a configuration script generated by Autoconf, under
16468+dnl the same distribution terms as the rest of that program.
16469+dnl
16470+dnl This file can can be used in projects which are not available under
16471+dnl the GNU General Public License or the GNU Library General Public
16472+dnl License but which still want to provide support for the GNU gettext
16473+dnl functionality.
16474+dnl Please note that the actual code of the GNU gettext library is covered
16475+dnl by the GNU Library General Public License, and the rest of the GNU
16476+dnl gettext package package is covered by the GNU General Public License.
16477+dnl They are *not* in the public domain.
16478+
16479+dnl Authors:
16480+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
16481+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
16482+
16483+AC_DEFUN([AM_NLS],
16484+[
16485+ AC_MSG_CHECKING([whether NLS is requested])
16486+ dnl Default is enabled NLS
16487+ AC_ARG_ENABLE(nls,
16488+ [ --disable-nls do not use Native Language Support],
16489+ USE_NLS=$enableval, USE_NLS=yes)
16490+ AC_MSG_RESULT($USE_NLS)
16491+ AC_SUBST(USE_NLS)
16492+])
16493+
16494+AC_DEFUN([AM_MKINSTALLDIRS],
16495+[
16496+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
16497+ dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
16498+ dnl Try to locate it.
16499+ MKINSTALLDIRS=
16500+ if test -n "$ac_aux_dir"; then
16501+ case "$ac_aux_dir" in
16502+ /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
16503+ *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
16504+ esac
16505+ fi
16506+ if test -z "$MKINSTALLDIRS"; then
16507+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
16508+ fi
16509+ AC_SUBST(MKINSTALLDIRS)
16510+])
16511diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/nls.m4~ psmisc-20.2.works.clean/m4/nls.m4~
16512diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/po.m4 psmisc-20.2.works.clean/m4/po.m4
16513--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/po.m4 1969-12-31 18:00:00.000000000 -0600
16514+++ psmisc-20.2.works.clean/m4/po.m4 2004-10-13 15:18:42.000000000 -0500
16515@@ -0,0 +1,426 @@
16516+# po.m4 serial 3 (gettext-0.14)
16517+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
16518+dnl This file is free software, distributed under the terms of the GNU
16519+dnl General Public License. As a special exception to the GNU General
16520+dnl Public License, this file may be distributed as part of a program
16521+dnl that contains a configuration script generated by Autoconf, under
16522+dnl the same distribution terms as the rest of that program.
16523+dnl
16524+dnl This file can can be used in projects which are not available under
16525+dnl the GNU General Public License or the GNU Library General Public
16526+dnl License but which still want to provide support for the GNU gettext
16527+dnl functionality.
16528+dnl Please note that the actual code of the GNU gettext library is covered
16529+dnl by the GNU Library General Public License, and the rest of the GNU
16530+dnl gettext package package is covered by the GNU General Public License.
16531+dnl They are *not* in the public domain.
16532+
16533+dnl Authors:
16534+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
16535+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
16536+
16537+dnl Checks for all prerequisites of the po subdirectory.
16538+AC_DEFUN([AM_PO_SUBDIRS],
16539+[
16540+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
16541+ AC_REQUIRE([AC_PROG_INSTALL])dnl
16542+ AC_REQUIRE([AM_MKINSTALLDIRS])dnl
16543+ AC_REQUIRE([AM_NLS])dnl
16544+
16545+ dnl Perform the following tests also if --disable-nls has been given,
16546+ dnl because they are needed for "make dist" to work.
16547+
16548+ dnl Search for GNU msgfmt in the PATH.
16549+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
16550+ dnl The second test excludes FreeBSD msgfmt.
16551+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
16552+ [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
16553+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
16554+ :)
16555+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
16556+
16557+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
16558+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
16559+ dnl The second test excludes FreeBSD xgettext.
16560+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
16561+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
16562+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
16563+ :)
16564+ dnl Remove leftover from FreeBSD xgettext call.
16565+ rm -f messages.po
16566+
16567+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
16568+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
16569+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
16570+
16571+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
16572+ dnl Test whether we really found GNU msgfmt.
16573+ if test "$GMSGFMT" != ":"; then
16574+ dnl If it is no GNU msgfmt we define it as : so that the
16575+ dnl Makefiles still can work.
16576+ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
16577+ (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
16578+ : ;
16579+ else
16580+ GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
16581+ AC_MSG_RESULT(
16582+ [found $GMSGFMT program is not GNU msgfmt; ignore it])
16583+ GMSGFMT=":"
16584+ fi
16585+ fi
16586+
16587+ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
16588+ dnl Test whether we really found GNU xgettext.
16589+ if test "$XGETTEXT" != ":"; then
16590+ dnl If it is no GNU xgettext we define it as : so that the
16591+ dnl Makefiles still can work.
16592+ if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
16593+ (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
16594+ : ;
16595+ else
16596+ AC_MSG_RESULT(
16597+ [found xgettext program is not GNU xgettext; ignore it])
16598+ XGETTEXT=":"
16599+ fi
16600+ dnl Remove leftover from FreeBSD xgettext call.
16601+ rm -f messages.po
16602+ fi
16603+
16604+ AC_OUTPUT_COMMANDS([
16605+ for ac_file in $CONFIG_FILES; do
16606+ # Support "outfile[:infile[:infile...]]"
16607+ case "$ac_file" in
16608+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16609+ esac
16610+ # PO directories have a Makefile.in generated from Makefile.in.in.
16611+ case "$ac_file" in */Makefile.in)
16612+ # Adjust a relative srcdir.
16613+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
16614+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
16615+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
16616+ # In autoconf-2.13 it is called $ac_given_srcdir.
16617+ # In autoconf-2.50 it is called $srcdir.
16618+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
16619+ case "$ac_given_srcdir" in
16620+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
16621+ /*) top_srcdir="$ac_given_srcdir" ;;
16622+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
16623+ esac
16624+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
16625+ rm -f "$ac_dir/POTFILES"
16626+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
16627+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
16628+ POMAKEFILEDEPS="POTFILES.in"
16629+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
16630+ # on $ac_dir but don't depend on user-specified configuration
16631+ # parameters.
16632+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
16633+ # The LINGUAS file contains the set of available languages.
16634+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
16635+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
16636+ fi
16637+ ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
16638+ # Hide the ALL_LINGUAS assigment from automake.
16639+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
16640+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
16641+ else
16642+ # The set of available languages was given in configure.in.
16643+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
16644+ fi
16645+ # Compute POFILES
16646+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
16647+ # Compute UPDATEPOFILES
16648+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
16649+ # Compute DUMMYPOFILES
16650+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
16651+ # Compute GMOFILES
16652+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
16653+ case "$ac_given_srcdir" in
16654+ .) srcdirpre= ;;
16655+ *) srcdirpre='$(srcdir)/' ;;
16656+ esac
16657+ POFILES=
16658+ UPDATEPOFILES=
16659+ DUMMYPOFILES=
16660+ GMOFILES=
16661+ for lang in $ALL_LINGUAS; do
16662+ POFILES="$POFILES $srcdirpre$lang.po"
16663+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
16664+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
16665+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
16666+ done
16667+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
16668+ # environment variable.
16669+ INST_LINGUAS=
16670+ if test -n "$ALL_LINGUAS"; then
16671+ for presentlang in $ALL_LINGUAS; do
16672+ useit=no
16673+ if test "%UNSET%" != "$LINGUAS"; then
16674+ desiredlanguages="$LINGUAS"
16675+ else
16676+ desiredlanguages="$ALL_LINGUAS"
16677+ fi
16678+ for desiredlang in $desiredlanguages; do
16679+ # Use the presentlang catalog if desiredlang is
16680+ # a. equal to presentlang, or
16681+ # b. a variant of presentlang (because in this case,
16682+ # presentlang can be used as a fallback for messages
16683+ # which are not translated in the desiredlang catalog).
16684+ case "$desiredlang" in
16685+ "$presentlang"*) useit=yes;;
16686+ esac
16687+ done
16688+ if test $useit = yes; then
16689+ INST_LINGUAS="$INST_LINGUAS $presentlang"
16690+ fi
16691+ done
16692+ fi
16693+ CATALOGS=
16694+ if test -n "$INST_LINGUAS"; then
16695+ for lang in $INST_LINGUAS; do
16696+ CATALOGS="$CATALOGS $lang.gmo"
16697+ done
16698+ fi
16699+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
16700+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
16701+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
16702+ if test -f "$f"; then
16703+ case "$f" in
16704+ *.orig | *.bak | *~) ;;
16705+ *) cat "$f" >> "$ac_dir/Makefile" ;;
16706+ esac
16707+ fi
16708+ done
16709+ fi
16710+ ;;
16711+ esac
16712+ done],
16713+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
16714+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
16715+ # from automake.
16716+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
16717+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
16718+ LINGUAS="${LINGUAS-%UNSET%}"
16719+ ])
16720+])
16721+
16722+dnl Postprocesses a Makefile in a directory containing PO files.
16723+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
16724+[
16725+ # When this code is run, in config.status, two variables have already been
16726+ # set:
16727+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
16728+ # - LINGUAS is the value of the environment variable LINGUAS at configure
16729+ # time.
16730+
16731+changequote(,)dnl
16732+ # Adjust a relative srcdir.
16733+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
16734+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
16735+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
16736+ # In autoconf-2.13 it is called $ac_given_srcdir.
16737+ # In autoconf-2.50 it is called $srcdir.
16738+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
16739+ case "$ac_given_srcdir" in
16740+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
16741+ /*) top_srcdir="$ac_given_srcdir" ;;
16742+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
16743+ esac
16744+
16745+ # Find a way to echo strings without interpreting backslash.
16746+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
16747+ gt_echo='echo'
16748+ else
16749+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
16750+ gt_echo='printf %s\n'
16751+ else
16752+ echo_func () {
16753+ cat <<EOT
16754+$*
16755+EOT
16756+ }
16757+ gt_echo='echo_func'
16758+ fi
16759+ fi
16760+
16761+ # A sed script that extracts the value of VARIABLE from a Makefile.
16762+ sed_x_variable='
16763+# Test if the hold space is empty.
16764+x
16765+s/P/P/
16766+x
16767+ta
16768+# Yes it was empty. Look if we have the expected variable definition.
16769+/^[ ]*VARIABLE[ ]*=/{
16770+ # Seen the first line of the variable definition.
16771+ s/^[ ]*VARIABLE[ ]*=//
16772+ ba
16773+}
16774+bd
16775+:a
16776+# Here we are processing a line from the variable definition.
16777+# Remove comment, more precisely replace it with a space.
16778+s/#.*$/ /
16779+# See if the line ends in a backslash.
16780+tb
16781+:b
16782+s/\\$//
16783+# Print the line, without the trailing backslash.
16784+p
16785+tc
16786+# There was no trailing backslash. The end of the variable definition is
16787+# reached. Clear the hold space.
16788+s/^.*$//
16789+x
16790+bd
16791+:c
16792+# A trailing backslash means that the variable definition continues in the
16793+# next line. Put a nonempty string into the hold space to indicate this.
16794+s/^.*$/P/
16795+x
16796+:d
16797+'
16798+changequote([,])dnl
16799+
16800+ # Set POTFILES to the value of the Makefile variable POTFILES.
16801+ sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
16802+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
16803+ # Compute POTFILES_DEPS as
16804+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
16805+ POTFILES_DEPS=
16806+ for file in $POTFILES; do
16807+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
16808+ done
16809+ POMAKEFILEDEPS=""
16810+
16811+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
16812+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
16813+ fi
16814+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
16815+ # The LINGUAS file contains the set of available languages.
16816+ ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
16817+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
16818+ else
16819+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
16820+ sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
16821+ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
16822+ fi
16823+ # Hide the ALL_LINGUAS assigment from automake.
16824+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
16825+ # Compute POFILES
16826+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
16827+ # Compute UPDATEPOFILES
16828+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
16829+ # Compute DUMMYPOFILES
16830+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
16831+ # Compute GMOFILES
16832+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
16833+ # Compute PROPERTIESFILES
16834+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
16835+ # Compute CLASSFILES
16836+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
16837+ # Compute QMFILES
16838+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
16839+ # Compute MSGFILES
16840+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
16841+ # Compute RESOURCESDLLFILES
16842+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
16843+ case "$ac_given_srcdir" in
16844+ .) srcdirpre= ;;
16845+ *) srcdirpre='$(srcdir)/' ;;
16846+ esac
16847+ POFILES=
16848+ UPDATEPOFILES=
16849+ DUMMYPOFILES=
16850+ GMOFILES=
16851+ PROPERTIESFILES=
16852+ CLASSFILES=
16853+ QMFILES=
16854+ MSGFILES=
16855+ RESOURCESDLLFILES=
16856+ for lang in $ALL_LINGUAS; do
16857+ POFILES="$POFILES $srcdirpre$lang.po"
16858+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
16859+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
16860+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
16861+ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
16862+ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
16863+ QMFILES="$QMFILES $srcdirpre$lang.qm"
16864+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
16865+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
16866+ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
16867+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
16868+ done
16869+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
16870+ # environment variable.
16871+ INST_LINGUAS=
16872+ if test -n "$ALL_LINGUAS"; then
16873+ for presentlang in $ALL_LINGUAS; do
16874+ useit=no
16875+ if test "%UNSET%" != "$LINGUAS"; then
16876+ desiredlanguages="$LINGUAS"
16877+ else
16878+ desiredlanguages="$ALL_LINGUAS"
16879+ fi
16880+ for desiredlang in $desiredlanguages; do
16881+ # Use the presentlang catalog if desiredlang is
16882+ # a. equal to presentlang, or
16883+ # b. a variant of presentlang (because in this case,
16884+ # presentlang can be used as a fallback for messages
16885+ # which are not translated in the desiredlang catalog).
16886+ case "$desiredlang" in
16887+ "$presentlang"*) useit=yes;;
16888+ esac
16889+ done
16890+ if test $useit = yes; then
16891+ INST_LINGUAS="$INST_LINGUAS $presentlang"
16892+ fi
16893+ done
16894+ fi
16895+ CATALOGS=
16896+ JAVACATALOGS=
16897+ QTCATALOGS=
16898+ TCLCATALOGS=
16899+ CSHARPCATALOGS=
16900+ if test -n "$INST_LINGUAS"; then
16901+ for lang in $INST_LINGUAS; do
16902+ CATALOGS="$CATALOGS $lang.gmo"
16903+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
16904+ QTCATALOGS="$QTCATALOGS $lang.qm"
16905+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
16906+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
16907+ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
16908+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
16909+ done
16910+ fi
16911+
16912+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
16913+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
16914+ # Add dependencies that cannot be formulated as a simple suffix rule.
16915+ for lang in $ALL_LINGUAS; do
16916+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
16917+ cat >> "$ac_file.tmp" <<EOF
16918+$frobbedlang.msg: $lang.po
16919+ @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
16920+ \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
16921+EOF
16922+ done
16923+ fi
16924+ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
16925+ # Add dependencies that cannot be formulated as a simple suffix rule.
16926+ for lang in $ALL_LINGUAS; do
16927+ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
16928+ cat >> "$ac_file.tmp" <<EOF
16929+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
16930+ @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
16931+ \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
16932+EOF
16933+ done
16934+ fi
16935+ if test -n "$POMAKEFILEDEPS"; then
16936+ cat >> "$ac_file.tmp" <<EOF
16937+Makefile: $POMAKEFILEDEPS
16938+EOF
16939+ fi
16940+ mv "$ac_file.tmp" "$ac_file"
16941+])
16942diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/po.m4~ psmisc-20.2.works.clean/m4/po.m4~
16943diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/printf-posix.m4 psmisc-20.2.works.clean/m4/printf-posix.m4
16944--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/printf-posix.m4 1969-12-31 18:00:00.000000000 -0600
16945+++ psmisc-20.2.works.clean/m4/printf-posix.m4 2004-10-13 15:18:42.000000000 -0500
16946@@ -0,0 +1,46 @@
16947+# printf-posix.m4 serial 2 (gettext-0.13.1)
16948+dnl Copyright (C) 2003 Free Software Foundation, Inc.
16949+dnl This file is free software, distributed under the terms of the GNU
16950+dnl General Public License. As a special exception to the GNU General
16951+dnl Public License, this file may be distributed as part of a program
16952+dnl that contains a configuration script generated by Autoconf, under
16953+dnl the same distribution terms as the rest of that program.
16954+
16955+dnl From Bruno Haible.
16956+dnl Test whether the printf() function supports POSIX/XSI format strings with
16957+dnl positions.
16958+
16959+AC_DEFUN([gt_PRINTF_POSIX],
16960+[
16961+ AC_REQUIRE([AC_PROG_CC])
16962+ AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
16963+ gt_cv_func_printf_posix,
16964+ [
16965+ AC_TRY_RUN([
16966+#include <stdio.h>
16967+#include <string.h>
16968+/* The string "%2$d %1$d", with dollar characters protected from the shell's
16969+ dollar expansion (possibly an autoconf bug). */
16970+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
16971+static char buf[100];
16972+int main ()
16973+{
16974+ sprintf (buf, format, 33, 55);
16975+ return (strcmp (buf, "55 33") != 0);
16976+}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
16977+ [
16978+ AC_EGREP_CPP(notposix, [
16979+#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
16980+ notposix
16981+#endif
16982+ ], gt_cv_func_printf_posix="guessing no",
16983+ gt_cv_func_printf_posix="guessing yes")
16984+ ])
16985+ ])
16986+ case $gt_cv_func_printf_posix in
16987+ *yes)
16988+ AC_DEFINE(HAVE_POSIX_PRINTF, 1,
16989+ [Define if your printf() function supports format strings with positions.])
16990+ ;;
16991+ esac
16992+])
16993diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/printf-posix.m4~ psmisc-20.2.works.clean/m4/printf-posix.m4~
16994diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/progtest.m4 psmisc-20.2.works.clean/m4/progtest.m4
16995--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/progtest.m4 1969-12-31 18:00:00.000000000 -0600
16996+++ psmisc-20.2.works.clean/m4/progtest.m4 2004-10-13 15:18:42.000000000 -0500
16997@@ -0,0 +1,91 @@
16998+# progtest.m4 serial 3 (gettext-0.12)
16999+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
17000+dnl This file is free software, distributed under the terms of the GNU
17001+dnl General Public License. As a special exception to the GNU General
17002+dnl Public License, this file may be distributed as part of a program
17003+dnl that contains a configuration script generated by Autoconf, under
17004+dnl the same distribution terms as the rest of that program.
17005+dnl
17006+dnl This file can can be used in projects which are not available under
17007+dnl the GNU General Public License or the GNU Library General Public
17008+dnl License but which still want to provide support for the GNU gettext
17009+dnl functionality.
17010+dnl Please note that the actual code of the GNU gettext library is covered
17011+dnl by the GNU Library General Public License, and the rest of the GNU
17012+dnl gettext package package is covered by the GNU General Public License.
17013+dnl They are *not* in the public domain.
17014+
17015+dnl Authors:
17016+dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
17017+
17018+# Search path for a program which passes the given test.
17019+
17020+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
17021+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
17022+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
17023+[
17024+# Prepare PATH_SEPARATOR.
17025+# The user is always right.
17026+if test "${PATH_SEPARATOR+set}" != set; then
17027+ echo "#! /bin/sh" >conf$$.sh
17028+ echo "exit 0" >>conf$$.sh
17029+ chmod +x conf$$.sh
17030+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
17031+ PATH_SEPARATOR=';'
17032+ else
17033+ PATH_SEPARATOR=:
17034+ fi
17035+ rm -f conf$$.sh
17036+fi
17037+
17038+# Find out how to test for executable files. Don't use a zero-byte file,
17039+# as systems may use methods other than mode bits to determine executability.
17040+cat >conf$$.file <<_ASEOF
17041+#! /bin/sh
17042+exit 0
17043+_ASEOF
17044+chmod +x conf$$.file
17045+if test -x conf$$.file >/dev/null 2>&1; then
17046+ ac_executable_p="test -x"
17047+else
17048+ ac_executable_p="test -f"
17049+fi
17050+rm -f conf$$.file
17051+
17052+# Extract the first word of "$2", so it can be a program name with args.
17053+set dummy $2; ac_word=[$]2
17054+AC_MSG_CHECKING([for $ac_word])
17055+AC_CACHE_VAL(ac_cv_path_$1,
17056+[case "[$]$1" in
17057+ [[\\/]]* | ?:[[\\/]]*)
17058+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
17059+ ;;
17060+ *)
17061+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
17062+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
17063+ IFS="$ac_save_IFS"
17064+ test -z "$ac_dir" && ac_dir=.
17065+ for ac_exec_ext in '' $ac_executable_extensions; do
17066+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
17067+ if [$3]; then
17068+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
17069+ break 2
17070+ fi
17071+ fi
17072+ done
17073+ done
17074+ IFS="$ac_save_IFS"
17075+dnl If no 4th arg is given, leave the cache variable unset,
17076+dnl so AC_PATH_PROGS will keep looking.
17077+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
17078+])dnl
17079+ ;;
17080+esac])dnl
17081+$1="$ac_cv_path_$1"
17082+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
17083+ AC_MSG_RESULT([$]$1)
17084+else
17085+ AC_MSG_RESULT(no)
17086+fi
17087+AC_SUBST($1)dnl
17088+])
17089diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/progtest.m4~ psmisc-20.2.works.clean/m4/progtest.m4~
17090diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/signed.m4 psmisc-20.2.works.clean/m4/signed.m4
17091--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/signed.m4 1969-12-31 18:00:00.000000000 -0600
17092+++ psmisc-20.2.works.clean/m4/signed.m4 2004-10-13 15:18:42.000000000 -0500
17093@@ -0,0 +1,19 @@
17094+# signed.m4 serial 1 (gettext-0.10.40)
17095+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
17096+dnl This file is free software, distributed under the terms of the GNU
17097+dnl General Public License. As a special exception to the GNU General
17098+dnl Public License, this file may be distributed as part of a program
17099+dnl that contains a configuration script generated by Autoconf, under
17100+dnl the same distribution terms as the rest of that program.
17101+
17102+dnl From Bruno Haible.
17103+
17104+AC_DEFUN([bh_C_SIGNED],
17105+[
17106+ AC_CACHE_CHECK([for signed], bh_cv_c_signed,
17107+ [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
17108+ if test $bh_cv_c_signed = no; then
17109+ AC_DEFINE(signed, ,
17110+ [Define to empty if the C compiler doesn't support this keyword.])
17111+ fi
17112+])
17113diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/signed.m4~ psmisc-20.2.works.clean/m4/signed.m4~
17114diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/size_max.m4 psmisc-20.2.works.clean/m4/size_max.m4
17115--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/size_max.m4 1969-12-31 18:00:00.000000000 -0600
17116+++ psmisc-20.2.works.clean/m4/size_max.m4 2004-10-13 15:18:42.000000000 -0500
17117@@ -0,0 +1,61 @@
17118+# size_max.m4 serial 2
17119+dnl Copyright (C) 2003 Free Software Foundation, Inc.
17120+dnl This file is free software, distributed under the terms of the GNU
17121+dnl General Public License. As a special exception to the GNU General
17122+dnl Public License, this file may be distributed as part of a program
17123+dnl that contains a configuration script generated by Autoconf, under
17124+dnl the same distribution terms as the rest of that program.
17125+
17126+dnl From Bruno Haible.
17127+
17128+AC_DEFUN([gl_SIZE_MAX],
17129+[
17130+ AC_CHECK_HEADERS(stdint.h)
17131+ dnl First test whether the system already has SIZE_MAX.
17132+ AC_MSG_CHECKING([for SIZE_MAX])
17133+ result=
17134+ AC_EGREP_CPP([Found it], [
17135+#include <limits.h>
17136+#if HAVE_STDINT_H
17137+#include <stdint.h>
17138+#endif
17139+#ifdef SIZE_MAX
17140+Found it
17141+#endif
17142+], result=yes)
17143+ if test -z "$result"; then
17144+ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
17145+ dnl than the type 'unsigned long'.
17146+ dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
17147+ dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
17148+ _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
17149+ [#include <stddef.h>], result=?)
17150+ _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
17151+ [#include <stddef.h>], result=?)
17152+ _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
17153+ [#include <stddef.h>], result=?)
17154+ if test "$fits_in_uint" = 1; then
17155+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
17156+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
17157+ AC_TRY_COMPILE([#include <stddef.h>
17158+ extern size_t foo;
17159+ extern unsigned long foo;
17160+ ], [], fits_in_uint=0)
17161+ fi
17162+ if test -z "$result"; then
17163+ if test "$fits_in_uint" = 1; then
17164+ result="$res_hi$res_lo"U
17165+ else
17166+ result="$res_hi$res_lo"UL
17167+ fi
17168+ else
17169+ dnl Shouldn't happen, but who knows...
17170+ result='~(size_t)0'
17171+ fi
17172+ fi
17173+ AC_MSG_RESULT([$result])
17174+ if test "$result" != yes; then
17175+ AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
17176+ [Define as the maximum value of type 'size_t', if the system doesn't define it.])
17177+ fi
17178+])
17179diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/size_max.m4~ psmisc-20.2.works.clean/m4/size_max.m4~
17180diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/stdint_h.m4 psmisc-20.2.works.clean/m4/stdint_h.m4
17181--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/stdint_h.m4 1969-12-31 18:00:00.000000000 -0600
17182+++ psmisc-20.2.works.clean/m4/stdint_h.m4 2004-10-13 15:18:42.000000000 -0500
17183@@ -0,0 +1,28 @@
17184+# stdint_h.m4 serial 3 (gettext-0.12)
17185+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
17186+dnl This file is free software, distributed under the terms of the GNU
17187+dnl General Public License. As a special exception to the GNU General
17188+dnl Public License, this file may be distributed as part of a program
17189+dnl that contains a configuration script generated by Autoconf, under
17190+dnl the same distribution terms as the rest of that program.
17191+
17192+dnl From Paul Eggert.
17193+
17194+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
17195+# doesn't clash with <sys/types.h>, and declares uintmax_t.
17196+
17197+AC_DEFUN([jm_AC_HEADER_STDINT_H],
17198+[
17199+ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
17200+ [AC_TRY_COMPILE(
17201+ [#include <sys/types.h>
17202+#include <stdint.h>],
17203+ [uintmax_t i = (uintmax_t) -1;],
17204+ jm_ac_cv_header_stdint_h=yes,
17205+ jm_ac_cv_header_stdint_h=no)])
17206+ if test $jm_ac_cv_header_stdint_h = yes; then
17207+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
17208+ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
17209+ and declares uintmax_t. ])
17210+ fi
17211+])
17212diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/stdint_h.m4~ psmisc-20.2.works.clean/m4/stdint_h.m4~
17213diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/uintmax_t.m4 psmisc-20.2.works.clean/m4/uintmax_t.m4
17214--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/uintmax_t.m4 1969-12-31 18:00:00.000000000 -0600
17215+++ psmisc-20.2.works.clean/m4/uintmax_t.m4 2004-10-13 15:18:42.000000000 -0500
17216@@ -0,0 +1,32 @@
17217+# uintmax_t.m4 serial 7 (gettext-0.12)
17218+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
17219+dnl This file is free software, distributed under the terms of the GNU
17220+dnl General Public License. As a special exception to the GNU General
17221+dnl Public License, this file may be distributed as part of a program
17222+dnl that contains a configuration script generated by Autoconf, under
17223+dnl the same distribution terms as the rest of that program.
17224+
17225+dnl From Paul Eggert.
17226+
17227+AC_PREREQ(2.13)
17228+
17229+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
17230+# if it is not already defined in <stdint.h> or <inttypes.h>.
17231+
17232+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
17233+[
17234+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
17235+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
17236+ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
17237+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
17238+ test $ac_cv_type_unsigned_long_long = yes \
17239+ && ac_type='unsigned long long' \
17240+ || ac_type='unsigned long'
17241+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
17242+ [Define to unsigned long or unsigned long long
17243+ if <stdint.h> and <inttypes.h> don't define.])
17244+ else
17245+ AC_DEFINE(HAVE_UINTMAX_T, 1,
17246+ [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
17247+ fi
17248+])
17249diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/uintmax_t.m4~ psmisc-20.2.works.clean/m4/uintmax_t.m4~
17250diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/ulonglong.m4 psmisc-20.2.works.clean/m4/ulonglong.m4
17251--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/ulonglong.m4 1969-12-31 18:00:00.000000000 -0600
17252+++ psmisc-20.2.works.clean/m4/ulonglong.m4 2004-10-13 15:18:42.000000000 -0500
17253@@ -0,0 +1,25 @@
17254+# ulonglong.m4 serial 3
17255+dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
17256+dnl This file is free software, distributed under the terms of the GNU
17257+dnl General Public License. As a special exception to the GNU General
17258+dnl Public License, this file may be distributed as part of a program
17259+dnl that contains a configuration script generated by Autoconf, under
17260+dnl the same distribution terms as the rest of that program.
17261+
17262+dnl From Paul Eggert.
17263+
17264+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
17265+
17266+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
17267+[
17268+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
17269+ [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
17270+ [unsigned long long ullmax = (unsigned long long) -1;
17271+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
17272+ ac_cv_type_unsigned_long_long=yes,
17273+ ac_cv_type_unsigned_long_long=no)])
17274+ if test $ac_cv_type_unsigned_long_long = yes; then
17275+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
17276+ [Define if you have the 'unsigned long long' type.])
17277+ fi
17278+])
17279diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/ulonglong.m4~ psmisc-20.2.works.clean/m4/ulonglong.m4~
17280diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/wchar_t.m4 psmisc-20.2.works.clean/m4/wchar_t.m4
17281--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/wchar_t.m4 1969-12-31 18:00:00.000000000 -0600
17282+++ psmisc-20.2.works.clean/m4/wchar_t.m4 2004-10-13 15:18:42.000000000 -0500
17283@@ -0,0 +1,22 @@
17284+# wchar_t.m4 serial 1 (gettext-0.12)
17285+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
17286+dnl This file is free software, distributed under the terms of the GNU
17287+dnl General Public License. As a special exception to the GNU General
17288+dnl Public License, this file may be distributed as part of a program
17289+dnl that contains a configuration script generated by Autoconf, under
17290+dnl the same distribution terms as the rest of that program.
17291+
17292+dnl From Bruno Haible.
17293+dnl Test whether <stddef.h> has the 'wchar_t' type.
17294+dnl Prerequisite: AC_PROG_CC
17295+
17296+AC_DEFUN([gt_TYPE_WCHAR_T],
17297+[
17298+ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
17299+ [AC_TRY_COMPILE([#include <stddef.h>
17300+ wchar_t foo = (wchar_t)'\0';], ,
17301+ gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
17302+ if test $gt_cv_c_wchar_t = yes; then
17303+ AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
17304+ fi
17305+])
17306diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/wchar_t.m4~ psmisc-20.2.works.clean/m4/wchar_t.m4~
17307diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/wint_t.m4 psmisc-20.2.works.clean/m4/wint_t.m4
17308--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/wint_t.m4 1969-12-31 18:00:00.000000000 -0600
17309+++ psmisc-20.2.works.clean/m4/wint_t.m4 2004-10-13 15:18:42.000000000 -0500
17310@@ -0,0 +1,22 @@
17311+# wint_t.m4 serial 1 (gettext-0.12)
17312+dnl Copyright (C) 2003 Free Software Foundation, Inc.
17313+dnl This file is free software, distributed under the terms of the GNU
17314+dnl General Public License. As a special exception to the GNU General
17315+dnl Public License, this file may be distributed as part of a program
17316+dnl that contains a configuration script generated by Autoconf, under
17317+dnl the same distribution terms as the rest of that program.
17318+
17319+dnl From Bruno Haible.
17320+dnl Test whether <wchar.h> has the 'wint_t' type.
17321+dnl Prerequisite: AC_PROG_CC
17322+
17323+AC_DEFUN([gt_TYPE_WINT_T],
17324+[
17325+ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
17326+ [AC_TRY_COMPILE([#include <wchar.h>
17327+ wint_t foo = (wchar_t)'\0';], ,
17328+ gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
17329+ if test $gt_cv_c_wint_t = yes; then
17330+ AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
17331+ fi
17332+])
17333diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/wint_t.m4~ psmisc-20.2.works.clean/m4/wint_t.m4~
17334diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/xsize.m4 psmisc-20.2.works.clean/m4/xsize.m4
17335--- tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/xsize.m4 1969-12-31 18:00:00.000000000 -0600
17336+++ psmisc-20.2.works.clean/m4/xsize.m4 2004-10-13 15:18:42.000000000 -0500
17337@@ -0,0 +1,14 @@
17338+# xsize.m4 serial 2
17339+dnl Copyright (C) 2003 Free Software Foundation, Inc.
17340+dnl This file is free software, distributed under the terms of the GNU
17341+dnl General Public License. As a special exception to the GNU General
17342+dnl Public License, this file may be distributed as part of a program
17343+dnl that contains a configuration script generated by Autoconf, under
17344+dnl the same distribution terms as the rest of that program.
17345+
17346+AC_DEFUN([gl_XSIZE],
17347+[
17348+ dnl Prerequisites of lib/xsize.h.
17349+ AC_REQUIRE([gl_SIZE_MAX])
17350+ AC_CHECK_HEADERS(stdint.h)
17351+])
17352diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/m4/xsize.m4~ psmisc-20.2.works.clean/m4/xsize.m4~
17353diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/missing psmisc-20.2.works.clean/missing
17354diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/mkinstalldirs psmisc-20.2.works.clean/mkinstalldirs
17355diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Makefile.in.in psmisc-20.2.works.clean/po/Makefile.in.in
17356--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Makefile.in.in 2001-04-13 23:00:46.000000000 -0500
17357+++ psmisc-20.2.works.clean/po/Makefile.in.in 2004-10-13 15:18:42.000000000 -0500
17358@@ -1,10 +1,14 @@
17359-# Makefile for program source directory in GNU NLS utilities package.
17360-# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
17361+# Makefile for PO directory in any package using GNU gettext.
17362+# Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
17363 #
17364-# This file file be copied and used freely without restrictions. It can
17365-# be used in projects which are not available under the GNU Public License
17366-# but which still want to provide support for the GNU gettext functionality.
17367-# Please note that the actual code is *not* freely available.
17368+# This file can be copied and used freely without restrictions. It can
17369+# be used in projects which are not available under the GNU General Public
17370+# License but which still want to provide support for the GNU gettext
17371+# functionality.
17372+# Please note that the actual code of GNU gettext is covered by the GNU
17373+# General Public License and is *not* in the public domain.
17374+#
17375+# Origin: gettext-0.14
17376
17377 PACKAGE = @PACKAGE@
17378 VERSION = @VERSION@
17379@@ -14,88 +18,139 @@
17380
17381 srcdir = @srcdir@
17382 top_srcdir = @top_srcdir@
17383-top_builddir = ..
17384 VPATH = @srcdir@
17385
17386 prefix = @prefix@
17387 exec_prefix = @exec_prefix@
17388-datadir = $(prefix)/share
17389+datadir = @datadir@
17390 localedir = $(datadir)/locale
17391-gettextsrcdir = $(prefix)/share/gettext/po
17392-subdir = po
17393+gettextsrcdir = $(datadir)/gettext/po
17394
17395 INSTALL = @INSTALL@
17396 INSTALL_DATA = @INSTALL_DATA@
17397 MKINSTALLDIRS = @MKINSTALLDIRS@
17398-mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
17399+mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
17400
17401-CC = @CC@
17402-GENCAT = @GENCAT@
17403 GMSGFMT = @GMSGFMT@
17404 MSGFMT = @MSGFMT@
17405 XGETTEXT = @XGETTEXT@
17406 MSGMERGE = msgmerge
17407-
17408-DEFS = @DEFS@
17409-CFLAGS = @CFLAGS@
17410-CPPFLAGS = @CPPFLAGS@
17411-
17412-INCLUDES = -I.. -I$(top_srcdir)/intl
17413-
17414-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
17415+MSGMERGE_UPDATE = @MSGMERGE@ --update
17416+MSGINIT = msginit
17417+MSGCONV = msgconv
17418+MSGFILTER = msgfilter
17419
17420 POFILES = @POFILES@
17421 GMOFILES = @GMOFILES@
17422-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
17423-$(POFILES) $(GMOFILES)
17424+UPDATEPOFILES = @UPDATEPOFILES@
17425+DUMMYPOFILES = @DUMMYPOFILES@
17426+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
17427+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
17428+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
17429+$(POFILES) $(GMOFILES) \
17430+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
17431
17432 POTFILES = \
17433
17434 CATALOGS = @CATALOGS@
17435
17436-.SUFFIXES:
17437-.SUFFIXES: .c .o .po .pox .gmo .mo
17438-
17439-.c.o:
17440- $(COMPILE) $<
17441+# Makevars gets inserted here. (Don't remove this line!)
17442
17443-.po.pox:
17444- $(MAKE) $(PACKAGE).pot
17445- $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
17446+.SUFFIXES:
17447+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
17448
17449 .po.mo:
17450- $(MSGFMT) -o $@ $<
17451+ @echo "$(MSGFMT) -c -o $@ $<"; \
17452+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
17453
17454 .po.gmo:
17455- file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
17456- && rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
17457+ @lang=`echo $* | sed -e 's,.*/,,'`; \
17458+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
17459+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
17460+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
17461+
17462+.sin.sed:
17463+ sed -e '/^#/d' $< > t-$@
17464+ mv t-$@ $@
17465
17466
17467 all: all-@USE_NLS@
17468
17469-all-yes: $(CATALOGS)
17470+all-yes: stamp-po
17471 all-no:
17472
17473-# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
17474+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
17475+# been loosely updated. Its purpose is that when a developer or translator
17476+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
17477+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
17478+# invocations of "make" will do nothing. This timestamp would not be necessary
17479+# if updating the $(CATALOGS) would always touch them; however, the rule for
17480+# $(POFILES) has been designed to not touch files that don't need to be
17481+# changed.
17482+stamp-po: $(srcdir)/$(DOMAIN).pot
17483+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
17484+ @echo "touch stamp-po"
17485+ @echo timestamp > stamp-poT
17486+ @mv stamp-poT stamp-po
17487+
17488+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
17489 # otherwise packages like GCC can not be built if only parts of the source
17490 # have been downloaded.
17491
17492-$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
17493- $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
17494- --add-comments --keyword=_ --keyword=N_ \
17495+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
17496+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
17497+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
17498+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
17499+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
17500 --files-from=$(srcdir)/POTFILES.in \
17501- && test ! -f $(PACKAGE).po \
17502- || ( rm -f $(srcdir)/$(PACKAGE).pot \
17503- && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
17504+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
17505+ --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
17506+ test ! -f $(DOMAIN).po || { \
17507+ if test -f $(srcdir)/$(DOMAIN).pot; then \
17508+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
17509+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
17510+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
17511+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
17512+ else \
17513+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
17514+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
17515+ fi; \
17516+ else \
17517+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
17518+ fi; \
17519+ }
17520+
17521+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
17522+# every "make" invocation, only create it when it is missing.
17523+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
17524+$(srcdir)/$(DOMAIN).pot:
17525+ $(MAKE) $(DOMAIN).pot-update
17526+
17527+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
17528+# Note that a PO file is not touched if it doesn't need to be changed.
17529+$(POFILES): $(srcdir)/$(DOMAIN).pot
17530+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
17531+ if test -f "$(srcdir)/$${lang}.po"; then \
17532+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
17533+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
17534+ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
17535+ else \
17536+ $(MAKE) $${lang}.po-create; \
17537+ fi
17538
17539
17540 install: install-exec install-data
17541 install-exec:
17542 install-data: install-data-@USE_NLS@
17543- if test "$(PACKAGE)" = "gettext"; then \
17544+ if test "$(PACKAGE)" = "gettext-tools"; then \
17545 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
17546- $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
17547- $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
17548+ for file in $(DISTFILES.common) Makevars.template; do \
17549+ $(INSTALL_DATA) $(srcdir)/$$file \
17550+ $(DESTDIR)$(gettextsrcdir)/$$file; \
17551+ done; \
17552+ for file in Makevars; do \
17553+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
17554+ done; \
17555 else \
17556 : ; \
17557 fi
17558@@ -105,41 +160,118 @@
17559 @catalogs='$(CATALOGS)'; \
17560 for cat in $$catalogs; do \
17561 cat=`basename $$cat`; \
17562- lang=`echo $$cat | sed 's/\.gmo$$//'`; \
17563+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
17564 dir=$(localedir)/$$lang/LC_MESSAGES; \
17565 $(mkinstalldirs) $(DESTDIR)$$dir; \
17566- if test -r $$cat; then \
17567- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
17568- echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
17569- else \
17570- $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
17571- echo "installing $(srcdir)/$$cat as" \
17572- "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
17573- fi; \
17574+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
17575+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
17576+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
17577+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
17578+ if test -n "$$lc"; then \
17579+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
17580+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
17581+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
17582+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
17583+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
17584+ for file in *; do \
17585+ if test -f $$file; then \
17586+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
17587+ fi; \
17588+ done); \
17589+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
17590+ else \
17591+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
17592+ :; \
17593+ else \
17594+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
17595+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
17596+ fi; \
17597+ fi; \
17598+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
17599+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
17600+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
17601+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
17602+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
17603+ fi; \
17604+ done; \
17605 done
17606
17607-# Define this as empty until I found a useful application.
17608-installcheck:
17609+install-strip: install
17610
17611-uninstall:
17612- catalogs='$(CATALOGS)'; \
17613+installdirs: installdirs-exec installdirs-data
17614+installdirs-exec:
17615+installdirs-data: installdirs-data-@USE_NLS@
17616+ if test "$(PACKAGE)" = "gettext-tools"; then \
17617+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
17618+ else \
17619+ : ; \
17620+ fi
17621+installdirs-data-no:
17622+installdirs-data-yes:
17623+ $(mkinstalldirs) $(DESTDIR)$(datadir)
17624+ @catalogs='$(CATALOGS)'; \
17625 for cat in $$catalogs; do \
17626 cat=`basename $$cat`; \
17627- lang=`echo $$cat | sed 's/\.gmo$$//'`; \
17628- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
17629+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
17630+ dir=$(localedir)/$$lang/LC_MESSAGES; \
17631+ $(mkinstalldirs) $(DESTDIR)$$dir; \
17632+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
17633+ if test -n "$$lc"; then \
17634+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
17635+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
17636+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
17637+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
17638+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
17639+ for file in *; do \
17640+ if test -f $$file; then \
17641+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
17642+ fi; \
17643+ done); \
17644+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
17645+ else \
17646+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
17647+ :; \
17648+ else \
17649+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
17650+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
17651+ fi; \
17652+ fi; \
17653+ fi; \
17654+ done; \
17655 done
17656- if test "$(PACKAGE)" = "gettext"; then \
17657- rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
17658+
17659+# Define this as empty until I found a useful application.
17660+installcheck:
17661+
17662+uninstall: uninstall-exec uninstall-data
17663+uninstall-exec:
17664+uninstall-data: uninstall-data-@USE_NLS@
17665+ if test "$(PACKAGE)" = "gettext-tools"; then \
17666+ for file in $(DISTFILES.common) Makevars.template; do \
17667+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
17668+ done; \
17669 else \
17670 : ; \
17671 fi
17672+uninstall-data-no:
17673+uninstall-data-yes:
17674+ catalogs='$(CATALOGS)'; \
17675+ for cat in $$catalogs; do \
17676+ cat=`basename $$cat`; \
17677+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
17678+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
17679+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
17680+ done; \
17681+ done
17682
17683 check: all
17684
17685-dvi info tags TAGS ID:
17686+info dvi ps pdf html tags TAGS ctags CTAGS ID:
17687
17688 mostlyclean:
17689- rm -f core core.* *.pox $(PACKAGE).po *.new.po
17690+ rm -f remove-potcdate.sed
17691+ rm -f stamp-poT
17692+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
17693 rm -fr *.o
17694
17695 clean: mostlyclean
17696@@ -150,58 +282,85 @@
17697 maintainer-clean: distclean
17698 @echo "This command is intended for maintainers to use;"
17699 @echo "it deletes files that may require special tools to rebuild."
17700- rm -f $(GMOFILES)
17701+ rm -f stamp-po $(GMOFILES)
17702
17703-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
17704+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
17705 dist distdir:
17706 $(MAKE) update-po
17707 @$(MAKE) dist2
17708 # This is a separate target because 'update-po' must be executed before.
17709 dist2: $(DISTFILES)
17710 dists="$(DISTFILES)"; \
17711+ if test "$(PACKAGE)" = "gettext-tools"; then \
17712+ dists="$$dists Makevars.template"; \
17713+ fi; \
17714+ if test -f $(srcdir)/ChangeLog; then \
17715+ dists="$$dists ChangeLog"; \
17716+ fi; \
17717+ for i in 0 1 2 3 4 5 6 7 8 9; do \
17718+ if test -f $(srcdir)/ChangeLog.$$i; then \
17719+ dists="$$dists ChangeLog.$$i"; \
17720+ fi; \
17721+ done; \
17722+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
17723 for file in $$dists; do \
17724- cp -p $(srcdir)/$$file $(distdir); \
17725+ if test -f $$file; then \
17726+ cp -p $$file $(distdir); \
17727+ else \
17728+ cp -p $(srcdir)/$$file $(distdir); \
17729+ fi; \
17730 done
17731
17732 update-po: Makefile
17733- $(MAKE) $(PACKAGE).pot
17734- if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
17735+ $(MAKE) $(DOMAIN).pot-update
17736+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
17737+ $(MAKE) update-gmo
17738+
17739+# General rule for creating PO files.
17740+
17741+.nop.po-create:
17742+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
17743+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
17744+ exit 1
17745+
17746+# General rule for updating PO files.
17747+
17748+.nop.po-update:
17749+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
17750+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
17751+ tmpdir=`pwd`; \
17752+ echo "$$lang:"; \
17753+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
17754+ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
17755 cd $(srcdir); \
17756- catalogs='$(GMOFILES)'; \
17757- for cat in $$catalogs; do \
17758- cat=`basename $$cat`; \
17759- lang=`echo $$cat | sed 's/\.gmo$$//'`; \
17760- echo "$$lang:"; \
17761- if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
17762- mv -f $$lang.new.po $$lang.po; \
17763+ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
17764+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
17765+ rm -f $$tmpdir/$$lang.new.po; \
17766 else \
17767- echo "msgmerge for $$cat failed!"; \
17768- rm -f $$lang.new.po; \
17769+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
17770+ :; \
17771+ else \
17772+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
17773+ exit 1; \
17774+ fi; \
17775 fi; \
17776- done
17777- $(MAKE) update-gmo
17778+ else \
17779+ echo "msgmerge for $$lang.po failed!" 1>&2; \
17780+ rm -f $$tmpdir/$$lang.new.po; \
17781+ fi
17782+
17783+$(DUMMYPOFILES):
17784
17785 update-gmo: Makefile $(GMOFILES)
17786 @:
17787
17788-POTFILES: POTFILES.in
17789- ( if test 'x$(srcdir)' != 'x.'; then \
17790- posrcprefix='$(top_srcdir)/'; \
17791- else \
17792- posrcprefix="../"; \
17793- fi; \
17794- rm -f $@-t $@ \
17795- && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
17796- -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
17797- | sed -e '$$s/\\$$//') > $@-t \
17798- && chmod a-w $@-t \
17799- && mv $@-t $@ )
17800-
17801-Makefile: Makefile.in.in ../config.status POTFILES
17802- cd .. \
17803+Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
17804+ cd $(top_builddir) \
17805 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
17806 $(SHELL) ./config.status
17807
17808+force:
17809+
17810 # Tell versions [3.59,3.63) of GNU make not to export all variables.
17811 # Otherwise a system limit (for SysV at least) may be exceeded.
17812 .NOEXPORT:
17813diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Makefile.in.in~ psmisc-20.2.works.clean/po/Makefile.in.in~
17814diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Makevars psmisc-20.2.works.clean/po/Makevars
17815--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Makevars 1969-12-31 18:00:00.000000000 -0600
17816+++ psmisc-20.2.works.clean/po/Makevars 2004-10-13 15:18:42.000000000 -0500
17817@@ -0,0 +1,41 @@
17818+# Makefile variables for PO directory in any package using GNU gettext.
17819+
17820+# Usually the message domain is the same as the package name.
17821+DOMAIN = $(PACKAGE)
17822+
17823+# These two variables depend on the location of this directory.
17824+subdir = po
17825+top_builddir = ..
17826+
17827+# These options get passed to xgettext.
17828+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
17829+
17830+# This is the copyright holder that gets inserted into the header of the
17831+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
17832+# package. (Note that the msgstr strings, extracted from the package's
17833+# sources, belong to the copyright holder of the package.) Translators are
17834+# expected to transfer the copyright for their translations to this person
17835+# or entity, or to disclaim their copyright. The empty string stands for
17836+# the public domain; in this case the translators are expected to disclaim
17837+# their copyright.
17838+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
17839+
17840+# This is the email address or URL to which the translators shall report
17841+# bugs in the untranslated strings:
17842+# - Strings which are not entire sentences, see the maintainer guidelines
17843+# in the GNU gettext documentation, section 'Preparing Strings'.
17844+# - Strings which use unclear terms or require additional context to be
17845+# understood.
17846+# - Strings which make invalid assumptions about notation of date, time or
17847+# money.
17848+# - Pluralisation problems.
17849+# - Incorrect English spelling.
17850+# - Incorrect formatting.
17851+# It can be your email address, or a mailing list address where translators
17852+# can write to without being subscribed, or the URL of a web page through
17853+# which the translators can contact you.
17854+MSGID_BUGS_ADDRESS =
17855+
17856+# This is the list of locale categories, beyond LC_MESSAGES, for which the
17857+# message catalogs shall be used. It is usually empty.
17858+EXTRA_LOCALE_CATEGORIES =
17859diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Rules-quot psmisc-20.2.works.clean/po/Rules-quot
17860--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Rules-quot 1969-12-31 18:00:00.000000000 -0600
17861+++ psmisc-20.2.works.clean/po/Rules-quot 2004-10-13 15:18:42.000000000 -0500
17862@@ -0,0 +1,47 @@
17863+# Special Makefile rules for English message catalogs with quotation marks.
17864+
17865+DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
17866+
17867+.SUFFIXES: .insert-header .po-update-en
17868+
17869+en@quot.po-create:
17870+ $(MAKE) en@quot.po-update
17871+en@boldquot.po-create:
17872+ $(MAKE) en@boldquot.po-update
17873+
17874+en@quot.po-update: en@quot.po-update-en
17875+en@boldquot.po-update: en@boldquot.po-update-en
17876+
17877+.insert-header.po-update-en:
17878+ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
17879+ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
17880+ tmpdir=`pwd`; \
17881+ echo "$$lang:"; \
17882+ ll=`echo $$lang | sed -e 's/@.*//'`; \
17883+ LC_ALL=C; export LC_ALL; \
17884+ cd $(srcdir); \
17885+ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
17886+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
17887+ rm -f $$tmpdir/$$lang.new.po; \
17888+ else \
17889+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
17890+ :; \
17891+ else \
17892+ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
17893+ exit 1; \
17894+ fi; \
17895+ fi; \
17896+ else \
17897+ echo "creation of $$lang.po failed!" 1>&2; \
17898+ rm -f $$tmpdir/$$lang.new.po; \
17899+ fi
17900+
17901+en@quot.insert-header: insert-header.sin
17902+ sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
17903+
17904+en@boldquot.insert-header: insert-header.sin
17905+ sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
17906+
17907+mostlyclean: mostlyclean-quot
17908+mostlyclean-quot:
17909+ rm -f *.insert-header
17910diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/Rules-quot~ psmisc-20.2.works.clean/po/Rules-quot~
17911diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/boldquot.sed psmisc-20.2.works.clean/po/boldquot.sed
17912--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/boldquot.sed 1969-12-31 18:00:00.000000000 -0600
17913+++ psmisc-20.2.works.clean/po/boldquot.sed 2004-10-13 15:18:42.000000000 -0500
17914@@ -0,0 +1,10 @@
17915+s/"\([^"]*\)"/“\1”/g
17916+s/`\([^`']*\)'/‘\1’/g
17917+s/ '\([^`']*\)' / ‘\1’ /g
17918+s/ '\([^`']*\)'$/ ‘\1’/g
17919+s/^'\([^`']*\)' /‘\1’ /g
17920+s/“”/""/g
17921+s/“/“/g
17922+s/”/”/g
17923+s/‘/‘/g
17924+s/’/’/g
17925diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/boldquot.sed~ psmisc-20.2.works.clean/po/boldquot.sed~
17926diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/en@boldquot.header psmisc-20.2.works.clean/po/en@boldquot.header
17927--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/en@boldquot.header 1969-12-31 18:00:00.000000000 -0600
17928+++ psmisc-20.2.works.clean/po/en@boldquot.header 2004-10-13 15:18:42.000000000 -0500
17929@@ -0,0 +1,25 @@
17930+# All this catalog "translates" are quotation characters.
17931+# The msgids must be ASCII and therefore cannot contain real quotation
17932+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
17933+# and double quote (0x22). These substitutes look strange; see
17934+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
17935+#
17936+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
17937+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
17938+# It also translates pairs of apostrophe (0x27) to
17939+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
17940+# and pairs of quotation mark (0x22) to
17941+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
17942+#
17943+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
17944+# When output to an ISO-8859-1 terminal, the single quotation marks are
17945+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
17946+# grave/acute accent (by libiconv), and the double quotation marks are
17947+# transliterated to 0x22.
17948+# When output to an ASCII terminal, the single quotation marks are
17949+# transliterated to apostrophes, and the double quotation marks are
17950+# transliterated to 0x22.
17951+#
17952+# This catalog furthermore displays the text between the quotation marks in
17953+# bold face, assuming the VT100/XTerm escape sequences.
17954+#
17955diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/en@boldquot.header~ psmisc-20.2.works.clean/po/en@boldquot.header~
17956diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/en@quot.header psmisc-20.2.works.clean/po/en@quot.header
17957--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/en@quot.header 1969-12-31 18:00:00.000000000 -0600
17958+++ psmisc-20.2.works.clean/po/en@quot.header 2004-10-13 15:18:42.000000000 -0500
17959@@ -0,0 +1,22 @@
17960+# All this catalog "translates" are quotation characters.
17961+# The msgids must be ASCII and therefore cannot contain real quotation
17962+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
17963+# and double quote (0x22). These substitutes look strange; see
17964+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
17965+#
17966+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
17967+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
17968+# It also translates pairs of apostrophe (0x27) to
17969+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
17970+# and pairs of quotation mark (0x22) to
17971+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
17972+#
17973+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
17974+# When output to an ISO-8859-1 terminal, the single quotation marks are
17975+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
17976+# grave/acute accent (by libiconv), and the double quotation marks are
17977+# transliterated to 0x22.
17978+# When output to an ASCII terminal, the single quotation marks are
17979+# transliterated to apostrophes, and the double quotation marks are
17980+# transliterated to 0x22.
17981+#
17982diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/en@quot.header~ psmisc-20.2.works.clean/po/en@quot.header~
17983diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/insert-header.sin psmisc-20.2.works.clean/po/insert-header.sin
17984--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/insert-header.sin 1969-12-31 18:00:00.000000000 -0600
17985+++ psmisc-20.2.works.clean/po/insert-header.sin 2004-10-13 15:18:42.000000000 -0500
17986@@ -0,0 +1,23 @@
17987+# Sed script that inserts the file called HEADER before the header entry.
17988+#
17989+# At each occurrence of a line starting with "msgid ", we execute the following
17990+# commands. At the first occurrence, insert the file. At the following
17991+# occurrences, do nothing. The distinction between the first and the following
17992+# occurrences is achieved by looking at the hold space.
17993+/^msgid /{
17994+x
17995+# Test if the hold space is empty.
17996+s/m/m/
17997+ta
17998+# Yes it was empty. First occurrence. Read the file.
17999+r HEADER
18000+# Output the file's contents by reading the next line. But don't lose the
18001+# current line while doing this.
18002+g
18003+N
18004+bb
18005+:a
18006+# The hold space was nonempty. Following occurrences. Do nothing.
18007+x
18008+:b
18009+}
18010diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/insert-header.sin~ psmisc-20.2.works.clean/po/insert-header.sin~
18011diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/quot.sed psmisc-20.2.works.clean/po/quot.sed
18012--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/quot.sed 1969-12-31 18:00:00.000000000 -0600
18013+++ psmisc-20.2.works.clean/po/quot.sed 2004-10-13 15:18:42.000000000 -0500
18014@@ -0,0 +1,6 @@
18015+s/"\([^"]*\)"/“\1”/g
18016+s/`\([^`']*\)'/‘\1’/g
18017+s/ '\([^`']*\)' / ‘\1’ /g
18018+s/ '\([^`']*\)'$/ ‘\1’/g
18019+s/^'\([^`']*\)' /‘\1’ /g
18020+s/“”/""/g
18021diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/quot.sed~ psmisc-20.2.works.clean/po/quot.sed~
18022diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/remove-potcdate.sin psmisc-20.2.works.clean/po/remove-potcdate.sin
18023--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/remove-potcdate.sin 1969-12-31 18:00:00.000000000 -0600
18024+++ psmisc-20.2.works.clean/po/remove-potcdate.sin 2004-10-13 15:18:42.000000000 -0500
18025@@ -0,0 +1,19 @@
18026+# Sed script that remove the POT-Creation-Date line in the header entry
18027+# from a POT file.
18028+#
18029+# The distinction between the first and the following occurrences of the
18030+# pattern is achieved by looking at the hold space.
18031+/^"POT-Creation-Date: .*"$/{
18032+x
18033+# Test if the hold space is empty.
18034+s/P/P/
18035+ta
18036+# Yes it was empty. First occurrence. Remove the line.
18037+g
18038+d
18039+bb
18040+:a
18041+# The hold space was nonempty. Following occurrences. Do nothing.
18042+x
18043+:b
18044+}
18045diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/remove-potcdate.sin~ psmisc-20.2.works.clean/po/remove-potcdate.sin~
18046diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/po/stamp-po psmisc-20.2.works.clean/po/stamp-po
18047--- tmp/work/psmisc-20.2-r0/psmisc-20.2/po/stamp-po 1969-12-31 18:00:00.000000000 -0600
18048+++ psmisc-20.2.works.clean/po/stamp-po 2004-10-13 15:11:01.000000000 -0500
18049@@ -0,0 +1 @@
18050+timestamp
18051diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/src/Makefile.am psmisc-20.2.works.clean/src/Makefile.am
18052--- tmp/work/psmisc-20.2-r0/psmisc-20.2/src/Makefile.am 2001-06-15 07:17:55.000000000 -0500
18053+++ psmisc-20.2.works.clean/src/Makefile.am 2004-10-13 15:11:01.000000000 -0500
18054@@ -1,5 +1,7 @@
18055
18056 CFLAGS = -Wall -DLOCALEDIR=\"/usr/share/locale\"
18057+INCLUDES = -I$(top_srcdir)/intl
18058+LDADD = @LIBINTL@
18059
18060 bin_PROGRAMS = fuser killall pstree
18061
18062diff -urNd -urNd tmp/work/psmisc-20.2-r0/psmisc-20.2/src/Makefile.in psmisc-20.2.works.clean/src/Makefile.in