mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-09-02 22:48:39 +00:00
Compare commits
78
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
342b8b6e21 | ||
|
|
0150aabe35 | ||
|
|
8484abf02c | ||
|
|
bafbfdd24c | ||
|
|
20e0b9749c | ||
|
|
3a7bc75ff7 | ||
|
|
40b97583b8 | ||
|
|
c20e2bdcf1 | ||
|
|
1c8c2190b1 | ||
|
|
180d45ba81 | ||
|
|
c51d1a1973 | ||
|
|
577c6c8499 | ||
|
|
6f9344dadf | ||
|
|
652def8074 | ||
|
|
209215672e | ||
|
|
25b222faf6 | ||
|
|
6bc35ae56a | ||
|
|
31b53af2fa | ||
|
|
a474de9b9a | ||
|
|
c0629aa10f | ||
|
|
82b6d266fd | ||
|
|
75f5aaea27 | ||
|
|
f508cb0ac9 | ||
|
|
f3c383d683 | ||
|
|
13105fc158 | ||
|
|
b0c4483ed2 | ||
|
|
714720fcfe | ||
|
|
4766a52862 | ||
|
|
11d82f03b4 | ||
|
|
a0ed1cb86a | ||
|
|
f753cd6292 | ||
|
|
93a37297e6 | ||
|
|
4134cae3c5 | ||
|
|
682d48cd09 | ||
|
|
53cdf751a3 | ||
|
|
087c8fdae3 | ||
|
|
7a999fcb7b | ||
|
|
dda680cb80 | ||
|
|
6b7d911c5d | ||
|
|
9e644e648d | ||
|
|
17da6427fe | ||
|
|
01ed3db59b | ||
|
|
e8cb70b957 | ||
|
|
63c2d5de0f | ||
|
|
675bc4e954 | ||
|
|
d8cb51834b | ||
|
|
6c686258e3 | ||
|
|
c111e171cd | ||
|
|
8f451ef727 | ||
|
|
5086915ebd | ||
|
|
416bd7a9f3 | ||
|
|
997b6fd0c7 | ||
|
|
2ba3b73c58 | ||
|
|
ff48177d25 | ||
|
|
4e5caae2c6 | ||
|
|
b33160bf45 | ||
|
|
535c0e75d1 | ||
|
|
d1a2daf76a | ||
|
|
2b763dfe15 | ||
|
|
f1a87ef6ad | ||
|
|
cbd8990652 | ||
|
|
82e236e2d6 | ||
|
|
b0cfa28a12 | ||
|
|
6fc7423473 | ||
|
|
40a64a7a48 | ||
|
|
944bc6ce43 | ||
|
|
9c76d118cc | ||
|
|
a8289c62db | ||
|
|
b6610515d5 | ||
|
|
26f609ffc3 | ||
|
|
6f43b11362 | ||
|
|
dd3127cf7a | ||
|
|
aa321494cf | ||
|
|
68bd3b6bfa | ||
|
|
bbb5bcc6f8 | ||
|
|
667a550e7b | ||
|
|
713fa62a74 | ||
|
|
83cd972a1a |
@@ -9,4 +9,5 @@ patches
|
|||||||
*.patch *.log log patches applied
|
*.patch *.log log patches applied
|
||||||
*.prj
|
*.prj
|
||||||
releases
|
releases
|
||||||
|
*.flc
|
||||||
autom4te.cache
|
autom4te.cache
|
||||||
|
|||||||
@@ -1,324 +0,0 @@
|
|||||||
Notes on the Free Translation Project
|
|
||||||
*************************************
|
|
||||||
|
|
||||||
Free software is going international! The Free Translation Project
|
|
||||||
is a way to get maintainers of free software, translators, and users all
|
|
||||||
together, so that will gradually become able to speak many languages.
|
|
||||||
A few packages already provide translations for their messages.
|
|
||||||
|
|
||||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
|
||||||
assume that the distributed package does use GNU `gettext' internally,
|
|
||||||
itself available at your nearest GNU archive site. But you do _not_
|
|
||||||
need to install GNU `gettext' prior to configuring, installing or using
|
|
||||||
this package with messages translated.
|
|
||||||
|
|
||||||
Installers will find here some useful hints. These notes also
|
|
||||||
explain how users should proceed for getting the programs to use the
|
|
||||||
available translations. They tell how people wanting to contribute and
|
|
||||||
work at translations should contact the appropriate team.
|
|
||||||
|
|
||||||
When reporting bugs in the `intl/' directory or bugs which may be
|
|
||||||
related to internationalization, you should tell about the version of
|
|
||||||
`gettext' which is used. The information can be found in the
|
|
||||||
`intl/VERSION' file, in internationalized packages.
|
|
||||||
|
|
||||||
Quick configuration advice
|
|
||||||
==========================
|
|
||||||
|
|
||||||
If you want to exploit the full power of internationalization, you
|
|
||||||
should configure it using
|
|
||||||
|
|
||||||
./configure --with-included-gettext
|
|
||||||
|
|
||||||
to force usage of internationalizing routines provided within this
|
|
||||||
package, despite the existence of internationalizing capabilities in the
|
|
||||||
operating system where this package is being installed. So far, only
|
|
||||||
the `gettext' implementation in the GNU C library version 2 provides as
|
|
||||||
many features (such as locale alias, message inheritance, automatic
|
|
||||||
charset conversion or plural form handling) as the implementation here.
|
|
||||||
It is also not possible to offer this additional functionality on top
|
|
||||||
of a `catgets' implementation. Future versions of GNU `gettext' will
|
|
||||||
very likely convey even more functionality. So it might be a good idea
|
|
||||||
to change to GNU `gettext' as soon as possible.
|
|
||||||
|
|
||||||
So you need _not_ provide this option if you are using GNU libc 2 or
|
|
||||||
you have installed a recent copy of the GNU gettext package with the
|
|
||||||
included `libintl'.
|
|
||||||
|
|
||||||
INSTALL Matters
|
|
||||||
===============
|
|
||||||
|
|
||||||
Some packages are "localizable" when properly installed; the
|
|
||||||
programs they contain can be made to speak your own native language.
|
|
||||||
Most such packages use GNU `gettext'. Other packages have their own
|
|
||||||
ways to internationalization, predating GNU `gettext'.
|
|
||||||
|
|
||||||
By default, this package will be installed to allow translation of
|
|
||||||
messages. It will automatically detect whether the system already
|
|
||||||
provides the GNU `gettext' functions. If not, the GNU `gettext' own
|
|
||||||
library will be used. This library is wholly contained within this
|
|
||||||
package, usually in the `intl/' subdirectory, so prior installation of
|
|
||||||
the GNU `gettext' package is _not_ required. Installers may use
|
|
||||||
special options at configuration time for changing the default
|
|
||||||
behaviour. The commands:
|
|
||||||
|
|
||||||
./configure --with-included-gettext
|
|
||||||
./configure --disable-nls
|
|
||||||
|
|
||||||
will respectively bypass any pre-existing `gettext' to use the
|
|
||||||
internationalizing routines provided within this package, or else,
|
|
||||||
_totally_ disable translation of messages.
|
|
||||||
|
|
||||||
When you already have GNU `gettext' installed on your system and run
|
|
||||||
configure without an option for your new package, `configure' will
|
|
||||||
probably detect the previously built and installed `libintl.a' file and
|
|
||||||
will decide to use this. This might be not what is desirable. You
|
|
||||||
should use the more recent version of the GNU `gettext' library. I.e.
|
|
||||||
if the file `intl/VERSION' shows that the library which comes with this
|
|
||||||
package is more recent, you should use
|
|
||||||
|
|
||||||
./configure --with-included-gettext
|
|
||||||
|
|
||||||
to prevent auto-detection.
|
|
||||||
|
|
||||||
The configuration process will not test for the `catgets' function
|
|
||||||
and therefore it will not be used. The reason is that even an
|
|
||||||
emulation of `gettext' on top of `catgets' could not provide all the
|
|
||||||
extensions of the GNU `gettext' library.
|
|
||||||
|
|
||||||
Internationalized packages have usually many `po/LL.po' files, where
|
|
||||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
|
||||||
translations have been forbidden at `configure' time by using the
|
|
||||||
`--disable-nls' switch, all available translations are installed
|
|
||||||
together with the package. However, the environment variable `LINGUAS'
|
|
||||||
may be set, prior to configuration, to limit the installed set.
|
|
||||||
`LINGUAS' should then contain a space separated list of two-letter
|
|
||||||
codes, stating which languages are allowed.
|
|
||||||
|
|
||||||
Using This Package
|
|
||||||
==================
|
|
||||||
|
|
||||||
As a user, if your language has been installed for this package, you
|
|
||||||
only have to set the `LANG' environment variable to the appropriate
|
|
||||||
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
|
|
||||||
and `CC' is an ISO 3166 two-letter country code. For example, let's
|
|
||||||
suppose that you speak German and live in Germany. At the shell
|
|
||||||
prompt, merely execute `setenv LANG de_DE' (in `csh'),
|
|
||||||
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
|
|
||||||
This can be done from your `.login' or `.profile' file, once and for
|
|
||||||
all.
|
|
||||||
|
|
||||||
You might think that the country code specification is redundant.
|
|
||||||
But in fact, some languages have dialects in different countries. For
|
|
||||||
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
|
|
||||||
country code serves to distinguish the dialects.
|
|
||||||
|
|
||||||
Not all programs have translations for all languages. By default, an
|
|
||||||
English message is shown in place of a nonexistent translation. If you
|
|
||||||
understand other languages, you can set up a priority list of languages.
|
|
||||||
This is done through a different environment variable, called
|
|
||||||
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
|
|
||||||
for the purpose of message handling, but you still need to have `LANG'
|
|
||||||
set to the primary language; this is required by other parts of the
|
|
||||||
system libraries. For example, some Swedish users who would rather
|
|
||||||
read translations in German than English for when Swedish is not
|
|
||||||
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
|
|
||||||
|
|
||||||
In the `LANGUAGE' environment variable, but not in the `LANG'
|
|
||||||
environment variable, `LL_CC' combinations can be abbreviated as `LL'
|
|
||||||
to denote the language's main dialect. For example, `de' is equivalent
|
|
||||||
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
|
|
||||||
(Portuguese as spoken in Portugal) in this context.
|
|
||||||
|
|
||||||
Translating Teams
|
|
||||||
=================
|
|
||||||
|
|
||||||
For the Free Translation Project to be a success, we need interested
|
|
||||||
people who like their own language and write it well, and who are also
|
|
||||||
able to synergize with other translators speaking the same language.
|
|
||||||
Each translation team has its own mailing list. The up-to-date list of
|
|
||||||
teams can be found at the Free Translation Project's homepage,
|
|
||||||
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
|
|
||||||
area.
|
|
||||||
|
|
||||||
If you'd like to volunteer to _work_ at translating messages, you
|
|
||||||
should become a member of the translating team for your own language.
|
|
||||||
The subscribing address is _not_ the same as the list itself, it has
|
|
||||||
`-request' appended. For example, speakers of Swedish can send a
|
|
||||||
message to `[email protected]', having this message body:
|
|
||||||
|
|
||||||
subscribe
|
|
||||||
|
|
||||||
Keep in mind that team members are expected to participate
|
|
||||||
_actively_ in translations, or at solving translational difficulties,
|
|
||||||
rather than merely lurking around. If your team does not exist yet and
|
|
||||||
you want to start one, or if you are unsure about what to do or how to
|
|
||||||
get started, please write to `[email protected]' to reach the
|
|
||||||
coordinator for all translator teams.
|
|
||||||
|
|
||||||
The English team is special. It works at improving and uniformizing
|
|
||||||
the terminology in use. Proven linguistic skill are praised more than
|
|
||||||
programming skill, here.
|
|
||||||
|
|
||||||
Available Packages
|
|
||||||
==================
|
|
||||||
|
|
||||||
Languages are not equally supported in all packages. The following
|
|
||||||
matrix shows the current state of internationalization, as of September
|
|
||||||
2001. The matrix shows, in regard of each package, for which languages
|
|
||||||
PO files have been submitted to translation coordination, with a
|
|
||||||
translation percentage of at least 50%.
|
|
||||||
|
|
||||||
Ready PO files bg cs da de el en eo es et fi fr gl he hr id it ja
|
|
||||||
+----------------------------------------------------+
|
|
||||||
a2ps | [] [] [] |
|
|
||||||
bash | [] [] [] [] |
|
|
||||||
bfd | |
|
|
||||||
binutils | [] |
|
|
||||||
bison | [] [] [] [] [] |
|
|
||||||
clisp | [] [] [] [] |
|
|
||||||
cpio | [] [] [] [] [] |
|
|
||||||
diffutils | [] [] [] [] [] [] [] |
|
|
||||||
enscript | [] [] |
|
|
||||||
error | [] [] |
|
|
||||||
fetchmail | |
|
|
||||||
fileutils | [] [] [] [] [] [] [] [] |
|
|
||||||
findutils | [] [] [] [] [] [] [] [] |
|
|
||||||
flex | [] [] [] |
|
|
||||||
freetype | |
|
|
||||||
gas | |
|
|
||||||
gawk | [] [] |
|
|
||||||
gcal | |
|
|
||||||
gcc | |
|
|
||||||
gettext | [] [] [] [] [] [] [] [] [] [] |
|
|
||||||
gnupg | [] [] [] [] [] [] [] |
|
|
||||||
gprof | |
|
|
||||||
grep | [] [] [] [] [] [] [] [] |
|
|
||||||
hello | [] [] [] [] [] [] [] [] [] [] [] |
|
|
||||||
id-utils | [] [] [] |
|
|
||||||
indent | [] [] [] [] [] |
|
|
||||||
jpilot | [] |
|
|
||||||
kbd | |
|
|
||||||
ld | [] |
|
|
||||||
libc | [] [] [] [] [] [] [] [] |
|
|
||||||
lilypond | [] |
|
|
||||||
lynx | [] [] [] [] |
|
|
||||||
m4 | [] [] [] [] [] [] [] [] |
|
|
||||||
make | [] [] [] [] [] [] |
|
|
||||||
mysecretdiary | [] |
|
|
||||||
nano | [] [] [] |
|
|
||||||
opcodes | |
|
|
||||||
parted | [] [] [] |
|
|
||||||
ptx | [] [] [] [] [] [] [] |
|
|
||||||
python | |
|
|
||||||
recode | [] [] [] [] [] [] [] [] [] |
|
|
||||||
sed | [] [] [] [] [] [] [] [] [] [] [] [] |
|
|
||||||
sh-utils | [] [] [] [] [] [] [] [] [] [] |
|
|
||||||
sharutils | [] [] [] [] [] [] [] [] |
|
|
||||||
sketch | |
|
|
||||||
soundtracker | [] [] [] |
|
|
||||||
sp | |
|
|
||||||
tar | [] [] [] [] [] [] [] [] |
|
|
||||||
texinfo | [] [] [] [] [] [] |
|
|
||||||
textutils | [] [] [] [] [] [] [] [] |
|
|
||||||
util-linux | [] [] |
|
|
||||||
wdiff | [] [] [] |
|
|
||||||
wget | [] [] [] [] [] [] [] [] [] [] |
|
|
||||||
+----------------------------------------------------+
|
|
||||||
bg cs da de el en eo es et fi fr gl he hr id it ja
|
|
||||||
0 14 24 32 11 1 8 23 13 1 33 22 4 0 7 9 18
|
|
||||||
|
|
||||||
ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
|
|
||||||
+----------------------------------------------------+
|
|
||||||
a2ps | [] [] [] | 6
|
|
||||||
bash | | 4
|
|
||||||
bfd | | 0
|
|
||||||
binutils | | 1
|
|
||||||
bison | [] | 6
|
|
||||||
clisp | [] | 5
|
|
||||||
cpio | [] [] [] [] [] | 10
|
|
||||||
diffutils | [] [] [] [] | 11
|
|
||||||
enscript | [] [] [] | 5
|
|
||||||
error | [] [] | 4
|
|
||||||
fetchmail | | 0
|
|
||||||
fileutils | [] [] [] [] [] [] [] [] [] | 17
|
|
||||||
findutils | [] [] [] [] [] [] [] [] | 16
|
|
||||||
flex | [] [] [] | 6
|
|
||||||
freetype | | 0
|
|
||||||
gas | | 0
|
|
||||||
gawk | [] | 3
|
|
||||||
gcal | | 0
|
|
||||||
gcc | | 0
|
|
||||||
gettext | [] [] [] [] [] [] [] [] | 18
|
|
||||||
gnupg | [] [] [] | 10
|
|
||||||
gprof | | 0
|
|
||||||
grep | [] [] [] [] | 12
|
|
||||||
hello | [] [] [] [] [] [] [] [] [] [] [] | 22
|
|
||||||
id-utils | [] [] [] | 6
|
|
||||||
indent | [] [] [] [] [] [] [] | 12
|
|
||||||
jpilot | | 1
|
|
||||||
kbd | [] | 1
|
|
||||||
ld | | 1
|
|
||||||
libc | [] [] [] [] [] [] [] [] | 16
|
|
||||||
lilypond | [] [] | 3
|
|
||||||
lynx | [] [] [] [] | 8
|
|
||||||
m4 | [] [] [] [] | 12
|
|
||||||
make | [] [] [] [] [] [] | 12
|
|
||||||
mysecretdiary | | 1
|
|
||||||
nano | [] | 4
|
|
||||||
opcodes | [] | 1
|
|
||||||
parted | [] [] | 5
|
|
||||||
ptx | [] [] [] [] [] [] [] [] | 15
|
|
||||||
python | | 0
|
|
||||||
recode | [] [] [] [] | 13
|
|
||||||
sed | [] [] [] [] [] [] [] | 19
|
|
||||||
sh-utils | [] [] [] [] [] [] [] [] [] [] [] | 21
|
|
||||||
sharutils | [] [] [] | 11
|
|
||||||
sketch | | 0
|
|
||||||
soundtracker | | 3
|
|
||||||
sp | | 0
|
|
||||||
tar | [] [] [] [] [] [] [] | 15
|
|
||||||
texinfo | [] | 7
|
|
||||||
textutils | [] [] [] [] [] [] [] [] | 16
|
|
||||||
util-linux | [] [] | 4
|
|
||||||
wdiff | [] [] [] [] | 7
|
|
||||||
wget | [] [] [] [] [] [] [] | 17
|
|
||||||
+----------------------------------------------------+
|
|
||||||
33 teams ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
|
|
||||||
53 domains 9 1 6 20 0 6 17 1 13 25 10 11 23 21 2 2 387
|
|
||||||
|
|
||||||
Some counters in the preceding matrix are higher than the number of
|
|
||||||
visible blocks let us expect. This is because a few extra PO files are
|
|
||||||
used for implementing regional variants of languages, or language
|
|
||||||
dialects.
|
|
||||||
|
|
||||||
For a PO file in the matrix above to be effective, the package to
|
|
||||||
which it applies should also have been internationalized and
|
|
||||||
distributed as such by its maintainer. There might be an observable
|
|
||||||
lag between the mere existence a PO file and its wide availability in a
|
|
||||||
distribution.
|
|
||||||
|
|
||||||
If September 2001 seems to be old, you may fetch a more recent copy
|
|
||||||
of this `ABOUT-NLS' file on most GNU archive sites. The most
|
|
||||||
up-to-date matrix with full percentage details can be found at
|
|
||||||
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
|
|
||||||
|
|
||||||
Using `gettext' in new packages
|
|
||||||
===============================
|
|
||||||
|
|
||||||
If you are writing a freely available program and want to
|
|
||||||
internationalize it you are welcome to use GNU `gettext' in your
|
|
||||||
package. Of course you have to respect the GNU Library General Public
|
|
||||||
License which covers the use of the GNU `gettext' library. This means
|
|
||||||
in particular that even non-free programs can use `libintl' as a shared
|
|
||||||
library, whereas only free software can use `libintl' as a static
|
|
||||||
library or use modified versions of `libintl'.
|
|
||||||
|
|
||||||
Once the sources are changed appropriately and the setup can handle
|
|
||||||
to use of `gettext' the only thing missing are the translations. The
|
|
||||||
Free Translation Project is also available for packages which are not
|
|
||||||
developed inside the GNU project. Therefore the information given above
|
|
||||||
applies also for every other Free Software Project. Contact
|
|
||||||
`[email protected]' to make the `.pot' files available to
|
|
||||||
the translation teams.
|
|
||||||
|
|
||||||
@@ -1,9 +1,3 @@
|
|||||||
Copyright 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation,
|
|
||||||
Inc.
|
|
||||||
|
|
||||||
This file is free documentation; the Free Software Foundation gives
|
|
||||||
unlimited permission to copy, distribute and modify it.
|
|
||||||
|
|
||||||
Basic Installation
|
Basic Installation
|
||||||
==================
|
==================
|
||||||
|
|
||||||
@@ -14,27 +8,20 @@ various system-dependent variables used during compilation. It uses
|
|||||||
those values to create a `Makefile' in each directory of the package.
|
those values to create a `Makefile' in each directory of the package.
|
||||||
It may also create one or more `.h' files containing system-dependent
|
It may also create one or more `.h' files containing system-dependent
|
||||||
definitions. Finally, it creates a shell script `config.status' that
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
you can run in the future to recreate the current configuration, and a
|
you can run in the future to recreate the current configuration, a file
|
||||||
file `config.log' containing compiler output (useful mainly for
|
`config.cache' that saves the results of its tests to speed up
|
||||||
debugging `configure').
|
reconfiguring, and a file `config.log' containing compiler output
|
||||||
|
(useful mainly for debugging `configure').
|
||||||
It can also use an optional file (typically called `config.cache'
|
|
||||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
|
||||||
the results of its tests to speed up reconfiguring. (Caching is
|
|
||||||
disabled by default to prevent problems with accidental use of stale
|
|
||||||
cache files.)
|
|
||||||
|
|
||||||
If you need to do unusual things to compile the package, please try
|
If you need to do unusual things to compile the package, please try
|
||||||
to figure out how `configure' could check whether to do them, and mail
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
diffs or instructions to the address given in the `README' so they can
|
diffs or instructions to the address given in the `README' so they can
|
||||||
be considered for the next release. If you are using the cache, and at
|
be considered for the next release. If at some point `config.cache'
|
||||||
some point `config.cache' contains results you don't want to keep, you
|
contains results you don't want to keep, you may remove or edit it.
|
||||||
may remove or edit it.
|
|
||||||
|
|
||||||
The file `configure.ac' (or `configure.in') is used to create
|
The file `configure.in' is used to create `configure' by a program
|
||||||
`configure' by a program called `autoconf'. You only need
|
called `autoconf'. You only need `configure.in' if you want to change
|
||||||
`configure.ac' if you want to change it or regenerate `configure' using
|
it or regenerate `configure' using a newer version of `autoconf'.
|
||||||
a newer version of `autoconf'.
|
|
||||||
|
|
||||||
The simplest way to compile this package is:
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
@@ -68,15 +55,14 @@ Compilers and Options
|
|||||||
=====================
|
=====================
|
||||||
|
|
||||||
Some systems require unusual options for compilation or linking that
|
Some systems require unusual options for compilation or linking that
|
||||||
the `configure' script does not know about. Run `./configure --help'
|
the `configure' script does not know about. You can give `configure'
|
||||||
for details on some of the pertinent environment variables.
|
initial values for variables by setting them in the environment. Using
|
||||||
|
a Bourne-compatible shell, you can do that on the command line like
|
||||||
|
this:
|
||||||
|
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||||
|
|
||||||
You can give `configure' initial values for variables by setting
|
Or on systems that have the `env' program, you can do it like this:
|
||||||
them in the environment. You can do that on the command line like this:
|
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||||
|
|
||||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
|
||||||
|
|
||||||
*Note Defining Variables::, for more details.
|
|
||||||
|
|
||||||
Compiling For Multiple Architectures
|
Compiling For Multiple Architectures
|
||||||
====================================
|
====================================
|
||||||
@@ -89,11 +75,11 @@ directory where you want the object files and executables to go and run
|
|||||||
the `configure' script. `configure' automatically checks for the
|
the `configure' script. `configure' automatically checks for the
|
||||||
source code in the directory that `configure' is in and in `..'.
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
If you have to use a `make' that does not support the `VPATH'
|
If you have to use a `make' that does not supports the `VPATH'
|
||||||
variable, you have to compile the package for one architecture at a
|
variable, you have to compile the package for one architecture at a time
|
||||||
time in the source code directory. After you have installed the
|
in the source code directory. After you have installed the package for
|
||||||
package for one architecture, use `make distclean' before reconfiguring
|
one architecture, use `make distclean' before reconfiguring for another
|
||||||
for another architecture.
|
architecture.
|
||||||
|
|
||||||
Installation Names
|
Installation Names
|
||||||
==================
|
==================
|
||||||
@@ -136,35 +122,22 @@ you can use the `configure' options `--x-includes=DIR' and
|
|||||||
Specifying the System Type
|
Specifying the System Type
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
There may be some features `configure' cannot figure out
|
There may be some features `configure' can not figure out
|
||||||
automatically, but needs to determine by the type of host the package
|
automatically, but needs to determine by the type of host the package
|
||||||
will run on. Usually `configure' can figure that out, but if it prints
|
will run on. Usually `configure' can figure that out, but if it prints
|
||||||
a message saying it cannot guess the host type, give it the
|
a message saying it can not guess the host type, give it the
|
||||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||||
type, such as `sun4', or a canonical name which has the form:
|
type, such as `sun4', or a canonical name with three fields:
|
||||||
|
|
||||||
CPU-COMPANY-SYSTEM
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
where SYSTEM can have one of these forms:
|
See the file `config.sub' for the possible values of each field. If
|
||||||
|
|
||||||
OS KERNEL-OS
|
|
||||||
|
|
||||||
See the file `config.sub' for the possible values of each field. If
|
|
||||||
`config.sub' isn't included in this package, then this package doesn't
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
need to know the host type.
|
need to know the host type.
|
||||||
|
|
||||||
If you are _building_ compiler tools for cross-compiling, you should
|
If you are building compiler tools for cross-compiling, you can also
|
||||||
use the `--target=TYPE' option to select the type of system they will
|
use the `--target=TYPE' option to select the type of system they will
|
||||||
produce code for.
|
produce code for and the `--build=TYPE' option to select the type of
|
||||||
|
system on which you are compiling the package.
|
||||||
If you want to _use_ a cross compiler, that generates code for a
|
|
||||||
platform different from the build platform, you should specify the host
|
|
||||||
platform (i.e., that on which the generated programs will eventually be
|
|
||||||
run) with `--host=TYPE'. In this case, you should also specify the
|
|
||||||
build platform with `--build=TYPE', because, in this case, it may not
|
|
||||||
be possible to guess the build platform (it sometimes involves
|
|
||||||
compiling and running simple test programs, and this can't be done if
|
|
||||||
the compiler is a cross compiler).
|
|
||||||
|
|
||||||
Sharing Defaults
|
Sharing Defaults
|
||||||
================
|
================
|
||||||
@@ -177,43 +150,19 @@ default values for variables like `CC', `cache_file', and `prefix'.
|
|||||||
`CONFIG_SITE' environment variable to the location of the site script.
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
A warning: not all `configure' scripts look for a site script.
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
Defining Variables
|
Operation Controls
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Variables not defined in a site shell script can be set in the
|
|
||||||
environment passed to `configure'. However, some packages may run
|
|
||||||
configure again during the build, and the customized values of these
|
|
||||||
variables may be lost. In order to avoid this problem, you should set
|
|
||||||
them in the `configure' command line, using `VAR=value'. For example:
|
|
||||||
|
|
||||||
./configure CC=/usr/local2/bin/gcc
|
|
||||||
|
|
||||||
will cause the specified gcc to be used as the C compiler (unless it is
|
|
||||||
overridden in the site shell script).
|
|
||||||
|
|
||||||
`configure' Invocation
|
|
||||||
======================
|
|
||||||
|
|
||||||
`configure' recognizes the following options to control how it
|
`configure' recognizes the following options to control how it
|
||||||
operates.
|
operates.
|
||||||
|
|
||||||
`--help'
|
|
||||||
`-h'
|
|
||||||
Print a summary of the options to `configure', and exit.
|
|
||||||
|
|
||||||
`--version'
|
|
||||||
`-V'
|
|
||||||
Print the version of Autoconf used to generate the `configure'
|
|
||||||
script, and exit.
|
|
||||||
|
|
||||||
`--cache-file=FILE'
|
`--cache-file=FILE'
|
||||||
Enable the cache: use and save the results of the tests in FILE,
|
Use and save the results of the tests in FILE instead of
|
||||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||||
disable caching.
|
debugging `configure'.
|
||||||
|
|
||||||
`--config-cache'
|
`--help'
|
||||||
`-C'
|
Print a summary of the options to `configure', and exit.
|
||||||
Alias for `--cache-file=config.cache'.
|
|
||||||
|
|
||||||
`--quiet'
|
`--quiet'
|
||||||
`--silent'
|
`--silent'
|
||||||
@@ -226,6 +175,8 @@ operates.
|
|||||||
Look for the package's source code in directory DIR. Usually
|
Look for the package's source code in directory DIR. Usually
|
||||||
`configure' can determine that directory automatically.
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
`configure' also accepts some other, not widely useful, options. Run
|
`--version'
|
||||||
`configure --help' for more details.
|
Print the version of Autoconf used to generate the `configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options.
|
||||||
|
|||||||
-15
@@ -1,18 +1,3 @@
|
|||||||
## This program is free software; you can redistribute it and/or modify
|
|
||||||
## it under the terms of the GNU General Public License as published by
|
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
||||||
## 02111-1307 USA
|
|
||||||
|
|
||||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
AUTOMAKE_OPTIONS = 1.5 check-news readme-alpha dist-bzip2
|
AUTOMAKE_OPTIONS = 1.5 check-news readme-alpha dist-bzip2
|
||||||
|
|
||||||
|
|||||||
-477
@@ -1,477 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.5c from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
|
|
||||||
srcdir = @srcdir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
|
|
||||||
bindir = @bindir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
datadir = @datadir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
libdir = @libdir@
|
|
||||||
infodir = @infodir@
|
|
||||||
mandir = @mandir@
|
|
||||||
includedir = @includedir@
|
|
||||||
oldincludedir = /usr/include
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
top_builddir = .
|
|
||||||
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = @program_transform_name@
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_triplet = @host@
|
|
||||||
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AUTOM4TE = @AUTOM4TE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
|
||||||
CATALOGS = @CATALOGS@
|
|
||||||
CATOBJEXT = @CATOBJEXT@
|
|
||||||
CC = @CC@
|
|
||||||
CPP = @CPP@
|
|
||||||
DATADIRNAME = @DATADIRNAME@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
GCC = @GCC@
|
|
||||||
GENCAT = @GENCAT@
|
|
||||||
GLIBC21 = @GLIBC21@
|
|
||||||
GMOFILES = @GMOFILES@
|
|
||||||
GMSGFMT = @GMSGFMT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
INSTOBJEXT = @INSTOBJEXT@
|
|
||||||
INTLBISON = @INTLBISON@
|
|
||||||
INTLLIBS = @INTLLIBS@
|
|
||||||
INTLOBJS = @INTLOBJS@
|
|
||||||
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
|
||||||
LIB = @LIB@
|
|
||||||
LIBICONV = @LIBICONV@
|
|
||||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
||||||
MSGFMT = @MSGFMT@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
POFILES = @POFILES@
|
|
||||||
POSUB = @POSUB@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
U = @U@
|
|
||||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
|
||||||
USE_NLS = @USE_NLS@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
|
||||||
WERROR_CFLAGS = @WERROR_CFLAGS@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = 1.5 check-news readme-alpha dist-bzip2
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
|
||||||
|
|
||||||
SUBDIRS = config intl po lib src doc m4 tests
|
|
||||||
|
|
||||||
EXTRA_DIST = REFERENCES configure.bat OChangeLog Makefile.maint GNUmakefile
|
|
||||||
|
|
||||||
DISTCLEANFILES = intl/libintl.h
|
|
||||||
|
|
||||||
move_if_change = $(srcdir)/config/move-if-change
|
|
||||||
prev_version_file = $(srcdir)/config/prev-version.txt
|
|
||||||
release_archive_dir = releases
|
|
||||||
|
|
||||||
# Uploading betas.
|
|
||||||
hosts = alpha
|
|
||||||
alpha_host = alpha.gnu.org
|
|
||||||
alpha_url_dir = gnu/bison
|
|
||||||
|
|
||||||
# Files to update automatically.
|
|
||||||
wget_files = $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
|
|
||||||
$(srcdir)/config/texinfo.tex
|
|
||||||
|
|
||||||
|
|
||||||
cvs_files = $(srcdir)/config/missing
|
|
||||||
subdir = .
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = config.h
|
|
||||||
CONFIG_CLEAN_FILES = intl/Makefile
|
|
||||||
DIST_SOURCES =
|
|
||||||
|
|
||||||
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
|
|
||||||
uninstall-info-recursive all-recursive install-data-recursive \
|
|
||||||
install-exec-recursive installdirs-recursive install-recursive \
|
|
||||||
uninstall-recursive check-recursive installcheck-recursive
|
|
||||||
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
|
|
||||||
Makefile.am Makefile.in NEWS THANKS aclocal.m4 config.hin \
|
|
||||||
configure configure.in
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
all: config.h
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
|
||||||
cd $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
$(SHELL) ./config.status --recheck
|
|
||||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
|
||||||
cd $(srcdir) && $(AUTOCONF)
|
|
||||||
|
|
||||||
$(ACLOCAL_M4): configure.in m4/c-bs-a.m4 m4/codeset.m4 m4/dmalloc.m4 m4/error.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/malloc.m4 m4/mbrtowc.m4 m4/mbstate_t.m4 m4/prereq.m4 m4/progtest.m4 m4/realloc.m4 m4/strerror_r.m4 m4/warning.m4
|
|
||||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
|
||||||
|
|
||||||
config.h: stamp-h1
|
|
||||||
@if test ! -f $@; then \
|
|
||||||
rm -f stamp-h1; \
|
|
||||||
$(MAKE) stamp-h1; \
|
|
||||||
else :; fi
|
|
||||||
|
|
||||||
stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
|
|
||||||
@rm -f stamp-h1
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
|
||||||
|
|
||||||
$(srcdir)/config.hin: $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
|
||||||
cd $(top_srcdir) && $(AUTOHEADER)
|
|
||||||
touch $(srcdir)/config.hin
|
|
||||||
|
|
||||||
distclean-hdr:
|
|
||||||
-rm -f config.h
|
|
||||||
intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
|
||||||
uninstall-info-am:
|
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
|
||||||
# into them and run `make' without going through this Makefile.
|
|
||||||
# To change the values of `make' variables: instead of editing Makefiles,
|
|
||||||
# (1) if the variable is set in `config.status', edit `config.status'
|
|
||||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
|
||||||
# (2) otherwise, pass the desired values on the `make' command line.
|
|
||||||
$(RECURSIVE_TARGETS):
|
|
||||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
|
||||||
dot_seen=no; \
|
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
|
||||||
if test "$$subdir" = "."; then \
|
|
||||||
dot_seen=yes; \
|
|
||||||
local_target="$$target-am"; \
|
|
||||||
else \
|
|
||||||
local_target="$$target"; \
|
|
||||||
fi; \
|
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|
||||||
done; \
|
|
||||||
if test "$$dot_seen" = "no"; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
|
||||||
fi; test -z "$$fail"
|
|
||||||
|
|
||||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
|
||||||
maintainer-clean-recursive:
|
|
||||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
|
||||||
dot_seen=no; \
|
|
||||||
case "$@" in \
|
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|
||||||
*) list='$(SUBDIRS)' ;; \
|
|
||||||
esac; \
|
|
||||||
rev=''; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = "."; then :; else \
|
|
||||||
rev="$$subdir $$rev"; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
rev="$$rev ."; \
|
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
|
||||||
for subdir in $$rev; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
|
||||||
if test "$$subdir" = "."; then \
|
|
||||||
local_target="$$target-am"; \
|
|
||||||
else \
|
|
||||||
local_target="$$target"; \
|
|
||||||
fi; \
|
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|
||||||
done && test -z "$$fail"
|
|
||||||
tags-recursive:
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
|
||||||
done
|
|
||||||
|
|
||||||
ETAGS = etags
|
|
||||||
ETAGSFLAGS =
|
|
||||||
|
|
||||||
tags: TAGS
|
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | \
|
|
||||||
$(AWK) ' { files[$$0] = 1; } \
|
|
||||||
END { for (i in files) print i; }'`; \
|
|
||||||
mkid -fID $$unique
|
|
||||||
|
|
||||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
|
|
||||||
$(TAGS_FILES) $(LISP)
|
|
||||||
tags=; \
|
|
||||||
here=`pwd`; \
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | \
|
|
||||||
$(AWK) ' { files[$$0] = 1; } \
|
|
||||||
END { for (i in files) print i; }'`; \
|
|
||||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
|
||||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
$$tags $$unique
|
|
||||||
|
|
||||||
GTAGS:
|
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|
||||||
&& cd $(top_srcdir) \
|
|
||||||
&& gtags -i $(GTAGS_ARGS) $$here
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
|
|
||||||
top_distdir = .
|
|
||||||
distdir = $(PACKAGE)-$(VERSION)
|
|
||||||
|
|
||||||
am__remove_distdir = \
|
|
||||||
{ test ! -d $(distdir) \
|
|
||||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
|
||||||
&& rm -fr $(distdir); }; }
|
|
||||||
|
|
||||||
GZIP_ENV = --best
|
|
||||||
distcleancheck_listfiles = find . -type f -print
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
@if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; \
|
|
||||||
then :; else \
|
|
||||||
echo "NEWS not updated; not releasing" 1>&2; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
$(am__remove_distdir)
|
|
||||||
mkdir $(distdir)
|
|
||||||
$(mkinstalldirs) $(distdir)/intl $(distdir)/po $(distdir)/tests
|
|
||||||
@for file in $(DISTFILES); do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
|
||||||
dir="/$$dir"; \
|
|
||||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
|
||||||
else \
|
|
||||||
dir=''; \
|
|
||||||
fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
cp -pR $$d/$$file $(distdir)$$dir \
|
|
||||||
|| exit 1; \
|
|
||||||
else \
|
|
||||||
test -f $(distdir)/$$file \
|
|
||||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
test -d $(distdir)/$$subdir \
|
|
||||||
|| mkdir $(distdir)/$$subdir \
|
|
||||||
|| exit 1; \
|
|
||||||
(cd $$subdir && \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$(top_distdir)" \
|
|
||||||
distdir=../$(distdir)/$$subdir \
|
|
||||||
distdir) \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
|
||||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
|
||||||
|| chmod -R a+r $(distdir)
|
|
||||||
dist-gzip: distdir
|
|
||||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
|
||||||
$(am__remove_distdir)
|
|
||||||
|
|
||||||
dist-bzip2: distdir
|
|
||||||
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
|
|
||||||
$(am__remove_distdir)
|
|
||||||
|
|
||||||
dist dist-all: distdir
|
|
||||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
|
||||||
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
|
|
||||||
$(am__remove_distdir)
|
|
||||||
|
|
||||||
# This target untars the dist file and tries a VPATH configuration. Then
|
|
||||||
# it guarantees that the distribution is self-contained by making another
|
|
||||||
# tarfile.
|
|
||||||
distcheck: dist
|
|
||||||
$(am__remove_distdir)
|
|
||||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
|
||||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
|
||||||
mkdir $(distdir)/=build
|
|
||||||
mkdir $(distdir)/=inst
|
|
||||||
chmod a-w $(distdir)
|
|
||||||
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
|
|
||||||
&& cd $(distdir)/=build \
|
|
||||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
|
||||||
--with-included-gettext \
|
|
||||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
|
||||||
&& (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
|
|
||||||
|| { echo "ERROR: files left after uninstall:" ; \
|
|
||||||
find $$dc_install_base -type f -print ; \
|
|
||||||
exit 1; } >&2 ) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
|
||||||
&& rm -f $(distdir).tar.gz \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
|
||||||
$(am__remove_distdir)
|
|
||||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
|
||||||
sed 'h;s/./=/g;p;x;p;x'
|
|
||||||
distcleancheck: distclean
|
|
||||||
if test '$(srcdir)' = . ; then \
|
|
||||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
|
||||||
exit 1 ; \
|
|
||||||
fi
|
|
||||||
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
|
||||||
|| { echo "ERROR: files left after distclean:" ; \
|
|
||||||
$(distcleancheck_listfiles) ; \
|
|
||||||
exit 1; } >&2
|
|
||||||
check-am: all-am
|
|
||||||
check: check-recursive
|
|
||||||
all-am: Makefile config.h
|
|
||||||
installdirs: installdirs-recursive
|
|
||||||
installdirs-am:
|
|
||||||
|
|
||||||
install: install-recursive
|
|
||||||
install-exec: install-exec-recursive
|
|
||||||
install-data: install-data-recursive
|
|
||||||
uninstall: uninstall-recursive
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-recursive
|
|
||||||
install-strip:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
INSTALL_STRIP_FLAG=-s \
|
|
||||||
`test -z '$(STRIP)' || \
|
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
|
||||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-recursive
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-recursive
|
|
||||||
-rm -f config.status config.cache config.log
|
|
||||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-recursive
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
info: info-recursive
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-info: install-info-recursive
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-recursive
|
|
||||||
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-recursive
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
uninstall-am: uninstall-info-am
|
|
||||||
|
|
||||||
uninstall-info: uninstall-info-recursive
|
|
||||||
|
|
||||||
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
|
|
||||||
clean-generic clean-recursive dist dist-all dist-bzip2 \
|
|
||||||
dist-gzip distcheck distclean distclean-generic distclean-hdr \
|
|
||||||
distclean-recursive distclean-tags distcleancheck distdir dvi \
|
|
||||||
dvi-am dvi-recursive info info-am info-recursive install \
|
|
||||||
install-am install-data install-data-am install-data-recursive \
|
|
||||||
install-exec install-exec-am install-exec-recursive \
|
|
||||||
install-info install-info-am install-info-recursive install-man \
|
|
||||||
install-recursive install-strip installcheck installcheck-am \
|
|
||||||
installdirs installdirs-am installdirs-recursive \
|
|
||||||
maintainer-clean maintainer-clean-generic \
|
|
||||||
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
|
||||||
mostlyclean-recursive tags tags-recursive uninstall \
|
|
||||||
uninstall-am uninstall-info-am uninstall-info-recursive \
|
|
||||||
uninstall-recursive
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
@@ -1,129 +1,7 @@
|
|||||||
Bison News
|
Bison News
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Changes in version 1.34, 2002-03-12:
|
Changes in version 1.29d:
|
||||||
|
|
||||||
* File name clashes are detected
|
|
||||||
$ bison foo.y -d -o foo.x
|
|
||||||
fatal error: header and parser would be both named `foo.x'
|
|
||||||
|
|
||||||
* A missing `;' ending a rule triggers a warning
|
|
||||||
In accordance with POSIX, and in agreement with other
|
|
||||||
Yacc implementations, Bison will mandate this semicolon in a near
|
|
||||||
future. This eases the implementation of a Bison parser of Bison
|
|
||||||
grammars by making this grammar LALR(1) instead of LR(2). To
|
|
||||||
facilitate the transition, this release introduces a warning.
|
|
||||||
|
|
||||||
* Revert the C++ namespace changes introduced in 1.31, as they caused too
|
|
||||||
many portability hassles.
|
|
||||||
|
|
||||||
* DJGPP support added.
|
|
||||||
|
|
||||||
* Fix test suite portability problems.
|
|
||||||
|
|
||||||
Changes in version 1.33, 2002-02-07:
|
|
||||||
|
|
||||||
* Fix C++ issues
|
|
||||||
Groff could not be compiled for the definition of size_t was lacking
|
|
||||||
under some conditions.
|
|
||||||
|
|
||||||
* Catch invalid @n
|
|
||||||
As is done with $n.
|
|
||||||
|
|
||||||
Changes in version 1.32, 2002-01-23:
|
|
||||||
|
|
||||||
* Fix Yacc output file names
|
|
||||||
|
|
||||||
* Portability fixes
|
|
||||||
|
|
||||||
* Italian, Dutch translations
|
|
||||||
|
|
||||||
Changes in version 1.31, 2002-01-14:
|
|
||||||
|
|
||||||
* Many Bug Fixes
|
|
||||||
|
|
||||||
* GNU Gettext and %expect
|
|
||||||
GNU Gettext asserts 10 s/r conflicts, but there are 7. Now that
|
|
||||||
Bison dies on incorrect %expectations, we fear there will be
|
|
||||||
too many bug reports for Gettext, so _for the time being_, %expect
|
|
||||||
does not trigger an error when the input file is named `plural.y'.
|
|
||||||
|
|
||||||
* Use of alloca in parsers
|
|
||||||
If YYSTACK_USE_ALLOCA is defined to 0, then the parsers will use
|
|
||||||
malloc exclusively. Since 1.29, but was not NEWS'ed.
|
|
||||||
|
|
||||||
alloca is used only when compiled with GCC, to avoid portability
|
|
||||||
problems as on AIX.
|
|
||||||
|
|
||||||
* When the generated parser lacks debugging code, YYDEBUG is now 0
|
|
||||||
(as POSIX requires) instead of being undefined.
|
|
||||||
|
|
||||||
* User Actions
|
|
||||||
Bison has always permitted actions such as { $$ = $1 }: it adds the
|
|
||||||
ending semicolon. Now if in Yacc compatibility mode, the semicolon
|
|
||||||
is no longer output: one has to write { $$ = $1; }.
|
|
||||||
|
|
||||||
* Better C++ compliance
|
|
||||||
The output parsers try to respect C++ namespaces.
|
|
||||||
[This turned out to be a failed experiment, and it was reverted later.]
|
|
||||||
|
|
||||||
* Reduced Grammars
|
|
||||||
Fixed bugs when reporting useless nonterminals.
|
|
||||||
|
|
||||||
* 64 bit hosts
|
|
||||||
The parsers work properly on 64 bit hosts.
|
|
||||||
|
|
||||||
* Error messages
|
|
||||||
Some calls to strerror resulted in scrambled or missing error messages.
|
|
||||||
|
|
||||||
* %expect
|
|
||||||
When the number of shift/reduce conflicts is correct, don't issue
|
|
||||||
any warning.
|
|
||||||
|
|
||||||
* The verbose report includes the rule line numbers.
|
|
||||||
|
|
||||||
* Rule line numbers are fixed in traces.
|
|
||||||
|
|
||||||
* Swedish translation
|
|
||||||
|
|
||||||
* Parse errors
|
|
||||||
Verbose parse error messages from the parsers are better looking.
|
|
||||||
Before: parse error: unexpected `'/'', expecting `"number"' or `'-'' or `'(''
|
|
||||||
Now: parse error: unexpected '/', expecting "number" or '-' or '('
|
|
||||||
|
|
||||||
* Fixed parser memory leaks.
|
|
||||||
When the generated parser was using malloc to extend its stacks, the
|
|
||||||
previous allocations were not freed.
|
|
||||||
|
|
||||||
* Fixed verbose output file.
|
|
||||||
Some newlines were missing.
|
|
||||||
Some conflicts in state descriptions were missing.
|
|
||||||
|
|
||||||
* Fixed conflict report.
|
|
||||||
Option -v was needed to get the result.
|
|
||||||
|
|
||||||
* %expect
|
|
||||||
Was not used.
|
|
||||||
Mismatches are errors, not warnings.
|
|
||||||
|
|
||||||
* Fixed incorrect processing of some invalid input.
|
|
||||||
|
|
||||||
* Fixed CPP guards: 9foo.h uses BISON_9FOO_H instead of 9FOO_H.
|
|
||||||
|
|
||||||
* Fixed some typos in the documentation.
|
|
||||||
|
|
||||||
* %token MY_EOF 0 is supported.
|
|
||||||
Before, MY_EOF was silently renumbered as 257.
|
|
||||||
|
|
||||||
* doc/refcard.tex is updated.
|
|
||||||
|
|
||||||
* %output, %file-prefix, %name-prefix.
|
|
||||||
New.
|
|
||||||
|
|
||||||
* --output
|
|
||||||
New, aliasing `--output-file'.
|
|
||||||
|
|
||||||
Changes in version 1.30, 2001-10-26:
|
|
||||||
|
|
||||||
* `--defines' and `--graph' have now an optionnal argument which is the
|
* `--defines' and `--graph' have now an optionnal argument which is the
|
||||||
output file name. `-d' and `-g' do not change, they do not take any
|
output file name. `-d' and `-g' do not change, they do not take any
|
||||||
@@ -132,9 +10,11 @@ Changes in version 1.30, 2001-10-26:
|
|||||||
* `%source_extension' and `%header_extension' are removed, failed
|
* `%source_extension' and `%header_extension' are removed, failed
|
||||||
experiment.
|
experiment.
|
||||||
|
|
||||||
* Portability fixes.
|
* The test suite is more portable.
|
||||||
|
|
||||||
Changes in version 1.29, 2001-09-07:
|
* Better portability.
|
||||||
|
|
||||||
|
Changes in version 1.29:
|
||||||
|
|
||||||
* The output file does not define const, as this caused problems when used
|
* The output file does not define const, as this caused problems when used
|
||||||
with common autoconfiguration schemes. If you still use ancient compilers
|
with common autoconfiguration schemes. If you still use ancient compilers
|
||||||
@@ -165,11 +45,8 @@ Changes in version 1.29, 2001-09-07:
|
|||||||
* New directives.
|
* New directives.
|
||||||
`%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
|
`%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
|
||||||
`%debug', `%source_extension' and `%header_extension'.
|
`%debug', `%source_extension' and `%header_extension'.
|
||||||
|
|
||||||
* @$
|
|
||||||
Automatic location tracking.
|
|
||||||
|
|
||||||
Changes in version 1.28, 1999-07-06:
|
Changes in version 1.28:
|
||||||
|
|
||||||
* Should compile better now with K&R compilers.
|
* Should compile better now with K&R compilers.
|
||||||
|
|
||||||
@@ -201,7 +78,7 @@ Changes in version 1.26:
|
|||||||
* Generated parsers should now work even on operating systems which do
|
* Generated parsers should now work even on operating systems which do
|
||||||
not provide alloca().
|
not provide alloca().
|
||||||
|
|
||||||
Changes in version 1.25, 1995-10-16:
|
Changes in version 1.25:
|
||||||
|
|
||||||
* Errors in the input grammar are not fatal; Bison keeps reading
|
* Errors in the input grammar are not fatal; Bison keeps reading
|
||||||
the grammar file, and reports all the errors found in it.
|
the grammar file, and reports all the errors found in it.
|
||||||
@@ -242,7 +119,3 @@ Changes in version 1.22:
|
|||||||
Changes in version 1.20:
|
Changes in version 1.20:
|
||||||
|
|
||||||
Output file does not redefine const for C++.
|
Output file does not redefine const for C++.
|
||||||
|
|
||||||
Local Variables:
|
|
||||||
mode: outline
|
|
||||||
End:
|
|
||||||
|
|||||||
@@ -1,47 +1,27 @@
|
|||||||
Bison was originally written by Robert Corbett. It would not be what
|
Bison was originally written by Robert Corbett. It would not be what
|
||||||
it is today without the invaluable help of these people:
|
it is today without the invaluable help of these people:
|
||||||
|
|
||||||
Airy Andre Airy.Andre@edf.fr
|
Akim Demaille akim@epita.fr
|
||||||
Akim Demaille [email protected]
|
|
||||||
Albert Chin-A-Young [email protected]
|
Albert Chin-A-Young [email protected]
|
||||||
Alexander Belopolsky [email protected]
|
Alexander Belopolsky [email protected]
|
||||||
Andreas Schwab [email protected]
|
|
||||||
Arnold Robbins [email protected]
|
|
||||||
Bruce Lilly [email protected]
|
|
||||||
Cris van Pelt [email protected]
|
|
||||||
Daniel Hagerty [email protected]
|
Daniel Hagerty [email protected]
|
||||||
David J. MacKenzie [email protected]
|
David J. MacKenzie [email protected]
|
||||||
Dick Streefland [email protected]
|
|
||||||
Enrico Scholz [email protected]
|
|
||||||
Evgeny Stambulchik [email protected]
|
|
||||||
Fabrice Bauzac [email protected]
|
Fabrice Bauzac [email protected]
|
||||||
Florian Krohm [email protected]
|
|
||||||
H. Merijn Brand [email protected]
|
|
||||||
Hans Aberg [email protected]
|
Hans Aberg [email protected]
|
||||||
Jesse Thilo [email protected]
|
Jesse Thilo [email protected]
|
||||||
Jim Meyering [email protected]
|
Jim Meyering [email protected]
|
||||||
Juan Manuel Guerrero [email protected]
|
Juan Manuel Guerrero [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Marc Autret [email protected]
|
Marc Autret [email protected]
|
||||||
Mike Castle [email protected]
|
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
Nelson H. F. Beebe [email protected]
|
|
||||||
Noah Friedman [email protected]
|
Noah Friedman [email protected]
|
||||||
Pascal Bart [email protected]
|
Pascal Bart [email protected]
|
||||||
Paul Eggert [email protected]
|
Paul Eggert [email protected]
|
||||||
Per Allansson [email protected]
|
|
||||||
Peter Hámorský [email protected]
|
|
||||||
Piotr Gackiewicz [email protected]
|
Piotr Gackiewicz [email protected]
|
||||||
Richard Stallman [email protected]
|
Richard Stallman [email protected]
|
||||||
Robert Anisko [email protected]
|
Robert Anisko [email protected]
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
Tom Lane [email protected]
|
|
||||||
Tom Tromey [email protected]
|
|
||||||
Wayne Green [email protected]
|
|
||||||
Wolfram Wagner [email protected]
|
|
||||||
Wwp [email protected]
|
|
||||||
|
|
||||||
Many people are not named here because we lost track of them. We
|
Many people are not named here because we lost track of them. We
|
||||||
thank them! Please, help us keeping this list up to date.
|
thank them! Please, help us keeping this list up to date.
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
-*- outline -*-
|
||||||
|
|
||||||
|
* src/reader.c
|
||||||
|
Complete parse_skel_decl () with parse_dquoted_param (). []
|
||||||
|
Check and cleanup for CPP-out code. []
|
||||||
|
|
||||||
|
* src/output.c
|
||||||
|
Synchronize `#line' directive with user file. [ok]
|
||||||
|
|
||||||
|
Cleanup dirty CPP-out code. []
|
||||||
|
** Output sub-skeleton files. []
|
||||||
|
Useful for %no_parser. []
|
||||||
|
*** New skeleton. []
|
||||||
|
|
||||||
|
* src/getargs.c src/lex.c
|
||||||
|
Synchronize percent and command line options. [ok]
|
||||||
|
|
||||||
|
* src/macrotab.[ch]
|
||||||
|
Removing warnings when compiling. (gcc-warnings). [ok]
|
||||||
|
|
||||||
|
* src/print_graph.c
|
||||||
|
Find the best graph parameters. []
|
||||||
|
|
||||||
|
* doc/bison.texinfo
|
||||||
|
Echo modifications of prologue and epilogue. []
|
||||||
|
Add informations about YYERROR_VERBOSE. []
|
||||||
|
Add explainations about skeleton muscles. []
|
||||||
|
Add explainations about %skeleton. []
|
||||||
Vendored
-1820
File diff suppressed because it is too large
Load Diff
-320
@@ -1,320 +0,0 @@
|
|||||||
/* config.hin. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
|
||||||
systems. This function is required for `alloca.c' support on those systems.
|
|
||||||
*/
|
|
||||||
#undef CRAY_STACKSEG_END
|
|
||||||
|
|
||||||
/* Define to 1 if using `alloca.c'. */
|
|
||||||
#undef C_ALLOCA
|
|
||||||
|
|
||||||
/* Define to 1 if translation of program messages to the user's native
|
|
||||||
language is requested. */
|
|
||||||
#undef ENABLE_NLS
|
|
||||||
|
|
||||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
|
||||||
#undef HAVE_ALLOCA
|
|
||||||
|
|
||||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
|
||||||
*/
|
|
||||||
#undef HAVE_ALLOCA_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <argz.h> header file. */
|
|
||||||
#undef HAVE_ARGZ_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <ctype.h> header file. */
|
|
||||||
#undef HAVE_CTYPE_H
|
|
||||||
|
|
||||||
/* Define if backslash-a works in C strings. */
|
|
||||||
#undef HAVE_C_BACKSLASH_A
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `dcgettext' function. */
|
|
||||||
#undef HAVE_DCGETTEXT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `memchr', and to 0 if you don't.
|
|
||||||
*/
|
|
||||||
#undef HAVE_DECL_MEMCHR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_MEMRCHR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
|
|
||||||
*/
|
|
||||||
#undef HAVE_DECL_STPCPY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strchr', and to 0 if you don't.
|
|
||||||
*/
|
|
||||||
#undef HAVE_DECL_STRCHR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strerror', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_STRERROR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_STRERROR_R
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
|
|
||||||
don't. */
|
|
||||||
#undef HAVE_DECL_STRNLEN
|
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `strspn', and to 0 if you don't.
|
|
||||||
*/
|
|
||||||
#undef HAVE_DECL_STRSPN
|
|
||||||
|
|
||||||
/* Define if the malloc check has been performed. */
|
|
||||||
#undef HAVE_DONE_WORKING_MALLOC_CHECK
|
|
||||||
|
|
||||||
/* Define if the realloc check has been performed. */
|
|
||||||
#undef HAVE_DONE_WORKING_REALLOC_CHECK
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `doprnt' function. */
|
|
||||||
#undef HAVE_DOPRNT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `feof_unlocked' function. */
|
|
||||||
#undef HAVE_FEOF_UNLOCKED
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `fgets_unlocked' function. */
|
|
||||||
#undef HAVE_FGETS_UNLOCKED
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getcwd' function. */
|
|
||||||
#undef HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getegid' function. */
|
|
||||||
#undef HAVE_GETEGID
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `geteuid' function. */
|
|
||||||
#undef HAVE_GETEUID
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getgid' function. */
|
|
||||||
#undef HAVE_GETGID
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getpagesize' function. */
|
|
||||||
#undef HAVE_GETPAGESIZE
|
|
||||||
|
|
||||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
|
||||||
#undef HAVE_GETTEXT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getuid' function. */
|
|
||||||
#undef HAVE_GETUID
|
|
||||||
|
|
||||||
/* Define if you have the iconv() function. */
|
|
||||||
#undef HAVE_ICONV
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `isascii' function. */
|
|
||||||
#undef HAVE_ISASCII
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `iswprint' function. */
|
|
||||||
#undef HAVE_ISWPRINT
|
|
||||||
|
|
||||||
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
|
||||||
#undef HAVE_LANGINFO_CODESET
|
|
||||||
|
|
||||||
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
|
||||||
#undef HAVE_LC_MESSAGES
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <limits.h> header file. */
|
|
||||||
#undef HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <locale.h> header file. */
|
|
||||||
#undef HAVE_LOCALE_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <malloc.h> header file. */
|
|
||||||
#undef HAVE_MALLOC_H
|
|
||||||
|
|
||||||
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
|
|
||||||
#undef HAVE_MBRTOWC
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `mbsinit' function. */
|
|
||||||
#undef HAVE_MBSINIT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `memchr' function. */
|
|
||||||
#undef HAVE_MEMCHR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `mempcpy' function. */
|
|
||||||
#undef HAVE_MEMPCPY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `memrchr' function. */
|
|
||||||
#undef HAVE_MEMRCHR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `mkstemp' function. */
|
|
||||||
#undef HAVE_MKSTEMP
|
|
||||||
|
|
||||||
/* Define to 1 if you have a working `mmap' system call. */
|
|
||||||
#undef HAVE_MMAP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `munmap' function. */
|
|
||||||
#undef HAVE_MUNMAP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <nl_types.h> header file. */
|
|
||||||
#undef HAVE_NL_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if libc includes obstacks. */
|
|
||||||
#undef HAVE_OBSTACK
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `putenv' function. */
|
|
||||||
#undef HAVE_PUTENV
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `setenv' function. */
|
|
||||||
#undef HAVE_SETENV
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `setlocale' function. */
|
|
||||||
#undef HAVE_SETLOCALE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stddef.h> header file. */
|
|
||||||
#undef HAVE_STDDEF_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `stpcpy' function. */
|
|
||||||
#undef HAVE_STPCPY
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strcasecmp' function. */
|
|
||||||
#undef HAVE_STRCASECMP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strchr' function. */
|
|
||||||
#undef HAVE_STRCHR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strdup' function. */
|
|
||||||
#undef HAVE_STRDUP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strerror' function. */
|
|
||||||
#undef HAVE_STRERROR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strerror_r' function. */
|
|
||||||
#undef HAVE_STRERROR_R
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strspn' function. */
|
|
||||||
#undef HAVE_STRSPN
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `strtoul' function. */
|
|
||||||
#undef HAVE_STRTOUL
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
|
||||||
#undef HAVE_SYS_PARAM_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `tsearch' function. */
|
|
||||||
#undef HAVE_TSEARCH
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `vprintf' function. */
|
|
||||||
#undef HAVE_VPRINTF
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <wchar.h> header file. */
|
|
||||||
#undef HAVE_WCHAR_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <wctype.h> header file. */
|
|
||||||
#undef HAVE_WCTYPE_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `__argz_count' function. */
|
|
||||||
#undef HAVE___ARGZ_COUNT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `__argz_next' function. */
|
|
||||||
#undef HAVE___ARGZ_NEXT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `__argz_stringify' function. */
|
|
||||||
#undef HAVE___ARGZ_STRINGIFY
|
|
||||||
|
|
||||||
/* Define as const if the declaration of iconv() needs const. */
|
|
||||||
#undef ICONV_CONST
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Define if compiler has function prototypes */
|
|
||||||
#undef PROTOTYPES
|
|
||||||
|
|
||||||
/* If using the C implementation of alloca, define if you know the
|
|
||||||
direction of stack growth for your system; otherwise it will be
|
|
||||||
automatically deduced at run-time.
|
|
||||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
|
||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
|
||||||
#undef STACK_DIRECTION
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Define to 1 if strerror_r returns char *. */
|
|
||||||
#undef STRERROR_R_CHAR_P
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
||||||
|
|
||||||
/* Define if using the dmalloc debugging malloc package */
|
|
||||||
#undef WITH_DMALLOC
|
|
||||||
|
|
||||||
/* Define to 1 for GNU C library extensions. */
|
|
||||||
#undef _GNU_SOURCE
|
|
||||||
|
|
||||||
/* Define to 1 if on MINIX. */
|
|
||||||
#undef _MINIX
|
|
||||||
|
|
||||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
|
||||||
this defined. */
|
|
||||||
#undef _POSIX_1_SOURCE
|
|
||||||
|
|
||||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
|
||||||
#undef _POSIX_SOURCE
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
#undef const
|
|
||||||
|
|
||||||
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
|
||||||
if it is not supported. */
|
|
||||||
#undef inline
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
#undef malloc
|
|
||||||
|
|
||||||
/* Define to a type if <wchar.h> does not define. */
|
|
||||||
#undef mbstate_t
|
|
||||||
|
|
||||||
/* Define to `long' if <sys/types.h> does not define. */
|
|
||||||
#undef off_t
|
|
||||||
|
|
||||||
/* Define to rpl_realloc if the replacement function should be used. */
|
|
||||||
#undef realloc
|
|
||||||
|
|
||||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
|
||||||
#undef size_t
|
|
||||||
@@ -1,225 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.5c from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
|
|
||||||
srcdir = @srcdir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
|
|
||||||
bindir = @bindir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
datadir = @datadir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
libdir = @libdir@
|
|
||||||
infodir = @infodir@
|
|
||||||
mandir = @mandir@
|
|
||||||
includedir = @includedir@
|
|
||||||
oldincludedir = /usr/include
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
top_builddir = ..
|
|
||||||
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = @program_transform_name@
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_triplet = @host@
|
|
||||||
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AUTOM4TE = @AUTOM4TE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
|
||||||
CATALOGS = @CATALOGS@
|
|
||||||
CATOBJEXT = @CATOBJEXT@
|
|
||||||
CC = @CC@
|
|
||||||
CPP = @CPP@
|
|
||||||
DATADIRNAME = @DATADIRNAME@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
GCC = @GCC@
|
|
||||||
GENCAT = @GENCAT@
|
|
||||||
GLIBC21 = @GLIBC21@
|
|
||||||
GMOFILES = @GMOFILES@
|
|
||||||
GMSGFMT = @GMSGFMT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
INSTOBJEXT = @INSTOBJEXT@
|
|
||||||
INTLBISON = @INTLBISON@
|
|
||||||
INTLLIBS = @INTLLIBS@
|
|
||||||
INTLOBJS = @INTLOBJS@
|
|
||||||
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
|
||||||
LIB = @LIB@
|
|
||||||
LIBICONV = @LIBICONV@
|
|
||||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
||||||
MSGFMT = @MSGFMT@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
POFILES = @POFILES@
|
|
||||||
POSUB = @POSUB@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
U = @U@
|
|
||||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
|
||||||
USE_NLS = @USE_NLS@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
|
||||||
WERROR_CFLAGS = @WERROR_CFLAGS@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
EXTRA_DIST = move-if-change prev-version.txt
|
|
||||||
subdir = config
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
DIST_COMMON = Makefile.am Makefile.in config.guess config.sub depcomp \
|
|
||||||
install-sh mdate-sh missing mkinstalldirs texinfo.tex
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
|
||||||
cd $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu config/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
|
||||||
uninstall-info-am:
|
|
||||||
tags: TAGS
|
|
||||||
TAGS:
|
|
||||||
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
|
|
||||||
top_distdir = ..
|
|
||||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
@for file in $(DISTFILES); do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
|
||||||
dir="/$$dir"; \
|
|
||||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
|
||||||
else \
|
|
||||||
dir=''; \
|
|
||||||
fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
cp -pR $$d/$$file $(distdir)$$dir \
|
|
||||||
|| exit 1; \
|
|
||||||
else \
|
|
||||||
test -f $(distdir)/$$file \
|
|
||||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile
|
|
||||||
|
|
||||||
installdirs:
|
|
||||||
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
INSTALL_STRIP_FLAG=-s \
|
|
||||||
`test -z '$(STRIP)' || \
|
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
uninstall-am: uninstall-info-am
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
|
||||||
distclean-generic distdir dvi dvi-am info info-am install \
|
|
||||||
install-am install-data install-data-am install-exec \
|
|
||||||
install-exec-am install-info install-info-am install-man \
|
|
||||||
install-strip installcheck installcheck-am installdirs \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic uninstall uninstall-am uninstall-info-am
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
Vendored
-1321
File diff suppressed because it is too large
Load Diff
Vendored
-1443
File diff suppressed because it is too large
Load Diff
+3
-28
@@ -31,16 +31,7 @@ if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
|||||||
fi
|
fi
|
||||||
# `libtool' can also be set to `yes' or `no'.
|
# `libtool' can also be set to `yes' or `no'.
|
||||||
|
|
||||||
if test -z "$depfile"; then
|
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
||||||
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
|
|
||||||
dir=`echo "$object" | sed 's,/.*$,/,'`
|
|
||||||
if test "$dir" = "$object"; then
|
|
||||||
dir=
|
|
||||||
fi
|
|
||||||
# FIXME: should be _deps on DOS.
|
|
||||||
depfile="$dir.deps/$base"
|
|
||||||
fi
|
|
||||||
|
|
||||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||||
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
@@ -213,9 +204,8 @@ tru64)
|
|||||||
# dependencies in `foo.d' instead, so we check for that too.
|
# dependencies in `foo.d' instead, so we check for that too.
|
||||||
# Subdirectories are respected.
|
# Subdirectories are respected.
|
||||||
|
|
||||||
base=`echo "$object" | sed -e 's/\.o$/.d/' -e 's/\.lo$/.d/'`
|
tmpdepfile1="$object.d"
|
||||||
tmpdepfile1="$base.o.d"
|
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
||||||
tmpdepfile2="$base.d"
|
|
||||||
if test "$libtool" = yes; then
|
if test "$libtool" = yes; then
|
||||||
"$@" -Wc,-MD
|
"$@" -Wc,-MD
|
||||||
else
|
else
|
||||||
@@ -392,21 +382,6 @@ msvisualcpp)
|
|||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
for arg
|
|
||||||
do
|
|
||||||
case "$arg" in
|
|
||||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
|
||||||
set fnord "$@"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
"$@" -E |
|
"$@" -E |
|
||||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||||
) &
|
) &
|
||||||
|
|||||||
+1
-6
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Get modification time of a file or directory and pretty-print it.
|
# Get modification time of a file or directory and pretty-print it.
|
||||||
# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
|
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
# written by Ulrich Drepper <[email protected]>, June 1995
|
# written by Ulrich Drepper <[email protected]>, June 1995
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
@@ -17,11 +17,6 @@
|
|||||||
# along with this program; if not, write to the Free Software Foundation,
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# Prevent date giving response in another language.
|
# Prevent date giving response in another language.
|
||||||
LANG=C
|
LANG=C
|
||||||
export LANG
|
export LANG
|
||||||
|
|||||||
-336
@@ -1,336 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Common stub for a few missing GNU programs while installing.
|
|
||||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
|
||||||
# Originally by Fran,cois Pinard <[email protected]>, 1996.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
echo 1>&2 "Try \`$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
run=:
|
|
||||||
|
|
||||||
# In the cases where this matters, `missing' is being run in the
|
|
||||||
# srcdir already.
|
|
||||||
if test -f configure.ac; then
|
|
||||||
configure_ac=configure.ac
|
|
||||||
else
|
|
||||||
configure_ac=configure.in
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
--run)
|
|
||||||
# Try to run requested program, and just exit if it succeeds.
|
|
||||||
run=
|
|
||||||
shift
|
|
||||||
"$@" && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# If it does not exist, or fails to run (possibly an outdated version),
|
|
||||||
# try to emulate it.
|
|
||||||
case "$1" in
|
|
||||||
|
|
||||||
-h|--h|--he|--hel|--help)
|
|
||||||
echo "\
|
|
||||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
|
||||||
|
|
||||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
|
||||||
error status if there is no known handling for PROGRAM.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-h, --help display this help and exit
|
|
||||||
-v, --version output version information and exit
|
|
||||||
--run try to run the given command, and emulate it if it fails
|
|
||||||
|
|
||||||
Supported PROGRAM values:
|
|
||||||
aclocal touch file \`aclocal.m4'
|
|
||||||
autoconf touch file \`configure'
|
|
||||||
autoheader touch file \`config.h.in'
|
|
||||||
automake touch all \`Makefile.in' files
|
|
||||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
|
||||||
flex create \`lex.yy.c', if possible, from existing .c
|
|
||||||
help2man touch the output file
|
|
||||||
lex create \`lex.yy.c', if possible, from existing .c
|
|
||||||
makeinfo touch the output file
|
|
||||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
|
||||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
|
||||||
echo "missing 0.4 - GNU automake"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-*)
|
|
||||||
echo 1>&2 "$0: Unknown \`$1' option"
|
|
||||||
echo 1>&2 "Try \`$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
aclocal*)
|
|
||||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
|
||||||
# We have it, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
|
||||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
|
||||||
any GNU archive site."
|
|
||||||
touch aclocal.m4
|
|
||||||
;;
|
|
||||||
|
|
||||||
autoconf)
|
|
||||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
|
||||||
# We have it, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`${configure_ac}'. You might want to install the
|
|
||||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
|
||||||
archive site."
|
|
||||||
touch configure
|
|
||||||
;;
|
|
||||||
|
|
||||||
autoheader)
|
|
||||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
|
||||||
# We have it, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
|
||||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
|
||||||
from any GNU archive site."
|
|
||||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
|
||||||
test -z "$files" && files="config.h"
|
|
||||||
touch_files=
|
|
||||||
for f in $files; do
|
|
||||||
case "$f" in
|
|
||||||
*:*) touch_files="$touch_files "`echo "$f" |
|
|
||||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
|
||||||
*) touch_files="$touch_files $f.in";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
touch $touch_files
|
|
||||||
;;
|
|
||||||
|
|
||||||
automake*)
|
|
||||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
|
||||||
# We have it, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
|
||||||
You might want to install the \`Automake' and \`Perl' packages.
|
|
||||||
Grab them from any GNU archive site."
|
|
||||||
find . -type f -name Makefile.am -print |
|
|
||||||
sed 's/\.am$/.in/' |
|
|
||||||
while read f; do touch "$f"; done
|
|
||||||
;;
|
|
||||||
|
|
||||||
autom4te)
|
|
||||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
|
||||||
# We have it, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
|
||||||
system. You might have modified some files without having the
|
|
||||||
proper tools for further handling them.
|
|
||||||
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
|
|
||||||
archive site."
|
|
||||||
|
|
||||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
|
||||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
|
||||||
if test -f "$file"; then
|
|
||||||
touch $file
|
|
||||||
else
|
|
||||||
test -z "$file" || exec >$file
|
|
||||||
echo "#! /bin/sh"
|
|
||||||
echo "# Created by GNU Automake missing as a replacement of"
|
|
||||||
echo "# $ $@"
|
|
||||||
echo "exit 0"
|
|
||||||
chmod +x $file
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
bison|yacc)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.y' file. You may need the \`Bison' package
|
|
||||||
in order for those modifications to take effect. You can get
|
|
||||||
\`Bison' from any GNU archive site."
|
|
||||||
rm -f y.tab.c y.tab.h
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
eval LASTARG="\${$#}"
|
|
||||||
case "$LASTARG" in
|
|
||||||
*.y)
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" y.tab.c
|
|
||||||
fi
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" y.tab.h
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [ ! -f y.tab.h ]; then
|
|
||||||
echo >y.tab.h
|
|
||||||
fi
|
|
||||||
if [ ! -f y.tab.c ]; then
|
|
||||||
echo 'main() { return 0; }' >y.tab.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
lex|flex)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.l' file. You may need the \`Flex' package
|
|
||||||
in order for those modifications to take effect. You can get
|
|
||||||
\`Flex' from any GNU archive site."
|
|
||||||
rm -f lex.yy.c
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
eval LASTARG="\${$#}"
|
|
||||||
case "$LASTARG" in
|
|
||||||
*.l)
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" lex.yy.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [ ! -f lex.yy.c ]; then
|
|
||||||
echo 'main() { return 0; }' >lex.yy.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
help2man)
|
|
||||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
|
||||||
# We have it, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a dependency of a manual page. You may need the
|
|
||||||
\`Help2man' package in order for those modifications to take
|
|
||||||
effect. You can get \`Help2man' from any GNU archive site."
|
|
||||||
|
|
||||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
|
||||||
if test -z "$file"; then
|
|
||||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
|
||||||
fi
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
touch $file
|
|
||||||
else
|
|
||||||
test -z "$file" || exec >$file
|
|
||||||
echo ".ab help2man is required to generate this page"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
makeinfo)
|
|
||||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
|
||||||
# We have makeinfo, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
|
||||||
indirectly affecting the aspect of the manual. The spurious
|
|
||||||
call might also be the consequence of using a buggy \`make' (AIX,
|
|
||||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
|
||||||
the \`GNU make' package. Grab either from any GNU archive site."
|
|
||||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
|
||||||
if test -z "$file"; then
|
|
||||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
|
||||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
|
||||||
fi
|
|
||||||
touch $file
|
|
||||||
;;
|
|
||||||
|
|
||||||
tar)
|
|
||||||
shift
|
|
||||||
if test -n "$run"; then
|
|
||||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We have already tried tar in the generic part.
|
|
||||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
|
||||||
# messages.
|
|
||||||
if (gnutar --version > /dev/null 2>&1); then
|
|
||||||
gnutar ${1+"$@"} && exit 0
|
|
||||||
fi
|
|
||||||
if (gtar --version > /dev/null 2>&1); then
|
|
||||||
gtar ${1+"$@"} && exit 0
|
|
||||||
fi
|
|
||||||
firstarg="$1"
|
|
||||||
if shift; then
|
|
||||||
case "$firstarg" in
|
|
||||||
*o*)
|
|
||||||
firstarg=`echo "$firstarg" | sed s/o//`
|
|
||||||
tar "$firstarg" ${1+"$@"} && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case "$firstarg" in
|
|
||||||
*h*)
|
|
||||||
firstarg=`echo "$firstarg" | sed s/h//`
|
|
||||||
tar "$firstarg" ${1+"$@"} && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
|
||||||
You may want to install GNU tar or Free paxutils, or check the
|
|
||||||
command line arguments."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
|
||||||
system. You might have modified some files without having the
|
|
||||||
proper tools for further handling them. Check the \`README' file,
|
|
||||||
it often tells you about the needed prerequirements for installing
|
|
||||||
this package. You may also peek at any GNU archive site, in case
|
|
||||||
some other package would contain this missing \`$1' program."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# mkinstalldirs --- make directory hierarchy
|
|
||||||
# Author: Noah Friedman <[email protected]>
|
|
||||||
# Created: 1993-05-16
|
|
||||||
# Public domain
|
|
||||||
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
errstatus=0
|
|
||||||
dirmode=""
|
|
||||||
|
|
||||||
usage="\
|
|
||||||
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
|
|
||||||
|
|
||||||
# process command line arguments
|
|
||||||
while test $# -gt 0 ; do
|
|
||||||
case "${1}" in
|
|
||||||
-h | --help | --h* ) # -h for help
|
|
||||||
echo "${usage}" 1>&2; exit 0 ;;
|
|
||||||
-m ) # -m PERM arg
|
|
||||||
shift
|
|
||||||
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
|
|
||||||
dirmode="${1}"
|
|
||||||
shift ;;
|
|
||||||
-- ) shift; break ;; # stop option processing
|
|
||||||
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
|
|
||||||
* ) break ;; # first non-opt arg
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
for file
|
|
||||||
do
|
|
||||||
if test -d "$file"; then
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
case $# in
|
|
||||||
0) exit 0 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case $dirmode in
|
|
||||||
'')
|
|
||||||
if mkdir -p -- . 2>/dev/null; then
|
|
||||||
echo "mkdir -p -- $*"
|
|
||||||
exec mkdir -p -- "$@"
|
|
||||||
fi ;;
|
|
||||||
*)
|
|
||||||
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
|
|
||||||
echo "mkdir -m $dirmode -p -- $*"
|
|
||||||
exec mkdir -m "$dirmode" -p -- "$@"
|
|
||||||
fi ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
for file
|
|
||||||
do
|
|
||||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
|
||||||
shift
|
|
||||||
|
|
||||||
pathcomp=
|
|
||||||
for d
|
|
||||||
do
|
|
||||||
pathcomp="$pathcomp$d"
|
|
||||||
case "$pathcomp" in
|
|
||||||
-* ) pathcomp=./$pathcomp ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test ! -d "$pathcomp"; then
|
|
||||||
echo "mkdir $pathcomp"
|
|
||||||
|
|
||||||
mkdir "$pathcomp" || lasterr=$?
|
|
||||||
|
|
||||||
if test ! -d "$pathcomp"; then
|
|
||||||
errstatus=$lasterr
|
|
||||||
else
|
|
||||||
if test ! -z "$dirmode"; then
|
|
||||||
echo "chmod $dirmode $pathcomp"
|
|
||||||
|
|
||||||
lasterr=""
|
|
||||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
|
||||||
|
|
||||||
if test ! -z "$lasterr"; then
|
|
||||||
errstatus=$lasterr
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
pathcomp="$pathcomp/"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $errstatus
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 3
|
|
||||||
# End:
|
|
||||||
# mkinstalldirs ends here
|
|
||||||
@@ -1 +1 @@
|
|||||||
1.33b
|
1.29c
|
||||||
|
|||||||
+213
-270
@@ -3,10 +3,10 @@
|
|||||||
% Load plain if necessary, i.e., if running under initex.
|
% Load plain if necessary, i.e., if running under initex.
|
||||||
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
||||||
%
|
%
|
||||||
\def\texinfoversion{2002-03-11.08}
|
\def\texinfoversion{2001-07-25.07}
|
||||||
%
|
%
|
||||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
|
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
|
||||||
% 2000, 01, 02 Free Software Foundation, Inc.
|
% 2000, 01 Free Software Foundation, Inc.
|
||||||
%
|
%
|
||||||
% This texinfo.tex file is free software; you can redistribute it and/or
|
% This texinfo.tex file is free software; you can redistribute it and/or
|
||||||
% modify it under the terms of the GNU General Public License as
|
% modify it under the terms of the GNU General Public License as
|
||||||
@@ -30,17 +30,14 @@
|
|||||||
% Please try the latest version of texinfo.tex before submitting bug
|
% Please try the latest version of texinfo.tex before submitting bug
|
||||||
% reports; you can get the latest version from:
|
% reports; you can get the latest version from:
|
||||||
% ftp://ftp.gnu.org/gnu/texinfo.tex
|
% ftp://ftp.gnu.org/gnu/texinfo.tex
|
||||||
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
|
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
|
||||||
% ftp://texinfo.org/texinfo/texinfo.tex
|
% ftp://texinfo.org/tex/texinfo.tex
|
||||||
% ftp://tug.org/tex/texinfo.tex
|
% ftp://us.ctan.org/macros/texinfo/texinfo.tex
|
||||||
% (and all CTAN mirrors, see http://www.ctan.org),
|
% (and all CTAN mirrors, finger [email protected] for a list).
|
||||||
% and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
|
% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
|
||||||
%
|
|
||||||
% The texinfo.tex in any given Texinfo distribution could well be out
|
% The texinfo.tex in any given Texinfo distribution could well be out
|
||||||
% of date, so if that's what you're using, please check.
|
% of date, so if that's what you're using, please check.
|
||||||
%
|
% Texinfo has a small home page at http://texinfo.org/.
|
||||||
% Texinfo has a small home page at http://texinfo.org/ and also
|
|
||||||
% http://www.gnu.org/software/texinfo.
|
|
||||||
%
|
%
|
||||||
% Send bug reports to [email protected]. Please include including a
|
% Send bug reports to [email protected]. Please include including a
|
||||||
% complete document in each bug report with which we can reproduce the
|
% complete document in each bug report with which we can reproduce the
|
||||||
@@ -54,12 +51,12 @@
|
|||||||
% tex foo.texi
|
% tex foo.texi
|
||||||
% tex foo.texi
|
% tex foo.texi
|
||||||
% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
|
% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
|
||||||
% The extra TeX runs get the cross-reference information correct.
|
% The extra runs of TeX get the cross-reference information correct.
|
||||||
% Sometimes one run after texindex suffices, and sometimes you need more
|
% Sometimes one run after texindex suffices, and sometimes you need more
|
||||||
% than two; texi2dvi does it as many times as necessary.
|
% than two; texi2dvi does it as many times as necessary.
|
||||||
%
|
%
|
||||||
% It is possible to adapt texinfo.tex for other languages. You can get
|
% It is possible to adapt texinfo.tex for other languages. You can get
|
||||||
% the existing language-specific files from the full Texinfo distribution.
|
% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
|
||||||
|
|
||||||
\message{Loading texinfo [version \texinfoversion]:}
|
\message{Loading texinfo [version \texinfoversion]:}
|
||||||
|
|
||||||
@@ -836,43 +833,18 @@ where each line of input produces a line of output.}
|
|||||||
%
|
%
|
||||||
\def\asis#1{#1}
|
\def\asis#1{#1}
|
||||||
|
|
||||||
% @math outputs its argument in math mode.
|
% @math means output in math mode.
|
||||||
% We don't use $'s directly in the definition of \math because we need
|
% We don't use $'s directly in the definition of \math because control
|
||||||
% to set catcodes according to plain TeX first, to allow for subscripts,
|
% sequences like \math are expanded when the toc file is written. Then,
|
||||||
% superscripts, special math chars, etc.
|
% we read the toc file back, the $'s will be normal characters (as they
|
||||||
|
% should be, according to the definition of Texinfo). So we must use a
|
||||||
|
% control sequence to switch into and out of math mode.
|
||||||
%
|
%
|
||||||
% @math does not do math typesetting in section titles, index
|
% This isn't quite enough for @math to work properly in indices, but it
|
||||||
% entries, and other such contexts where the catcodes are set before
|
% seems unlikely it will ever be needed there.
|
||||||
% @math gets a chance to work. This could perhaps be fixed, but for now
|
|
||||||
% at least we can have real math in the main text, where it's needed most.
|
|
||||||
%
|
%
|
||||||
\let\implicitmath = $%$ font-lock fix
|
\let\implicitmath = $
|
||||||
%
|
\def\math#1{\implicitmath #1\implicitmath}
|
||||||
% One complication: _ usually means subscripts, but it could also mean
|
|
||||||
% an actual _ character, as in @math{@var{some_variable} + 1}. So make
|
|
||||||
% _ within @math be active (mathcode "8000), and distinguish by seeing
|
|
||||||
% if the current family is \slfam, which is what @var uses.
|
|
||||||
%
|
|
||||||
{\catcode95 = \active % 95 = _
|
|
||||||
\gdef\mathunderscore{%
|
|
||||||
\catcode95=\active
|
|
||||||
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
|
|
||||||
}}
|
|
||||||
%
|
|
||||||
% Another complication: we want \\ (and @\) to output a \ character.
|
|
||||||
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
|
|
||||||
% this is not advertised and we don't care. Texinfo does not
|
|
||||||
% otherwise define @\.
|
|
||||||
%
|
|
||||||
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
|
|
||||||
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
|
|
||||||
%
|
|
||||||
\def\math{%
|
|
||||||
\tex
|
|
||||||
\mathcode`\_="8000 \mathunderscore
|
|
||||||
\let\\ = \mathbackslash
|
|
||||||
\implicitmath\finishmath}
|
|
||||||
\def\finishmath#1{#1\implicitmath\Etex}
|
|
||||||
|
|
||||||
% @bullet and @minus need the same treatment as @math, just above.
|
% @bullet and @minus need the same treatment as @math, just above.
|
||||||
\def\bullet{\implicitmath\ptexbullet\implicitmath}
|
\def\bullet{\implicitmath\ptexbullet\implicitmath}
|
||||||
@@ -955,12 +927,10 @@ where each line of input produces a line of output.}
|
|||||||
\def\dopdfimage#1#2#3{%
|
\def\dopdfimage#1#2#3{%
|
||||||
\def\imagewidth{#2}%
|
\def\imagewidth{#2}%
|
||||||
\def\imageheight{#3}%
|
\def\imageheight{#3}%
|
||||||
% without \immediate, pdftex seg faults when the same image is
|
|
||||||
% included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
|
|
||||||
\ifnum\pdftexversion < 14
|
\ifnum\pdftexversion < 14
|
||||||
\immediate\pdfimage
|
\pdfimage
|
||||||
\else
|
\else
|
||||||
\immediate\pdfximage
|
\pdfximage
|
||||||
\fi
|
\fi
|
||||||
\ifx\empty\imagewidth\else width \imagewidth \fi
|
\ifx\empty\imagewidth\else width \imagewidth \fi
|
||||||
\ifx\empty\imageheight\else height \imageheight \fi
|
\ifx\empty\imageheight\else height \imageheight \fi
|
||||||
@@ -973,7 +943,7 @@ where each line of input produces a line of output.}
|
|||||||
\pdfrefximage \pdflastximage
|
\pdfrefximage \pdflastximage
|
||||||
\fi}
|
\fi}
|
||||||
\def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
|
\def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
|
||||||
\def\pdfmkpgn#1{#1}
|
\def\pdfmkpgn#1{#1@}
|
||||||
\let\linkcolor = \Blue % was Cyan, but that seems light?
|
\let\linkcolor = \Blue % was Cyan, but that seems light?
|
||||||
\def\endlink{\Black\pdfendlink}
|
\def\endlink{\Black\pdfendlink}
|
||||||
% Adding outlines to PDF; macros for calculating structure of outlines
|
% Adding outlines to PDF; macros for calculating structure of outlines
|
||||||
@@ -985,7 +955,7 @@ where each line of input produces a line of output.}
|
|||||||
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
|
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
|
||||||
\def\pdfmakeoutlines{{%
|
\def\pdfmakeoutlines{{%
|
||||||
\openin 1 \jobname.toc
|
\openin 1 \jobname.toc
|
||||||
\ifeof 1\else\begingroup
|
\ifeof 1\else\bgroup
|
||||||
\closein 1
|
\closein 1
|
||||||
\indexnofonts
|
\indexnofonts
|
||||||
\def\tt{}
|
\def\tt{}
|
||||||
@@ -995,34 +965,32 @@ where each line of input produces a line of output.}
|
|||||||
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
|
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
|
||||||
%
|
%
|
||||||
\def\chapentry ##1##2##3{}
|
\def\chapentry ##1##2##3{}
|
||||||
\let\appendixentry = \chapentry
|
|
||||||
\def\unnumbchapentry ##1##2{}
|
\def\unnumbchapentry ##1##2{}
|
||||||
\def\secentry ##1##2##3##4{\advancenumber{chap##2}}
|
\def\secentry ##1##2##3##4{\advancenumber{chap##2}}
|
||||||
\def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}}
|
\def\unnumbsecentry ##1##2{}
|
||||||
\def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
|
\def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
|
||||||
\def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}}
|
\def\unnumbsubsecentry ##1##2{}
|
||||||
\def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
|
\def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
|
||||||
\def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}}
|
\def\unnumbsubsubsecentry ##1##2{}
|
||||||
\input \jobname.toc
|
\input \jobname.toc
|
||||||
\def\chapentry ##1##2##3{%
|
\def\chapentry ##1##2##3{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
|
||||||
\let\appendixentry = \chapentry
|
|
||||||
\def\unnumbchapentry ##1##2{%
|
\def\unnumbchapentry ##1##2{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
|
||||||
\def\secentry ##1##2##3##4{%
|
\def\secentry ##1##2##3##4{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
|
||||||
\def\unnumbsecentry ##1##2##3{%
|
\def\unnumbsecentry ##1##2{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##3}}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
|
||||||
\def\subsecentry ##1##2##3##4##5{%
|
\def\subsecentry ##1##2##3##4##5{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
|
||||||
\def\unnumbsubsecentry ##1##2##3##4{%
|
\def\unnumbsubsecentry ##1##2{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##4}}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
|
||||||
\def\subsubsecentry ##1##2##3##4##5##6{%
|
\def\subsubsecentry ##1##2##3##4##5##6{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
|
||||||
\def\unnumbsubsubsecentry ##1##2##3##4##5{%
|
\def\unnumbsubsubsecentry ##1##2{%
|
||||||
\pdfoutline goto name{\pdfmkpgn{##5}}{##1}}
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
|
||||||
\input \jobname.toc
|
\input \jobname.toc
|
||||||
\endgroup\fi
|
\egroup\fi
|
||||||
}}
|
}}
|
||||||
\def\makelinks #1,{%
|
\def\makelinks #1,{%
|
||||||
\def\params{#1}\def\E{END}%
|
\def\params{#1}\def\E{END}%
|
||||||
@@ -1139,6 +1107,9 @@ where each line of input produces a line of output.}
|
|||||||
}%
|
}%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
% Use Computer Modern fonts at \magstephalf (11pt).
|
||||||
|
\newcount\mainmagstep \mainmagstep=\magstephalf
|
||||||
|
|
||||||
% Set the font macro #1 to the font named #2, adding on the
|
% Set the font macro #1 to the font named #2, adding on the
|
||||||
% specified font prefix (normally `cm').
|
% specified font prefix (normally `cm').
|
||||||
% #3 is the font's design size, #4 is a scale factor
|
% #3 is the font's design size, #4 is a scale factor
|
||||||
@@ -1167,16 +1138,13 @@ where each line of input produces a line of output.}
|
|||||||
\def\scshape{csc}
|
\def\scshape{csc}
|
||||||
\def\scbshape{csc}
|
\def\scbshape{csc}
|
||||||
|
|
||||||
\newcount\mainmagstep
|
|
||||||
\ifx\bigger\relax
|
\ifx\bigger\relax
|
||||||
% not really supported.
|
\let\mainmagstep=\magstep1
|
||||||
\let\mainmagstep=\magstep1
|
\setfont\textrm\rmshape{12}{1000}
|
||||||
\setfont\textrm\rmshape{12}{1000}
|
\setfont\texttt\ttshape{12}{1000}
|
||||||
\setfont\texttt\ttshape{12}{1000}
|
|
||||||
\else
|
\else
|
||||||
\mainmagstep=\magstephalf
|
\setfont\textrm\rmshape{10}{\mainmagstep}
|
||||||
\setfont\textrm\rmshape{10}{\mainmagstep}
|
\setfont\texttt\ttshape{10}{\mainmagstep}
|
||||||
\setfont\texttt\ttshape{10}{\mainmagstep}
|
|
||||||
\fi
|
\fi
|
||||||
% Instead of cmb10, you many want to use cmbx10.
|
% Instead of cmb10, you many want to use cmbx10.
|
||||||
% cmbx10 is a prettier font on its own, but cmb10
|
% cmbx10 is a prettier font on its own, but cmb10
|
||||||
@@ -1256,6 +1224,20 @@ where each line of input produces a line of output.}
|
|||||||
\font\seci=cmmi12 scaled \magstep1
|
\font\seci=cmmi12 scaled \magstep1
|
||||||
\font\secsy=cmsy10 scaled \magstep2
|
\font\secsy=cmsy10 scaled \magstep2
|
||||||
|
|
||||||
|
% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
|
||||||
|
% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
|
||||||
|
% \setfont\ssecsl\slshape{10}{\magstep1}
|
||||||
|
% \setfont\ssectt\ttshape{10}{\magstep1}
|
||||||
|
% \setfont\ssecsf\sfshape{10}{\magstep1}
|
||||||
|
|
||||||
|
%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
|
||||||
|
%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
|
||||||
|
%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
|
||||||
|
%\setfont\ssectt\ttshape{10}{1315}
|
||||||
|
%\setfont\ssecsf\sfshape{10}{1315}
|
||||||
|
|
||||||
|
%\let\ssecbf=\ssecrm
|
||||||
|
|
||||||
% Subsection fonts (13.15pt).
|
% Subsection fonts (13.15pt).
|
||||||
\setfont\ssecrm\rmbshape{12}{\magstephalf}
|
\setfont\ssecrm\rmbshape{12}{\magstephalf}
|
||||||
\setfont\ssecit\itbshape{10}{1315}
|
\setfont\ssecit\itbshape{10}{1315}
|
||||||
@@ -1272,16 +1254,17 @@ where each line of input produces a line of output.}
|
|||||||
|
|
||||||
% In order for the font changes to affect most math symbols and letters,
|
% In order for the font changes to affect most math symbols and letters,
|
||||||
% we have to define the \textfont of the standard families. Since
|
% we have to define the \textfont of the standard families. Since
|
||||||
% texinfo doesn't allow for producing subscripts and superscripts except
|
% texinfo doesn't allow for producing subscripts and superscripts, we
|
||||||
% in the main text, we don't bother to reset \scriptfont and
|
% don't bother to reset \scriptfont and \scriptscriptfont (which would
|
||||||
% \scriptscriptfont (which would also require loading a lot more fonts).
|
% also require loading a lot more fonts).
|
||||||
%
|
%
|
||||||
\def\resetmathfonts{%
|
\def\resetmathfonts{%
|
||||||
\textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
|
\textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
|
||||||
\textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
|
\textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
|
||||||
\textfont\ttfam=\tentt \textfont\sffam=\tensf
|
\textfont\ttfam = \tentt \textfont\sffam = \tensf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
% The font-changing commands redefine the meanings of \tenSTYLE, instead
|
% The font-changing commands redefine the meanings of \tenSTYLE, instead
|
||||||
% of just \STYLE. We do this so that font changes will continue to work
|
% of just \STYLE. We do this so that font changes will continue to work
|
||||||
% in math mode, where it is the current \fam that is relevant in most
|
% in math mode, where it is the current \fam that is relevant in most
|
||||||
@@ -1442,19 +1425,11 @@ where each line of input produces a line of output.}
|
|||||||
|
|
||||||
\def\realdash{-}
|
\def\realdash{-}
|
||||||
\def\codedash{-\discretionary{}{}{}}
|
\def\codedash{-\discretionary{}{}{}}
|
||||||
\def\codeunder{%
|
\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
|
||||||
% this is all so @math{@code{var_name}+1} can work. In math mode, _
|
|
||||||
% is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
|
|
||||||
% will therefore expand the active definition of _, which is us
|
|
||||||
% (inside @code that is), therefore an endless loop.
|
|
||||||
\ifusingtt{\ifmmode
|
|
||||||
\mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
|
|
||||||
\else\normalunderscore \fi
|
|
||||||
\discretionary{}{}{}}%
|
|
||||||
{\_}%
|
|
||||||
}
|
|
||||||
\def\codex #1{\tclose{#1}\endgroup}
|
\def\codex #1{\tclose{#1}\endgroup}
|
||||||
|
|
||||||
|
%\let\exp=\tclose %Was temporary
|
||||||
|
|
||||||
% @kbd is like @code, except that if the argument is just one @key command,
|
% @kbd is like @code, except that if the argument is just one @key command,
|
||||||
% then @kbd has no effect.
|
% then @kbd has no effect.
|
||||||
|
|
||||||
@@ -2778,23 +2753,9 @@ width0pt\relax} \fi
|
|||||||
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
|
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
|
||||||
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
|
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
|
||||||
|
|
||||||
% Take care of texinfo commands likely to appear in an index entry.
|
|
||||||
% (Must be a way to avoid doing expansion at all, and thus not have to
|
|
||||||
% laboriously list every single command here.)
|
|
||||||
%
|
|
||||||
\def\indexdummies{%
|
\def\indexdummies{%
|
||||||
\def\ { }%
|
\def\ { }%
|
||||||
\def\@{@}% change to @@ when we switch to @ as escape char in aux files.
|
|
||||||
% Need these in case \tex is in effect and \{ is a \delimiter again.
|
|
||||||
% But can't use \lbracecmd and \rbracecmd because texindex assumes
|
|
||||||
% braces and backslashes are used only as delimiters.
|
|
||||||
\let\{ = \mylbrace
|
|
||||||
\let\} = \myrbrace
|
|
||||||
\def\_{{\realbackslash _}}%
|
|
||||||
\normalturnoffactive
|
|
||||||
%
|
|
||||||
% Take care of the plain tex accent commands.
|
% Take care of the plain tex accent commands.
|
||||||
\def\,##1{\realbackslash ,{##1}}%
|
|
||||||
\def\"{\realbackslash "}%
|
\def\"{\realbackslash "}%
|
||||||
\def\`{\realbackslash `}%
|
\def\`{\realbackslash `}%
|
||||||
\def\'{\realbackslash '}%
|
\def\'{\realbackslash '}%
|
||||||
@@ -2807,66 +2768,69 @@ width0pt\relax} \fi
|
|||||||
\def\u{\realbackslash u}%
|
\def\u{\realbackslash u}%
|
||||||
\def\v{\realbackslash v}%
|
\def\v{\realbackslash v}%
|
||||||
\def\H{\realbackslash H}%
|
\def\H{\realbackslash H}%
|
||||||
\def\dotless##1{\realbackslash dotless {##1}}%
|
|
||||||
% Take care of the plain tex special European modified letters.
|
% Take care of the plain tex special European modified letters.
|
||||||
\def\AA{\realbackslash AA}%
|
|
||||||
\def\AE{\realbackslash AE}%
|
|
||||||
\def\L{\realbackslash L}%
|
|
||||||
\def\OE{\realbackslash OE}%
|
|
||||||
\def\O{\realbackslash O}%
|
|
||||||
\def\aa{\realbackslash aa}%
|
|
||||||
\def\ae{\realbackslash ae}%
|
|
||||||
\def\l{\realbackslash l}%
|
|
||||||
\def\oe{\realbackslash oe}%
|
\def\oe{\realbackslash oe}%
|
||||||
|
\def\ae{\realbackslash ae}%
|
||||||
|
\def\aa{\realbackslash aa}%
|
||||||
|
\def\OE{\realbackslash OE}%
|
||||||
|
\def\AE{\realbackslash AE}%
|
||||||
|
\def\AA{\realbackslash AA}%
|
||||||
\def\o{\realbackslash o}%
|
\def\o{\realbackslash o}%
|
||||||
|
\def\O{\realbackslash O}%
|
||||||
|
\def\l{\realbackslash l}%
|
||||||
|
\def\L{\realbackslash L}%
|
||||||
\def\ss{\realbackslash ss}%
|
\def\ss{\realbackslash ss}%
|
||||||
%
|
% Take care of texinfo commands likely to appear in an index entry.
|
||||||
% Although these internals commands shouldn't show up, sometimes they do.
|
% (Must be a way to avoid doing expansion at all, and thus not have to
|
||||||
|
% laboriously list every single command here.)
|
||||||
|
\def\@{@}% will be @@ when we switch to @ as escape char.
|
||||||
|
% Need these in case \tex is in effect and \{ is a \delimiter again.
|
||||||
|
% But can't use \lbracecmd and \rbracecmd because texindex assumes
|
||||||
|
% braces and backslashes are used only as delimiters.
|
||||||
|
\let\{ = \mylbrace
|
||||||
|
\let\} = \myrbrace
|
||||||
|
\def\_{{\realbackslash _}}%
|
||||||
|
\def\w{\realbackslash w }%
|
||||||
\def\bf{\realbackslash bf }%
|
\def\bf{\realbackslash bf }%
|
||||||
\def\gtr{\realbackslash gtr}%
|
|
||||||
\def\hat{\realbackslash hat}%
|
|
||||||
\def\less{\realbackslash less}%
|
|
||||||
%\def\rm{\realbackslash rm }%
|
%\def\rm{\realbackslash rm }%
|
||||||
\def\sf{\realbackslash sf}%
|
|
||||||
\def\sl{\realbackslash sl }%
|
\def\sl{\realbackslash sl }%
|
||||||
\def\tclose##1{\realbackslash tclose {##1}}%
|
\def\sf{\realbackslash sf}%
|
||||||
\def\tt{\realbackslash tt}%
|
\def\tt{\realbackslash tt}%
|
||||||
%
|
\def\gtr{\realbackslash gtr}%
|
||||||
\def\b##1{\realbackslash b {##1}}%
|
\def\less{\realbackslash less}%
|
||||||
\def\i##1{\realbackslash i {##1}}%
|
\def\hat{\realbackslash hat}%
|
||||||
\def\sc##1{\realbackslash sc {##1}}%
|
|
||||||
\def\t##1{\realbackslash t {##1}}%
|
|
||||||
\def\r##1{\realbackslash r {##1}}%
|
|
||||||
%
|
|
||||||
\def\TeX{\realbackslash TeX}%
|
\def\TeX{\realbackslash TeX}%
|
||||||
\def\acronym##1{\realbackslash acronym {##1}}%
|
|
||||||
\def\cite##1{\realbackslash cite {##1}}%
|
|
||||||
\def\code##1{\realbackslash code {##1}}%
|
|
||||||
\def\command##1{\realbackslash command {##1}}%
|
|
||||||
\def\dfn##1{\realbackslash dfn {##1}}%
|
|
||||||
\def\dots{\realbackslash dots }%
|
\def\dots{\realbackslash dots }%
|
||||||
\def\emph##1{\realbackslash emph {##1}}%
|
\def\result{\realbackslash result}%
|
||||||
\def\env##1{\realbackslash env {##1}}%
|
\def\equiv{\realbackslash equiv}%
|
||||||
\def\file##1{\realbackslash file {##1}}%
|
\def\expansion{\realbackslash expansion}%
|
||||||
\def\kbd##1{\realbackslash kbd {##1}}%
|
\def\print{\realbackslash print}%
|
||||||
\def\key##1{\realbackslash key {##1}}%
|
\def\error{\realbackslash error}%
|
||||||
\def\math##1{\realbackslash math {##1}}%
|
\def\point{\realbackslash point}%
|
||||||
\def\option##1{\realbackslash option {##1}}%
|
\def\copyright{\realbackslash copyright}%
|
||||||
\def\samp##1{\realbackslash samp {##1}}%
|
\def\tclose##1{\realbackslash tclose {##1}}%
|
||||||
\def\strong##1{\realbackslash strong {##1}}%
|
\def\code##1{\realbackslash code {##1}}%
|
||||||
\def\uref##1{\realbackslash uref {##1}}%
|
\def\uref##1{\realbackslash uref {##1}}%
|
||||||
\def\url##1{\realbackslash url {##1}}%
|
\def\url##1{\realbackslash url {##1}}%
|
||||||
|
\def\env##1{\realbackslash env {##1}}%
|
||||||
|
\def\command##1{\realbackslash command {##1}}%
|
||||||
|
\def\option##1{\realbackslash option {##1}}%
|
||||||
|
\def\dotless##1{\realbackslash dotless {##1}}%
|
||||||
|
\def\samp##1{\realbackslash samp {##1}}%
|
||||||
|
\def\,##1{\realbackslash ,{##1}}%
|
||||||
|
\def\t##1{\realbackslash t {##1}}%
|
||||||
|
\def\r##1{\realbackslash r {##1}}%
|
||||||
|
\def\i##1{\realbackslash i {##1}}%
|
||||||
|
\def\b##1{\realbackslash b {##1}}%
|
||||||
|
\def\sc##1{\realbackslash sc {##1}}%
|
||||||
|
\def\cite##1{\realbackslash cite {##1}}%
|
||||||
|
\def\key##1{\realbackslash key {##1}}%
|
||||||
|
\def\file##1{\realbackslash file {##1}}%
|
||||||
\def\var##1{\realbackslash var {##1}}%
|
\def\var##1{\realbackslash var {##1}}%
|
||||||
\def\w{\realbackslash w }%
|
\def\kbd##1{\realbackslash kbd {##1}}%
|
||||||
%
|
\def\dfn##1{\realbackslash dfn {##1}}%
|
||||||
% These math commands don't seem likely to be used in index entries.
|
\def\emph##1{\realbackslash emph {##1}}%
|
||||||
\def\copyright{\realbackslash copyright}%
|
\def\acronym##1{\realbackslash acronym {##1}}%
|
||||||
\def\equiv{\realbackslash equiv}%
|
|
||||||
\def\error{\realbackslash error}%
|
|
||||||
\def\expansion{\realbackslash expansion}%
|
|
||||||
\def\point{\realbackslash point}%
|
|
||||||
\def\print{\realbackslash print}%
|
|
||||||
\def\result{\realbackslash result}%
|
|
||||||
%
|
%
|
||||||
% Handle some cases of @value -- where the variable name does not
|
% Handle some cases of @value -- where the variable name does not
|
||||||
% contain - or _, and the value does not contain any
|
% contain - or _, and the value does not contain any
|
||||||
@@ -2880,7 +2844,7 @@ width0pt\relax} \fi
|
|||||||
|
|
||||||
% If an index command is used in an @example environment, any spaces
|
% If an index command is used in an @example environment, any spaces
|
||||||
% therein should become regular spaces in the raw index file, not the
|
% therein should become regular spaces in the raw index file, not the
|
||||||
% expansion of \tie (\leavevmode \penalty \@M \ ).
|
% expansion of \tie (\\leavevmode \penalty \@M \ ).
|
||||||
{\obeyspaces
|
{\obeyspaces
|
||||||
\gdef\unsepspaces{\obeyspaces\let =\space}}
|
\gdef\unsepspaces{\obeyspaces\let =\space}}
|
||||||
|
|
||||||
@@ -2891,10 +2855,7 @@ width0pt\relax} \fi
|
|||||||
\def\indexdummydots{...}
|
\def\indexdummydots{...}
|
||||||
|
|
||||||
\def\indexnofonts{%
|
\def\indexnofonts{%
|
||||||
\def\@{@}%
|
% Just ignore accents.
|
||||||
% how to handle braces?
|
|
||||||
\def\_{\normalunderscore}%
|
|
||||||
%
|
|
||||||
\let\,=\indexdummyfont
|
\let\,=\indexdummyfont
|
||||||
\let\"=\indexdummyfont
|
\let\"=\indexdummyfont
|
||||||
\let\`=\indexdummyfont
|
\let\`=\indexdummyfont
|
||||||
@@ -2910,49 +2871,45 @@ width0pt\relax} \fi
|
|||||||
\let\H=\indexdummyfont
|
\let\H=\indexdummyfont
|
||||||
\let\dotless=\indexdummyfont
|
\let\dotless=\indexdummyfont
|
||||||
% Take care of the plain tex special European modified letters.
|
% Take care of the plain tex special European modified letters.
|
||||||
\def\AA{AA}%
|
|
||||||
\def\AE{AE}%
|
|
||||||
\def\L{L}%
|
|
||||||
\def\OE{OE}%
|
|
||||||
\def\O{O}%
|
|
||||||
\def\aa{aa}%
|
|
||||||
\def\ae{ae}%
|
|
||||||
\def\l{l}%
|
|
||||||
\def\oe{oe}%
|
\def\oe{oe}%
|
||||||
|
\def\ae{ae}%
|
||||||
|
\def\aa{aa}%
|
||||||
|
\def\OE{OE}%
|
||||||
|
\def\AE{AE}%
|
||||||
|
\def\AA{AA}%
|
||||||
\def\o{o}%
|
\def\o{o}%
|
||||||
|
\def\O{O}%
|
||||||
|
\def\l{l}%
|
||||||
|
\def\L{L}%
|
||||||
\def\ss{ss}%
|
\def\ss{ss}%
|
||||||
%
|
\let\w=\indexdummyfont
|
||||||
% Don't no-op \tt, since it isn't a user-level command
|
|
||||||
% and is used in the definitions of the active chars like <, >, |, etc.
|
|
||||||
% Likewise with the other plain tex font commands.
|
|
||||||
%\let\tt=\indexdummyfont
|
|
||||||
%
|
|
||||||
\let\b=\indexdummyfont
|
|
||||||
\let\i=\indexdummyfont
|
|
||||||
\let\r=\indexdummyfont
|
|
||||||
\let\sc=\indexdummyfont
|
|
||||||
\let\t=\indexdummyfont
|
\let\t=\indexdummyfont
|
||||||
%
|
\let\r=\indexdummyfont
|
||||||
\let\TeX=\indexdummytex
|
\let\i=\indexdummyfont
|
||||||
\let\acronym=\indexdummyfont
|
\let\b=\indexdummyfont
|
||||||
\let\cite=\indexdummyfont
|
|
||||||
\let\code=\indexdummyfont
|
|
||||||
\let\command=\indexdummyfont
|
|
||||||
\let\dfn=\indexdummyfont
|
|
||||||
\let\dots=\indexdummydots
|
|
||||||
\let\emph=\indexdummyfont
|
\let\emph=\indexdummyfont
|
||||||
|
\let\strong=\indexdummyfont
|
||||||
|
\let\cite=\indexdummyfont
|
||||||
|
\let\sc=\indexdummyfont
|
||||||
|
%Don't no-op \tt, since it isn't a user-level command
|
||||||
|
% and is used in the definitions of the active chars like <, >, |...
|
||||||
|
%\let\tt=\indexdummyfont
|
||||||
|
\let\tclose=\indexdummyfont
|
||||||
|
\let\code=\indexdummyfont
|
||||||
|
\let\url=\indexdummyfont
|
||||||
|
\let\uref=\indexdummyfont
|
||||||
\let\env=\indexdummyfont
|
\let\env=\indexdummyfont
|
||||||
|
\let\acronym=\indexdummyfont
|
||||||
|
\let\command=\indexdummyfont
|
||||||
|
\let\option=\indexdummyfont
|
||||||
\let\file=\indexdummyfont
|
\let\file=\indexdummyfont
|
||||||
|
\let\samp=\indexdummyfont
|
||||||
\let\kbd=\indexdummyfont
|
\let\kbd=\indexdummyfont
|
||||||
\let\key=\indexdummyfont
|
\let\key=\indexdummyfont
|
||||||
\let\math=\indexdummyfont
|
|
||||||
\let\option=\indexdummyfont
|
|
||||||
\let\samp=\indexdummyfont
|
|
||||||
\let\strong=\indexdummyfont
|
|
||||||
\let\uref=\indexdummyfont
|
|
||||||
\let\url=\indexdummyfont
|
|
||||||
\let\var=\indexdummyfont
|
\let\var=\indexdummyfont
|
||||||
\let\w=\indexdummyfont
|
\let\TeX=\indexdummytex
|
||||||
|
\let\dots=\indexdummydots
|
||||||
|
\def\@{@}%
|
||||||
}
|
}
|
||||||
|
|
||||||
% To define \realbackslash, we must make \ not be an escape.
|
% To define \realbackslash, we must make \ not be an escape.
|
||||||
@@ -3554,8 +3511,8 @@ width0pt\relax} \fi
|
|||||||
\gdef\thischaptername{#1}%
|
\gdef\thischaptername{#1}%
|
||||||
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
|
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
|
||||||
\toks0 = {#1}%
|
\toks0 = {#1}%
|
||||||
\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}%
|
\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
|
||||||
{\appendixletter}}}%
|
{\putwordAppendix{} \appendixletter}}}%
|
||||||
\temp
|
\temp
|
||||||
\appendixnoderef
|
\appendixnoderef
|
||||||
\global\let\section = \appendixsec
|
\global\let\section = \appendixsec
|
||||||
@@ -3632,8 +3589,7 @@ width0pt\relax} \fi
|
|||||||
\def\unnumberedseczzz #1{%
|
\def\unnumberedseczzz #1{%
|
||||||
\plainsecheading {#1}\gdef\thissection{#1}%
|
\plainsecheading {#1}\gdef\thissection{#1}%
|
||||||
\toks0 = {#1}%
|
\toks0 = {#1}%
|
||||||
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry%
|
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
|
||||||
{\the\toks0}{\the\chapno}}}%
|
|
||||||
\temp
|
\temp
|
||||||
\unnumbnoderef
|
\unnumbnoderef
|
||||||
\nobreak
|
\nobreak
|
||||||
@@ -3672,7 +3628,7 @@ width0pt\relax} \fi
|
|||||||
\plainsubsecheading {#1}\gdef\thissection{#1}%
|
\plainsubsecheading {#1}\gdef\thissection{#1}%
|
||||||
\toks0 = {#1}%
|
\toks0 = {#1}%
|
||||||
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
|
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
|
||||||
{\the\toks0}{\the\chapno}{\the\secno}}}%
|
{\the\toks0}}}%
|
||||||
\temp
|
\temp
|
||||||
\unnumbnoderef
|
\unnumbnoderef
|
||||||
\nobreak
|
\nobreak
|
||||||
@@ -3713,7 +3669,7 @@ width0pt\relax} \fi
|
|||||||
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
|
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
|
||||||
\toks0 = {#1}%
|
\toks0 = {#1}%
|
||||||
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
|
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
|
||||||
{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}%
|
{\the\toks0}}}%
|
||||||
\temp
|
\temp
|
||||||
\unnumbnoderef
|
\unnumbnoderef
|
||||||
\nobreak
|
\nobreak
|
||||||
@@ -3989,7 +3945,6 @@ width0pt\relax} \fi
|
|||||||
\startcontents{\putwordShortTOC}%
|
\startcontents{\putwordShortTOC}%
|
||||||
%
|
%
|
||||||
\let\chapentry = \shortchapentry
|
\let\chapentry = \shortchapentry
|
||||||
\let\appendixentry = \shortappendixentry
|
|
||||||
\let\unnumbchapentry = \shortunnumberedentry
|
\let\unnumbchapentry = \shortunnumberedentry
|
||||||
% We want a true roman here for the page numbers.
|
% We want a true roman here for the page numbers.
|
||||||
\secfonts
|
\secfonts
|
||||||
@@ -3998,11 +3953,11 @@ width0pt\relax} \fi
|
|||||||
\hyphenpenalty = 10000
|
\hyphenpenalty = 10000
|
||||||
\advance\baselineskip by 1pt % Open it up a little.
|
\advance\baselineskip by 1pt % Open it up a little.
|
||||||
\def\secentry ##1##2##3##4{}
|
\def\secentry ##1##2##3##4{}
|
||||||
\def\unnumbsecentry ##1##2##3{}
|
\def\unnumbsecentry ##1##2{}
|
||||||
\def\subsecentry ##1##2##3##4##5{}
|
\def\subsecentry ##1##2##3##4##5{}
|
||||||
\def\unnumbsubsecentry ##1##2##3##4{}
|
\def\unnumbsubsecentry ##1##2{}
|
||||||
\def\subsubsecentry ##1##2##3##4##5##6{}
|
\def\subsubsecentry ##1##2##3##4##5##6{}
|
||||||
\def\unnumbsubsubsecentry ##1##2##3##4##5{}
|
\def\unnumbsubsubsecentry ##1##2{}
|
||||||
\openin 1 \jobname.toc
|
\openin 1 \jobname.toc
|
||||||
\ifeof 1 \else
|
\ifeof 1 \else
|
||||||
\closein 1
|
\closein 1
|
||||||
@@ -4025,23 +3980,16 @@ width0pt\relax} \fi
|
|||||||
% The last argument is the page number.
|
% The last argument is the page number.
|
||||||
% The arguments in between are the chapter number, section number, ...
|
% The arguments in between are the chapter number, section number, ...
|
||||||
|
|
||||||
% Chapters, in the main contents.
|
% Chapter-level things, for both the long and short contents.
|
||||||
\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
|
\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
|
||||||
%
|
|
||||||
% Chapters, in the short toc.
|
% See comments in \dochapentry re vbox and related settings
|
||||||
% See comments in \dochapentry re vbox and related settings.
|
|
||||||
\def\shortchapentry#1#2#3{%
|
\def\shortchapentry#1#2#3{%
|
||||||
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
|
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
|
||||||
}
|
}
|
||||||
|
|
||||||
% Appendices, in the main contents.
|
|
||||||
\def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}}
|
|
||||||
%
|
|
||||||
% Appendices, in the short toc.
|
|
||||||
\let\shortappendixentry = \shortchapentry
|
|
||||||
|
|
||||||
% Typeset the label for a chapter or appendix for the short contents.
|
% Typeset the label for a chapter or appendix for the short contents.
|
||||||
% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter.
|
% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
|
||||||
% We could simplify the code here by writing out an \appendixentry
|
% We could simplify the code here by writing out an \appendixentry
|
||||||
% command in the toc file for appendices, instead of using \chapentry
|
% command in the toc file for appendices, instead of using \chapentry
|
||||||
% for both, but it doesn't seem worth it.
|
% for both, but it doesn't seem worth it.
|
||||||
@@ -4049,31 +3997,38 @@ width0pt\relax} \fi
|
|||||||
\newdimen\shortappendixwidth
|
\newdimen\shortappendixwidth
|
||||||
%
|
%
|
||||||
\def\shortchaplabel#1{%
|
\def\shortchaplabel#1{%
|
||||||
% This space should be enough, since a single number is .5em, and the
|
% Compute width of word "Appendix", may change with language.
|
||||||
|
\setbox0 = \hbox{\shortcontrm \putwordAppendix}%
|
||||||
|
\shortappendixwidth = \wd0
|
||||||
|
%
|
||||||
|
% We typeset #1 in a box of constant width, regardless of the text of
|
||||||
|
% #1, so the chapter titles will come out aligned.
|
||||||
|
\setbox0 = \hbox{#1}%
|
||||||
|
\dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
|
||||||
|
%
|
||||||
|
% This space should be plenty, since a single number is .5em, and the
|
||||||
% widest letter (M) is 1em, at least in the Computer Modern fonts.
|
% widest letter (M) is 1em, at least in the Computer Modern fonts.
|
||||||
% But use \hss just in case.
|
|
||||||
% (This space doesn't include the extra space that gets added after
|
% (This space doesn't include the extra space that gets added after
|
||||||
% the label; that gets put in by \shortchapentry above.)
|
% the label; that gets put in by \shortchapentry above.)
|
||||||
\dimen0 = 1em
|
\advance\dimen0 by 1.1em
|
||||||
\hbox to \dimen0{#1\hss}%
|
\hbox to \dimen0{#1\hfil}%
|
||||||
}
|
}
|
||||||
|
|
||||||
% Unnumbered chapters.
|
|
||||||
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
|
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
|
||||||
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
|
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
|
||||||
|
|
||||||
% Sections.
|
% Sections.
|
||||||
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
|
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
|
||||||
\def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}}
|
\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
|
||||||
|
|
||||||
% Subsections.
|
% Subsections.
|
||||||
\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
|
\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
|
||||||
\def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
|
\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
|
||||||
|
|
||||||
% And subsubsections.
|
% And subsubsections.
|
||||||
\def\subsubsecentry#1#2#3#4#5#6{%
|
\def\subsubsecentry#1#2#3#4#5#6{%
|
||||||
\dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
|
\dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
|
||||||
\def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}}
|
\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
|
||||||
|
|
||||||
% This parameter controls the indentation of the various levels.
|
% This parameter controls the indentation of the various levels.
|
||||||
\newdimen\tocindent \tocindent = 3pc
|
\newdimen\tocindent \tocindent = 3pc
|
||||||
@@ -4114,7 +4069,7 @@ width0pt\relax} \fi
|
|||||||
\def\tocentry#1#2{\begingroup
|
\def\tocentry#1#2{\begingroup
|
||||||
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
|
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
|
||||||
% Do not use \turnoffactive in these arguments. Since the toc is
|
% Do not use \turnoffactive in these arguments. Since the toc is
|
||||||
% typeset in cmr, characters such as _ would come out wrong; we
|
% typeset in cmr, so characters such as _ would come out wrong; we
|
||||||
% have to do the usual translation tricks.
|
% have to do the usual translation tricks.
|
||||||
\entry{#1}{#2}%
|
\entry{#1}{#2}%
|
||||||
\endgroup}
|
\endgroup}
|
||||||
@@ -4943,7 +4898,7 @@ width0pt\relax} \fi
|
|||||||
% #1 is the data type, #2 the name, #3 the args.
|
% #1 is the data type, #2 the name, #3 the args.
|
||||||
\def\deftypefunheaderx #1#2 #3\relax{%
|
\def\deftypefunheaderx #1#2 #3\relax{%
|
||||||
\doind {fn}{\code{#2}}% Make entry in function index
|
\doind {fn}{\code{#2}}% Make entry in function index
|
||||||
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
|
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
|
||||||
\deftypefunargs {#3}\endgroup %
|
\deftypefunargs {#3}\endgroup %
|
||||||
\catcode 61=\other % Turn off change made in \defparsebody
|
\catcode 61=\other % Turn off change made in \defparsebody
|
||||||
}
|
}
|
||||||
@@ -4952,9 +4907,9 @@ width0pt\relax} \fi
|
|||||||
|
|
||||||
\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
|
\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
|
||||||
|
|
||||||
% \defheaderxcond#1\relax$.$
|
% \defheaderxcond#1\relax$$$
|
||||||
% puts #1 in @code, followed by a space, but does nothing if #1 is null.
|
% puts #1 in @code, followed by a space, but does nothing if #1 is null.
|
||||||
\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi}
|
\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
|
||||||
|
|
||||||
% #1 is the classification. #2 is the data type. #3 is the name and args.
|
% #1 is the classification. #2 is the data type. #3 is the name and args.
|
||||||
\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
|
\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
|
||||||
@@ -4964,7 +4919,7 @@ width0pt\relax} \fi
|
|||||||
\begingroup
|
\begingroup
|
||||||
\normalparens % notably, turn off `&' magic, which prevents
|
\normalparens % notably, turn off `&' magic, which prevents
|
||||||
% at least some C++ text from working
|
% at least some C++ text from working
|
||||||
\defname {\defheaderxcond#2\relax$.$#3}{#1}%
|
\defname {\defheaderxcond#2\relax$$$#3}{#1}%
|
||||||
\deftypefunargs {#4}\endgroup %
|
\deftypefunargs {#4}\endgroup %
|
||||||
\catcode 61=\other % Turn off change made in \defparsebody
|
\catcode 61=\other % Turn off change made in \defparsebody
|
||||||
}
|
}
|
||||||
@@ -5010,7 +4965,7 @@ width0pt\relax} \fi
|
|||||||
\def\deftypeopheader#1#2#3#4{%
|
\def\deftypeopheader#1#2#3#4{%
|
||||||
\dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
|
\dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
|
||||||
\begingroup
|
\begingroup
|
||||||
\defname{\defheaderxcond#2\relax$.$#3}
|
\defname{\defheaderxcond#2\relax$$$#3}
|
||||||
{\deftypeopcategory\ \putwordon\ \code{#1}}%
|
{\deftypeopcategory\ \putwordon\ \code{#1}}%
|
||||||
\deftypefunargs{#4}%
|
\deftypefunargs{#4}%
|
||||||
\endgroup
|
\endgroup
|
||||||
@@ -5025,7 +4980,7 @@ width0pt\relax} \fi
|
|||||||
\def\deftypemethodheader#1#2#3#4{%
|
\def\deftypemethodheader#1#2#3#4{%
|
||||||
\dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
|
\dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
|
||||||
\begingroup
|
\begingroup
|
||||||
\defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
|
\defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
|
||||||
\deftypefunargs{#4}%
|
\deftypefunargs{#4}%
|
||||||
\endgroup
|
\endgroup
|
||||||
}
|
}
|
||||||
@@ -5039,7 +4994,7 @@ width0pt\relax} \fi
|
|||||||
\def\deftypeivarheader#1#2#3{%
|
\def\deftypeivarheader#1#2#3{%
|
||||||
\dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
|
\dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
|
||||||
\begingroup
|
\begingroup
|
||||||
\defname{\defheaderxcond#2\relax$.$#3}
|
\defname{\defheaderxcond#2\relax$$$#3}
|
||||||
{\putwordInstanceVariableof\ \code{#1}}%
|
{\putwordInstanceVariableof\ \code{#1}}%
|
||||||
\defvarargs{#3}%
|
\defvarargs{#3}%
|
||||||
\endgroup
|
\endgroup
|
||||||
@@ -5122,7 +5077,7 @@ width0pt\relax} \fi
|
|||||||
% is actually part of the data type, which should not be put into the index.
|
% is actually part of the data type, which should not be put into the index.
|
||||||
\def\deftypevarheader #1#2{%
|
\def\deftypevarheader #1#2{%
|
||||||
\dovarind#2 \relax% Make entry in variables index
|
\dovarind#2 \relax% Make entry in variables index
|
||||||
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
|
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
|
||||||
\interlinepenalty=10000
|
\interlinepenalty=10000
|
||||||
\endgraf\nobreak\vskip -\parskip\nobreak
|
\endgraf\nobreak\vskip -\parskip\nobreak
|
||||||
\endgroup}
|
\endgroup}
|
||||||
@@ -5133,7 +5088,7 @@ width0pt\relax} \fi
|
|||||||
\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
|
\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
|
||||||
|
|
||||||
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
|
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
|
||||||
\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
|
\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
|
||||||
\interlinepenalty=10000
|
\interlinepenalty=10000
|
||||||
\endgraf\nobreak\vskip -\parskip\nobreak
|
\endgraf\nobreak\vskip -\parskip\nobreak
|
||||||
\endgroup}
|
\endgroup}
|
||||||
@@ -5293,7 +5248,7 @@ width0pt\relax} \fi
|
|||||||
\message{Warning: redefining \the\macname}%
|
\message{Warning: redefining \the\macname}%
|
||||||
\else
|
\else
|
||||||
\expandafter\ifx\csname \the\macname\endcsname \relax
|
\expandafter\ifx\csname \the\macname\endcsname \relax
|
||||||
\else \errmessage{Macro name \the\macname\space already defined}\fi
|
\else \errmessage{The name \the\macname\space is reserved}\fi
|
||||||
\global\cslet{macsave.\the\macname}{\the\macname}%
|
\global\cslet{macsave.\the\macname}{\the\macname}%
|
||||||
\global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
|
\global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
|
||||||
% Add the macroname to \macrolist
|
% Add the macroname to \macrolist
|
||||||
@@ -5844,15 +5799,8 @@ width0pt\relax} \fi
|
|||||||
%
|
%
|
||||||
\smallfonts \rm
|
\smallfonts \rm
|
||||||
%
|
%
|
||||||
% Because we use hanging indentation in footnotes, a @noindent appears
|
% Hang the footnote text off the number.
|
||||||
% to exdent this text, so make it be a no-op. makeinfo does not use
|
\hang
|
||||||
% hanging indentation so @noindent can still be needed within footnote
|
|
||||||
% text after an @example or the like (not that this is good style).
|
|
||||||
\let\noindent = \relax
|
|
||||||
%
|
|
||||||
% Hang the footnote text off the number. Use \everypar in case the
|
|
||||||
% footnote extends for more than one paragraph.
|
|
||||||
\everypar = {\hang}%
|
|
||||||
\textindent{\thisfootno}%
|
\textindent{\thisfootno}%
|
||||||
%
|
%
|
||||||
% Don't crash into the line above the footnote text. Since this
|
% Don't crash into the line above the footnote text. Since this
|
||||||
@@ -5933,7 +5881,7 @@ width0pt\relax} \fi
|
|||||||
\global\warnednoepsftrue
|
\global\warnednoepsftrue
|
||||||
\fi
|
\fi
|
||||||
\else
|
\else
|
||||||
\imagexxx #1,,,,,\finish
|
\imagexxx #1,,,\finish
|
||||||
\fi
|
\fi
|
||||||
}
|
}
|
||||||
%
|
%
|
||||||
@@ -5943,34 +5891,33 @@ width0pt\relax} \fi
|
|||||||
% #4 is (ignored optional) html alt text.
|
% #4 is (ignored optional) html alt text.
|
||||||
% #5 is (ignored optional) extension.
|
% #5 is (ignored optional) extension.
|
||||||
% #6 is just the usual extra ignored arg for parsing this stuff.
|
% #6 is just the usual extra ignored arg for parsing this stuff.
|
||||||
\newif\ifimagevmode
|
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{%
|
||||||
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
|
|
||||||
\catcode`\^^M = 5 % in case we're inside an example
|
|
||||||
\normalturnoffactive % allow _ et al. in names
|
|
||||||
% If the image is by itself, center it.
|
|
||||||
\ifvmode
|
|
||||||
\imagevmodetrue
|
|
||||||
\nobreak\bigskip
|
|
||||||
% Usually we'll have text after the image which will insert
|
|
||||||
% \parskip glue, so insert it here too to equalize the space
|
|
||||||
% above and below.
|
|
||||||
\nobreak\vskip\parskip
|
|
||||||
\nobreak
|
|
||||||
\line\bgroup\hss
|
|
||||||
\fi
|
|
||||||
%
|
|
||||||
% Output the image.
|
|
||||||
\ifpdf
|
\ifpdf
|
||||||
\dopdfimage{#1}{#2}{#3}%
|
\centerline{\dopdfimage{#1}{#2}{#3}}%
|
||||||
\else
|
\else
|
||||||
% \epsfbox itself resets \epsf?size at each figure.
|
% \epsfbox itself resets \epsf?size at each figure.
|
||||||
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
|
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
|
||||||
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
|
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
|
||||||
\epsfbox{#1.eps}%
|
\begingroup
|
||||||
|
\catcode`\^^M = 5 % in case we're inside an example
|
||||||
|
\normalturnoffactive % allow _ et al. in names
|
||||||
|
% If the image is by itself, center it.
|
||||||
|
\ifvmode
|
||||||
|
\nobreak\bigskip
|
||||||
|
% Usually we'll have text after the image which will insert
|
||||||
|
% \parskip glue, so insert it here too to equalize the space
|
||||||
|
% above and below.
|
||||||
|
\nobreak\vskip\parskip
|
||||||
|
\nobreak
|
||||||
|
\centerline{\epsfbox{#1.eps}}%
|
||||||
|
\bigbreak
|
||||||
|
\else
|
||||||
|
% In the middle of a paragraph, no extra space.
|
||||||
|
\epsfbox{#1.eps}%
|
||||||
|
\fi
|
||||||
|
\endgroup
|
||||||
\fi
|
\fi
|
||||||
%
|
}
|
||||||
\ifimagevmode \hss \egroup \bigbreak \fi % space after the image
|
|
||||||
\endgroup}
|
|
||||||
|
|
||||||
|
|
||||||
\message{localization,}
|
\message{localization,}
|
||||||
@@ -6140,10 +6087,6 @@ should work if nowhere else does.}
|
|||||||
%
|
%
|
||||||
\afourpaper
|
\afourpaper
|
||||||
\internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
|
\internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
|
||||||
%
|
|
||||||
% Must explicitly reset to 0 because we call \afourpaper, apparently,
|
|
||||||
% although this does not entirely make sense.
|
|
||||||
\globaldefs = 0
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
% Use @afourwide to print on European A4 paper in wide format.
|
% Use @afourwide to print on European A4 paper in wide format.
|
||||||
@@ -6193,7 +6136,7 @@ should work if nowhere else does.}
|
|||||||
\def\normalless{<}
|
\def\normalless{<}
|
||||||
\def\normalgreater{>}
|
\def\normalgreater{>}
|
||||||
\def\normalplus{+}
|
\def\normalplus{+}
|
||||||
\def\normaldollar{$}%$ font-lock fix
|
\def\normaldollar{$}
|
||||||
|
|
||||||
% This macro is used to make a character print one way in ttfont
|
% This macro is used to make a character print one way in ttfont
|
||||||
% where it can probably just be output, and another way in other fonts,
|
% where it can probably just be output, and another way in other fonts,
|
||||||
@@ -6242,7 +6185,7 @@ should work if nowhere else does.}
|
|||||||
\catcode`\+=\active
|
\catcode`\+=\active
|
||||||
\def+{{\tt \char 43}}
|
\def+{{\tt \char 43}}
|
||||||
\catcode`\$=\active
|
\catcode`\$=\active
|
||||||
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
|
\def${\ifusingit{{\sl\$}}\normaldollar}
|
||||||
%\catcode 27=\active
|
%\catcode 27=\active
|
||||||
%\def^^[{$\diamondsuit$}
|
%\def^^[{$\diamondsuit$}
|
||||||
|
|
||||||
@@ -6287,7 +6230,7 @@ should work if nowhere else does.}
|
|||||||
@let<=@normalless
|
@let<=@normalless
|
||||||
@let>=@normalgreater
|
@let>=@normalgreater
|
||||||
@let+=@normalplus
|
@let+=@normalplus
|
||||||
@let$=@normaldollar}%$ font-lock fix
|
@let$=@normaldollar}
|
||||||
|
|
||||||
@def@normalturnoffactive{@let"=@normaldoublequote
|
@def@normalturnoffactive{@let"=@normaldoublequote
|
||||||
@let\=@normalbackslash
|
@let\=@normalbackslash
|
||||||
@@ -6298,7 +6241,7 @@ should work if nowhere else does.}
|
|||||||
@let<=@normalless
|
@let<=@normalless
|
||||||
@let>=@normalgreater
|
@let>=@normalgreater
|
||||||
@let+=@normalplus
|
@let+=@normalplus
|
||||||
@let$=@normaldollar}%$ font-lock fix
|
@let$=@normaldollar}
|
||||||
|
|
||||||
% Make _ and + \other characters, temporarily.
|
% Make _ and + \other characters, temporarily.
|
||||||
% This is canceled by @fixbackslash.
|
% This is canceled by @fixbackslash.
|
||||||
|
|||||||
+18
-22
@@ -1,7 +1,5 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright 2001, 2002 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -18,20 +16,17 @@
|
|||||||
# 02111-1307 USA
|
# 02111-1307 USA
|
||||||
|
|
||||||
# We need a recent Autoconf to run a recent Autotest.
|
# We need a recent Autoconf to run a recent Autotest.
|
||||||
AC_PREREQ(2.52g)
|
AC_PREREQ(2.52e)
|
||||||
|
|
||||||
AC_INIT([GNU Bison], [1.34], [[email protected]])
|
AC_INIT([GNU Bison], [1.29d], [[email protected]])
|
||||||
AC_CONFIG_AUX_DIR(config)
|
AC_CONFIG_AUX_DIR(config)
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([bison], [1.34])
|
AM_INIT_AUTOMAKE([bison], [1.29d])
|
||||||
AM_CONFIG_HEADER(config.h:config.hin)
|
AM_CONFIG_HEADER(config.h:config.hin)
|
||||||
|
|
||||||
# Initialize the test suite.
|
# Initialize the test suite.
|
||||||
AC_CONFIG_TESTDIR(tests)
|
AC_CONFIG_TESTDIR(tests)
|
||||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||||
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
|
||||||
# Needed by tests/atlocal.in.
|
|
||||||
AC_SUBST([GCC])
|
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
@@ -39,7 +34,12 @@ AC_MINIX
|
|||||||
AC_ISC_POSIX
|
AC_ISC_POSIX
|
||||||
AM_PROG_CC_STDC
|
AM_PROG_CC_STDC
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
# GNU M4 is needed to build the testsuite.
|
||||||
|
BISON_AC_PROG_GNU_M4
|
||||||
|
if test "$ac_cv_prog_gnu_m4" != yes; then
|
||||||
|
missing_dir=`cd $ac_aux_dir && pwd`
|
||||||
|
M4="$missing_dir/missing m4"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(gcc-warnings,
|
AC_ARG_ENABLE(gcc-warnings,
|
||||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||||
@@ -49,9 +49,6 @@ AC_ARG_ENABLE(gcc-warnings,
|
|||||||
esac],
|
esac],
|
||||||
[enableval=no])
|
[enableval=no])
|
||||||
if test "${enableval}" = yes; then
|
if test "${enableval}" = yes; then
|
||||||
BISON_WARNING(-Werror)
|
|
||||||
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
|
||||||
WARNING_CFLAGS=
|
|
||||||
BISON_WARNING(-Wall)
|
BISON_WARNING(-Wall)
|
||||||
BISON_WARNING(-W)
|
BISON_WARNING(-W)
|
||||||
BISON_WARNING(-Wbad-function-cast)
|
BISON_WARNING(-Wbad-function-cast)
|
||||||
@@ -64,6 +61,7 @@ if test "${enableval}" = yes; then
|
|||||||
BISON_WARNING(-Wshadow)
|
BISON_WARNING(-Wshadow)
|
||||||
BISON_WARNING(-Wstrict-prototypes)
|
BISON_WARNING(-Wstrict-prototypes)
|
||||||
BISON_WARNING(-Wwrite-strings)
|
BISON_WARNING(-Wwrite-strings)
|
||||||
|
CFLAGS="$CFLAGS $WARNING_CFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
@@ -84,28 +82,26 @@ AM_C_PROTOTYPES
|
|||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_FUNC_ALLOCA
|
AC_FUNC_ALLOCA
|
||||||
AC_FUNC_OBSTACK
|
|
||||||
AC_FUNC_ERROR_AT_LINE
|
|
||||||
AC_FUNC_STRNLEN
|
|
||||||
AC_CHECK_FUNCS(mkstemp setlocale)
|
AC_CHECK_FUNCS(mkstemp setlocale)
|
||||||
AC_CHECK_DECLS([stpcpy, strchr, strspn, strnlen, memchr, memrchr])
|
AC_CHECK_DECLS([stpcpy, strndup, strnlen, memchr])
|
||||||
AC_REPLACE_FUNCS(stpcpy strchr strspn memchr memrchr)
|
AC_REPLACE_FUNCS(stpcpy strndup strnlen strspn memchr)
|
||||||
jm_FUNC_MALLOC
|
jm_FUNC_MALLOC
|
||||||
jm_FUNC_REALLOC
|
jm_FUNC_REALLOC
|
||||||
jm_PREREQ_QUOTEARG
|
jm_PREREQ_QUOTEARG
|
||||||
jm_PREREQ_ERROR
|
jm_PREREQ_ERROR
|
||||||
AM_WITH_DMALLOC
|
AM_WITH_DMALLOC
|
||||||
|
|
||||||
ALL_LINGUAS="de es et fr it ja nl ru sv tr"
|
ALL_LINGUAS="de es et fr ja nl tr ru"
|
||||||
AM_GNU_GETTEXT(, need-ngettext)
|
AM_GNU_GETTEXT
|
||||||
|
|
||||||
# This is necessary so that .o files in LIBOBJS are also built via
|
# This is necessary so that .o files in LIBOBJS are also built via
|
||||||
# the ANSI2KNR-filtering rules.
|
# the ANSI2KNR-filtering rules.
|
||||||
LIB@&t@OBJS=`echo $LIB@&t@OBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
|
LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
|
||||||
AC_SUBST(LIB@&t@OBJS)
|
AC_SUBST(LIBOBJS)
|
||||||
|
|
||||||
AC_OUTPUT([Makefile
|
AC_OUTPUT([Makefile
|
||||||
config/Makefile
|
config/Makefile
|
||||||
intl/Makefile po/Makefile.in
|
intl/Makefile po/Makefile.in
|
||||||
lib/Makefile src/Makefile doc/Makefile
|
lib/Makefile src/Makefile doc/Makefile
|
||||||
m4/Makefile])
|
m4/Makefile
|
||||||
|
tests/Makefile])
|
||||||
|
|||||||
+8
-4
@@ -1,12 +1,16 @@
|
|||||||
Makefile Makefile.in
|
Makefile
|
||||||
*.aux *.dvi *.log *.info* *.pdf *.ps
|
bison.aux
|
||||||
stamp-*
|
|
||||||
auto
|
|
||||||
bison.cp
|
bison.cp
|
||||||
bison.cps
|
bison.cps
|
||||||
|
bison.dvi
|
||||||
bison.fn
|
bison.fn
|
||||||
bison.ky
|
bison.ky
|
||||||
|
bison.log
|
||||||
bison.pg
|
bison.pg
|
||||||
|
bison.ps
|
||||||
bison.toc
|
bison.toc
|
||||||
bison.tp
|
bison.tp
|
||||||
bison.vr
|
bison.vr
|
||||||
|
refcard.dvi
|
||||||
|
refcard.log
|
||||||
|
refcard.ps
|
||||||
|
|||||||
+2
-2
@@ -262,9 +262,9 @@ and so on.
|
|||||||
.ns
|
.ns
|
||||||
.TP
|
.TP
|
||||||
.B \-\-debug
|
.B \-\-debug
|
||||||
In the parser file, define the macro
|
Output a definition of the macro
|
||||||
.B YYDEBUG
|
.B YYDEBUG
|
||||||
to 1 if it is not already defined,
|
into the parser file,
|
||||||
so that the debugging facilities are compiled.
|
so that the debugging facilities are compiled.
|
||||||
.TP
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
|
|||||||
+1
-2
@@ -56,8 +56,7 @@ foo_tab.c.
|
|||||||
.indent -1
|
.indent -1
|
||||||
2 /DEBUG
|
2 /DEBUG
|
||||||
.skip
|
.skip
|
||||||
In the parser file,
|
Output a definition of the macro YYDEBUG into the parser file,
|
||||||
define the macro YYDEBUG to 1 if it is not already defined,
|
|
||||||
so that the debugging facilities are compiled.
|
so that the debugging facilities are compiled.
|
||||||
.skip
|
.skip
|
||||||
.indent -1
|
.indent -1
|
||||||
|
|||||||
+241
-338
File diff suppressed because it is too large
Load Diff
+13
-19
@@ -19,7 +19,7 @@
|
|||||||
\def\finalout{\overfullrule=0pt}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
|
% Copyright (c) 1998 Free Software Foundation, Inc.
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
@@ -66,11 +66,11 @@
|
|||||||
% We only change the following to change the version numbers and
|
% We only change the following to change the version numbers and
|
||||||
% such.
|
% such.
|
||||||
|
|
||||||
\def\bisonversion{1.31} % the bison version
|
\def\bisonversion{1.20} % the bison version
|
||||||
|
|
||||||
\def\refcardversion{0.5} % reference card version
|
\def\refcardversion{0.4a} % reference card version
|
||||||
\def\month{November} % month
|
\def\month{August} % month
|
||||||
\def\year{2001} % year
|
\def\year{1998} % year
|
||||||
\def\version{\month\ \year, Bison Refcard Version \refcardversion}
|
\def\version{\month\ \year, Bison Refcard Version \refcardversion}
|
||||||
|
|
||||||
% for copyright notices
|
% for copyright notices
|
||||||
@@ -316,13 +316,10 @@ Options can be used as: \kbd{bison {\it options} {\it filename}}
|
|||||||
\section{Command Line Options}
|
\section{Command Line Options}
|
||||||
%*****************************
|
%*****************************
|
||||||
|
|
||||||
\key{Display usage information.} {-h}
|
|
||||||
\key{Display version information.} {-V}
|
|
||||||
\key{Generate token and {\tt YYSTYPE} definitions.} {-d}
|
\key{Generate token and {\tt YYSTYPE} definitions.} {-d}
|
||||||
\key{Prepend a prefix to external symbols.} {-p {\it prefix}}
|
|
||||||
\key{Don't put {\tt \#line} directives in the parser.} {-l}
|
\key{Don't put {\tt \#line} directives in the parser.} {-l}
|
||||||
\key{Specify the output file.} {-o {\it filename}}
|
\key{Specify the output file.} {-o {\it filename}}
|
||||||
\key{Debug or {\it trace} mode.} {-t}
|
\key{Debug or {\it trace} mode.} {-t}
|
||||||
\key{Verbose description of the parser.} {-v}
|
\key{Verbose description of the parser.} {-v}
|
||||||
\key{Emulate {\tt yacc} (generate {\tt y.tab.*} files).} {-y}
|
\key{Emulate {\tt yacc} (generate {\tt y.tab.*} files).} {-y}
|
||||||
|
|
||||||
@@ -365,8 +362,8 @@ definition, {\it n} is a {\it terminal} symbol name, {\it m} is a
|
|||||||
\vskip .10truein
|
\vskip .10truein
|
||||||
|
|
||||||
The {\tt <{\it t\/}>} after {\tt \%token, \%left, \%right} and {\tt
|
The {\tt <{\it t\/}>} after {\tt \%token, \%left, \%right} and {\tt
|
||||||
\%nonassoc} is optional. Additionally, precedence may be overridden
|
\%nonassoc} is optional. Additionally, precedence may be overridden with
|
||||||
in the rules with {\tt \%prec} commands.
|
embedded {\tt \%prec} commands.
|
||||||
|
|
||||||
\section{Parser Definition Files}
|
\section{Parser Definition Files}
|
||||||
%*********************************
|
%*********************************
|
||||||
@@ -400,7 +397,6 @@ The general form for a parser definition is:
|
|||||||
|
|
||||||
Rules take the form:
|
Rules take the form:
|
||||||
|
|
||||||
\vskip -\baselineskip
|
|
||||||
\beginexample
|
\beginexample
|
||||||
non-terminal : {\it statement} 1
|
non-terminal : {\it statement} 1
|
||||||
| {\it statement} 2
|
| {\it statement} 2
|
||||||
@@ -443,17 +439,15 @@ For example:
|
|||||||
\key{Access data associated with a symbol.} {\$\$, \$0\dots\${\it n}}
|
\key{Access data associated with a symbol.} {\$\$, \$0\dots\${\it n}}
|
||||||
\key{Access a field of the data union.} {\$\$.{\it t},
|
\key{Access a field of the data union.} {\$\$.{\it t},
|
||||||
\$0.{\it t}\dots\${\it n}.{\it t}}
|
\$0.{\it t}\dots\${\it n}.{\it t}}
|
||||||
\key{Access symbol's location.} {@\$, @0\dots@{\it n}}
|
\key{Access data's line position.} {@{\it n}.{\it line\_spec}}
|
||||||
\key{Access data's line location.} {@{\it x}.{\it line\_spec}}
|
\key{Access data's column position.} {@{\it n}.{\it column\_spec}}
|
||||||
\key{Access data's column location.} {@{\it x}.{\it column\_spec}}
|
|
||||||
|
|
||||||
|
|
||||||
\vskip .10truein
|
\vskip .10truein
|
||||||
%
|
|
||||||
Where {\it t} is a type defined in the {\tt \%union}, {\it n} is a
|
Where {\it t} is a type defined in the {\tt \%union}, {\it n} is a
|
||||||
number, {\it x} is a number or \$, {\it line\_spec} one of {\tt
|
number, {\it line\_spec} one of {\tt first_line} and {\tt last_line},
|
||||||
first_line} and {\tt last_line}, and {\it column\_spec} is specified
|
and {\it column\_spec} is specified as either {\tt first_column} or {\tt
|
||||||
as either {\tt first_column} or {\tt last_column}.
|
last_column}.
|
||||||
|
|
||||||
\section {Variables and Types}
|
\section {Variables and Types}
|
||||||
%*****************************
|
%*****************************
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
@set UPDATED 25 February 2002
|
|
||||||
@set UPDATED-MONTH February 2002
|
|
||||||
@set EDITION 1.34
|
|
||||||
@set VERSION 1.34
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
2001-09-13 GNU <[email protected]>
|
|
||||||
|
|
||||||
* Version 0.10.40 released.
|
|
||||||
|
|
||||||
@@ -1,313 +0,0 @@
|
|||||||
# Makefile for directory with message catalog handling in GNU NLS Utilities.
|
|
||||||
# Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Library General Public License as published
|
|
||||||
# by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Library General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
|
||||||
# License along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
srcdir = @srcdir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
top_builddir = ..
|
|
||||||
VPATH = @srcdir@
|
|
||||||
|
|
||||||
prefix = @prefix@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
transform = @program_transform_name@
|
|
||||||
libdir = @libdir@
|
|
||||||
includedir = @includedir@
|
|
||||||
datadir = @datadir@
|
|
||||||
localedir = $(datadir)/locale
|
|
||||||
gettextsrcdir = $(datadir)/gettext/intl
|
|
||||||
aliaspath = $(localedir)
|
|
||||||
subdir = intl
|
|
||||||
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
||||||
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
|
||||||
|
|
||||||
l = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
|
||||||
|
|
||||||
AR = ar
|
|
||||||
CC = @CC@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
YACC = @INTLBISON@ -y -d
|
|
||||||
YFLAGS = --name-prefix=__gettext
|
|
||||||
|
|
||||||
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
|
|
||||||
-DLIBDIR=\"$(libdir)\" @DEFS@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
|
|
||||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
|
||||||
|
|
||||||
HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h
|
|
||||||
COMHDRS = gettext.h gettextP.h hash-string.h
|
|
||||||
SOURCES = $(COMSRCS) intl-compat.c
|
|
||||||
COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
|
|
||||||
finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
|
|
||||||
explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
|
|
||||||
localcharset.c
|
|
||||||
OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
|
|
||||||
finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
|
|
||||||
explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \
|
|
||||||
plural.$lo localcharset.$lo
|
|
||||||
GETTOBJS = intl-compat.$lo
|
|
||||||
DISTFILES.common = Makefile.in \
|
|
||||||
config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
|
|
||||||
DISTFILES.generated = plural.c
|
|
||||||
DISTFILES.normal = VERSION
|
|
||||||
DISTFILES.gettext = COPYING.LIB-2 COPYING.LIB-2.1 libintl.glibc
|
|
||||||
DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c
|
|
||||||
|
|
||||||
# Libtool's library version information for libintl.
|
|
||||||
# Before making a gettext release, the gettext maintainer must change this
|
|
||||||
# according to the libtool documentation, section "Library interface versions".
|
|
||||||
# Maintainers of other packages that include the intl directory must *not*
|
|
||||||
# change these values.
|
|
||||||
LTV_CURRENT=1
|
|
||||||
LTV_REVISION=1
|
|
||||||
LTV_AGE=0
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .c .y .o .lo .sin .sed
|
|
||||||
.c.o:
|
|
||||||
$(COMPILE) $<
|
|
||||||
.c.lo:
|
|
||||||
$(LIBTOOL) --mode=compile $(COMPILE) $<
|
|
||||||
|
|
||||||
.y.c:
|
|
||||||
$(YACC) $(YFLAGS) --output $@ $<
|
|
||||||
rm -f $*.h
|
|
||||||
|
|
||||||
.sin.sed:
|
|
||||||
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
|
|
||||||
mv t-$@ $@
|
|
||||||
|
|
||||||
INCLUDES = -I.. -I. -I$(top_srcdir)/intl
|
|
||||||
|
|
||||||
all: all-@USE_INCLUDED_LIBINTL@
|
|
||||||
all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
|
|
||||||
all-no: all-no-@BUILD_INCLUDED_LIBINTL@
|
|
||||||
all-no-yes: libgnuintl.$la
|
|
||||||
all-no-no:
|
|
||||||
|
|
||||||
libintl.a libgnuintl.a: $(OBJECTS)
|
|
||||||
rm -f $@
|
|
||||||
$(AR) cru $@ $(OBJECTS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
libintl.la libgnuintl.la: $(OBJECTS)
|
|
||||||
$(LIBTOOL) --mode=link \
|
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
|
|
||||||
$(OBJECTS) @LIBICONV@ \
|
|
||||||
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
|
|
||||||
-rpath $(libdir) \
|
|
||||||
-no-undefined
|
|
||||||
|
|
||||||
libintl.h: libgnuintl.h
|
|
||||||
cp $(srcdir)/libgnuintl.h libintl.h
|
|
||||||
|
|
||||||
charset.alias: config.charset
|
|
||||||
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
|
|
||||||
mv t-$@ $@
|
|
||||||
|
|
||||||
check: all
|
|
||||||
|
|
||||||
# This installation goal is only used in GNU gettext. Packages which
|
|
||||||
# only use the library should use install instead.
|
|
||||||
|
|
||||||
# We must not install the libintl.h/libintl.a files if we are on a
|
|
||||||
# system which has the GNU gettext() function in its C library or in a
|
|
||||||
# separate library.
|
|
||||||
# If you want to use the one which comes with this version of the
|
|
||||||
# package, you have to use `configure --with-included-gettext'.
|
|
||||||
install: install-exec install-data
|
|
||||||
install-exec: all
|
|
||||||
if test "$(PACKAGE)" = "gettext" \
|
|
||||||
&& test '@INTLOBJS@' = '$(GETTOBJS)'; then \
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
|
|
||||||
$(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
|
|
||||||
$(LIBTOOL) --mode=install \
|
|
||||||
$(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
|
|
||||||
else \
|
|
||||||
: ; \
|
|
||||||
fi
|
|
||||||
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(libdir); \
|
|
||||||
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
|
|
||||||
dest=$(DESTDIR)$(libdir)/charset.alias; \
|
|
||||||
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
|
|
||||||
orig=$(DESTDIR)$(libdir)/charset.alias; \
|
|
||||||
sed -f ref-add.sed $$orig > $$temp; \
|
|
||||||
$(INSTALL_DATA) $$temp $$dest; \
|
|
||||||
rm -f $$temp; \
|
|
||||||
else \
|
|
||||||
if test @GLIBC21@ = no; then \
|
|
||||||
orig=charset.alias; \
|
|
||||||
sed -f ref-add.sed $$orig > $$temp; \
|
|
||||||
$(INSTALL_DATA) $$temp $$dest; \
|
|
||||||
rm -f $$temp; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(localedir); \
|
|
||||||
test -f $(DESTDIR)$(localedir)/locale.alias \
|
|
||||||
&& orig=$(DESTDIR)$(localedir)/locale.alias \
|
|
||||||
|| orig=$(srcdir)/locale.alias; \
|
|
||||||
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
|
|
||||||
dest=$(DESTDIR)$(localedir)/locale.alias; \
|
|
||||||
sed -f ref-add.sed $$orig > $$temp; \
|
|
||||||
$(INSTALL_DATA) $$temp $$dest; \
|
|
||||||
rm -f $$temp; \
|
|
||||||
else \
|
|
||||||
: ; \
|
|
||||||
fi
|
|
||||||
install-data: all
|
|
||||||
if test "$(PACKAGE)" = "gettext"; then \
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
|
||||||
$(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
|
|
||||||
$(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
|
|
||||||
dists="COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common)"; \
|
|
||||||
for file in $$dists; do \
|
|
||||||
$(INSTALL_DATA) $(srcdir)/$$file \
|
|
||||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
|
||||||
done; \
|
|
||||||
chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
|
|
||||||
dists="$(DISTFILES.generated)"; \
|
|
||||||
for file in $$dists; do \
|
|
||||||
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
$(INSTALL_DATA) $$dir/$$file \
|
|
||||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
|
||||||
done; \
|
|
||||||
dists="$(DISTFILES.obsolete)"; \
|
|
||||||
for file in $$dists; do \
|
|
||||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
|
||||||
done; \
|
|
||||||
else \
|
|
||||||
: ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define this as empty until I found a useful application.
|
|
||||||
installcheck:
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
if test "$(PACKAGE)" = "gettext" \
|
|
||||||
&& test '@INTLOBJS@' = '$(GETTOBJS)'; then \
|
|
||||||
rm -f $(DESTDIR)$(includedir)/libintl.h; \
|
|
||||||
$(LIBTOOL) --mode=uninstall \
|
|
||||||
rm -f $(DESTDIR)$(libdir)/libintl.$la; \
|
|
||||||
else \
|
|
||||||
: ; \
|
|
||||||
fi
|
|
||||||
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
|
|
||||||
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
|
|
||||||
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
|
|
||||||
dest=$(DESTDIR)$(libdir)/charset.alias; \
|
|
||||||
sed -f ref-del.sed $$dest > $$temp; \
|
|
||||||
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
|
|
||||||
rm -f $$dest; \
|
|
||||||
else \
|
|
||||||
$(INSTALL_DATA) $$temp $$dest; \
|
|
||||||
fi; \
|
|
||||||
rm -f $$temp; \
|
|
||||||
fi; \
|
|
||||||
if test -f $(DESTDIR)$(localedir)/locale.alias; then \
|
|
||||||
temp=$(DESTDIR)$(localedir)/t-locale.alias; \
|
|
||||||
dest=$(DESTDIR)$(localedir)/locale.alias; \
|
|
||||||
sed -f ref-del.sed $$dest > $$temp; \
|
|
||||||
if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
|
|
||||||
rm -f $$dest; \
|
|
||||||
else \
|
|
||||||
$(INSTALL_DATA) $$temp $$dest; \
|
|
||||||
fi; \
|
|
||||||
rm -f $$temp; \
|
|
||||||
fi; \
|
|
||||||
else \
|
|
||||||
: ; \
|
|
||||||
fi
|
|
||||||
if test "$(PACKAGE)" = "gettext"; then \
|
|
||||||
for file in VERSION ChangeLog COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
|
|
||||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
|
||||||
done; \
|
|
||||||
else \
|
|
||||||
: ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
info dvi:
|
|
||||||
|
|
||||||
$(OBJECTS): ../config.h libgnuintl.h
|
|
||||||
bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
|
|
||||||
dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
|
|
||||||
|
|
||||||
tags: TAGS
|
|
||||||
|
|
||||||
TAGS: $(HEADERS) $(SOURCES)
|
|
||||||
here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
|
|
||||||
|
|
||||||
id: ID
|
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES)
|
|
||||||
here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
|
|
||||||
|
|
||||||
|
|
||||||
mostlyclean:
|
|
||||||
rm -f *.a *.la *.o *.lo core core.*
|
|
||||||
rm -f libintl.h charset.alias ref-add.sed ref-del.sed
|
|
||||||
rm -f -r .libs _libs
|
|
||||||
|
|
||||||
clean: mostlyclean
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f Makefile ID TAGS
|
|
||||||
if test "$(PACKAGE)" = gettext; then \
|
|
||||||
rm -f ChangeLog.inst $(DISTFILES.normal); \
|
|
||||||
else \
|
|
||||||
: ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
maintainer-clean: distclean
|
|
||||||
@echo "This command is intended for maintainers to use;"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
|
|
||||||
|
|
||||||
# GNU gettext needs not contain the file `VERSION' but contains some
|
|
||||||
# other files which should not be distributed in other packages.
|
|
||||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
|
||||||
dist distdir: Makefile
|
|
||||||
if test "$(PACKAGE)" = gettext; then \
|
|
||||||
additional="$(DISTFILES.gettext)"; \
|
|
||||||
else \
|
|
||||||
additional="$(DISTFILES.normal)"; \
|
|
||||||
fi; \
|
|
||||||
$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
|
|
||||||
for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
|
|
||||||
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
ln $$dir/$$file $(distdir) 2> /dev/null \
|
|
||||||
|| cp -p $$dir/$$file $(distdir); \
|
|
||||||
done
|
|
||||||
|
|
||||||
Makefile: Makefile.in ../config.status
|
|
||||||
cd .. \
|
|
||||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
GNU gettext library from gettext-0.10.40
|
|
||||||
@@ -1,369 +0,0 @@
|
|||||||
/* Implementation of the bindtextdomain(3) function
|
|
||||||
Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
#include "gettextP.h"
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* We have to handle multi-threaded applications. */
|
|
||||||
# include <bits/libc-lock.h>
|
|
||||||
#else
|
|
||||||
/* Provide dummy implementation if this is outside glibc. */
|
|
||||||
# define __libc_rwlock_define(CLASS, NAME)
|
|
||||||
# define __libc_rwlock_wrlock(NAME)
|
|
||||||
# define __libc_rwlock_unlock(NAME)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The internal variables in the standalone libintl.a must have different
|
|
||||||
names than the internal variables in GNU libc, otherwise programs
|
|
||||||
using libintl.a cannot be linked statically. */
|
|
||||||
#if !defined _LIBC
|
|
||||||
# define _nl_default_dirname _nl_default_dirname__
|
|
||||||
# define _nl_domain_bindings _nl_domain_bindings__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
|
|
||||||
#ifndef offsetof
|
|
||||||
# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Contains the default location of the message catalogs. */
|
|
||||||
extern const char _nl_default_dirname[];
|
|
||||||
|
|
||||||
/* List with bindings of specific domains. */
|
|
||||||
extern struct binding *_nl_domain_bindings;
|
|
||||||
|
|
||||||
/* Lock variable to protect the global data in the gettext implementation. */
|
|
||||||
__libc_rwlock_define (extern, _nl_state_lock)
|
|
||||||
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define BINDTEXTDOMAIN __bindtextdomain
|
|
||||||
# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
|
|
||||||
# ifndef strdup
|
|
||||||
# define strdup(str) __strdup (str)
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define BINDTEXTDOMAIN bindtextdomain__
|
|
||||||
# define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Prototypes for local functions. */
|
|
||||||
static void set_binding_values PARAMS ((const char *domainname,
|
|
||||||
const char **dirnamep,
|
|
||||||
const char **codesetp));
|
|
||||||
|
|
||||||
/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
|
|
||||||
to be used for the DOMAINNAME message catalog.
|
|
||||||
If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
|
|
||||||
modified, only the current value is returned.
|
|
||||||
If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
|
|
||||||
modified nor returned. */
|
|
||||||
static void
|
|
||||||
set_binding_values (domainname, dirnamep, codesetp)
|
|
||||||
const char *domainname;
|
|
||||||
const char **dirnamep;
|
|
||||||
const char **codesetp;
|
|
||||||
{
|
|
||||||
struct binding *binding;
|
|
||||||
int modified;
|
|
||||||
|
|
||||||
/* Some sanity checks. */
|
|
||||||
if (domainname == NULL || domainname[0] == '\0')
|
|
||||||
{
|
|
||||||
if (dirnamep)
|
|
||||||
*dirnamep = NULL;
|
|
||||||
if (codesetp)
|
|
||||||
*codesetp = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
__libc_rwlock_wrlock (_nl_state_lock);
|
|
||||||
|
|
||||||
modified = 0;
|
|
||||||
|
|
||||||
for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
|
|
||||||
{
|
|
||||||
int compare = strcmp (domainname, binding->domainname);
|
|
||||||
if (compare == 0)
|
|
||||||
/* We found it! */
|
|
||||||
break;
|
|
||||||
if (compare < 0)
|
|
||||||
{
|
|
||||||
/* It is not in the list. */
|
|
||||||
binding = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (binding != NULL)
|
|
||||||
{
|
|
||||||
if (dirnamep)
|
|
||||||
{
|
|
||||||
const char *dirname = *dirnamep;
|
|
||||||
|
|
||||||
if (dirname == NULL)
|
|
||||||
/* The current binding has be to returned. */
|
|
||||||
*dirnamep = binding->dirname;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* The domain is already bound. If the new value and the old
|
|
||||||
one are equal we simply do nothing. Otherwise replace the
|
|
||||||
old binding. */
|
|
||||||
char *result = binding->dirname;
|
|
||||||
if (strcmp (dirname, result) != 0)
|
|
||||||
{
|
|
||||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
|
||||||
result = (char *) _nl_default_dirname;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#if defined _LIBC || defined HAVE_STRDUP
|
|
||||||
result = strdup (dirname);
|
|
||||||
#else
|
|
||||||
size_t len = strlen (dirname) + 1;
|
|
||||||
result = (char *) malloc (len);
|
|
||||||
if (__builtin_expect (result != NULL, 1))
|
|
||||||
memcpy (result, dirname, len);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (__builtin_expect (result != NULL, 1))
|
|
||||||
{
|
|
||||||
if (binding->dirname != _nl_default_dirname)
|
|
||||||
free (binding->dirname);
|
|
||||||
|
|
||||||
binding->dirname = result;
|
|
||||||
modified = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*dirnamep = result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (codesetp)
|
|
||||||
{
|
|
||||||
const char *codeset = *codesetp;
|
|
||||||
|
|
||||||
if (codeset == NULL)
|
|
||||||
/* The current binding has be to returned. */
|
|
||||||
*codesetp = binding->codeset;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* The domain is already bound. If the new value and the old
|
|
||||||
one are equal we simply do nothing. Otherwise replace the
|
|
||||||
old binding. */
|
|
||||||
char *result = binding->codeset;
|
|
||||||
if (result == NULL || strcmp (codeset, result) != 0)
|
|
||||||
{
|
|
||||||
#if defined _LIBC || defined HAVE_STRDUP
|
|
||||||
result = strdup (codeset);
|
|
||||||
#else
|
|
||||||
size_t len = strlen (codeset) + 1;
|
|
||||||
result = (char *) malloc (len);
|
|
||||||
if (__builtin_expect (result != NULL, 1))
|
|
||||||
memcpy (result, codeset, len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (__builtin_expect (result != NULL, 1))
|
|
||||||
{
|
|
||||||
if (binding->codeset != NULL)
|
|
||||||
free (binding->codeset);
|
|
||||||
|
|
||||||
binding->codeset = result;
|
|
||||||
binding->codeset_cntr++;
|
|
||||||
modified = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*codesetp = result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ((dirnamep == NULL || *dirnamep == NULL)
|
|
||||||
&& (codesetp == NULL || *codesetp == NULL))
|
|
||||||
{
|
|
||||||
/* Simply return the default values. */
|
|
||||||
if (dirnamep)
|
|
||||||
*dirnamep = _nl_default_dirname;
|
|
||||||
if (codesetp)
|
|
||||||
*codesetp = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* We have to create a new binding. */
|
|
||||||
size_t len = strlen (domainname) + 1;
|
|
||||||
struct binding *new_binding =
|
|
||||||
(struct binding *) malloc (offsetof (struct binding, domainname) + len);
|
|
||||||
|
|
||||||
if (__builtin_expect (new_binding == NULL, 0))
|
|
||||||
goto failed;
|
|
||||||
|
|
||||||
memcpy (new_binding->domainname, domainname, len);
|
|
||||||
|
|
||||||
if (dirnamep)
|
|
||||||
{
|
|
||||||
const char *dirname = *dirnamep;
|
|
||||||
|
|
||||||
if (dirname == NULL)
|
|
||||||
/* The default value. */
|
|
||||||
dirname = _nl_default_dirname;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
|
||||||
dirname = _nl_default_dirname;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *result;
|
|
||||||
#if defined _LIBC || defined HAVE_STRDUP
|
|
||||||
result = strdup (dirname);
|
|
||||||
if (__builtin_expect (result == NULL, 0))
|
|
||||||
goto failed_dirname;
|
|
||||||
#else
|
|
||||||
size_t len = strlen (dirname) + 1;
|
|
||||||
result = (char *) malloc (len);
|
|
||||||
if (__builtin_expect (result == NULL, 0))
|
|
||||||
goto failed_dirname;
|
|
||||||
memcpy (result, dirname, len);
|
|
||||||
#endif
|
|
||||||
dirname = result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*dirnamep = dirname;
|
|
||||||
new_binding->dirname = (char *) dirname;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* The default value. */
|
|
||||||
new_binding->dirname = (char *) _nl_default_dirname;
|
|
||||||
|
|
||||||
new_binding->codeset_cntr = 0;
|
|
||||||
|
|
||||||
if (codesetp)
|
|
||||||
{
|
|
||||||
const char *codeset = *codesetp;
|
|
||||||
|
|
||||||
if (codeset != NULL)
|
|
||||||
{
|
|
||||||
char *result;
|
|
||||||
|
|
||||||
#if defined _LIBC || defined HAVE_STRDUP
|
|
||||||
result = strdup (codeset);
|
|
||||||
if (__builtin_expect (result == NULL, 0))
|
|
||||||
goto failed_codeset;
|
|
||||||
#else
|
|
||||||
size_t len = strlen (codeset) + 1;
|
|
||||||
result = (char *) malloc (len);
|
|
||||||
if (__builtin_expect (result == NULL, 0))
|
|
||||||
goto failed_codeset;
|
|
||||||
memcpy (result, codeset, len);
|
|
||||||
#endif
|
|
||||||
codeset = result;
|
|
||||||
new_binding->codeset_cntr++;
|
|
||||||
}
|
|
||||||
*codesetp = codeset;
|
|
||||||
new_binding->codeset = (char *) codeset;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
new_binding->codeset = NULL;
|
|
||||||
|
|
||||||
/* Now enqueue it. */
|
|
||||||
if (_nl_domain_bindings == NULL
|
|
||||||
|| strcmp (domainname, _nl_domain_bindings->domainname) < 0)
|
|
||||||
{
|
|
||||||
new_binding->next = _nl_domain_bindings;
|
|
||||||
_nl_domain_bindings = new_binding;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
binding = _nl_domain_bindings;
|
|
||||||
while (binding->next != NULL
|
|
||||||
&& strcmp (domainname, binding->next->domainname) > 0)
|
|
||||||
binding = binding->next;
|
|
||||||
|
|
||||||
new_binding->next = binding->next;
|
|
||||||
binding->next = new_binding;
|
|
||||||
}
|
|
||||||
|
|
||||||
modified = 1;
|
|
||||||
|
|
||||||
/* Here we deal with memory allocation failures. */
|
|
||||||
if (0)
|
|
||||||
{
|
|
||||||
failed_codeset:
|
|
||||||
if (new_binding->dirname != _nl_default_dirname)
|
|
||||||
free (new_binding->dirname);
|
|
||||||
failed_dirname:
|
|
||||||
free (new_binding);
|
|
||||||
failed:
|
|
||||||
if (dirnamep)
|
|
||||||
*dirnamep = NULL;
|
|
||||||
if (codesetp)
|
|
||||||
*codesetp = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we modified any binding, we flush the caches. */
|
|
||||||
if (modified)
|
|
||||||
++_nl_msg_cat_cntr;
|
|
||||||
|
|
||||||
__libc_rwlock_unlock (_nl_state_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Specify that the DOMAINNAME message catalog will be found
|
|
||||||
in DIRNAME rather than in the system locale data base. */
|
|
||||||
char *
|
|
||||||
BINDTEXTDOMAIN (domainname, dirname)
|
|
||||||
const char *domainname;
|
|
||||||
const char *dirname;
|
|
||||||
{
|
|
||||||
set_binding_values (domainname, &dirname, NULL);
|
|
||||||
return (char *) dirname;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Specify the character encoding in which the messages from the
|
|
||||||
DOMAINNAME message catalog will be returned. */
|
|
||||||
char *
|
|
||||||
BIND_TEXTDOMAIN_CODESET (domainname, codeset)
|
|
||||||
const char *domainname;
|
|
||||||
const char *codeset;
|
|
||||||
{
|
|
||||||
set_binding_values (domainname, NULL, &codeset);
|
|
||||||
return (char *) codeset;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Aliases for function names in GNU C Library. */
|
|
||||||
weak_alias (__bindtextdomain, bindtextdomain);
|
|
||||||
weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
|
|
||||||
#endif
|
|
||||||
@@ -1,438 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Output a system dependent table of character encoding aliases.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2000-2001 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Library General Public License as published
|
|
||||||
# by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Library General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
|
||||||
# License along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
#
|
|
||||||
# The table consists of lines of the form
|
|
||||||
# ALIAS CANONICAL
|
|
||||||
#
|
|
||||||
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
|
|
||||||
# ALIAS is compared in a case sensitive way.
|
|
||||||
#
|
|
||||||
# CANONICAL is the GNU canonical name for this character encoding.
|
|
||||||
# It must be an encoding supported by libiconv. Support by GNU libc is
|
|
||||||
# also desirable. CANONICAL is case insensitive. Usually an upper case
|
|
||||||
# MIME charset name is preferred.
|
|
||||||
# The current list of GNU canonical charset names is as follows.
|
|
||||||
#
|
|
||||||
# name used by which systems a MIME name?
|
|
||||||
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd
|
|
||||||
# ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes
|
|
||||||
# ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes
|
|
||||||
# ISO-8859-3 glibc yes
|
|
||||||
# ISO-8859-4 osf solaris freebsd yes
|
|
||||||
# ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes
|
|
||||||
# ISO-8859-6 glibc aix hpux solaris yes
|
|
||||||
# ISO-8859-7 glibc aix hpux irix osf solaris yes
|
|
||||||
# ISO-8859-8 glibc aix hpux osf solaris yes
|
|
||||||
# ISO-8859-9 glibc aix hpux irix osf solaris yes
|
|
||||||
# ISO-8859-13 glibc
|
|
||||||
# ISO-8859-15 glibc aix osf solaris freebsd
|
|
||||||
# KOI8-R glibc solaris freebsd yes
|
|
||||||
# KOI8-U glibc freebsd yes
|
|
||||||
# CP437 dos
|
|
||||||
# CP775 dos
|
|
||||||
# CP850 aix osf dos
|
|
||||||
# CP852 dos
|
|
||||||
# CP855 dos
|
|
||||||
# CP856 aix
|
|
||||||
# CP857 dos
|
|
||||||
# CP861 dos
|
|
||||||
# CP862 dos
|
|
||||||
# CP864 dos
|
|
||||||
# CP865 dos
|
|
||||||
# CP866 freebsd dos
|
|
||||||
# CP869 dos
|
|
||||||
# CP874 win32 dos
|
|
||||||
# CP922 aix
|
|
||||||
# CP932 aix win32 dos
|
|
||||||
# CP943 aix
|
|
||||||
# CP949 osf win32 dos
|
|
||||||
# CP950 win32 dos
|
|
||||||
# CP1046 aix
|
|
||||||
# CP1124 aix
|
|
||||||
# CP1129 aix
|
|
||||||
# CP1250 win32
|
|
||||||
# CP1251 glibc win32
|
|
||||||
# CP1252 aix win32
|
|
||||||
# CP1253 win32
|
|
||||||
# CP1254 win32
|
|
||||||
# CP1255 win32
|
|
||||||
# CP1256 win32
|
|
||||||
# CP1257 win32
|
|
||||||
# GB2312 glibc aix hpux irix solaris freebsd yes
|
|
||||||
# EUC-JP glibc aix hpux irix osf solaris freebsd yes
|
|
||||||
# EUC-KR glibc aix hpux irix osf solaris freebsd yes
|
|
||||||
# EUC-TW glibc aix hpux irix osf solaris
|
|
||||||
# BIG5 glibc aix hpux osf solaris freebsd yes
|
|
||||||
# BIG5-HKSCS glibc
|
|
||||||
# GBK aix osf win32 dos
|
|
||||||
# GB18030 glibc
|
|
||||||
# SHIFT_JIS hpux osf solaris freebsd yes
|
|
||||||
# JOHAB glibc win32
|
|
||||||
# TIS-620 glibc aix hpux osf solaris
|
|
||||||
# VISCII glibc yes
|
|
||||||
# HP-ROMAN8 hpux
|
|
||||||
# HP-ARABIC8 hpux
|
|
||||||
# HP-GREEK8 hpux
|
|
||||||
# HP-HEBREW8 hpux
|
|
||||||
# HP-TURKISH8 hpux
|
|
||||||
# HP-KANA8 hpux
|
|
||||||
# DEC-KANJI osf
|
|
||||||
# DEC-HANYU osf
|
|
||||||
# UTF-8 glibc aix hpux osf solaris yes
|
|
||||||
#
|
|
||||||
# Note: Names which are not marked as being a MIME name should not be used in
|
|
||||||
# Internet protocols for information interchange (mail, news, etc.).
|
|
||||||
#
|
|
||||||
# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
|
|
||||||
# must understand both names and treat them as equivalent.
|
|
||||||
#
|
|
||||||
# The first argument passed to this file is the canonical host specification,
|
|
||||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
|
||||||
# or
|
|
||||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
|
||||||
|
|
||||||
host="$1"
|
|
||||||
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
|
|
||||||
echo "# This file contains a table of character encoding aliases,"
|
|
||||||
echo "# suitable for operating system '${os}'."
|
|
||||||
echo "# It was automatically generated from config.charset."
|
|
||||||
# List of references, updated during installation:
|
|
||||||
echo "# Packages using this file: "
|
|
||||||
case "$os" in
|
|
||||||
linux* | *-gnu*)
|
|
||||||
# With glibc-2.1 or newer, we don't need any canonicalization,
|
|
||||||
# because glibc has iconv and both glibc and libiconv support all
|
|
||||||
# GNU canonical names directly. Therefore, the Makefile does not
|
|
||||||
# need to install the alias file at all.
|
|
||||||
# The following applies only to glibc-2.0.x and older libcs.
|
|
||||||
echo "ISO_646.IRV:1983 ASCII"
|
|
||||||
;;
|
|
||||||
aix*)
|
|
||||||
echo "ISO8859-1 ISO-8859-1"
|
|
||||||
echo "ISO8859-2 ISO-8859-2"
|
|
||||||
echo "ISO8859-5 ISO-8859-5"
|
|
||||||
echo "ISO8859-6 ISO-8859-6"
|
|
||||||
echo "ISO8859-7 ISO-8859-7"
|
|
||||||
echo "ISO8859-8 ISO-8859-8"
|
|
||||||
echo "ISO8859-9 ISO-8859-9"
|
|
||||||
echo "ISO8859-15 ISO-8859-15"
|
|
||||||
echo "IBM-850 CP850"
|
|
||||||
echo "IBM-856 CP856"
|
|
||||||
echo "IBM-921 ISO-8859-13"
|
|
||||||
echo "IBM-922 CP922"
|
|
||||||
echo "IBM-932 CP932"
|
|
||||||
echo "IBM-943 CP943"
|
|
||||||
echo "IBM-1046 CP1046"
|
|
||||||
echo "IBM-1124 CP1124"
|
|
||||||
echo "IBM-1129 CP1129"
|
|
||||||
echo "IBM-1252 CP1252"
|
|
||||||
echo "IBM-eucCN GB2312"
|
|
||||||
echo "IBM-eucJP EUC-JP"
|
|
||||||
echo "IBM-eucKR EUC-KR"
|
|
||||||
echo "IBM-eucTW EUC-TW"
|
|
||||||
echo "big5 BIG5"
|
|
||||||
echo "GBK GBK"
|
|
||||||
echo "TIS-620 TIS-620"
|
|
||||||
echo "UTF-8 UTF-8"
|
|
||||||
;;
|
|
||||||
hpux*)
|
|
||||||
echo "iso88591 ISO-8859-1"
|
|
||||||
echo "iso88592 ISO-8859-2"
|
|
||||||
echo "iso88595 ISO-8859-5"
|
|
||||||
echo "iso88596 ISO-8859-6"
|
|
||||||
echo "iso88597 ISO-8859-7"
|
|
||||||
echo "iso88598 ISO-8859-8"
|
|
||||||
echo "iso88599 ISO-8859-9"
|
|
||||||
echo "iso885915 ISO-8859-15"
|
|
||||||
echo "roman8 HP-ROMAN8"
|
|
||||||
echo "arabic8 HP-ARABIC8"
|
|
||||||
echo "greek8 HP-GREEK8"
|
|
||||||
echo "hebrew8 HP-HEBREW8"
|
|
||||||
echo "turkish8 HP-TURKISH8"
|
|
||||||
echo "kana8 HP-KANA8"
|
|
||||||
echo "tis620 TIS-620"
|
|
||||||
echo "big5 BIG5"
|
|
||||||
echo "eucJP EUC-JP"
|
|
||||||
echo "eucKR EUC-KR"
|
|
||||||
echo "eucTW EUC-TW"
|
|
||||||
echo "hp15CN GB2312"
|
|
||||||
#echo "ccdc ?" # what is this?
|
|
||||||
echo "SJIS SHIFT_JIS"
|
|
||||||
echo "utf8 UTF-8"
|
|
||||||
;;
|
|
||||||
irix*)
|
|
||||||
echo "ISO8859-1 ISO-8859-1"
|
|
||||||
echo "ISO8859-2 ISO-8859-2"
|
|
||||||
echo "ISO8859-5 ISO-8859-5"
|
|
||||||
echo "ISO8859-7 ISO-8859-7"
|
|
||||||
echo "ISO8859-9 ISO-8859-9"
|
|
||||||
echo "eucCN GB2312"
|
|
||||||
echo "eucJP EUC-JP"
|
|
||||||
echo "eucKR EUC-KR"
|
|
||||||
echo "eucTW EUC-TW"
|
|
||||||
;;
|
|
||||||
osf*)
|
|
||||||
echo "ISO8859-1 ISO-8859-1"
|
|
||||||
echo "ISO8859-2 ISO-8859-2"
|
|
||||||
echo "ISO8859-4 ISO-8859-4"
|
|
||||||
echo "ISO8859-5 ISO-8859-5"
|
|
||||||
echo "ISO8859-7 ISO-8859-7"
|
|
||||||
echo "ISO8859-8 ISO-8859-8"
|
|
||||||
echo "ISO8859-9 ISO-8859-9"
|
|
||||||
echo "ISO8859-15 ISO-8859-15"
|
|
||||||
echo "cp850 CP850"
|
|
||||||
echo "big5 BIG5"
|
|
||||||
echo "dechanyu DEC-HANYU"
|
|
||||||
echo "dechanzi GB2312"
|
|
||||||
echo "deckanji DEC-KANJI"
|
|
||||||
echo "deckorean EUC-KR"
|
|
||||||
echo "eucJP EUC-JP"
|
|
||||||
echo "eucKR EUC-KR"
|
|
||||||
echo "eucTW EUC-TW"
|
|
||||||
echo "GBK GBK"
|
|
||||||
echo "KSC5601 CP949"
|
|
||||||
echo "sdeckanji EUC-JP"
|
|
||||||
echo "SJIS SHIFT_JIS"
|
|
||||||
echo "TACTIS TIS-620"
|
|
||||||
echo "UTF-8 UTF-8"
|
|
||||||
;;
|
|
||||||
solaris*)
|
|
||||||
echo "646 ASCII"
|
|
||||||
echo "ISO8859-1 ISO-8859-1"
|
|
||||||
echo "ISO8859-2 ISO-8859-2"
|
|
||||||
echo "ISO8859-4 ISO-8859-4"
|
|
||||||
echo "ISO8859-5 ISO-8859-5"
|
|
||||||
echo "ISO8859-6 ISO-8859-6"
|
|
||||||
echo "ISO8859-7 ISO-8859-7"
|
|
||||||
echo "ISO8859-8 ISO-8859-8"
|
|
||||||
echo "ISO8859-9 ISO-8859-9"
|
|
||||||
echo "ISO8859-15 ISO-8859-15"
|
|
||||||
echo "koi8-r KOI8-R"
|
|
||||||
echo "BIG5 BIG5"
|
|
||||||
echo "gb2312 GB2312"
|
|
||||||
echo "cns11643 EUC-TW"
|
|
||||||
echo "5601 EUC-KR"
|
|
||||||
echo "eucJP EUC-JP"
|
|
||||||
echo "PCK SHIFT_JIS"
|
|
||||||
echo "TIS620.2533 TIS-620"
|
|
||||||
#echo "sun_eu_greek ?" # what is this?
|
|
||||||
echo "UTF-8 UTF-8"
|
|
||||||
;;
|
|
||||||
freebsd*)
|
|
||||||
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
|
|
||||||
# localcharset.c falls back to using the full locale name
|
|
||||||
# from the environment variables.
|
|
||||||
echo "C ASCII"
|
|
||||||
echo "US-ASCII ASCII"
|
|
||||||
for l in la_LN lt_LN; do
|
|
||||||
echo "$l.ASCII ASCII"
|
|
||||||
done
|
|
||||||
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
|
||||||
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
|
|
||||||
lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
|
|
||||||
echo "$l.ISO_8859-1 ISO-8859-1"
|
|
||||||
echo "$l.DIS_8859-15 ISO-8859-15"
|
|
||||||
done
|
|
||||||
for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
|
|
||||||
echo "$l.ISO_8859-2 ISO-8859-2"
|
|
||||||
done
|
|
||||||
for l in la_LN lt_LT; do
|
|
||||||
echo "$l.ISO_8859-4 ISO-8859-4"
|
|
||||||
done
|
|
||||||
for l in ru_RU ru_SU; do
|
|
||||||
echo "$l.KOI8-R KOI8-R"
|
|
||||||
echo "$l.ISO_8859-5 ISO-8859-5"
|
|
||||||
echo "$l.CP866 CP866"
|
|
||||||
done
|
|
||||||
echo "uk_UA.KOI8-U KOI8-U"
|
|
||||||
echo "zh_TW.BIG5 BIG5"
|
|
||||||
echo "zh_TW.Big5 BIG5"
|
|
||||||
echo "zh_CN.EUC GB2312"
|
|
||||||
echo "ja_JP.EUC EUC-JP"
|
|
||||||
echo "ja_JP.SJIS SHIFT_JIS"
|
|
||||||
echo "ja_JP.Shift_JIS SHIFT_JIS"
|
|
||||||
echo "ko_KR.EUC EUC-KR"
|
|
||||||
;;
|
|
||||||
beos*)
|
|
||||||
# BeOS has a single locale, and it has UTF-8 encoding.
|
|
||||||
echo "* UTF-8"
|
|
||||||
;;
|
|
||||||
msdosdjgpp*)
|
|
||||||
# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
|
|
||||||
# localcharset.c falls back to using the full locale name
|
|
||||||
# from the environment variables.
|
|
||||||
echo "#"
|
|
||||||
echo "# The encodings given here may not all be correct."
|
|
||||||
echo "# If you find that the encoding given for your language and"
|
|
||||||
echo "# country is not the one your DOS machine actually uses, just"
|
|
||||||
echo "# correct it in this file, and send a mail to"
|
|
||||||
echo "# Juan Manuel Guerrero <[email protected]>"
|
|
||||||
echo "# and Bruno Haible <[email protected]>."
|
|
||||||
echo "#"
|
|
||||||
echo "C ASCII"
|
|
||||||
# ISO-8859-1 languages
|
|
||||||
echo "ca CP850"
|
|
||||||
echo "ca_ES CP850"
|
|
||||||
echo "da CP865" # not CP850 ??
|
|
||||||
echo "da_DK CP865" # not CP850 ??
|
|
||||||
echo "de CP850"
|
|
||||||
echo "de_AT CP850"
|
|
||||||
echo "de_CH CP850"
|
|
||||||
echo "de_DE CP850"
|
|
||||||
echo "en CP850"
|
|
||||||
echo "en_AU CP850" # not CP437 ??
|
|
||||||
echo "en_CA CP850"
|
|
||||||
echo "en_GB CP850"
|
|
||||||
echo "en_NZ CP437"
|
|
||||||
echo "en_US CP437"
|
|
||||||
echo "en_ZA CP850" # not CP437 ??
|
|
||||||
echo "es CP850"
|
|
||||||
echo "es_AR CP850"
|
|
||||||
echo "es_BO CP850"
|
|
||||||
echo "es_CL CP850"
|
|
||||||
echo "es_CO CP850"
|
|
||||||
echo "es_CR CP850"
|
|
||||||
echo "es_CU CP850"
|
|
||||||
echo "es_DO CP850"
|
|
||||||
echo "es_EC CP850"
|
|
||||||
echo "es_ES CP850"
|
|
||||||
echo "es_GT CP850"
|
|
||||||
echo "es_HN CP850"
|
|
||||||
echo "es_MX CP850"
|
|
||||||
echo "es_NI CP850"
|
|
||||||
echo "es_PA CP850"
|
|
||||||
echo "es_PY CP850"
|
|
||||||
echo "es_PE CP850"
|
|
||||||
echo "es_SV CP850"
|
|
||||||
echo "es_UY CP850"
|
|
||||||
echo "es_VE CP850"
|
|
||||||
echo "et CP850"
|
|
||||||
echo "et_EE CP850"
|
|
||||||
echo "eu CP850"
|
|
||||||
echo "eu_ES CP850"
|
|
||||||
echo "fi CP850"
|
|
||||||
echo "fi_FI CP850"
|
|
||||||
echo "fr CP850"
|
|
||||||
echo "fr_BE CP850"
|
|
||||||
echo "fr_CA CP850"
|
|
||||||
echo "fr_CH CP850"
|
|
||||||
echo "fr_FR CP850"
|
|
||||||
echo "ga CP850"
|
|
||||||
echo "ga_IE CP850"
|
|
||||||
echo "gd CP850"
|
|
||||||
echo "gd_GB CP850"
|
|
||||||
echo "gl CP850"
|
|
||||||
echo "gl_ES CP850"
|
|
||||||
echo "id CP850" # not CP437 ??
|
|
||||||
echo "id_ID CP850" # not CP437 ??
|
|
||||||
echo "is CP861" # not CP850 ??
|
|
||||||
echo "is_IS CP861" # not CP850 ??
|
|
||||||
echo "it CP850"
|
|
||||||
echo "it_CH CP850"
|
|
||||||
echo "it_IT CP850"
|
|
||||||
echo "lt CP775"
|
|
||||||
echo "lt_LT CP775"
|
|
||||||
echo "lv CP775"
|
|
||||||
echo "lv_LV CP775"
|
|
||||||
echo "nb CP865" # not CP850 ??
|
|
||||||
echo "nb_NO CP865" # not CP850 ??
|
|
||||||
echo "nl CP850"
|
|
||||||
echo "nl_BE CP850"
|
|
||||||
echo "nl_NL CP850"
|
|
||||||
echo "nn CP865" # not CP850 ??
|
|
||||||
echo "nn_NO CP865" # not CP850 ??
|
|
||||||
echo "no CP865" # not CP850 ??
|
|
||||||
echo "no_NO CP865" # not CP850 ??
|
|
||||||
echo "pt CP850"
|
|
||||||
echo "pt_BR CP850"
|
|
||||||
echo "pt_PT CP850"
|
|
||||||
echo "sv CP850"
|
|
||||||
echo "sv_SE CP850"
|
|
||||||
# ISO-8859-2 languages
|
|
||||||
echo "cs CP852"
|
|
||||||
echo "cs_CZ CP852"
|
|
||||||
echo "hr CP852"
|
|
||||||
echo "hr_HR CP852"
|
|
||||||
echo "hu CP852"
|
|
||||||
echo "hu_HU CP852"
|
|
||||||
echo "pl CP852"
|
|
||||||
echo "pl_PL CP852"
|
|
||||||
echo "ro CP852"
|
|
||||||
echo "ro_RO CP852"
|
|
||||||
echo "sk CP852"
|
|
||||||
echo "sk_SK CP852"
|
|
||||||
echo "sl CP852"
|
|
||||||
echo "sl_SI CP852"
|
|
||||||
echo "sq CP852"
|
|
||||||
echo "sq_AL CP852"
|
|
||||||
echo "sr CP852" # CP852 or CP866 or CP855 ??
|
|
||||||
echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
|
|
||||||
# ISO-8859-3 languages
|
|
||||||
echo "mt CP850"
|
|
||||||
echo "mt_MT CP850"
|
|
||||||
# ISO-8859-5 languages
|
|
||||||
echo "be CP866"
|
|
||||||
echo "be_BE CP866"
|
|
||||||
echo "bg CP866" # not CP855 ??
|
|
||||||
echo "bg_BG CP866" # not CP855 ??
|
|
||||||
echo "mk CP866" # not CP855 ??
|
|
||||||
echo "mk_MK CP866" # not CP855 ??
|
|
||||||
echo "ru KOI8-R" # not CP866 ??
|
|
||||||
echo "ru_RU KOI8-R" # not CP866 ??
|
|
||||||
# ISO-8859-6 languages
|
|
||||||
echo "ar CP864"
|
|
||||||
echo "ar_AE CP864"
|
|
||||||
echo "ar_DZ CP864"
|
|
||||||
echo "ar_EG CP864"
|
|
||||||
echo "ar_IQ CP864"
|
|
||||||
echo "ar_IR CP864"
|
|
||||||
echo "ar_JO CP864"
|
|
||||||
echo "ar_KW CP864"
|
|
||||||
echo "ar_MA CP864"
|
|
||||||
echo "ar_OM CP864"
|
|
||||||
echo "ar_QA CP864"
|
|
||||||
echo "ar_SA CP864"
|
|
||||||
echo "ar_SY CP864"
|
|
||||||
# ISO-8859-7 languages
|
|
||||||
echo "el CP869"
|
|
||||||
echo "el_GR CP869"
|
|
||||||
# ISO-8859-8 languages
|
|
||||||
echo "he CP862"
|
|
||||||
echo "he_IL CP862"
|
|
||||||
# ISO-8859-9 languages
|
|
||||||
echo "tr CP857"
|
|
||||||
echo "tr_TR CP857"
|
|
||||||
# Japanese
|
|
||||||
echo "ja CP932"
|
|
||||||
echo "ja_JP CP932"
|
|
||||||
# Chinese
|
|
||||||
echo "zh_CN GBK"
|
|
||||||
echo "zh_TW CP950" # not CP938 ??
|
|
||||||
# Korean
|
|
||||||
echo "kr CP949" # not CP934 ??
|
|
||||||
echo "kr_KR CP949" # not CP934 ??
|
|
||||||
# Thai
|
|
||||||
echo "th CP874"
|
|
||||||
echo "th_TH CP874"
|
|
||||||
# Other
|
|
||||||
echo "eo CP850"
|
|
||||||
echo "eo_EO CP850"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
/* Implementation of the dcgettext(3) function.
|
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define DCGETTEXT __dcgettext
|
|
||||||
# define DCIGETTEXT __dcigettext
|
|
||||||
#else
|
|
||||||
# define DCGETTEXT dcgettext__
|
|
||||||
# define DCIGETTEXT dcigettext__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
|
||||||
locale. */
|
|
||||||
char *
|
|
||||||
DCGETTEXT (domainname, msgid, category)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid;
|
|
||||||
int category;
|
|
||||||
{
|
|
||||||
return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Alias for function name in GNU C Library. */
|
|
||||||
weak_alias (__dcgettext, dcgettext);
|
|
||||||
#endif
|
|
||||||
-1259
File diff suppressed because it is too large
Load Diff
@@ -1,60 +0,0 @@
|
|||||||
/* Implementation of the dcngettext(3) function.
|
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define DCNGETTEXT __dcngettext
|
|
||||||
# define DCIGETTEXT __dcigettext
|
|
||||||
#else
|
|
||||||
# define DCNGETTEXT dcngettext__
|
|
||||||
# define DCIGETTEXT dcigettext__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
|
||||||
locale. */
|
|
||||||
char *
|
|
||||||
DCNGETTEXT (domainname, msgid1, msgid2, n, category)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid1;
|
|
||||||
const char *msgid2;
|
|
||||||
unsigned long int n;
|
|
||||||
int category;
|
|
||||||
{
|
|
||||||
return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Alias for function name in GNU C Library. */
|
|
||||||
weak_alias (__dcngettext, dcngettext);
|
|
||||||
#endif
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
/* Implementation of the dgettext(3) function.
|
|
||||||
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define DGETTEXT __dgettext
|
|
||||||
# define DCGETTEXT __dcgettext
|
|
||||||
#else
|
|
||||||
# define DGETTEXT dgettext__
|
|
||||||
# define DCGETTEXT dcgettext__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look up MSGID in the DOMAINNAME message catalog of the current
|
|
||||||
LC_MESSAGES locale. */
|
|
||||||
char *
|
|
||||||
DGETTEXT (domainname, msgid)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid;
|
|
||||||
{
|
|
||||||
return DCGETTEXT (domainname, msgid, LC_MESSAGES);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Alias for function name in GNU C Library. */
|
|
||||||
weak_alias (__dgettext, dgettext);
|
|
||||||
#endif
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
/* Implementation of the dngettext(3) function.
|
|
||||||
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define DNGETTEXT __dngettext
|
|
||||||
# define DCNGETTEXT __dcngettext
|
|
||||||
#else
|
|
||||||
# define DNGETTEXT dngettext__
|
|
||||||
# define DCNGETTEXT dcngettext__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look up MSGID in the DOMAINNAME message catalog of the current
|
|
||||||
LC_MESSAGES locale and skip message according to the plural form. */
|
|
||||||
char *
|
|
||||||
DNGETTEXT (domainname, msgid1, msgid2, n)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid1;
|
|
||||||
const char *msgid2;
|
|
||||||
unsigned long int n;
|
|
||||||
{
|
|
||||||
return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Alias for function name in GNU C Library. */
|
|
||||||
weak_alias (__dngettext, dngettext);
|
|
||||||
#endif
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
Contributed by Ulrich Drepper <[email protected]>, 1995.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include "loadinfo.h"
|
|
||||||
|
|
||||||
/* On some strange systems still no definition of NULL is found. Sigh! */
|
|
||||||
#ifndef NULL
|
|
||||||
# if defined __STDC__ && __STDC__
|
|
||||||
# define NULL ((void *) 0)
|
|
||||||
# else
|
|
||||||
# define NULL 0
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
char *
|
|
||||||
_nl_find_language (name)
|
|
||||||
const char *name;
|
|
||||||
{
|
|
||||||
while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
|
|
||||||
&& name[0] != '+' && name[0] != ',')
|
|
||||||
++name;
|
|
||||||
|
|
||||||
return (char *) name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
_nl_explode_name (name, language, modifier, territory, codeset,
|
|
||||||
normalized_codeset, special, sponsor, revision)
|
|
||||||
char *name;
|
|
||||||
const char **language;
|
|
||||||
const char **modifier;
|
|
||||||
const char **territory;
|
|
||||||
const char **codeset;
|
|
||||||
const char **normalized_codeset;
|
|
||||||
const char **special;
|
|
||||||
const char **sponsor;
|
|
||||||
const char **revision;
|
|
||||||
{
|
|
||||||
enum { undecided, xpg, cen } syntax;
|
|
||||||
char *cp;
|
|
||||||
int mask;
|
|
||||||
|
|
||||||
*modifier = NULL;
|
|
||||||
*territory = NULL;
|
|
||||||
*codeset = NULL;
|
|
||||||
*normalized_codeset = NULL;
|
|
||||||
*special = NULL;
|
|
||||||
*sponsor = NULL;
|
|
||||||
*revision = NULL;
|
|
||||||
|
|
||||||
/* Now we determine the single parts of the locale name. First
|
|
||||||
look for the language. Termination symbols are `_' and `@' if
|
|
||||||
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
|
|
||||||
mask = 0;
|
|
||||||
syntax = undecided;
|
|
||||||
*language = cp = name;
|
|
||||||
cp = _nl_find_language (*language);
|
|
||||||
|
|
||||||
if (*language == cp)
|
|
||||||
/* This does not make sense: language has to be specified. Use
|
|
||||||
this entry as it is without exploding. Perhaps it is an alias. */
|
|
||||||
cp = strchr (*language, '\0');
|
|
||||||
else if (cp[0] == '_')
|
|
||||||
{
|
|
||||||
/* Next is the territory. */
|
|
||||||
cp[0] = '\0';
|
|
||||||
*territory = ++cp;
|
|
||||||
|
|
||||||
while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
|
|
||||||
&& cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= TERRITORY;
|
|
||||||
|
|
||||||
if (cp[0] == '.')
|
|
||||||
{
|
|
||||||
/* Next is the codeset. */
|
|
||||||
syntax = xpg;
|
|
||||||
cp[0] = '\0';
|
|
||||||
*codeset = ++cp;
|
|
||||||
|
|
||||||
while (cp[0] != '\0' && cp[0] != '@')
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= XPG_CODESET;
|
|
||||||
|
|
||||||
if (*codeset != cp && (*codeset)[0] != '\0')
|
|
||||||
{
|
|
||||||
*normalized_codeset = _nl_normalize_codeset (*codeset,
|
|
||||||
cp - *codeset);
|
|
||||||
if (strcmp (*codeset, *normalized_codeset) == 0)
|
|
||||||
free ((char *) *normalized_codeset);
|
|
||||||
else
|
|
||||||
mask |= XPG_NORM_CODESET;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
|
|
||||||
{
|
|
||||||
/* Next is the modifier. */
|
|
||||||
syntax = cp[0] == '@' ? xpg : cen;
|
|
||||||
cp[0] = '\0';
|
|
||||||
*modifier = ++cp;
|
|
||||||
|
|
||||||
while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
|
|
||||||
&& cp[0] != ',' && cp[0] != '_')
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= XPG_MODIFIER | CEN_AUDIENCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
|
|
||||||
{
|
|
||||||
syntax = cen;
|
|
||||||
|
|
||||||
if (cp[0] == '+')
|
|
||||||
{
|
|
||||||
/* Next is special application (CEN syntax). */
|
|
||||||
cp[0] = '\0';
|
|
||||||
*special = ++cp;
|
|
||||||
|
|
||||||
while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= CEN_SPECIAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cp[0] == ',')
|
|
||||||
{
|
|
||||||
/* Next is sponsor (CEN syntax). */
|
|
||||||
cp[0] = '\0';
|
|
||||||
*sponsor = ++cp;
|
|
||||||
|
|
||||||
while (cp[0] != '\0' && cp[0] != '_')
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
mask |= CEN_SPONSOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cp[0] == '_')
|
|
||||||
{
|
|
||||||
/* Next is revision (CEN syntax). */
|
|
||||||
cp[0] = '\0';
|
|
||||||
*revision = ++cp;
|
|
||||||
|
|
||||||
mask |= CEN_REVISION;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* For CEN syntax values it might be important to have the
|
|
||||||
separator character in the file name, not for XPG syntax. */
|
|
||||||
if (syntax == xpg)
|
|
||||||
{
|
|
||||||
if (*territory != NULL && (*territory)[0] == '\0')
|
|
||||||
mask &= ~TERRITORY;
|
|
||||||
|
|
||||||
if (*codeset != NULL && (*codeset)[0] == '\0')
|
|
||||||
mask &= ~XPG_CODESET;
|
|
||||||
|
|
||||||
if (*modifier != NULL && (*modifier)[0] == '\0')
|
|
||||||
mask &= ~XPG_MODIFIER;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mask;
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
/* Handle list of needed message catalogs
|
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
Written by Ulrich Drepper <[email protected]>, 1995.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#if defined HAVE_UNISTD_H || defined _LIBC
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
/* List of already loaded domains. */
|
|
||||||
static struct loaded_l10nfile *_nl_loaded_domains;
|
|
||||||
|
|
||||||
|
|
||||||
/* Return a data structure describing the message catalog described by
|
|
||||||
the DOMAINNAME and CATEGORY parameters with respect to the currently
|
|
||||||
established bindings. */
|
|
||||||
struct loaded_l10nfile *
|
|
||||||
internal_function
|
|
||||||
_nl_find_domain (dirname, locale, domainname, domainbinding)
|
|
||||||
const char *dirname;
|
|
||||||
char *locale;
|
|
||||||
const char *domainname;
|
|
||||||
struct binding *domainbinding;
|
|
||||||
{
|
|
||||||
struct loaded_l10nfile *retval;
|
|
||||||
const char *language;
|
|
||||||
const char *modifier;
|
|
||||||
const char *territory;
|
|
||||||
const char *codeset;
|
|
||||||
const char *normalized_codeset;
|
|
||||||
const char *special;
|
|
||||||
const char *sponsor;
|
|
||||||
const char *revision;
|
|
||||||
const char *alias_value;
|
|
||||||
int mask;
|
|
||||||
|
|
||||||
/* LOCALE can consist of up to four recognized parts for the XPG syntax:
|
|
||||||
|
|
||||||
language[_territory[.codeset]][@modifier]
|
|
||||||
|
|
||||||
and six parts for the CEN syntax:
|
|
||||||
|
|
||||||
language[_territory][+audience][+special][,[sponsor][_revision]]
|
|
||||||
|
|
||||||
Beside the first part all of them are allowed to be missing. If
|
|
||||||
the full specified locale is not found, the less specific one are
|
|
||||||
looked for. The various parts will be stripped off according to
|
|
||||||
the following order:
|
|
||||||
(1) revision
|
|
||||||
(2) sponsor
|
|
||||||
(3) special
|
|
||||||
(4) codeset
|
|
||||||
(5) normalized codeset
|
|
||||||
(6) territory
|
|
||||||
(7) audience/modifier
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* If we have already tested for this locale entry there has to
|
|
||||||
be one data set in the list of loaded domains. */
|
|
||||||
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
|
||||||
strlen (dirname) + 1, 0, locale, NULL, NULL,
|
|
||||||
NULL, NULL, NULL, NULL, NULL, domainname, 0);
|
|
||||||
if (retval != NULL)
|
|
||||||
{
|
|
||||||
/* We know something about this locale. */
|
|
||||||
int cnt;
|
|
||||||
|
|
||||||
if (retval->decided == 0)
|
|
||||||
_nl_load_domain (retval, domainbinding);
|
|
||||||
|
|
||||||
if (retval->data != NULL)
|
|
||||||
return retval;
|
|
||||||
|
|
||||||
for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
|
|
||||||
{
|
|
||||||
if (retval->successor[cnt]->decided == 0)
|
|
||||||
_nl_load_domain (retval->successor[cnt], domainbinding);
|
|
||||||
|
|
||||||
if (retval->successor[cnt]->data != NULL)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return cnt >= 0 ? retval : NULL;
|
|
||||||
/* NOTREACHED */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* See whether the locale value is an alias. If yes its value
|
|
||||||
*overwrites* the alias name. No test for the original value is
|
|
||||||
done. */
|
|
||||||
alias_value = _nl_expand_alias (locale);
|
|
||||||
if (alias_value != NULL)
|
|
||||||
{
|
|
||||||
#if defined _LIBC || defined HAVE_STRDUP
|
|
||||||
locale = strdup (alias_value);
|
|
||||||
if (locale == NULL)
|
|
||||||
return NULL;
|
|
||||||
#else
|
|
||||||
size_t len = strlen (alias_value) + 1;
|
|
||||||
locale = (char *) malloc (len);
|
|
||||||
if (locale == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
memcpy (locale, alias_value, len);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now we determine the single parts of the locale name. First
|
|
||||||
look for the language. Termination symbols are `_' and `@' if
|
|
||||||
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
|
|
||||||
mask = _nl_explode_name (locale, &language, &modifier, &territory,
|
|
||||||
&codeset, &normalized_codeset, &special,
|
|
||||||
&sponsor, &revision);
|
|
||||||
|
|
||||||
/* Create all possible locale entries which might be interested in
|
|
||||||
generalization. */
|
|
||||||
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
|
||||||
strlen (dirname) + 1, mask, language, territory,
|
|
||||||
codeset, normalized_codeset, modifier, special,
|
|
||||||
sponsor, revision, domainname, 1);
|
|
||||||
if (retval == NULL)
|
|
||||||
/* This means we are out of core. */
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (retval->decided == 0)
|
|
||||||
_nl_load_domain (retval, domainbinding);
|
|
||||||
if (retval->data == NULL)
|
|
||||||
{
|
|
||||||
int cnt;
|
|
||||||
for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
|
|
||||||
{
|
|
||||||
if (retval->successor[cnt]->decided == 0)
|
|
||||||
_nl_load_domain (retval->successor[cnt], domainbinding);
|
|
||||||
if (retval->successor[cnt]->data != NULL)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The room for an alias was dynamically allocated. Free it now. */
|
|
||||||
if (alias_value != NULL)
|
|
||||||
free (locale);
|
|
||||||
|
|
||||||
/* The space for normalized_codeset is dynamically allocated. Free it. */
|
|
||||||
if (mask & XPG_NORM_CODESET)
|
|
||||||
free ((void *) normalized_codeset);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
static void __attribute__ ((unused))
|
|
||||||
free_mem (void)
|
|
||||||
{
|
|
||||||
struct loaded_l10nfile *runp = _nl_loaded_domains;
|
|
||||||
|
|
||||||
while (runp != NULL)
|
|
||||||
{
|
|
||||||
struct loaded_l10nfile *here = runp;
|
|
||||||
if (runp->data != NULL)
|
|
||||||
_nl_unload_domain ((struct loaded_domain *) runp->data);
|
|
||||||
runp = runp->next;
|
|
||||||
free ((char *) here->filename);
|
|
||||||
free (here);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
text_set_element (__libc_subfreeres, free_mem);
|
|
||||||
#endif
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
/* Implementation of gettext(3) function.
|
|
||||||
Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define __need_NULL
|
|
||||||
# include <stddef.h>
|
|
||||||
#else
|
|
||||||
# include <stdlib.h> /* Just for NULL. */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define GETTEXT __gettext
|
|
||||||
# define DCGETTEXT __dcgettext
|
|
||||||
#else
|
|
||||||
# define GETTEXT gettext__
|
|
||||||
# define DCGETTEXT dcgettext__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look up MSGID in the current default message catalog for the current
|
|
||||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
|
||||||
text). */
|
|
||||||
char *
|
|
||||||
GETTEXT (msgid)
|
|
||||||
const char *msgid;
|
|
||||||
{
|
|
||||||
return DCGETTEXT (NULL, msgid, LC_MESSAGES);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Alias for function name in GNU C Library. */
|
|
||||||
weak_alias (__gettext, gettext);
|
|
||||||
#endif
|
|
||||||
-102
@@ -1,102 +0,0 @@
|
|||||||
/* Description of GNU message catalog format: general file layout.
|
|
||||||
Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifndef _GETTEXT_H
|
|
||||||
#define _GETTEXT_H 1
|
|
||||||
|
|
||||||
#if HAVE_LIMITS_H || _LIBC
|
|
||||||
# include <limits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* The magic number of the GNU message catalog format. */
|
|
||||||
#define _MAGIC 0x950412de
|
|
||||||
#define _MAGIC_SWAPPED 0xde120495
|
|
||||||
|
|
||||||
/* Revision number of the currently used .mo (binary) file format. */
|
|
||||||
#define MO_REVISION_NUMBER 0
|
|
||||||
|
|
||||||
/* The following contortions are an attempt to use the C preprocessor
|
|
||||||
to determine an unsigned integral type that is 32 bits wide. An
|
|
||||||
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
|
||||||
as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
|
|
||||||
when cross-compiling. */
|
|
||||||
|
|
||||||
#if __STDC__
|
|
||||||
# define UINT_MAX_32_BITS 4294967295U
|
|
||||||
#else
|
|
||||||
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
|
|
||||||
This should be valid for all systems GNU cares about because
|
|
||||||
that doesn't include 16-bit systems, and only modern systems
|
|
||||||
(that certainly have <limits.h>) have 64+-bit integral types. */
|
|
||||||
|
|
||||||
#ifndef UINT_MAX
|
|
||||||
# define UINT_MAX UINT_MAX_32_BITS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UINT_MAX == UINT_MAX_32_BITS
|
|
||||||
typedef unsigned nls_uint32;
|
|
||||||
#else
|
|
||||||
# if USHRT_MAX == UINT_MAX_32_BITS
|
|
||||||
typedef unsigned short nls_uint32;
|
|
||||||
# else
|
|
||||||
# if ULONG_MAX == UINT_MAX_32_BITS
|
|
||||||
typedef unsigned long nls_uint32;
|
|
||||||
# else
|
|
||||||
/* The following line is intended to throw an error. Using #error is
|
|
||||||
not portable enough. */
|
|
||||||
"Cannot determine unsigned 32-bit data type."
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Header for binary .mo file format. */
|
|
||||||
struct mo_file_header
|
|
||||||
{
|
|
||||||
/* The magic number. */
|
|
||||||
nls_uint32 magic;
|
|
||||||
/* The revision number of the file format. */
|
|
||||||
nls_uint32 revision;
|
|
||||||
/* The number of strings pairs. */
|
|
||||||
nls_uint32 nstrings;
|
|
||||||
/* Offset of table with start offsets of original strings. */
|
|
||||||
nls_uint32 orig_tab_offset;
|
|
||||||
/* Offset of table with start offsets of translation strings. */
|
|
||||||
nls_uint32 trans_tab_offset;
|
|
||||||
/* Size of hashing table. */
|
|
||||||
nls_uint32 hash_tab_size;
|
|
||||||
/* Offset of first hashing entry. */
|
|
||||||
nls_uint32 hash_tab_offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct string_desc
|
|
||||||
{
|
|
||||||
/* Length of addressed string. */
|
|
||||||
nls_uint32 length;
|
|
||||||
/* Offset of string in file. */
|
|
||||||
nls_uint32 offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* @@ begin of epilog @@ */
|
|
||||||
|
|
||||||
#endif /* gettext.h */
|
|
||||||
-252
@@ -1,252 +0,0 @@
|
|||||||
/* Header describing internals of libintl library.
|
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
Written by Ulrich Drepper <[email protected]>, 1995.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifndef _GETTEXTP_H
|
|
||||||
#define _GETTEXTP_H
|
|
||||||
|
|
||||||
#include <stddef.h> /* Get size_t. */
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include "../iconv/gconv_int.h"
|
|
||||||
#else
|
|
||||||
# if HAVE_ICONV
|
|
||||||
# include <iconv.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "loadinfo.h"
|
|
||||||
|
|
||||||
#include "gettext.h" /* Get nls_uint32. */
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
#ifndef PARAMS
|
|
||||||
# if __STDC__
|
|
||||||
# define PARAMS(args) args
|
|
||||||
# else
|
|
||||||
# define PARAMS(args) ()
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef internal_function
|
|
||||||
# define internal_function
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Tell the compiler when a conditional or integer expression is
|
|
||||||
almost always true or almost always false. */
|
|
||||||
#ifndef HAVE_BUILTIN_EXPECT
|
|
||||||
# define __builtin_expect(expr, val) (expr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef W
|
|
||||||
# define W(flag, data) ((flag) ? SWAP (data) : (data))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <byteswap.h>
|
|
||||||
# define SWAP(i) bswap_32 (i)
|
|
||||||
#else
|
|
||||||
static inline nls_uint32
|
|
||||||
SWAP (i)
|
|
||||||
nls_uint32 i;
|
|
||||||
{
|
|
||||||
return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* This is the representation of the expressions to determine the
|
|
||||||
plural form. */
|
|
||||||
struct expression
|
|
||||||
{
|
|
||||||
int nargs; /* Number of arguments. */
|
|
||||||
enum operator
|
|
||||||
{
|
|
||||||
/* Without arguments: */
|
|
||||||
var, /* The variable "n". */
|
|
||||||
num, /* Decimal number. */
|
|
||||||
/* Unary operators: */
|
|
||||||
lnot, /* Logical NOT. */
|
|
||||||
/* Binary operators: */
|
|
||||||
mult, /* Multiplication. */
|
|
||||||
divide, /* Division. */
|
|
||||||
module, /* Module operation. */
|
|
||||||
plus, /* Addition. */
|
|
||||||
minus, /* Subtraction. */
|
|
||||||
less_than, /* Comparison. */
|
|
||||||
greater_than, /* Comparison. */
|
|
||||||
less_or_equal, /* Comparison. */
|
|
||||||
greater_or_equal, /* Comparison. */
|
|
||||||
equal, /* Comparision for equality. */
|
|
||||||
not_equal, /* Comparision for inequality. */
|
|
||||||
land, /* Logical AND. */
|
|
||||||
lor, /* Logical OR. */
|
|
||||||
/* Ternary operators: */
|
|
||||||
qmop /* Question mark operator. */
|
|
||||||
} operation;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
unsigned long int num; /* Number value for `num'. */
|
|
||||||
struct expression *args[3]; /* Up to three arguments. */
|
|
||||||
} val;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* This is the data structure to pass information to the parser and get
|
|
||||||
the result in a thread-safe way. */
|
|
||||||
struct parse_args
|
|
||||||
{
|
|
||||||
const char *cp;
|
|
||||||
struct expression *res;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* The representation of an opened message catalog. */
|
|
||||||
struct loaded_domain
|
|
||||||
{
|
|
||||||
const char *data;
|
|
||||||
int use_mmap;
|
|
||||||
size_t mmap_size;
|
|
||||||
int must_swap;
|
|
||||||
nls_uint32 nstrings;
|
|
||||||
struct string_desc *orig_tab;
|
|
||||||
struct string_desc *trans_tab;
|
|
||||||
nls_uint32 hash_size;
|
|
||||||
nls_uint32 *hash_tab;
|
|
||||||
int codeset_cntr;
|
|
||||||
#ifdef _LIBC
|
|
||||||
__gconv_t conv;
|
|
||||||
#else
|
|
||||||
# if HAVE_ICONV
|
|
||||||
iconv_t conv;
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
char **conv_tab;
|
|
||||||
|
|
||||||
struct expression *plural;
|
|
||||||
unsigned long int nplurals;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* We want to allocate a string at the end of the struct. But ISO C
|
|
||||||
doesn't allow zero sized arrays. */
|
|
||||||
#ifdef __GNUC__
|
|
||||||
# define ZERO 0
|
|
||||||
#else
|
|
||||||
# define ZERO 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* A set of settings bound to a message domain. Used to store settings
|
|
||||||
from bindtextdomain() and bind_textdomain_codeset(). */
|
|
||||||
struct binding
|
|
||||||
{
|
|
||||||
struct binding *next;
|
|
||||||
char *dirname;
|
|
||||||
int codeset_cntr; /* Incremented each time codeset changes. */
|
|
||||||
char *codeset;
|
|
||||||
char domainname[ZERO];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* A counter which is incremented each time some previous translations
|
|
||||||
become invalid.
|
|
||||||
This variable is part of the external ABI of the GNU libintl. */
|
|
||||||
extern int _nl_msg_cat_cntr;
|
|
||||||
|
|
||||||
struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
|
|
||||||
char *__locale,
|
|
||||||
const char *__domainname,
|
|
||||||
struct binding *__domainbinding))
|
|
||||||
internal_function;
|
|
||||||
void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
|
|
||||||
struct binding *__domainbinding))
|
|
||||||
internal_function;
|
|
||||||
void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
|
|
||||||
internal_function;
|
|
||||||
const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
|
|
||||||
struct loaded_domain *__domain,
|
|
||||||
struct binding *__domainbinding))
|
|
||||||
internal_function;
|
|
||||||
void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
|
|
||||||
internal_function;
|
|
||||||
|
|
||||||
char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
|
|
||||||
struct binding *domainbinding,
|
|
||||||
const char *msgid, size_t *lengthp))
|
|
||||||
internal_function;
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
extern char *__gettext PARAMS ((const char *__msgid));
|
|
||||||
extern char *__dgettext PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid));
|
|
||||||
extern char *__dcgettext PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid, int __category));
|
|
||||||
extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
|
|
||||||
unsigned long int __n));
|
|
||||||
extern char *__dngettext PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid1, const char *__msgid2,
|
|
||||||
unsigned long int n));
|
|
||||||
extern char *__dcngettext PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid1, const char *__msgid2,
|
|
||||||
unsigned long int __n, int __category));
|
|
||||||
extern char *__dcigettext PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid1, const char *__msgid2,
|
|
||||||
int __plural, unsigned long int __n,
|
|
||||||
int __category));
|
|
||||||
extern char *__textdomain PARAMS ((const char *__domainname));
|
|
||||||
extern char *__bindtextdomain PARAMS ((const char *__domainname,
|
|
||||||
const char *__dirname));
|
|
||||||
extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
|
|
||||||
const char *__codeset));
|
|
||||||
#else
|
|
||||||
extern char *gettext__ PARAMS ((const char *__msgid));
|
|
||||||
extern char *dgettext__ PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid));
|
|
||||||
extern char *dcgettext__ PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid, int __category));
|
|
||||||
extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
|
|
||||||
unsigned long int __n));
|
|
||||||
extern char *dngettext__ PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid1, const char *__msgid2,
|
|
||||||
unsigned long int __n));
|
|
||||||
extern char *dcngettext__ PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid1, const char *__msgid2,
|
|
||||||
unsigned long int __n, int __category));
|
|
||||||
extern char *dcigettext__ PARAMS ((const char *__domainname,
|
|
||||||
const char *__msgid1, const char *__msgid2,
|
|
||||||
int __plural, unsigned long int __n,
|
|
||||||
int __category));
|
|
||||||
extern char *textdomain__ PARAMS ((const char *__domainname));
|
|
||||||
extern char *bindtextdomain__ PARAMS ((const char *__domainname,
|
|
||||||
const char *__dirname));
|
|
||||||
extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
|
|
||||||
const char *__codeset));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
extern void __gettext_free_exp PARAMS ((struct expression *exp))
|
|
||||||
internal_function;
|
|
||||||
extern int __gettextparse PARAMS ((void *arg));
|
|
||||||
#else
|
|
||||||
extern void gettext_free_exp__ PARAMS ((struct expression *exp))
|
|
||||||
internal_function;
|
|
||||||
extern int gettextparse__ PARAMS ((void *arg));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ begin of epilog @@ */
|
|
||||||
|
|
||||||
#endif /* gettextP.h */
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
/* Description of GNU message catalog format: string hashing function.
|
|
||||||
Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
#ifndef PARAMS
|
|
||||||
# if __STDC__
|
|
||||||
# define PARAMS(Args) Args
|
|
||||||
# else
|
|
||||||
# define PARAMS(Args) ()
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We assume to have `unsigned long int' value with at least 32 bits. */
|
|
||||||
#define HASHWORDBITS 32
|
|
||||||
|
|
||||||
|
|
||||||
/* Defines the so called `hashpjw' function by P.J. Weinberger
|
|
||||||
[see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
|
|
||||||
1986, 1987 Bell Telephone Laboratories, Inc.] */
|
|
||||||
static unsigned long int hash_string PARAMS ((const char *__str_param));
|
|
||||||
|
|
||||||
static inline unsigned long int
|
|
||||||
hash_string (str_param)
|
|
||||||
const char *str_param;
|
|
||||||
{
|
|
||||||
unsigned long int hval, g;
|
|
||||||
const char *str = str_param;
|
|
||||||
|
|
||||||
/* Compute the hash value for the given string. */
|
|
||||||
hval = 0;
|
|
||||||
while (*str != '\0')
|
|
||||||
{
|
|
||||||
hval <<= 4;
|
|
||||||
hval += (unsigned long int) *str++;
|
|
||||||
g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
|
|
||||||
if (g != 0)
|
|
||||||
{
|
|
||||||
hval ^= g >> (HASHWORDBITS - 8);
|
|
||||||
hval ^= g;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return hval;
|
|
||||||
}
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
|
|
||||||
Library.
|
|
||||||
Copyright (C) 1995, 2000, 2001 Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "libgnuintl.h"
|
|
||||||
#include "gettextP.h"
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* This file redirects the gettext functions (without prefix or suffix) to
|
|
||||||
those defined in the included GNU gettext library (with "__" suffix).
|
|
||||||
It is compiled into libintl when the included GNU gettext library is
|
|
||||||
configured --with-included-gettext.
|
|
||||||
|
|
||||||
This redirection works also in the case that the system C library or
|
|
||||||
the system libintl library contain gettext/textdomain/... functions.
|
|
||||||
If it didn't, we would need to add preprocessor level redirections to
|
|
||||||
libgnuintl.h of the following form:
|
|
||||||
|
|
||||||
# define gettext gettext__
|
|
||||||
# define dgettext dgettext__
|
|
||||||
# define dcgettext dcgettext__
|
|
||||||
# define ngettext ngettext__
|
|
||||||
# define dngettext dngettext__
|
|
||||||
# define dcngettext dcngettext__
|
|
||||||
# define textdomain textdomain__
|
|
||||||
# define bindtextdomain bindtextdomain__
|
|
||||||
# define bind_textdomain_codeset bind_textdomain_codeset__
|
|
||||||
|
|
||||||
How does this redirection work? There are two cases.
|
|
||||||
A. When libintl.a is linked into an executable, it works because
|
|
||||||
functions defined in the executable always override functions in
|
|
||||||
the shared libraries.
|
|
||||||
B. When libintl.so is used, it works because
|
|
||||||
1. those systems defining gettext/textdomain/... in the C library
|
|
||||||
(namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are
|
|
||||||
ELF systems and define these symbols as weak, thus explicitly
|
|
||||||
letting other shared libraries override it.
|
|
||||||
2. those systems defining gettext/textdomain/... in a standalone
|
|
||||||
libintl.so library (namely, Solaris 2.3 and newer) have this
|
|
||||||
shared library in /usr/lib, and the linker will search /usr/lib
|
|
||||||
*after* the directory where the GNU gettext library is installed.
|
|
||||||
|
|
||||||
A third case, namely when libintl.a is linked into a shared library
|
|
||||||
whose name is not libintl.so, is not supported. In this case, on
|
|
||||||
Solaris, when -lintl precedes the linker option for the shared library
|
|
||||||
containing GNU gettext, the system's gettext would indeed override
|
|
||||||
the GNU gettext. Anyone doing this kind of stuff must be clever enough
|
|
||||||
to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker
|
|
||||||
command line. */
|
|
||||||
|
|
||||||
|
|
||||||
#undef gettext
|
|
||||||
#undef dgettext
|
|
||||||
#undef dcgettext
|
|
||||||
#undef ngettext
|
|
||||||
#undef dngettext
|
|
||||||
#undef dcngettext
|
|
||||||
#undef textdomain
|
|
||||||
#undef bindtextdomain
|
|
||||||
#undef bind_textdomain_codeset
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
gettext (msgid)
|
|
||||||
const char *msgid;
|
|
||||||
{
|
|
||||||
return gettext__ (msgid);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
dgettext (domainname, msgid)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid;
|
|
||||||
{
|
|
||||||
return dgettext__ (domainname, msgid);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
dcgettext (domainname, msgid, category)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid;
|
|
||||||
int category;
|
|
||||||
{
|
|
||||||
return dcgettext__ (domainname, msgid, category);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
ngettext (msgid1, msgid2, n)
|
|
||||||
const char *msgid1;
|
|
||||||
const char *msgid2;
|
|
||||||
unsigned long int n;
|
|
||||||
{
|
|
||||||
return ngettext__ (msgid1, msgid2, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
dngettext (domainname, msgid1, msgid2, n)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid1;
|
|
||||||
const char *msgid2;
|
|
||||||
unsigned long int n;
|
|
||||||
{
|
|
||||||
return dngettext__ (domainname, msgid1, msgid2, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
dcngettext (domainname, msgid1, msgid2, n, category)
|
|
||||||
const char *domainname;
|
|
||||||
const char *msgid1;
|
|
||||||
const char *msgid2;
|
|
||||||
unsigned long int n;
|
|
||||||
int category;
|
|
||||||
{
|
|
||||||
return dcngettext__ (domainname, msgid1, msgid2, n, category);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
textdomain (domainname)
|
|
||||||
const char *domainname;
|
|
||||||
{
|
|
||||||
return textdomain__ (domainname);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
bindtextdomain (domainname, dirname)
|
|
||||||
const char *domainname;
|
|
||||||
const char *dirname;
|
|
||||||
{
|
|
||||||
return bindtextdomain__ (domainname, dirname);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
bind_textdomain_codeset (domainname, codeset)
|
|
||||||
const char *domainname;
|
|
||||||
const char *codeset;
|
|
||||||
{
|
|
||||||
return bind_textdomain_codeset__ (domainname, codeset);
|
|
||||||
}
|
|
||||||
@@ -1,405 +0,0 @@
|
|||||||
/* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
Contributed by Ulrich Drepper <[email protected]>, 1995.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
/* Tell glibc's <string.h> to provide a prototype for stpcpy().
|
|
||||||
This must come before <config.h> because <config.h> may include
|
|
||||||
<features.h>, and once <features.h> has been included, it's too late. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# define _GNU_SOURCE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#if !HAVE_STRCHR && !defined _LIBC
|
|
||||||
# ifndef strchr
|
|
||||||
# define strchr index
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined _LIBC || defined HAVE_ARGZ_H
|
|
||||||
# include <argz.h>
|
|
||||||
#endif
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "loadinfo.h"
|
|
||||||
|
|
||||||
/* On some strange systems still no definition of NULL is found. Sigh! */
|
|
||||||
#ifndef NULL
|
|
||||||
# if defined __STDC__ && __STDC__
|
|
||||||
# define NULL ((void *) 0)
|
|
||||||
# else
|
|
||||||
# define NULL 0
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Rename the non ANSI C functions. This is required by the standard
|
|
||||||
because some ANSI C functions will require linking with this object
|
|
||||||
file and the name space must not be polluted. */
|
|
||||||
# ifndef stpcpy
|
|
||||||
# define stpcpy(dest, src) __stpcpy(dest, src)
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# ifndef HAVE_STPCPY
|
|
||||||
static char *stpcpy PARAMS ((char *dest, const char *src));
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define function which are usually not available. */
|
|
||||||
|
|
||||||
#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
|
|
||||||
/* Returns the number of strings in ARGZ. */
|
|
||||||
static size_t argz_count__ PARAMS ((const char *argz, size_t len));
|
|
||||||
|
|
||||||
static size_t
|
|
||||||
argz_count__ (argz, len)
|
|
||||||
const char *argz;
|
|
||||||
size_t len;
|
|
||||||
{
|
|
||||||
size_t count = 0;
|
|
||||||
while (len > 0)
|
|
||||||
{
|
|
||||||
size_t part_len = strlen (argz);
|
|
||||||
argz += part_len + 1;
|
|
||||||
len -= part_len + 1;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
# undef __argz_count
|
|
||||||
# define __argz_count(argz, len) argz_count__ (argz, len)
|
|
||||||
#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
|
|
||||||
|
|
||||||
#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
|
|
||||||
/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
|
|
||||||
except the last into the character SEP. */
|
|
||||||
static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
|
|
||||||
|
|
||||||
static void
|
|
||||||
argz_stringify__ (argz, len, sep)
|
|
||||||
char *argz;
|
|
||||||
size_t len;
|
|
||||||
int sep;
|
|
||||||
{
|
|
||||||
while (len > 0)
|
|
||||||
{
|
|
||||||
size_t part_len = strlen (argz);
|
|
||||||
argz += part_len;
|
|
||||||
len -= part_len + 1;
|
|
||||||
if (len > 0)
|
|
||||||
*argz++ = sep;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# undef __argz_stringify
|
|
||||||
# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
|
|
||||||
#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
|
|
||||||
|
|
||||||
#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
|
|
||||||
static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
|
|
||||||
const char *entry));
|
|
||||||
|
|
||||||
static char *
|
|
||||||
argz_next__ (argz, argz_len, entry)
|
|
||||||
char *argz;
|
|
||||||
size_t argz_len;
|
|
||||||
const char *entry;
|
|
||||||
{
|
|
||||||
if (entry)
|
|
||||||
{
|
|
||||||
if (entry < argz + argz_len)
|
|
||||||
entry = strchr (entry, '\0') + 1;
|
|
||||||
|
|
||||||
return entry >= argz + argz_len ? NULL : (char *) entry;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (argz_len > 0)
|
|
||||||
return argz;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
# undef __argz_next
|
|
||||||
# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
|
|
||||||
#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
|
|
||||||
|
|
||||||
|
|
||||||
/* Return number of bits set in X. */
|
|
||||||
static int pop PARAMS ((int x));
|
|
||||||
|
|
||||||
static inline int
|
|
||||||
pop (x)
|
|
||||||
int x;
|
|
||||||
{
|
|
||||||
/* We assume that no more than 16 bits are used. */
|
|
||||||
x = ((x & ~0x5555) >> 1) + (x & 0x5555);
|
|
||||||
x = ((x & ~0x3333) >> 2) + (x & 0x3333);
|
|
||||||
x = ((x >> 4) + x) & 0x0f0f;
|
|
||||||
x = ((x >> 8) + x) & 0xff;
|
|
||||||
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
struct loaded_l10nfile *
|
|
||||||
_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
|
||||||
territory, codeset, normalized_codeset, modifier, special,
|
|
||||||
sponsor, revision, filename, do_allocate)
|
|
||||||
struct loaded_l10nfile **l10nfile_list;
|
|
||||||
const char *dirlist;
|
|
||||||
size_t dirlist_len;
|
|
||||||
int mask;
|
|
||||||
const char *language;
|
|
||||||
const char *territory;
|
|
||||||
const char *codeset;
|
|
||||||
const char *normalized_codeset;
|
|
||||||
const char *modifier;
|
|
||||||
const char *special;
|
|
||||||
const char *sponsor;
|
|
||||||
const char *revision;
|
|
||||||
const char *filename;
|
|
||||||
int do_allocate;
|
|
||||||
{
|
|
||||||
char *abs_filename;
|
|
||||||
struct loaded_l10nfile *last = NULL;
|
|
||||||
struct loaded_l10nfile *retval;
|
|
||||||
char *cp;
|
|
||||||
size_t entries;
|
|
||||||
int cnt;
|
|
||||||
|
|
||||||
/* Allocate room for the full file name. */
|
|
||||||
abs_filename = (char *) malloc (dirlist_len
|
|
||||||
+ strlen (language)
|
|
||||||
+ ((mask & TERRITORY) != 0
|
|
||||||
? strlen (territory) + 1 : 0)
|
|
||||||
+ ((mask & XPG_CODESET) != 0
|
|
||||||
? strlen (codeset) + 1 : 0)
|
|
||||||
+ ((mask & XPG_NORM_CODESET) != 0
|
|
||||||
? strlen (normalized_codeset) + 1 : 0)
|
|
||||||
+ (((mask & XPG_MODIFIER) != 0
|
|
||||||
|| (mask & CEN_AUDIENCE) != 0)
|
|
||||||
? strlen (modifier) + 1 : 0)
|
|
||||||
+ ((mask & CEN_SPECIAL) != 0
|
|
||||||
? strlen (special) + 1 : 0)
|
|
||||||
+ (((mask & CEN_SPONSOR) != 0
|
|
||||||
|| (mask & CEN_REVISION) != 0)
|
|
||||||
? (1 + ((mask & CEN_SPONSOR) != 0
|
|
||||||
? strlen (sponsor) + 1 : 0)
|
|
||||||
+ ((mask & CEN_REVISION) != 0
|
|
||||||
? strlen (revision) + 1 : 0)) : 0)
|
|
||||||
+ 1 + strlen (filename) + 1);
|
|
||||||
|
|
||||||
if (abs_filename == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
retval = NULL;
|
|
||||||
last = NULL;
|
|
||||||
|
|
||||||
/* Construct file name. */
|
|
||||||
memcpy (abs_filename, dirlist, dirlist_len);
|
|
||||||
__argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR);
|
|
||||||
cp = abs_filename + (dirlist_len - 1);
|
|
||||||
*cp++ = '/';
|
|
||||||
cp = stpcpy (cp, language);
|
|
||||||
|
|
||||||
if ((mask & TERRITORY) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = '_';
|
|
||||||
cp = stpcpy (cp, territory);
|
|
||||||
}
|
|
||||||
if ((mask & XPG_CODESET) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = '.';
|
|
||||||
cp = stpcpy (cp, codeset);
|
|
||||||
}
|
|
||||||
if ((mask & XPG_NORM_CODESET) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = '.';
|
|
||||||
cp = stpcpy (cp, normalized_codeset);
|
|
||||||
}
|
|
||||||
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
|
|
||||||
{
|
|
||||||
/* This component can be part of both syntaces but has different
|
|
||||||
leading characters. For CEN we use `+', else `@'. */
|
|
||||||
*cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
|
|
||||||
cp = stpcpy (cp, modifier);
|
|
||||||
}
|
|
||||||
if ((mask & CEN_SPECIAL) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = '+';
|
|
||||||
cp = stpcpy (cp, special);
|
|
||||||
}
|
|
||||||
if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = ',';
|
|
||||||
if ((mask & CEN_SPONSOR) != 0)
|
|
||||||
cp = stpcpy (cp, sponsor);
|
|
||||||
if ((mask & CEN_REVISION) != 0)
|
|
||||||
{
|
|
||||||
*cp++ = '_';
|
|
||||||
cp = stpcpy (cp, revision);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*cp++ = '/';
|
|
||||||
stpcpy (cp, filename);
|
|
||||||
|
|
||||||
/* Look in list of already loaded domains whether it is already
|
|
||||||
available. */
|
|
||||||
last = NULL;
|
|
||||||
for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
|
|
||||||
if (retval->filename != NULL)
|
|
||||||
{
|
|
||||||
int compare = strcmp (retval->filename, abs_filename);
|
|
||||||
if (compare == 0)
|
|
||||||
/* We found it! */
|
|
||||||
break;
|
|
||||||
if (compare < 0)
|
|
||||||
{
|
|
||||||
/* It's not in the list. */
|
|
||||||
retval = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
last = retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (retval != NULL || do_allocate == 0)
|
|
||||||
{
|
|
||||||
free (abs_filename);
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
retval = (struct loaded_l10nfile *)
|
|
||||||
malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
|
|
||||||
* (1 << pop (mask))
|
|
||||||
* sizeof (struct loaded_l10nfile *)));
|
|
||||||
if (retval == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
retval->filename = abs_filename;
|
|
||||||
retval->decided = (__argz_count (dirlist, dirlist_len) != 1
|
|
||||||
|| ((mask & XPG_CODESET) != 0
|
|
||||||
&& (mask & XPG_NORM_CODESET) != 0));
|
|
||||||
retval->data = NULL;
|
|
||||||
|
|
||||||
if (last == NULL)
|
|
||||||
{
|
|
||||||
retval->next = *l10nfile_list;
|
|
||||||
*l10nfile_list = retval;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
retval->next = last->next;
|
|
||||||
last->next = retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
entries = 0;
|
|
||||||
/* If the DIRLIST is a real list the RETVAL entry corresponds not to
|
|
||||||
a real file. So we have to use the DIRLIST separation mechanism
|
|
||||||
of the inner loop. */
|
|
||||||
cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
|
|
||||||
for (; cnt >= 0; --cnt)
|
|
||||||
if ((cnt & ~mask) == 0
|
|
||||||
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
|
|
||||||
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
|
|
||||||
{
|
|
||||||
/* Iterate over all elements of the DIRLIST. */
|
|
||||||
char *dir = NULL;
|
|
||||||
|
|
||||||
while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
|
|
||||||
!= NULL)
|
|
||||||
retval->successor[entries++]
|
|
||||||
= _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
|
|
||||||
language, territory, codeset,
|
|
||||||
normalized_codeset, modifier, special,
|
|
||||||
sponsor, revision, filename, 1);
|
|
||||||
}
|
|
||||||
retval->successor[entries] = NULL;
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Normalize codeset name. There is no standard for the codeset
|
|
||||||
names. Normalization allows the user to use any of the common
|
|
||||||
names. The return value is dynamically allocated and has to be
|
|
||||||
freed by the caller. */
|
|
||||||
const char *
|
|
||||||
_nl_normalize_codeset (codeset, name_len)
|
|
||||||
const char *codeset;
|
|
||||||
size_t name_len;
|
|
||||||
{
|
|
||||||
int len = 0;
|
|
||||||
int only_digit = 1;
|
|
||||||
char *retval;
|
|
||||||
char *wp;
|
|
||||||
size_t cnt;
|
|
||||||
|
|
||||||
for (cnt = 0; cnt < name_len; ++cnt)
|
|
||||||
if (isalnum (codeset[cnt]))
|
|
||||||
{
|
|
||||||
++len;
|
|
||||||
|
|
||||||
if (isalpha (codeset[cnt]))
|
|
||||||
only_digit = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
|
|
||||||
|
|
||||||
if (retval != NULL)
|
|
||||||
{
|
|
||||||
if (only_digit)
|
|
||||||
wp = stpcpy (retval, "iso");
|
|
||||||
else
|
|
||||||
wp = retval;
|
|
||||||
|
|
||||||
for (cnt = 0; cnt < name_len; ++cnt)
|
|
||||||
if (isalpha (codeset[cnt]))
|
|
||||||
*wp++ = tolower (codeset[cnt]);
|
|
||||||
else if (isdigit (codeset[cnt]))
|
|
||||||
*wp++ = codeset[cnt];
|
|
||||||
|
|
||||||
*wp = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
return (const char *) retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* @@ begin of epilog @@ */
|
|
||||||
|
|
||||||
/* We don't want libintl.a to depend on any other library. So we
|
|
||||||
avoid the non-standard function stpcpy. In GNU C Library this
|
|
||||||
function is available, though. Also allow the symbol HAVE_STPCPY
|
|
||||||
to be defined. */
|
|
||||||
#if !_LIBC && !HAVE_STPCPY
|
|
||||||
static char *
|
|
||||||
stpcpy (dest, src)
|
|
||||||
char *dest;
|
|
||||||
const char *src;
|
|
||||||
{
|
|
||||||
while ((*dest++ = *src++) != '\0')
|
|
||||||
/* Do nothing. */ ;
|
|
||||||
return dest - 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
|
||||||
Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifndef _LIBGETTEXT_H
|
|
||||||
#define _LIBGETTEXT_H 1
|
|
||||||
|
|
||||||
/* NLS can be disabled through the configure --disable-nls option. */
|
|
||||||
#if ENABLE_NLS
|
|
||||||
|
|
||||||
/* Get declarations of GNU message catalog functions. */
|
|
||||||
# include <libintl.h>
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
# define gettext(Msgid) (Msgid)
|
|
||||||
# define dgettext(Domainname, Msgid) (Msgid)
|
|
||||||
# define dcgettext(Domainname, Msgid, Category) (Msgid)
|
|
||||||
# define ngettext(Msgid1, Msgid2, N) \
|
|
||||||
((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
|
|
||||||
# define dngettext(Domainname, Msgid1, Msgid2, N) \
|
|
||||||
((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
|
|
||||||
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
|
|
||||||
((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2))
|
|
||||||
# define textdomain(Domainname) ((char *) (Domainname))
|
|
||||||
# define bindtextdomain(Domainname, Dirname) ((char *) (Dirname))
|
|
||||||
# define bind_textdomain_codeset(Domainname, Codeset) ((char *) (Codeset))
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For automatical extraction of messages sometimes no real
|
|
||||||
translation is needed. Instead the string itself is the result. */
|
|
||||||
#define gettext_noop(Str) (Str)
|
|
||||||
|
|
||||||
#endif /* _LIBGETTEXT_H */
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
/* Message catalogs for internationalization.
|
|
||||||
Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifndef _LIBINTL_H
|
|
||||||
#define _LIBINTL_H 1
|
|
||||||
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
/* The LC_MESSAGES locale category is the category used by the functions
|
|
||||||
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
|
|
||||||
On systems that don't define it, use an arbitrary value instead.
|
|
||||||
On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e.
|
|
||||||
this file!) and then only defines LC_MESSAGES. To avoid a redefinition
|
|
||||||
warning, don't define LC_MESSAGES in this case. */
|
|
||||||
#if !defined LC_MESSAGES && !defined __LOCALE_H
|
|
||||||
# define LC_MESSAGES 1729
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We define an additional symbol to signal that we use the GNU
|
|
||||||
implementation of gettext. */
|
|
||||||
#define __USE_GNU_GETTEXT 1
|
|
||||||
|
|
||||||
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
|
|
||||||
precedence over _conio_gettext. */
|
|
||||||
#ifdef __DJGPP__
|
|
||||||
# undef gettext
|
|
||||||
# define gettext gettext
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PARAMS
|
|
||||||
# if __STDC__ || defined __cplusplus
|
|
||||||
# define PARAMS(args) args
|
|
||||||
# else
|
|
||||||
# define PARAMS(args) ()
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look up MSGID in the current default message catalog for the current
|
|
||||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
|
||||||
text). */
|
|
||||||
extern char *gettext PARAMS ((const char *__msgid));
|
|
||||||
|
|
||||||
/* Look up MSGID in the DOMAINNAME message catalog for the current
|
|
||||||
LC_MESSAGES locale. */
|
|
||||||
extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
|
|
||||||
|
|
||||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
|
||||||
locale. */
|
|
||||||
extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
|
|
||||||
int __category));
|
|
||||||
|
|
||||||
|
|
||||||
/* Similar to `gettext' but select the plural form corresponding to the
|
|
||||||
number N. */
|
|
||||||
extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
|
|
||||||
unsigned long int __n));
|
|
||||||
|
|
||||||
/* Similar to `dgettext' but select the plural form corresponding to the
|
|
||||||
number N. */
|
|
||||||
extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1,
|
|
||||||
const char *__msgid2, unsigned long int __n));
|
|
||||||
|
|
||||||
/* Similar to `dcgettext' but select the plural form corresponding to the
|
|
||||||
number N. */
|
|
||||||
extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1,
|
|
||||||
const char *__msgid2, unsigned long int __n,
|
|
||||||
int __category));
|
|
||||||
|
|
||||||
|
|
||||||
/* Set the current default message catalog to DOMAINNAME.
|
|
||||||
If DOMAINNAME is null, return the current default.
|
|
||||||
If DOMAINNAME is "", reset to the default of "messages". */
|
|
||||||
extern char *textdomain PARAMS ((const char *__domainname));
|
|
||||||
|
|
||||||
/* Specify that the DOMAINNAME message catalog will be found
|
|
||||||
in DIRNAME rather than in the system locale data base. */
|
|
||||||
extern char *bindtextdomain PARAMS ((const char *__domainname,
|
|
||||||
const char *__dirname));
|
|
||||||
|
|
||||||
/* Specify the character encoding in which the messages from the
|
|
||||||
DOMAINNAME message catalog will be returned. */
|
|
||||||
extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
|
|
||||||
const char *__codeset));
|
|
||||||
|
|
||||||
|
|
||||||
/* Optimized version of the functions above. */
|
|
||||||
#if defined __OPTIMIZED
|
|
||||||
/* These are macros, but could also be inline functions. */
|
|
||||||
|
|
||||||
# define gettext(msgid) \
|
|
||||||
dgettext (NULL, msgid)
|
|
||||||
|
|
||||||
# define dgettext(domainname, msgid) \
|
|
||||||
dcgettext (domainname, msgid, LC_MESSAGES)
|
|
||||||
|
|
||||||
# define ngettext(msgid1, msgid2, n) \
|
|
||||||
dngettext (NULL, msgid1, msgid2, n)
|
|
||||||
|
|
||||||
# define dngettext(domainname, msgid1, msgid2, n) \
|
|
||||||
dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
|
|
||||||
|
|
||||||
#endif /* Optimizing. */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* libintl.h */
|
|
||||||
-109
@@ -1,109 +0,0 @@
|
|||||||
/* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
Contributed by Ulrich Drepper <[email protected]>, 1996.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifndef _LOADINFO_H
|
|
||||||
#define _LOADINFO_H 1
|
|
||||||
|
|
||||||
#ifndef PARAMS
|
|
||||||
# if __STDC__
|
|
||||||
# define PARAMS(args) args
|
|
||||||
# else
|
|
||||||
# define PARAMS(args) ()
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef internal_function
|
|
||||||
# define internal_function
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Tell the compiler when a conditional or integer expression is
|
|
||||||
almost always true or almost always false. */
|
|
||||||
#ifndef HAVE_BUILTIN_EXPECT
|
|
||||||
# define __builtin_expect(expr, val) (expr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Separator in PATH like lists of pathnames. */
|
|
||||||
#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
|
|
||||||
/* Win32, OS/2, DOS */
|
|
||||||
# define PATH_SEPARATOR ';'
|
|
||||||
#else
|
|
||||||
/* Unix */
|
|
||||||
# define PATH_SEPARATOR ':'
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Encoding of locale name parts. */
|
|
||||||
#define CEN_REVISION 1
|
|
||||||
#define CEN_SPONSOR 2
|
|
||||||
#define CEN_SPECIAL 4
|
|
||||||
#define XPG_NORM_CODESET 8
|
|
||||||
#define XPG_CODESET 16
|
|
||||||
#define TERRITORY 32
|
|
||||||
#define CEN_AUDIENCE 64
|
|
||||||
#define XPG_MODIFIER 128
|
|
||||||
|
|
||||||
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
|
|
||||||
#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
|
|
||||||
|
|
||||||
|
|
||||||
struct loaded_l10nfile
|
|
||||||
{
|
|
||||||
const char *filename;
|
|
||||||
int decided;
|
|
||||||
|
|
||||||
const void *data;
|
|
||||||
|
|
||||||
struct loaded_l10nfile *next;
|
|
||||||
struct loaded_l10nfile *successor[1];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Normalize codeset name. There is no standard for the codeset
|
|
||||||
names. Normalization allows the user to use any of the common
|
|
||||||
names. The return value is dynamically allocated and has to be
|
|
||||||
freed by the caller. */
|
|
||||||
extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
|
|
||||||
size_t name_len));
|
|
||||||
|
|
||||||
extern struct loaded_l10nfile *
|
|
||||||
_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
|
|
||||||
const char *dirlist, size_t dirlist_len, int mask,
|
|
||||||
const char *language, const char *territory,
|
|
||||||
const char *codeset,
|
|
||||||
const char *normalized_codeset,
|
|
||||||
const char *modifier, const char *special,
|
|
||||||
const char *sponsor, const char *revision,
|
|
||||||
const char *filename, int do_allocate));
|
|
||||||
|
|
||||||
|
|
||||||
extern const char *_nl_expand_alias PARAMS ((const char *name));
|
|
||||||
|
|
||||||
/* normalized_codeset is dynamically allocated and has to be freed by
|
|
||||||
the caller. */
|
|
||||||
extern int _nl_explode_name PARAMS ((char *name, const char **language,
|
|
||||||
const char **modifier,
|
|
||||||
const char **territory,
|
|
||||||
const char **codeset,
|
|
||||||
const char **normalized_codeset,
|
|
||||||
const char **special,
|
|
||||||
const char **sponsor,
|
|
||||||
const char **revision));
|
|
||||||
|
|
||||||
extern char *_nl_find_language PARAMS ((const char *name));
|
|
||||||
|
|
||||||
#endif /* loadinfo.h */
|
|
||||||
@@ -1,567 +0,0 @@
|
|||||||
/* Load needed message catalogs.
|
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
|
|
||||||
This must come before <config.h> because <config.h> may include
|
|
||||||
<features.h>, and once <features.h> has been included, it's too late. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# define _GNU_SOURCE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
# define alloca __builtin_alloca
|
|
||||||
# define HAVE_ALLOCA 1
|
|
||||||
#else
|
|
||||||
# if defined HAVE_ALLOCA_H || defined _LIBC
|
|
||||||
# include <alloca.h>
|
|
||||||
# else
|
|
||||||
# ifdef _AIX
|
|
||||||
#pragma alloca
|
|
||||||
# else
|
|
||||||
# ifndef alloca
|
|
||||||
char *alloca ();
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#if defined HAVE_UNISTD_H || defined _LIBC
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <langinfo.h>
|
|
||||||
# include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|
|
||||||
|| (defined _LIBC && defined _POSIX_MAPPED_FILES)
|
|
||||||
# include <sys/mman.h>
|
|
||||||
# undef HAVE_MMAP
|
|
||||||
# define HAVE_MMAP 1
|
|
||||||
#else
|
|
||||||
# undef HAVE_MMAP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gettext.h"
|
|
||||||
#include "gettextP.h"
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include "../locale/localeinfo.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Rename the non ISO C functions. This is required by the standard
|
|
||||||
because some ISO C functions will require linking with this object
|
|
||||||
file and the name space must not be polluted. */
|
|
||||||
# define open __open
|
|
||||||
# define close __close
|
|
||||||
# define read __read
|
|
||||||
# define mmap __mmap
|
|
||||||
# define munmap __munmap
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define PLURAL_PARSE __gettextparse
|
|
||||||
#else
|
|
||||||
# define PLURAL_PARSE gettextparse__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For those losing systems which don't have `alloca' we have to add
|
|
||||||
some additional code emulating it. */
|
|
||||||
#ifdef HAVE_ALLOCA
|
|
||||||
# define freea(p) /* nothing */
|
|
||||||
#else
|
|
||||||
# define alloca(n) malloc (n)
|
|
||||||
# define freea(p) free (p)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For systems that distinguish between text and binary I/O.
|
|
||||||
O_BINARY is usually declared in <fcntl.h>. */
|
|
||||||
#if !defined O_BINARY && defined _O_BINARY
|
|
||||||
/* For MSC-compatible compilers. */
|
|
||||||
# define O_BINARY _O_BINARY
|
|
||||||
# define O_TEXT _O_TEXT
|
|
||||||
#endif
|
|
||||||
#ifdef __BEOS__
|
|
||||||
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
|
|
||||||
# undef O_BINARY
|
|
||||||
# undef O_TEXT
|
|
||||||
#endif
|
|
||||||
/* On reasonable systems, binary I/O is the default. */
|
|
||||||
#ifndef O_BINARY
|
|
||||||
# define O_BINARY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We need a sign, whether a new catalog was loaded, which can be associated
|
|
||||||
with all translations. This is important if the translations are
|
|
||||||
cached by one of GCC's features. */
|
|
||||||
int _nl_msg_cat_cntr;
|
|
||||||
|
|
||||||
#if (defined __GNUC__ && !defined __APPLE_CC__) \
|
|
||||||
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
|
|
||||||
|
|
||||||
/* These structs are the constant expression for the germanic plural
|
|
||||||
form determination. It represents the expression "n != 1". */
|
|
||||||
static const struct expression plvar =
|
|
||||||
{
|
|
||||||
.nargs = 0,
|
|
||||||
.operation = var,
|
|
||||||
};
|
|
||||||
static const struct expression plone =
|
|
||||||
{
|
|
||||||
.nargs = 0,
|
|
||||||
.operation = num,
|
|
||||||
.val =
|
|
||||||
{
|
|
||||||
.num = 1
|
|
||||||
}
|
|
||||||
};
|
|
||||||
static struct expression germanic_plural =
|
|
||||||
{
|
|
||||||
.nargs = 2,
|
|
||||||
.operation = not_equal,
|
|
||||||
.val =
|
|
||||||
{
|
|
||||||
.args =
|
|
||||||
{
|
|
||||||
[0] = (struct expression *) &plvar,
|
|
||||||
[1] = (struct expression *) &plone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
# define INIT_GERMANIC_PLURAL()
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* For compilers without support for ISO C 99 struct/union initializers:
|
|
||||||
Initialization at run-time. */
|
|
||||||
|
|
||||||
static struct expression plvar;
|
|
||||||
static struct expression plone;
|
|
||||||
static struct expression germanic_plural;
|
|
||||||
|
|
||||||
static void
|
|
||||||
init_germanic_plural ()
|
|
||||||
{
|
|
||||||
if (plone.val.num == 0)
|
|
||||||
{
|
|
||||||
plvar.nargs = 0;
|
|
||||||
plvar.operation = var;
|
|
||||||
|
|
||||||
plone.nargs = 0;
|
|
||||||
plone.operation = num;
|
|
||||||
plone.val.num = 1;
|
|
||||||
|
|
||||||
germanic_plural.nargs = 2;
|
|
||||||
germanic_plural.operation = not_equal;
|
|
||||||
germanic_plural.val.args[0] = &plvar;
|
|
||||||
germanic_plural.val.args[1] = &plone;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialize the codeset dependent parts of an opened message catalog.
|
|
||||||
Return the header entry. */
|
|
||||||
const char *
|
|
||||||
internal_function
|
|
||||||
_nl_init_domain_conv (domain_file, domain, domainbinding)
|
|
||||||
struct loaded_l10nfile *domain_file;
|
|
||||||
struct loaded_domain *domain;
|
|
||||||
struct binding *domainbinding;
|
|
||||||
{
|
|
||||||
/* Find out about the character set the file is encoded with.
|
|
||||||
This can be found (in textual form) in the entry "". If this
|
|
||||||
entry does not exist or if this does not contain the `charset='
|
|
||||||
information, we will assume the charset matches the one the
|
|
||||||
current locale and we don't have to perform any conversion. */
|
|
||||||
char *nullentry;
|
|
||||||
size_t nullentrylen;
|
|
||||||
|
|
||||||
/* Preinitialize fields, to avoid recursion during _nl_find_msg. */
|
|
||||||
domain->codeset_cntr =
|
|
||||||
(domainbinding != NULL ? domainbinding->codeset_cntr : 0);
|
|
||||||
#ifdef _LIBC
|
|
||||||
domain->conv = (__gconv_t) -1;
|
|
||||||
#else
|
|
||||||
# if HAVE_ICONV
|
|
||||||
domain->conv = (iconv_t) -1;
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
domain->conv_tab = NULL;
|
|
||||||
|
|
||||||
/* Get the header entry. */
|
|
||||||
nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen);
|
|
||||||
|
|
||||||
if (nullentry != NULL)
|
|
||||||
{
|
|
||||||
#if defined _LIBC || HAVE_ICONV
|
|
||||||
const char *charsetstr;
|
|
||||||
|
|
||||||
charsetstr = strstr (nullentry, "charset=");
|
|
||||||
if (charsetstr != NULL)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
char *charset;
|
|
||||||
const char *outcharset;
|
|
||||||
|
|
||||||
charsetstr += strlen ("charset=");
|
|
||||||
len = strcspn (charsetstr, " \t\n");
|
|
||||||
|
|
||||||
charset = (char *) alloca (len + 1);
|
|
||||||
# if defined _LIBC || HAVE_MEMPCPY
|
|
||||||
*((char *) mempcpy (charset, charsetstr, len)) = '\0';
|
|
||||||
# else
|
|
||||||
memcpy (charset, charsetstr, len);
|
|
||||||
charset[len] = '\0';
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* The output charset should normally be determined by the
|
|
||||||
locale. But sometimes the locale is not used or not correctly
|
|
||||||
set up, so we provide a possibility for the user to override
|
|
||||||
this. Moreover, the value specified through
|
|
||||||
bind_textdomain_codeset overrides both. */
|
|
||||||
if (domainbinding != NULL && domainbinding->codeset != NULL)
|
|
||||||
outcharset = domainbinding->codeset;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outcharset = getenv ("OUTPUT_CHARSET");
|
|
||||||
if (outcharset == NULL || outcharset[0] == '\0')
|
|
||||||
{
|
|
||||||
# ifdef _LIBC
|
|
||||||
outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
|
|
||||||
# else
|
|
||||||
# if HAVE_ICONV
|
|
||||||
extern const char *locale_charset (void);
|
|
||||||
outcharset = locale_charset ();
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# ifdef _LIBC
|
|
||||||
/* We always want to use transliteration. */
|
|
||||||
outcharset = norm_add_slashes (outcharset, "TRANSLIT");
|
|
||||||
charset = norm_add_slashes (charset, NULL);
|
|
||||||
if (__gconv_open (outcharset, charset, &domain->conv,
|
|
||||||
GCONV_AVOID_NOCONV)
|
|
||||||
!= __GCONV_OK)
|
|
||||||
domain->conv = (__gconv_t) -1;
|
|
||||||
# else
|
|
||||||
# if HAVE_ICONV
|
|
||||||
/* When using GNU libiconv, we want to use transliteration. */
|
|
||||||
# if _LIBICONV_VERSION >= 0x0105
|
|
||||||
len = strlen (outcharset);
|
|
||||||
{
|
|
||||||
char *tmp = (char *) alloca (len + 10 + 1);
|
|
||||||
memcpy (tmp, outcharset, len);
|
|
||||||
memcpy (tmp + len, "//TRANSLIT", 10 + 1);
|
|
||||||
outcharset = tmp;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
domain->conv = iconv_open (outcharset, charset);
|
|
||||||
# if _LIBICONV_VERSION >= 0x0105
|
|
||||||
freea (outcharset);
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
freea (charset);
|
|
||||||
}
|
|
||||||
#endif /* _LIBC || HAVE_ICONV */
|
|
||||||
}
|
|
||||||
|
|
||||||
return nullentry;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Frees the codeset dependent parts of an opened message catalog. */
|
|
||||||
void
|
|
||||||
internal_function
|
|
||||||
_nl_free_domain_conv (domain)
|
|
||||||
struct loaded_domain *domain;
|
|
||||||
{
|
|
||||||
if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
|
|
||||||
free (domain->conv_tab);
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
if (domain->conv != (__gconv_t) -1)
|
|
||||||
__gconv_close (domain->conv);
|
|
||||||
#else
|
|
||||||
# if HAVE_ICONV
|
|
||||||
if (domain->conv != (iconv_t) -1)
|
|
||||||
iconv_close (domain->conv);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Load the message catalogs specified by FILENAME. If it is no valid
|
|
||||||
message catalog do nothing. */
|
|
||||||
void
|
|
||||||
internal_function
|
|
||||||
_nl_load_domain (domain_file, domainbinding)
|
|
||||||
struct loaded_l10nfile *domain_file;
|
|
||||||
struct binding *domainbinding;
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
size_t size;
|
|
||||||
#ifdef _LIBC
|
|
||||||
struct stat64 st;
|
|
||||||
#else
|
|
||||||
struct stat st;
|
|
||||||
#endif
|
|
||||||
struct mo_file_header *data = (struct mo_file_header *) -1;
|
|
||||||
int use_mmap = 0;
|
|
||||||
struct loaded_domain *domain;
|
|
||||||
const char *nullentry;
|
|
||||||
|
|
||||||
domain_file->decided = 1;
|
|
||||||
domain_file->data = NULL;
|
|
||||||
|
|
||||||
/* Note that it would be useless to store domainbinding in domain_file
|
|
||||||
because domainbinding might be == NULL now but != NULL later (after
|
|
||||||
a call to bind_textdomain_codeset). */
|
|
||||||
|
|
||||||
/* If the record does not represent a valid locale the FILENAME
|
|
||||||
might be NULL. This can happen when according to the given
|
|
||||||
specification the locale file name is different for XPG and CEN
|
|
||||||
syntax. */
|
|
||||||
if (domain_file->filename == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Try to open the addressed file. */
|
|
||||||
fd = open (domain_file->filename, O_RDONLY | O_BINARY);
|
|
||||||
if (fd == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* We must know about the size of the file. */
|
|
||||||
if (
|
|
||||||
#ifdef _LIBC
|
|
||||||
__builtin_expect (fstat64 (fd, &st) != 0, 0)
|
|
||||||
#else
|
|
||||||
__builtin_expect (fstat (fd, &st) != 0, 0)
|
|
||||||
#endif
|
|
||||||
|| __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
|
|
||||||
|| __builtin_expect (size < sizeof (struct mo_file_header), 0))
|
|
||||||
{
|
|
||||||
/* Something went wrong. */
|
|
||||||
close (fd);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_MMAP
|
|
||||||
/* Now we are ready to load the file. If mmap() is available we try
|
|
||||||
this first. If not available or it failed we try to load it. */
|
|
||||||
data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
|
|
||||||
MAP_PRIVATE, fd, 0);
|
|
||||||
|
|
||||||
if (__builtin_expect (data != (struct mo_file_header *) -1, 1))
|
|
||||||
{
|
|
||||||
/* mmap() call was successful. */
|
|
||||||
close (fd);
|
|
||||||
use_mmap = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If the data is not yet available (i.e. mmap'ed) we try to load
|
|
||||||
it manually. */
|
|
||||||
if (data == (struct mo_file_header *) -1)
|
|
||||||
{
|
|
||||||
size_t to_read;
|
|
||||||
char *read_ptr;
|
|
||||||
|
|
||||||
data = (struct mo_file_header *) malloc (size);
|
|
||||||
if (data == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
to_read = size;
|
|
||||||
read_ptr = (char *) data;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
long int nb = (long int) read (fd, read_ptr, to_read);
|
|
||||||
if (nb <= 0)
|
|
||||||
{
|
|
||||||
#ifdef EINTR
|
|
||||||
if (nb == -1 && errno == EINTR)
|
|
||||||
continue;
|
|
||||||
#endif
|
|
||||||
close (fd);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
read_ptr += nb;
|
|
||||||
to_read -= nb;
|
|
||||||
}
|
|
||||||
while (to_read > 0);
|
|
||||||
|
|
||||||
close (fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Using the magic number we can test whether it really is a message
|
|
||||||
catalog file. */
|
|
||||||
if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED,
|
|
||||||
0))
|
|
||||||
{
|
|
||||||
/* The magic number is wrong: not a message catalog file. */
|
|
||||||
#ifdef HAVE_MMAP
|
|
||||||
if (use_mmap)
|
|
||||||
munmap ((caddr_t) data, size);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
free (data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
|
|
||||||
if (domain == NULL)
|
|
||||||
return;
|
|
||||||
domain_file->data = domain;
|
|
||||||
|
|
||||||
domain->data = (char *) data;
|
|
||||||
domain->use_mmap = use_mmap;
|
|
||||||
domain->mmap_size = size;
|
|
||||||
domain->must_swap = data->magic != _MAGIC;
|
|
||||||
|
|
||||||
/* Fill in the information about the available tables. */
|
|
||||||
switch (W (domain->must_swap, data->revision))
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
domain->nstrings = W (domain->must_swap, data->nstrings);
|
|
||||||
domain->orig_tab = (struct string_desc *)
|
|
||||||
((char *) data + W (domain->must_swap, data->orig_tab_offset));
|
|
||||||
domain->trans_tab = (struct string_desc *)
|
|
||||||
((char *) data + W (domain->must_swap, data->trans_tab_offset));
|
|
||||||
domain->hash_size = W (domain->must_swap, data->hash_tab_size);
|
|
||||||
domain->hash_tab = (nls_uint32 *)
|
|
||||||
((char *) data + W (domain->must_swap, data->hash_tab_offset));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* This is an invalid revision. */
|
|
||||||
#ifdef HAVE_MMAP
|
|
||||||
if (use_mmap)
|
|
||||||
munmap ((caddr_t) data, size);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
free (data);
|
|
||||||
free (domain);
|
|
||||||
domain_file->data = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now initialize the character set converter from the character set
|
|
||||||
the file is encoded with (found in the header entry) to the domain's
|
|
||||||
specified character set or the locale's character set. */
|
|
||||||
nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding);
|
|
||||||
|
|
||||||
/* Also look for a plural specification. */
|
|
||||||
if (nullentry != NULL)
|
|
||||||
{
|
|
||||||
const char *plural;
|
|
||||||
const char *nplurals;
|
|
||||||
|
|
||||||
plural = strstr (nullentry, "plural=");
|
|
||||||
nplurals = strstr (nullentry, "nplurals=");
|
|
||||||
if (plural == NULL || nplurals == NULL)
|
|
||||||
goto no_plural;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* First get the number. */
|
|
||||||
char *endp;
|
|
||||||
unsigned long int n;
|
|
||||||
struct parse_args args;
|
|
||||||
|
|
||||||
nplurals += 9;
|
|
||||||
while (*nplurals != '\0' && isspace (*nplurals))
|
|
||||||
++nplurals;
|
|
||||||
#if defined HAVE_STRTOUL || defined _LIBC
|
|
||||||
n = strtoul (nplurals, &endp, 10);
|
|
||||||
#else
|
|
||||||
for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
|
|
||||||
n = n * 10 + (*endp - '0');
|
|
||||||
#endif
|
|
||||||
domain->nplurals = n;
|
|
||||||
if (nplurals == endp)
|
|
||||||
goto no_plural;
|
|
||||||
|
|
||||||
/* Due to the restrictions bison imposes onto the interface of the
|
|
||||||
scanner function we have to put the input string and the result
|
|
||||||
passed up from the parser into the same structure which address
|
|
||||||
is passed down to the parser. */
|
|
||||||
plural += 7;
|
|
||||||
args.cp = plural;
|
|
||||||
if (PLURAL_PARSE (&args) != 0)
|
|
||||||
goto no_plural;
|
|
||||||
domain->plural = args.res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* By default we are using the Germanic form: singular form only
|
|
||||||
for `one', the plural form otherwise. Yes, this is also what
|
|
||||||
English is using since English is a Germanic language. */
|
|
||||||
no_plural:
|
|
||||||
INIT_GERMANIC_PLURAL ();
|
|
||||||
domain->plural = &germanic_plural;
|
|
||||||
domain->nplurals = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
void
|
|
||||||
internal_function
|
|
||||||
_nl_unload_domain (domain)
|
|
||||||
struct loaded_domain *domain;
|
|
||||||
{
|
|
||||||
if (domain->plural != &germanic_plural)
|
|
||||||
__gettext_free_exp (domain->plural);
|
|
||||||
|
|
||||||
_nl_free_domain_conv (domain);
|
|
||||||
|
|
||||||
# ifdef _POSIX_MAPPED_FILES
|
|
||||||
if (domain->use_mmap)
|
|
||||||
munmap ((caddr_t) domain->data, domain->mmap_size);
|
|
||||||
else
|
|
||||||
# endif /* _POSIX_MAPPED_FILES */
|
|
||||||
free ((void *) domain->data);
|
|
||||||
|
|
||||||
free (domain);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -1,271 +0,0 @@
|
|||||||
/* Determine a canonical name for the current locale's character encoding.
|
|
||||||
|
|
||||||
Copyright (C) 2000-2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
/* Written by Bruno Haible <[email protected]>. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_STDDEF_H
|
|
||||||
# include <stddef.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#if HAVE_STRING_H
|
|
||||||
# include <string.h>
|
|
||||||
#else
|
|
||||||
# include <strings.h>
|
|
||||||
#endif
|
|
||||||
#if HAVE_STDLIB_H
|
|
||||||
# include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined _WIN32 || defined __WIN32__
|
|
||||||
# undef WIN32 /* avoid warning on mingw32 */
|
|
||||||
# define WIN32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
# if HAVE_LANGINFO_CODESET
|
|
||||||
# include <langinfo.h>
|
|
||||||
# else
|
|
||||||
# if HAVE_SETLOCALE
|
|
||||||
# include <locale.h>
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#else /* WIN32 */
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DIRECTORY_SEPARATOR
|
|
||||||
# define DIRECTORY_SEPARATOR '/'
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ISSLASH
|
|
||||||
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The following static variable is declared 'volatile' to avoid a
|
|
||||||
possible multithread problem in the function get_charset_aliases. If we
|
|
||||||
are running in a threaded environment, and if two threads initialize
|
|
||||||
'charset_aliases' simultaneously, both will produce the same value,
|
|
||||||
and everything will be ok if the two assignments to 'charset_aliases'
|
|
||||||
are atomic. But I don't know what will happen if the two assignments mix. */
|
|
||||||
#if __STDC__ != 1
|
|
||||||
# define volatile /* empty */
|
|
||||||
#endif
|
|
||||||
/* Pointer to the contents of the charset.alias file, if it has already been
|
|
||||||
read, else NULL. Its format is:
|
|
||||||
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
|
|
||||||
static const char * volatile charset_aliases;
|
|
||||||
|
|
||||||
/* Return a pointer to the contents of the charset.alias file. */
|
|
||||||
static const char *
|
|
||||||
get_charset_aliases ()
|
|
||||||
{
|
|
||||||
const char *cp;
|
|
||||||
|
|
||||||
cp = charset_aliases;
|
|
||||||
if (cp == NULL)
|
|
||||||
{
|
|
||||||
#ifndef WIN32
|
|
||||||
FILE *fp;
|
|
||||||
const char *dir = LIBDIR;
|
|
||||||
const char *base = "charset.alias";
|
|
||||||
char *file_name;
|
|
||||||
|
|
||||||
/* Concatenate dir and base into freshly allocated file_name. */
|
|
||||||
{
|
|
||||||
size_t dir_len = strlen (dir);
|
|
||||||
size_t base_len = strlen (base);
|
|
||||||
int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
|
|
||||||
file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
|
|
||||||
if (file_name != NULL)
|
|
||||||
{
|
|
||||||
memcpy (file_name, dir, dir_len);
|
|
||||||
if (add_slash)
|
|
||||||
file_name[dir_len] = DIRECTORY_SEPARATOR;
|
|
||||||
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
|
|
||||||
/* Out of memory or file not found, treat it as empty. */
|
|
||||||
cp = "";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Parse the file's contents. */
|
|
||||||
int c;
|
|
||||||
char buf1[50+1];
|
|
||||||
char buf2[50+1];
|
|
||||||
char *res_ptr = NULL;
|
|
||||||
size_t res_size = 0;
|
|
||||||
size_t l1, l2;
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
c = getc (fp);
|
|
||||||
if (c == EOF)
|
|
||||||
break;
|
|
||||||
if (c == '\n' || c == ' ' || c == '\t')
|
|
||||||
continue;
|
|
||||||
if (c == '#')
|
|
||||||
{
|
|
||||||
/* Skip comment, to end of line. */
|
|
||||||
do
|
|
||||||
c = getc (fp);
|
|
||||||
while (!(c == EOF || c == '\n'));
|
|
||||||
if (c == EOF)
|
|
||||||
break;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ungetc (c, fp);
|
|
||||||
if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
|
|
||||||
break;
|
|
||||||
l1 = strlen (buf1);
|
|
||||||
l2 = strlen (buf2);
|
|
||||||
if (res_size == 0)
|
|
||||||
{
|
|
||||||
res_size = l1 + 1 + l2 + 1;
|
|
||||||
res_ptr = malloc (res_size + 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
res_size += l1 + 1 + l2 + 1;
|
|
||||||
res_ptr = realloc (res_ptr, res_size + 1);
|
|
||||||
}
|
|
||||||
if (res_ptr == NULL)
|
|
||||||
{
|
|
||||||
/* Out of memory. */
|
|
||||||
res_size = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
|
|
||||||
strcpy (res_ptr + res_size - (l2 + 1), buf2);
|
|
||||||
}
|
|
||||||
fclose (fp);
|
|
||||||
if (res_size == 0)
|
|
||||||
cp = "";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*(res_ptr + res_size) = '\0';
|
|
||||||
cp = res_ptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file_name != NULL)
|
|
||||||
free (file_name);
|
|
||||||
|
|
||||||
#else /* WIN32 */
|
|
||||||
|
|
||||||
/* To avoid the troubles of installing a separate file in the same
|
|
||||||
directory as the DLL and of retrieving the DLL's directory at
|
|
||||||
runtime, simply inline the aliases here. */
|
|
||||||
|
|
||||||
cp = "CP936" "\0" "GBK" "\0"
|
|
||||||
"CP1361" "\0" "JOHAB" "\0";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
charset_aliases = cp;
|
|
||||||
}
|
|
||||||
|
|
||||||
return cp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Determine the current locale's character encoding, and canonicalize it
|
|
||||||
into one of the canonical names listed in config.charset.
|
|
||||||
The result must not be freed; it is statically allocated.
|
|
||||||
If the canonical name cannot be determined, the result is a non-canonical
|
|
||||||
name. */
|
|
||||||
|
|
||||||
#ifdef STATIC
|
|
||||||
STATIC
|
|
||||||
#endif
|
|
||||||
const char *
|
|
||||||
locale_charset ()
|
|
||||||
{
|
|
||||||
const char *codeset;
|
|
||||||
const char *aliases;
|
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
|
|
||||||
# if HAVE_LANGINFO_CODESET
|
|
||||||
|
|
||||||
/* Most systems support nl_langinfo (CODESET) nowadays. */
|
|
||||||
codeset = nl_langinfo (CODESET);
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
/* On old systems which lack it, use setlocale or getenv. */
|
|
||||||
const char *locale = NULL;
|
|
||||||
|
|
||||||
/* But most old systems don't have a complete set of locales. Some
|
|
||||||
(like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
|
|
||||||
use setlocale here; it would return "C" when it doesn't support the
|
|
||||||
locale name the user has set. */
|
|
||||||
# if HAVE_SETLOCALE && 0
|
|
||||||
locale = setlocale (LC_CTYPE, NULL);
|
|
||||||
# endif
|
|
||||||
if (locale == NULL || locale[0] == '\0')
|
|
||||||
{
|
|
||||||
locale = getenv ("LC_ALL");
|
|
||||||
if (locale == NULL || locale[0] == '\0')
|
|
||||||
{
|
|
||||||
locale = getenv ("LC_CTYPE");
|
|
||||||
if (locale == NULL || locale[0] == '\0')
|
|
||||||
locale = getenv ("LANG");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* On some old systems, one used to set locale = "iso8859_1". On others,
|
|
||||||
you set it to "language_COUNTRY.charset". In any case, we resolve it
|
|
||||||
through the charset.alias file. */
|
|
||||||
codeset = locale;
|
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#else /* WIN32 */
|
|
||||||
|
|
||||||
static char buf[2 + 10 + 1];
|
|
||||||
|
|
||||||
/* Win32 has a function returning the locale's codepage as a number. */
|
|
||||||
sprintf (buf, "CP%u", GetACP ());
|
|
||||||
codeset = buf;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (codeset == NULL)
|
|
||||||
/* The canonical name cannot be determined. */
|
|
||||||
codeset = "";
|
|
||||||
|
|
||||||
/* Resolve alias. */
|
|
||||||
for (aliases = get_charset_aliases ();
|
|
||||||
*aliases != '\0';
|
|
||||||
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
|
|
||||||
if (strcmp (codeset, aliases) == 0
|
|
||||||
|| (aliases[0] == '*' && aliases[1] == '\0'))
|
|
||||||
{
|
|
||||||
codeset = aliases + strlen (aliases) + 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return codeset;
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
# Locale name alias data base.
|
|
||||||
# Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Library General Public License as published
|
|
||||||
# by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Library General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
|
||||||
# License along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
|
|
||||||
# The format of this file is the same as for the corresponding file of
|
|
||||||
# the X Window System, which normally can be found in
|
|
||||||
# /usr/lib/X11/locale/locale.alias
|
|
||||||
# A single line contains two fields: an alias and a substitution value.
|
|
||||||
# All entries are case independent.
|
|
||||||
|
|
||||||
# Note: This file is far from being complete. If you have a value for
|
|
||||||
# your own site which you think might be useful for others too, share
|
|
||||||
# it with the rest of us. Send it using the `glibcbug' script to
|
|
||||||
# [email protected].
|
|
||||||
|
|
||||||
# Packages using this file:
|
|
||||||
|
|
||||||
bokmal no_NO.ISO-8859-1
|
|
||||||
bokmål no_NO.ISO-8859-1
|
|
||||||
catalan ca_ES.ISO-8859-1
|
|
||||||
croatian hr_HR.ISO-8859-2
|
|
||||||
czech cs_CZ.ISO-8859-2
|
|
||||||
danish da_DK.ISO-8859-1
|
|
||||||
dansk da_DK.ISO-8859-1
|
|
||||||
deutsch de_DE.ISO-8859-1
|
|
||||||
dutch nl_NL.ISO-8859-1
|
|
||||||
eesti et_EE.ISO-8859-1
|
|
||||||
estonian et_EE.ISO-8859-1
|
|
||||||
finnish fi_FI.ISO-8859-1
|
|
||||||
français fr_FR.ISO-8859-1
|
|
||||||
french fr_FR.ISO-8859-1
|
|
||||||
galego gl_ES.ISO-8859-1
|
|
||||||
galician gl_ES.ISO-8859-1
|
|
||||||
german de_DE.ISO-8859-1
|
|
||||||
greek el_GR.ISO-8859-7
|
|
||||||
hebrew he_IL.ISO-8859-8
|
|
||||||
hrvatski hr_HR.ISO-8859-2
|
|
||||||
hungarian hu_HU.ISO-8859-2
|
|
||||||
icelandic is_IS.ISO-8859-1
|
|
||||||
italian it_IT.ISO-8859-1
|
|
||||||
japanese ja_JP.eucJP
|
|
||||||
japanese.euc ja_JP.eucJP
|
|
||||||
ja_JP ja_JP.eucJP
|
|
||||||
ja_JP.ujis ja_JP.eucJP
|
|
||||||
japanese.sjis ja_JP.SJIS
|
|
||||||
korean ko_KR.eucKR
|
|
||||||
korean.euc ko_KR.eucKR
|
|
||||||
ko_KR ko_KR.eucKR
|
|
||||||
lithuanian lt_LT.ISO-8859-13
|
|
||||||
nb_NO no_NO.ISO-8859-1
|
|
||||||
nb_NO.ISO-8859-1 no_NO.ISO-8859-1
|
|
||||||
norwegian no_NO.ISO-8859-1
|
|
||||||
nynorsk nn_NO.ISO-8859-1
|
|
||||||
polish pl_PL.ISO-8859-2
|
|
||||||
portuguese pt_PT.ISO-8859-1
|
|
||||||
romanian ro_RO.ISO-8859-2
|
|
||||||
russian ru_RU.ISO-8859-5
|
|
||||||
slovak sk_SK.ISO-8859-2
|
|
||||||
slovene sl_SI.ISO-8859-2
|
|
||||||
slovenian sl_SI.ISO-8859-2
|
|
||||||
spanish es_ES.ISO-8859-1
|
|
||||||
swedish sv_SE.ISO-8859-1
|
|
||||||
thai th_TH.TIS-620
|
|
||||||
turkish tr_TR.ISO-8859-9
|
|
||||||
@@ -1,404 +0,0 @@
|
|||||||
/* Handle aliases for locale names.
|
|
||||||
Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
|
|
||||||
This must come before <config.h> because <config.h> may include
|
|
||||||
<features.h>, and once <features.h> has been included, it's too late. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# define _GNU_SOURCE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
# define alloca __builtin_alloca
|
|
||||||
# define HAVE_ALLOCA 1
|
|
||||||
#else
|
|
||||||
# if defined HAVE_ALLOCA_H || defined _LIBC
|
|
||||||
# include <alloca.h>
|
|
||||||
# else
|
|
||||||
# ifdef _AIX
|
|
||||||
#pragma alloca
|
|
||||||
# else
|
|
||||||
# ifndef alloca
|
|
||||||
char *alloca ();
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#if !HAVE_STRCHR && !defined _LIBC
|
|
||||||
# ifndef strchr
|
|
||||||
# define strchr index
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Rename the non ANSI C functions. This is required by the standard
|
|
||||||
because some ANSI C functions will require linking with this object
|
|
||||||
file and the name space must not be polluted. */
|
|
||||||
# define strcasecmp __strcasecmp
|
|
||||||
|
|
||||||
# ifndef mempcpy
|
|
||||||
# define mempcpy __mempcpy
|
|
||||||
# endif
|
|
||||||
# define HAVE_MEMPCPY 1
|
|
||||||
|
|
||||||
/* We need locking here since we can be called from different places. */
|
|
||||||
# include <bits/libc-lock.h>
|
|
||||||
|
|
||||||
__libc_lock_define_initialized (static, lock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef internal_function
|
|
||||||
# define internal_function
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For those losing systems which don't have `alloca' we have to add
|
|
||||||
some additional code emulating it. */
|
|
||||||
#ifdef HAVE_ALLOCA
|
|
||||||
# define freea(p) /* nothing */
|
|
||||||
#else
|
|
||||||
# define alloca(n) malloc (n)
|
|
||||||
# define freea(p) free (p)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED
|
|
||||||
# undef fgets
|
|
||||||
# define fgets(buf, len, s) fgets_unlocked (buf, len, s)
|
|
||||||
#endif
|
|
||||||
#if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED
|
|
||||||
# undef feof
|
|
||||||
# define feof(s) feof_unlocked (s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
struct alias_map
|
|
||||||
{
|
|
||||||
const char *alias;
|
|
||||||
const char *value;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static char *string_space;
|
|
||||||
static size_t string_space_act;
|
|
||||||
static size_t string_space_max;
|
|
||||||
static struct alias_map *map;
|
|
||||||
static size_t nmap;
|
|
||||||
static size_t maxmap;
|
|
||||||
|
|
||||||
|
|
||||||
/* Prototypes for local functions. */
|
|
||||||
static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
|
|
||||||
internal_function;
|
|
||||||
static int extend_alias_table PARAMS ((void));
|
|
||||||
static int alias_compare PARAMS ((const struct alias_map *map1,
|
|
||||||
const struct alias_map *map2));
|
|
||||||
|
|
||||||
|
|
||||||
const char *
|
|
||||||
_nl_expand_alias (name)
|
|
||||||
const char *name;
|
|
||||||
{
|
|
||||||
static const char *locale_alias_path = LOCALE_ALIAS_PATH;
|
|
||||||
struct alias_map *retval;
|
|
||||||
const char *result = NULL;
|
|
||||||
size_t added;
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
__libc_lock_lock (lock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
struct alias_map item;
|
|
||||||
|
|
||||||
item.alias = name;
|
|
||||||
|
|
||||||
if (nmap > 0)
|
|
||||||
retval = (struct alias_map *) bsearch (&item, map, nmap,
|
|
||||||
sizeof (struct alias_map),
|
|
||||||
(int (*) PARAMS ((const void *,
|
|
||||||
const void *))
|
|
||||||
) alias_compare);
|
|
||||||
else
|
|
||||||
retval = NULL;
|
|
||||||
|
|
||||||
/* We really found an alias. Return the value. */
|
|
||||||
if (retval != NULL)
|
|
||||||
{
|
|
||||||
result = retval->value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Perhaps we can find another alias file. */
|
|
||||||
added = 0;
|
|
||||||
while (added == 0 && locale_alias_path[0] != '\0')
|
|
||||||
{
|
|
||||||
const char *start;
|
|
||||||
|
|
||||||
while (locale_alias_path[0] == PATH_SEPARATOR)
|
|
||||||
++locale_alias_path;
|
|
||||||
start = locale_alias_path;
|
|
||||||
|
|
||||||
while (locale_alias_path[0] != '\0'
|
|
||||||
&& locale_alias_path[0] != PATH_SEPARATOR)
|
|
||||||
++locale_alias_path;
|
|
||||||
|
|
||||||
if (start < locale_alias_path)
|
|
||||||
added = read_alias_file (start, locale_alias_path - start);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (added != 0);
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
__libc_lock_unlock (lock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static size_t
|
|
||||||
internal_function
|
|
||||||
read_alias_file (fname, fname_len)
|
|
||||||
const char *fname;
|
|
||||||
int fname_len;
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
char *full_fname;
|
|
||||||
size_t added;
|
|
||||||
static const char aliasfile[] = "/locale.alias";
|
|
||||||
|
|
||||||
full_fname = (char *) alloca (fname_len + sizeof aliasfile);
|
|
||||||
#ifdef HAVE_MEMPCPY
|
|
||||||
mempcpy (mempcpy (full_fname, fname, fname_len),
|
|
||||||
aliasfile, sizeof aliasfile);
|
|
||||||
#else
|
|
||||||
memcpy (full_fname, fname, fname_len);
|
|
||||||
memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fp = fopen (full_fname, "r");
|
|
||||||
freea (full_fname);
|
|
||||||
if (fp == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
added = 0;
|
|
||||||
while (!feof (fp))
|
|
||||||
{
|
|
||||||
/* It is a reasonable approach to use a fix buffer here because
|
|
||||||
a) we are only interested in the first two fields
|
|
||||||
b) these fields must be usable as file names and so must not
|
|
||||||
be that long
|
|
||||||
*/
|
|
||||||
char buf[BUFSIZ];
|
|
||||||
char *alias;
|
|
||||||
char *value;
|
|
||||||
char *cp;
|
|
||||||
|
|
||||||
if (fgets (buf, sizeof buf, fp) == NULL)
|
|
||||||
/* EOF reached. */
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* Possibly not the whole line fits into the buffer. Ignore
|
|
||||||
the rest of the line. */
|
|
||||||
if (strchr (buf, '\n') == NULL)
|
|
||||||
{
|
|
||||||
char altbuf[BUFSIZ];
|
|
||||||
do
|
|
||||||
if (fgets (altbuf, sizeof altbuf, fp) == NULL)
|
|
||||||
/* Make sure the inner loop will be left. The outer loop
|
|
||||||
will exit at the `feof' test. */
|
|
||||||
break;
|
|
||||||
while (strchr (altbuf, '\n') == NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
cp = buf;
|
|
||||||
/* Ignore leading white space. */
|
|
||||||
while (isspace (cp[0]))
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
/* A leading '#' signals a comment line. */
|
|
||||||
if (cp[0] != '\0' && cp[0] != '#')
|
|
||||||
{
|
|
||||||
alias = cp++;
|
|
||||||
while (cp[0] != '\0' && !isspace (cp[0]))
|
|
||||||
++cp;
|
|
||||||
/* Terminate alias name. */
|
|
||||||
if (cp[0] != '\0')
|
|
||||||
*cp++ = '\0';
|
|
||||||
|
|
||||||
/* Now look for the beginning of the value. */
|
|
||||||
while (isspace (cp[0]))
|
|
||||||
++cp;
|
|
||||||
|
|
||||||
if (cp[0] != '\0')
|
|
||||||
{
|
|
||||||
size_t alias_len;
|
|
||||||
size_t value_len;
|
|
||||||
|
|
||||||
value = cp++;
|
|
||||||
while (cp[0] != '\0' && !isspace (cp[0]))
|
|
||||||
++cp;
|
|
||||||
/* Terminate value. */
|
|
||||||
if (cp[0] == '\n')
|
|
||||||
{
|
|
||||||
/* This has to be done to make the following test
|
|
||||||
for the end of line possible. We are looking for
|
|
||||||
the terminating '\n' which do not overwrite here. */
|
|
||||||
*cp++ = '\0';
|
|
||||||
*cp = '\n';
|
|
||||||
}
|
|
||||||
else if (cp[0] != '\0')
|
|
||||||
*cp++ = '\0';
|
|
||||||
|
|
||||||
if (nmap >= maxmap)
|
|
||||||
if (__builtin_expect (extend_alias_table (), 0))
|
|
||||||
return added;
|
|
||||||
|
|
||||||
alias_len = strlen (alias) + 1;
|
|
||||||
value_len = strlen (value) + 1;
|
|
||||||
|
|
||||||
if (string_space_act + alias_len + value_len > string_space_max)
|
|
||||||
{
|
|
||||||
/* Increase size of memory pool. */
|
|
||||||
size_t new_size = (string_space_max
|
|
||||||
+ (alias_len + value_len > 1024
|
|
||||||
? alias_len + value_len : 1024));
|
|
||||||
char *new_pool = (char *) realloc (string_space, new_size);
|
|
||||||
if (new_pool == NULL)
|
|
||||||
return added;
|
|
||||||
|
|
||||||
if (__builtin_expect (string_space != new_pool, 0))
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for (i = 0; i < nmap; i++)
|
|
||||||
{
|
|
||||||
map[i].alias += new_pool - string_space;
|
|
||||||
map[i].value += new_pool - string_space;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
string_space = new_pool;
|
|
||||||
string_space_max = new_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
map[nmap].alias = memcpy (&string_space[string_space_act],
|
|
||||||
alias, alias_len);
|
|
||||||
string_space_act += alias_len;
|
|
||||||
|
|
||||||
map[nmap].value = memcpy (&string_space[string_space_act],
|
|
||||||
value, value_len);
|
|
||||||
string_space_act += value_len;
|
|
||||||
|
|
||||||
++nmap;
|
|
||||||
++added;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Should we test for ferror()? I think we have to silently ignore
|
|
||||||
errors. --drepper */
|
|
||||||
fclose (fp);
|
|
||||||
|
|
||||||
if (added > 0)
|
|
||||||
qsort (map, nmap, sizeof (struct alias_map),
|
|
||||||
(int (*) PARAMS ((const void *, const void *))) alias_compare);
|
|
||||||
|
|
||||||
return added;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
extend_alias_table ()
|
|
||||||
{
|
|
||||||
size_t new_size;
|
|
||||||
struct alias_map *new_map;
|
|
||||||
|
|
||||||
new_size = maxmap == 0 ? 100 : 2 * maxmap;
|
|
||||||
new_map = (struct alias_map *) realloc (map, (new_size
|
|
||||||
* sizeof (struct alias_map)));
|
|
||||||
if (new_map == NULL)
|
|
||||||
/* Simply don't extend: we don't have any more core. */
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
map = new_map;
|
|
||||||
maxmap = new_size;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
static void __attribute__ ((unused))
|
|
||||||
free_mem (void)
|
|
||||||
{
|
|
||||||
if (string_space != NULL)
|
|
||||||
free (string_space);
|
|
||||||
if (map != NULL)
|
|
||||||
free (map);
|
|
||||||
}
|
|
||||||
text_set_element (__libc_subfreeres, free_mem);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
alias_compare (map1, map2)
|
|
||||||
const struct alias_map *map1;
|
|
||||||
const struct alias_map *map2;
|
|
||||||
{
|
|
||||||
#if defined _LIBC || defined HAVE_STRCASECMP
|
|
||||||
return strcasecmp (map1->alias, map2->alias);
|
|
||||||
#else
|
|
||||||
const unsigned char *p1 = (const unsigned char *) map1->alias;
|
|
||||||
const unsigned char *p2 = (const unsigned char *) map2->alias;
|
|
||||||
unsigned char c1, c2;
|
|
||||||
|
|
||||||
if (p1 == p2)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
/* I know this seems to be odd but the tolower() function in
|
|
||||||
some systems libc cannot handle nonalpha characters. */
|
|
||||||
c1 = isupper (*p1) ? tolower (*p1) : *p1;
|
|
||||||
c2 = isupper (*p2) ? tolower (*p2) : *p2;
|
|
||||||
if (c1 == '\0')
|
|
||||||
break;
|
|
||||||
++p1;
|
|
||||||
++p2;
|
|
||||||
}
|
|
||||||
while (c1 == c2);
|
|
||||||
|
|
||||||
return c1 - c2;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
/* Implementation of ngettext(3) function.
|
|
||||||
Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define __need_NULL
|
|
||||||
# include <stddef.h>
|
|
||||||
#else
|
|
||||||
# include <stdlib.h> /* Just for NULL. */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gettextP.h"
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define NGETTEXT __ngettext
|
|
||||||
# define DCNGETTEXT __dcngettext
|
|
||||||
#else
|
|
||||||
# define NGETTEXT ngettext__
|
|
||||||
# define DCNGETTEXT dcngettext__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Look up MSGID in the current default message catalog for the current
|
|
||||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
|
||||||
text). */
|
|
||||||
char *
|
|
||||||
NGETTEXT (msgid1, msgid2, n)
|
|
||||||
const char *msgid1;
|
|
||||||
const char *msgid2;
|
|
||||||
unsigned long int n;
|
|
||||||
{
|
|
||||||
return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Alias for function name in GNU C Library. */
|
|
||||||
weak_alias (__ngettext, ngettext);
|
|
||||||
#endif
|
|
||||||
-1326
File diff suppressed because it is too large
Load Diff
-413
@@ -1,413 +0,0 @@
|
|||||||
%{
|
|
||||||
/* Expression parsing for plural form selection.
|
|
||||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
Written by Ulrich Drepper <[email protected]>, 2000.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
/* The bison generated parser uses alloca. AIX 3 forces us to put this
|
|
||||||
declaration at the beginning of the file. The declaration in bison's
|
|
||||||
skeleton file comes too late. This must come before <config.h>
|
|
||||||
because <config.h> may include arbitrary system headers. */
|
|
||||||
#if defined _AIX && !defined __GNUC__
|
|
||||||
#pragma alloca
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "gettextP.h"
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define FREE_EXPRESSION __gettext_free_exp
|
|
||||||
#else
|
|
||||||
# define FREE_EXPRESSION gettext_free_exp__
|
|
||||||
# define __gettextparse gettextparse__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define YYLEX_PARAM &((struct parse_args *) arg)->cp
|
|
||||||
#define YYPARSE_PARAM arg
|
|
||||||
%}
|
|
||||||
%pure_parser
|
|
||||||
%expect 10
|
|
||||||
|
|
||||||
%union {
|
|
||||||
unsigned long int num;
|
|
||||||
enum operator op;
|
|
||||||
struct expression *exp;
|
|
||||||
}
|
|
||||||
|
|
||||||
%{
|
|
||||||
/* Prototypes for local functions. */
|
|
||||||
static struct expression *new_exp PARAMS ((int nargs, enum operator op,
|
|
||||||
struct expression * const *args));
|
|
||||||
static inline struct expression *new_exp_0 PARAMS ((enum operator op));
|
|
||||||
static inline struct expression *new_exp_1 PARAMS ((enum operator op,
|
|
||||||
struct expression *right));
|
|
||||||
static struct expression *new_exp_2 PARAMS ((enum operator op,
|
|
||||||
struct expression *left,
|
|
||||||
struct expression *right));
|
|
||||||
static inline struct expression *new_exp_3 PARAMS ((enum operator op,
|
|
||||||
struct expression *bexp,
|
|
||||||
struct expression *tbranch,
|
|
||||||
struct expression *fbranch));
|
|
||||||
static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
|
|
||||||
static void yyerror PARAMS ((const char *str));
|
|
||||||
|
|
||||||
/* Allocation of expressions. */
|
|
||||||
|
|
||||||
static struct expression *
|
|
||||||
new_exp (nargs, op, args)
|
|
||||||
int nargs;
|
|
||||||
enum operator op;
|
|
||||||
struct expression * const *args;
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
struct expression *newp;
|
|
||||||
|
|
||||||
/* If any of the argument could not be malloc'ed, just return NULL. */
|
|
||||||
for (i = nargs - 1; i >= 0; i--)
|
|
||||||
if (args[i] == NULL)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
/* Allocate a new expression. */
|
|
||||||
newp = (struct expression *) malloc (sizeof (*newp));
|
|
||||||
if (newp != NULL)
|
|
||||||
{
|
|
||||||
newp->nargs = nargs;
|
|
||||||
newp->operation = op;
|
|
||||||
for (i = nargs - 1; i >= 0; i--)
|
|
||||||
newp->val.args[i] = args[i];
|
|
||||||
return newp;
|
|
||||||
}
|
|
||||||
|
|
||||||
fail:
|
|
||||||
for (i = nargs - 1; i >= 0; i--)
|
|
||||||
FREE_EXPRESSION (args[i]);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct expression *
|
|
||||||
new_exp_0 (op)
|
|
||||||
enum operator op;
|
|
||||||
{
|
|
||||||
return new_exp (0, op, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct expression *
|
|
||||||
new_exp_1 (op, right)
|
|
||||||
enum operator op;
|
|
||||||
struct expression *right;
|
|
||||||
{
|
|
||||||
struct expression *args[1];
|
|
||||||
|
|
||||||
args[0] = right;
|
|
||||||
return new_exp (1, op, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct expression *
|
|
||||||
new_exp_2 (op, left, right)
|
|
||||||
enum operator op;
|
|
||||||
struct expression *left;
|
|
||||||
struct expression *right;
|
|
||||||
{
|
|
||||||
struct expression *args[2];
|
|
||||||
|
|
||||||
args[0] = left;
|
|
||||||
args[1] = right;
|
|
||||||
return new_exp (2, op, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct expression *
|
|
||||||
new_exp_3 (op, bexp, tbranch, fbranch)
|
|
||||||
enum operator op;
|
|
||||||
struct expression *bexp;
|
|
||||||
struct expression *tbranch;
|
|
||||||
struct expression *fbranch;
|
|
||||||
{
|
|
||||||
struct expression *args[3];
|
|
||||||
|
|
||||||
args[0] = bexp;
|
|
||||||
args[1] = tbranch;
|
|
||||||
args[2] = fbranch;
|
|
||||||
return new_exp (3, op, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
%}
|
|
||||||
|
|
||||||
/* This declares that all operators have the same associativity and the
|
|
||||||
precedence order as in C. See [Harbison, Steele: C, A Reference Manual].
|
|
||||||
There is no unary minus and no bitwise operators.
|
|
||||||
Operators with the same syntactic behaviour have been merged into a single
|
|
||||||
token, to save space in the array generated by bison. */
|
|
||||||
%right '?' /* ? */
|
|
||||||
%left '|' /* || */
|
|
||||||
%left '&' /* && */
|
|
||||||
%left EQUOP2 /* == != */
|
|
||||||
%left CMPOP2 /* < > <= >= */
|
|
||||||
%left ADDOP2 /* + - */
|
|
||||||
%left MULOP2 /* * / % */
|
|
||||||
%right '!' /* ! */
|
|
||||||
|
|
||||||
%token <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
|
|
||||||
%token <num> NUMBER
|
|
||||||
%type <exp> exp
|
|
||||||
|
|
||||||
%%
|
|
||||||
|
|
||||||
start: exp
|
|
||||||
{
|
|
||||||
if ($1 == NULL)
|
|
||||||
YYABORT;
|
|
||||||
((struct parse_args *) arg)->res = $1;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
exp: exp '?' exp ':' exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_3 (qmop, $1, $3, $5);
|
|
||||||
}
|
|
||||||
| exp '|' exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_2 (lor, $1, $3);
|
|
||||||
}
|
|
||||||
| exp '&' exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_2 (land, $1, $3);
|
|
||||||
}
|
|
||||||
| exp EQUOP2 exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_2 ($2, $1, $3);
|
|
||||||
}
|
|
||||||
| exp CMPOP2 exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_2 ($2, $1, $3);
|
|
||||||
}
|
|
||||||
| exp ADDOP2 exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_2 ($2, $1, $3);
|
|
||||||
}
|
|
||||||
| exp MULOP2 exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_2 ($2, $1, $3);
|
|
||||||
}
|
|
||||||
| '!' exp
|
|
||||||
{
|
|
||||||
$$ = new_exp_1 (lnot, $2);
|
|
||||||
}
|
|
||||||
| 'n'
|
|
||||||
{
|
|
||||||
$$ = new_exp_0 (var);
|
|
||||||
}
|
|
||||||
| NUMBER
|
|
||||||
{
|
|
||||||
if (($$ = new_exp_0 (num)) != NULL)
|
|
||||||
$$->val.num = $1;
|
|
||||||
}
|
|
||||||
| '(' exp ')'
|
|
||||||
{
|
|
||||||
$$ = $2;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
%%
|
|
||||||
|
|
||||||
void
|
|
||||||
internal_function
|
|
||||||
FREE_EXPRESSION (exp)
|
|
||||||
struct expression *exp;
|
|
||||||
{
|
|
||||||
if (exp == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Handle the recursive case. */
|
|
||||||
switch (exp->nargs)
|
|
||||||
{
|
|
||||||
case 3:
|
|
||||||
FREE_EXPRESSION (exp->val.args[2]);
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
case 2:
|
|
||||||
FREE_EXPRESSION (exp->val.args[1]);
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
case 1:
|
|
||||||
FREE_EXPRESSION (exp->val.args[0]);
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
free (exp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
yylex (lval, pexp)
|
|
||||||
YYSTYPE *lval;
|
|
||||||
const char **pexp;
|
|
||||||
{
|
|
||||||
const char *exp = *pexp;
|
|
||||||
int result;
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (exp[0] == '\0')
|
|
||||||
{
|
|
||||||
*pexp = exp;
|
|
||||||
return YYEOF;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exp[0] != ' ' && exp[0] != '\t')
|
|
||||||
break;
|
|
||||||
|
|
||||||
++exp;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = *exp++;
|
|
||||||
switch (result)
|
|
||||||
{
|
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
|
||||||
{
|
|
||||||
unsigned long int n = result - '0';
|
|
||||||
while (exp[0] >= '0' && exp[0] <= '9')
|
|
||||||
{
|
|
||||||
n *= 10;
|
|
||||||
n += exp[0] - '0';
|
|
||||||
++exp;
|
|
||||||
}
|
|
||||||
lval->num = n;
|
|
||||||
result = NUMBER;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '=':
|
|
||||||
if (exp[0] == '=')
|
|
||||||
{
|
|
||||||
++exp;
|
|
||||||
lval->op = equal;
|
|
||||||
result = EQUOP2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
result = YYERRCODE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '!':
|
|
||||||
if (exp[0] == '=')
|
|
||||||
{
|
|
||||||
++exp;
|
|
||||||
lval->op = not_equal;
|
|
||||||
result = EQUOP2;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '&':
|
|
||||||
case '|':
|
|
||||||
if (exp[0] == result)
|
|
||||||
++exp;
|
|
||||||
else
|
|
||||||
result = YYERRCODE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '<':
|
|
||||||
if (exp[0] == '=')
|
|
||||||
{
|
|
||||||
++exp;
|
|
||||||
lval->op = less_or_equal;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
lval->op = less_than;
|
|
||||||
result = CMPOP2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '>':
|
|
||||||
if (exp[0] == '=')
|
|
||||||
{
|
|
||||||
++exp;
|
|
||||||
lval->op = greater_or_equal;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
lval->op = greater_than;
|
|
||||||
result = CMPOP2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '*':
|
|
||||||
lval->op = mult;
|
|
||||||
result = MULOP2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '/':
|
|
||||||
lval->op = divide;
|
|
||||||
result = MULOP2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '%':
|
|
||||||
lval->op = module;
|
|
||||||
result = MULOP2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '+':
|
|
||||||
lval->op = plus;
|
|
||||||
result = ADDOP2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '-':
|
|
||||||
lval->op = minus;
|
|
||||||
result = ADDOP2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'n':
|
|
||||||
case '?':
|
|
||||||
case ':':
|
|
||||||
case '(':
|
|
||||||
case ')':
|
|
||||||
/* Nothing, just return the character. */
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ';':
|
|
||||||
case '\n':
|
|
||||||
case '\0':
|
|
||||||
/* Be safe and let the user call this function again. */
|
|
||||||
--exp;
|
|
||||||
result = YYEOF;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
result = YYERRCODE;
|
|
||||||
#if YYDEBUG != 0
|
|
||||||
--exp;
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
*pexp = exp;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
yyerror (str)
|
|
||||||
const char *str;
|
|
||||||
{
|
|
||||||
/* Do nothing. We don't print error messages here. */
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
# Add this package to a list of references stored in a text file.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Library General Public License as published
|
|
||||||
# by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Library General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
|
||||||
# License along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
#
|
|
||||||
# Written by Bruno Haible <[email protected]>.
|
|
||||||
#
|
|
||||||
/^# Packages using this file: / {
|
|
||||||
s/# Packages using this file://
|
|
||||||
ta
|
|
||||||
:a
|
|
||||||
s/ @PACKAGE@ / @PACKAGE@ /
|
|
||||||
tb
|
|
||||||
s/ $/ @PACKAGE@ /
|
|
||||||
:b
|
|
||||||
s/^/# Packages using this file:/
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
# Remove this package from a list of references stored in a text file.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Library General Public License as published
|
|
||||||
# by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Library General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
|
||||||
# License along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
#
|
|
||||||
# Written by Bruno Haible <[email protected]>.
|
|
||||||
#
|
|
||||||
/^# Packages using this file: / {
|
|
||||||
s/# Packages using this file://
|
|
||||||
s/ @PACKAGE@ / /
|
|
||||||
s/^/# Packages using this file:/
|
|
||||||
}
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
/* Implementation of the textdomain(3) function.
|
|
||||||
Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU Library General Public License as published
|
|
||||||
by the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# include "libgnuintl.h"
|
|
||||||
#endif
|
|
||||||
#include "gettextP.h"
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* We have to handle multi-threaded applications. */
|
|
||||||
# include <bits/libc-lock.h>
|
|
||||||
#else
|
|
||||||
/* Provide dummy implementation if this is outside glibc. */
|
|
||||||
# define __libc_rwlock_define(CLASS, NAME)
|
|
||||||
# define __libc_rwlock_wrlock(NAME)
|
|
||||||
# define __libc_rwlock_unlock(NAME)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The internal variables in the standalone libintl.a must have different
|
|
||||||
names than the internal variables in GNU libc, otherwise programs
|
|
||||||
using libintl.a cannot be linked statically. */
|
|
||||||
#if !defined _LIBC
|
|
||||||
# define _nl_default_default_domain _nl_default_default_domain__
|
|
||||||
# define _nl_current_default_domain _nl_current_default_domain__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* @@ end of prolog @@ */
|
|
||||||
|
|
||||||
/* Name of the default text domain. */
|
|
||||||
extern const char _nl_default_default_domain[];
|
|
||||||
|
|
||||||
/* Default text domain in which entries for gettext(3) are to be found. */
|
|
||||||
extern const char *_nl_current_default_domain;
|
|
||||||
|
|
||||||
|
|
||||||
/* Names for the libintl functions are a problem. They must not clash
|
|
||||||
with existing names and they should follow ANSI C. But this source
|
|
||||||
code is also used in GNU C Library where the names have a __
|
|
||||||
prefix. So we have to make a difference here. */
|
|
||||||
#ifdef _LIBC
|
|
||||||
# define TEXTDOMAIN __textdomain
|
|
||||||
# ifndef strdup
|
|
||||||
# define strdup(str) __strdup (str)
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define TEXTDOMAIN textdomain__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Lock variable to protect the global data in the gettext implementation. */
|
|
||||||
__libc_rwlock_define (extern, _nl_state_lock)
|
|
||||||
|
|
||||||
/* Set the current default message catalog to DOMAINNAME.
|
|
||||||
If DOMAINNAME is null, return the current default.
|
|
||||||
If DOMAINNAME is "", reset to the default of "messages". */
|
|
||||||
char *
|
|
||||||
TEXTDOMAIN (domainname)
|
|
||||||
const char *domainname;
|
|
||||||
{
|
|
||||||
char *new_domain;
|
|
||||||
char *old_domain;
|
|
||||||
|
|
||||||
/* A NULL pointer requests the current setting. */
|
|
||||||
if (domainname == NULL)
|
|
||||||
return (char *) _nl_current_default_domain;
|
|
||||||
|
|
||||||
__libc_rwlock_wrlock (_nl_state_lock);
|
|
||||||
|
|
||||||
old_domain = (char *) _nl_current_default_domain;
|
|
||||||
|
|
||||||
/* If domain name is the null string set to default domain "messages". */
|
|
||||||
if (domainname[0] == '\0'
|
|
||||||
|| strcmp (domainname, _nl_default_default_domain) == 0)
|
|
||||||
{
|
|
||||||
_nl_current_default_domain = _nl_default_default_domain;
|
|
||||||
new_domain = (char *) _nl_current_default_domain;
|
|
||||||
}
|
|
||||||
else if (strcmp (domainname, old_domain) == 0)
|
|
||||||
/* This can happen and people will use it to signal that some
|
|
||||||
environment variable changed. */
|
|
||||||
new_domain = old_domain;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* If the following malloc fails `_nl_current_default_domain'
|
|
||||||
will be NULL. This value will be returned and so signals we
|
|
||||||
are out of core. */
|
|
||||||
#if defined _LIBC || defined HAVE_STRDUP
|
|
||||||
new_domain = strdup (domainname);
|
|
||||||
#else
|
|
||||||
size_t len = strlen (domainname) + 1;
|
|
||||||
new_domain = (char *) malloc (len);
|
|
||||||
if (new_domain != NULL)
|
|
||||||
memcpy (new_domain, domainname, len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (new_domain != NULL)
|
|
||||||
_nl_current_default_domain = new_domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We use this possibility to signal a change of the loaded catalogs
|
|
||||||
since this is most likely the case and there is no other easy we
|
|
||||||
to do it. Do it only when the call was successful. */
|
|
||||||
if (new_domain != NULL)
|
|
||||||
{
|
|
||||||
++_nl_msg_cat_cntr;
|
|
||||||
|
|
||||||
if (old_domain != new_domain && old_domain != _nl_default_default_domain)
|
|
||||||
free (old_domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
__libc_rwlock_unlock (_nl_state_lock);
|
|
||||||
|
|
||||||
return new_domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
/* Alias for function name in GNU C Library. */
|
|
||||||
weak_alias (__textdomain, textdomain);
|
|
||||||
#endif
|
|
||||||
+10
-25
@@ -1,38 +1,23 @@
|
|||||||
## Copyright 2001, 2002 Free Software Foundation, Inc.
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
|
||||||
## This program is free software; you can redistribute it and/or modify
|
|
||||||
## it under the terms of the GNU General Public License as published by
|
|
||||||
## the Free Software Foundation; either version 2 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program; if not, write to the Free Software
|
|
||||||
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
||||||
## 02111-1307 USA
|
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = ansi2knr
|
AUTOMAKE_OPTIONS = ansi2knr
|
||||||
|
|
||||||
CFLAGS = @CFLAGS@ $(WARNING_CFLAGS)
|
|
||||||
|
|
||||||
noinst_LIBRARIES = libbison.a
|
noinst_LIBRARIES = libbison.a
|
||||||
|
|
||||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/src -I../intl
|
||||||
|
|
||||||
# Heck, we are still using an old version of Automake which does not
|
# Heck, we are still using an old version of Automake which does not
|
||||||
# understand inner AC_LIBOBJ (i.e., from Autoconf itself, not from
|
# understand LIBOBJ additions using $objext...
|
||||||
# configure.in).
|
|
||||||
EXTRA_DIST = malloc.c realloc.c strnlen.c
|
EXTRA_DIST = malloc.c realloc.c
|
||||||
|
|
||||||
libbison_a_SOURCES = \
|
libbison_a_SOURCES = \
|
||||||
basename.c dirname.h dirname.c \
|
error.c error.h \
|
||||||
getopt.h getopt.c getopt1.c \
|
getopt.h getopt.c getopt1.c \
|
||||||
|
hash.h hash.c \
|
||||||
|
obstack.h obstack.c \
|
||||||
quote.h quote.c quotearg.h quotearg.c \
|
quote.h quote.c quotearg.h quotearg.c \
|
||||||
xalloc.h xmalloc.c xstrdup.c xstrndup.c
|
xalloc.h xmalloc.c xstrdup.c
|
||||||
|
|
||||||
libbison_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
libbison_a_LIBADD = @LIBOBJS@
|
||||||
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
|
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
|
||||||
|
|||||||
-425
@@ -1,425 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.5c from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
|
|
||||||
srcdir = @srcdir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
|
|
||||||
bindir = @bindir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
datadir = @datadir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
libdir = @libdir@
|
|
||||||
infodir = @infodir@
|
|
||||||
mandir = @mandir@
|
|
||||||
includedir = @includedir@
|
|
||||||
oldincludedir = /usr/include
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
top_builddir = ..
|
|
||||||
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = @program_transform_name@
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_triplet = @host@
|
|
||||||
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AUTOM4TE = @AUTOM4TE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
|
||||||
CATALOGS = @CATALOGS@
|
|
||||||
CATOBJEXT = @CATOBJEXT@
|
|
||||||
CC = @CC@
|
|
||||||
CPP = @CPP@
|
|
||||||
DATADIRNAME = @DATADIRNAME@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
GCC = @GCC@
|
|
||||||
GENCAT = @GENCAT@
|
|
||||||
GLIBC21 = @GLIBC21@
|
|
||||||
GMOFILES = @GMOFILES@
|
|
||||||
GMSGFMT = @GMSGFMT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
INSTOBJEXT = @INSTOBJEXT@
|
|
||||||
INTLBISON = @INTLBISON@
|
|
||||||
INTLLIBS = @INTLLIBS@
|
|
||||||
INTLOBJS = @INTLOBJS@
|
|
||||||
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
|
||||||
LIB = @LIB@
|
|
||||||
LIBICONV = @LIBICONV@
|
|
||||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
||||||
MSGFMT = @MSGFMT@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
POFILES = @POFILES@
|
|
||||||
POSUB = @POSUB@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
U = @U@
|
|
||||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
|
||||||
USE_NLS = @USE_NLS@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
|
||||||
WERROR_CFLAGS = @WERROR_CFLAGS@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = ansi2knr
|
|
||||||
|
|
||||||
CFLAGS = @CFLAGS@ $(WARNING_CFLAGS)
|
|
||||||
|
|
||||||
noinst_LIBRARIES = libbison.a
|
|
||||||
|
|
||||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
|
||||||
|
|
||||||
# Heck, we are still using an old version of Automake which does not
|
|
||||||
# understand inner AC_LIBOBJ (i.e., from Autoconf itself, not from
|
|
||||||
# configure.in).
|
|
||||||
EXTRA_DIST = malloc.c realloc.c strnlen.c
|
|
||||||
|
|
||||||
libbison_a_SOURCES = \
|
|
||||||
basename.c dirname.h dirname.c \
|
|
||||||
getopt.h getopt.c getopt1.c \
|
|
||||||
quote.h quote.c quotearg.h quotearg.c \
|
|
||||||
xalloc.h xmalloc.c xstrdup.c xstrndup.c
|
|
||||||
|
|
||||||
|
|
||||||
libbison_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
|
||||||
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
|
|
||||||
subdir = lib
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
LIBRARIES = $(noinst_LIBRARIES)
|
|
||||||
|
|
||||||
libbison_a_AR = $(AR) cru
|
|
||||||
am_libbison_a_OBJECTS = basename$U.$(OBJEXT) dirname$U.$(OBJEXT) \
|
|
||||||
getopt$U.$(OBJEXT) getopt1$U.$(OBJEXT) quote$U.$(OBJEXT) \
|
|
||||||
quotearg$U.$(OBJEXT) xmalloc$U.$(OBJEXT) xstrdup$U.$(OBJEXT) \
|
|
||||||
xstrndup$U.$(OBJEXT)
|
|
||||||
libbison_a_OBJECTS = $(am_libbison_a_OBJECTS)
|
|
||||||
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
|
||||||
am__depfiles_maybe = depfiles
|
|
||||||
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/error.Po \
|
|
||||||
@AMDEP_TRUE@ $(DEPDIR)/malloc.Po $(DEPDIR)/memchr.Po \
|
|
||||||
@AMDEP_TRUE@ $(DEPDIR)/memrchr.Po $(DEPDIR)/obstack.Po \
|
|
||||||
@AMDEP_TRUE@ $(DEPDIR)/realloc.Po $(DEPDIR)/stpcpy.Po \
|
|
||||||
@AMDEP_TRUE@ $(DEPDIR)/strchr.Po $(DEPDIR)/strspn.Po \
|
|
||||||
@AMDEP_TRUE@ ./$(DEPDIR)/basename$U.Po ./$(DEPDIR)/dirname$U.Po \
|
|
||||||
@AMDEP_TRUE@ ./$(DEPDIR)/getopt$U.Po ./$(DEPDIR)/getopt1$U.Po \
|
|
||||||
@AMDEP_TRUE@ ./$(DEPDIR)/quote$U.Po ./$(DEPDIR)/quotearg$U.Po \
|
|
||||||
@AMDEP_TRUE@ ./$(DEPDIR)/xmalloc$U.Po ./$(DEPDIR)/xstrdup$U.Po \
|
|
||||||
@AMDEP_TRUE@ ./$(DEPDIR)/xstrndup$U.Po
|
|
||||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
|
||||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
|
||||||
CCLD = $(CC)
|
|
||||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
|
||||||
DIST_SOURCES = $(libbison_a_SOURCES)
|
|
||||||
DIST_COMMON = Makefile.am Makefile.in alloca.c ansi2knr.1 ansi2knr.c \
|
|
||||||
error.c error.h malloc.c memchr.c memrchr.c obstack.c obstack.h \
|
|
||||||
realloc.c stpcpy.c strchr.c strspn.c
|
|
||||||
SOURCES = $(libbison_a_SOURCES)
|
|
||||||
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .c .o .obj
|
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
|
||||||
cd $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu lib/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
|
||||||
|
|
||||||
AR = ar
|
|
||||||
|
|
||||||
clean-noinstLIBRARIES:
|
|
||||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
|
||||||
libbison.a: $(libbison_a_OBJECTS) $(libbison_a_DEPENDENCIES)
|
|
||||||
-rm -f libbison.a
|
|
||||||
$(libbison_a_AR) libbison.a $(libbison_a_OBJECTS) $(libbison_a_LIBADD)
|
|
||||||
$(RANLIB) libbison.a
|
|
||||||
|
|
||||||
mostlyclean-compile:
|
|
||||||
-rm -f *.$(OBJEXT) core *.core
|
|
||||||
|
|
||||||
distclean-compile:
|
|
||||||
-rm -f *.tab.c
|
|
||||||
|
|
||||||
ANSI2KNR = @ANSI2KNR@
|
|
||||||
ansi2knr: ansi2knr.$(OBJEXT)
|
|
||||||
$(LINK) ansi2knr.$(OBJEXT) $(LIBS)
|
|
||||||
ansi2knr.$(OBJEXT): $(CONFIG_HEADER)
|
|
||||||
|
|
||||||
clean-krextra:
|
|
||||||
-rm -f ansi2knr
|
|
||||||
|
|
||||||
mostlyclean-kr:
|
|
||||||
-test "$U" = "" || rm -f *_.c
|
|
||||||
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/error.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/malloc.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memchr.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memrchr.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/obstack.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/realloc.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/stpcpy.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strchr.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strspn.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quote$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrdup$U.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup$U.Po@am__quote@
|
|
||||||
|
|
||||||
distclean-depend:
|
|
||||||
-rm -rf $(DEPDIR) ./$(DEPDIR)
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
|
|
||||||
|
|
||||||
.c.obj:
|
|
||||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
$(COMPILE) -c `cygpath -w $<`
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
alloca_.c: lib/alloca.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/alloca.c; then echo $(srcdir)/lib/alloca.c; else echo lib/alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c || rm -f alloca_.c
|
|
||||||
basename_.c: basename.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > basename_.c || rm -f basename_.c
|
|
||||||
dirname_.c: dirname.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dirname_.c || rm -f dirname_.c
|
|
||||||
error_.c: lib/error.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/error.c; then echo $(srcdir)/lib/error.c; else echo lib/error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c || rm -f error_.c
|
|
||||||
getopt_.c: getopt.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c || rm -f getopt_.c
|
|
||||||
getopt1_.c: getopt1.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c || rm -f getopt1_.c
|
|
||||||
malloc_.c: lib/malloc.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/malloc.c; then echo $(srcdir)/lib/malloc.c; else echo lib/malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c || rm -f malloc_.c
|
|
||||||
memchr_.c: lib/memchr.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/memchr.c; then echo $(srcdir)/lib/memchr.c; else echo lib/memchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memchr_.c || rm -f memchr_.c
|
|
||||||
memrchr_.c: lib/memrchr.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/memrchr.c; then echo $(srcdir)/lib/memrchr.c; else echo lib/memrchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memrchr_.c || rm -f memrchr_.c
|
|
||||||
obstack_.c: lib/obstack.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/obstack.c; then echo $(srcdir)/lib/obstack.c; else echo lib/obstack.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > obstack_.c || rm -f obstack_.c
|
|
||||||
quote_.c: quote.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quote.c; then echo $(srcdir)/quote.c; else echo quote.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quote_.c || rm -f quote_.c
|
|
||||||
quotearg_.c: quotearg.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quotearg_.c || rm -f quotearg_.c
|
|
||||||
realloc_.c: lib/realloc.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/realloc.c; then echo $(srcdir)/lib/realloc.c; else echo lib/realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c || rm -f realloc_.c
|
|
||||||
stpcpy_.c: lib/stpcpy.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/stpcpy.c; then echo $(srcdir)/lib/stpcpy.c; else echo lib/stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c || rm -f stpcpy_.c
|
|
||||||
strchr_.c: lib/strchr.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/strchr.c; then echo $(srcdir)/lib/strchr.c; else echo lib/strchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strchr_.c || rm -f strchr_.c
|
|
||||||
strspn_.c: lib/strspn.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lib/strspn.c; then echo $(srcdir)/lib/strspn.c; else echo lib/strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c || rm -f strspn_.c
|
|
||||||
xmalloc_.c: xmalloc.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xmalloc_.c || rm -f xmalloc_.c
|
|
||||||
xstrdup_.c: xstrdup.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrdup_.c || rm -f xstrdup_.c
|
|
||||||
xstrndup_.c: xstrndup.c $(ANSI2KNR)
|
|
||||||
$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrndup.c; then echo $(srcdir)/xstrndup.c; else echo xstrndup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrndup_.c || rm -f xstrndup_.c
|
|
||||||
alloca_.$(OBJEXT) basename_.$(OBJEXT) dirname_.$(OBJEXT) \
|
|
||||||
error_.$(OBJEXT) getopt_.$(OBJEXT) getopt1_.$(OBJEXT) malloc_.$(OBJEXT) \
|
|
||||||
memchr_.$(OBJEXT) memrchr_.$(OBJEXT) obstack_.$(OBJEXT) \
|
|
||||||
quote_.$(OBJEXT) quotearg_.$(OBJEXT) realloc_.$(OBJEXT) \
|
|
||||||
stpcpy_.$(OBJEXT) strchr_.$(OBJEXT) strspn_.$(OBJEXT) \
|
|
||||||
xmalloc_.$(OBJEXT) xstrdup_.$(OBJEXT) xstrndup_.$(OBJEXT) : $(ANSI2KNR)
|
|
||||||
uninstall-info-am:
|
|
||||||
|
|
||||||
ETAGS = etags
|
|
||||||
ETAGSFLAGS =
|
|
||||||
|
|
||||||
tags: TAGS
|
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | \
|
|
||||||
$(AWK) ' { files[$$0] = 1; } \
|
|
||||||
END { for (i in files) print i; }'`; \
|
|
||||||
mkid -fID $$unique
|
|
||||||
|
|
||||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|
||||||
$(TAGS_FILES) $(LISP)
|
|
||||||
tags=; \
|
|
||||||
here=`pwd`; \
|
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | \
|
|
||||||
$(AWK) ' { files[$$0] = 1; } \
|
|
||||||
END { for (i in files) print i; }'`; \
|
|
||||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
|
||||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
$$tags $$unique
|
|
||||||
|
|
||||||
GTAGS:
|
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|
||||||
&& cd $(top_srcdir) \
|
|
||||||
&& gtags -i $(GTAGS_ARGS) $$here
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
|
|
||||||
top_distdir = ..
|
|
||||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
@for file in $(DISTFILES); do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
|
||||||
dir="/$$dir"; \
|
|
||||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
|
||||||
else \
|
|
||||||
dir=''; \
|
|
||||||
fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
cp -pR $$d/$$file $(distdir)$$dir \
|
|
||||||
|| exit 1; \
|
|
||||||
else \
|
|
||||||
test -f $(distdir)/$$file \
|
|
||||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile $(ANSI2KNR) $(LIBRARIES)
|
|
||||||
|
|
||||||
installdirs:
|
|
||||||
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
INSTALL_STRIP_FLAG=-s \
|
|
||||||
`test -z '$(STRIP)' || \
|
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-krextra clean-noinstLIBRARIES \
|
|
||||||
mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
|
|
||||||
distclean-am: clean-am distclean-compile distclean-depend \
|
|
||||||
distclean-generic distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr
|
|
||||||
|
|
||||||
uninstall-am: uninstall-info-am
|
|
||||||
|
|
||||||
.PHONY: GTAGS all all-am check check-am clean clean-generic \
|
|
||||||
clean-krextra clean-noinstLIBRARIES distclean distclean-compile \
|
|
||||||
distclean-depend distclean-generic distclean-tags distdir dvi \
|
|
||||||
dvi-am info info-am install install-am install-data \
|
|
||||||
install-data-am install-exec install-exec-am install-info \
|
|
||||||
install-info-am install-man install-strip installcheck \
|
|
||||||
installcheck-am installdirs maintainer-clean \
|
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
|
||||||
mostlyclean-generic mostlyclean-kr tags uninstall uninstall-am \
|
|
||||||
uninstall-info-am
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
+66
-66
@@ -22,18 +22,18 @@
|
|||||||
your main control loop, etc. to force garbage collection. */
|
your main control loop, etc. to force garbage collection. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
# include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef emacs
|
#ifdef emacs
|
||||||
# include "blockinput.h"
|
#include "blockinput.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If compiling with GCC 2, this file's not needed. */
|
/* If compiling with GCC 2, this file's not needed. */
|
||||||
@@ -41,41 +41,41 @@
|
|||||||
|
|
||||||
/* If someone has defined alloca as a macro,
|
/* If someone has defined alloca as a macro,
|
||||||
there must be some other way alloca is supposed to work. */
|
there must be some other way alloca is supposed to work. */
|
||||||
# ifndef alloca
|
#ifndef alloca
|
||||||
|
|
||||||
# ifdef emacs
|
#ifdef emacs
|
||||||
# ifdef static
|
#ifdef static
|
||||||
/* actually, only want this if static is defined as ""
|
/* actually, only want this if static is defined as ""
|
||||||
-- this is for usg, in which emacs must undefine static
|
-- this is for usg, in which emacs must undefine static
|
||||||
in order to make unexec workable
|
in order to make unexec workable
|
||||||
*/
|
*/
|
||||||
# ifndef STACK_DIRECTION
|
#ifndef STACK_DIRECTION
|
||||||
you
|
you
|
||||||
lose
|
lose
|
||||||
-- must know STACK_DIRECTION at compile-time
|
-- must know STACK_DIRECTION at compile-time
|
||||||
# endif /* STACK_DIRECTION undefined */
|
#endif /* STACK_DIRECTION undefined */
|
||||||
# endif /* static */
|
#endif /* static */
|
||||||
# endif /* emacs */
|
#endif /* emacs */
|
||||||
|
|
||||||
/* If your stack is a linked list of frames, you have to
|
/* If your stack is a linked list of frames, you have to
|
||||||
provide an "address metric" ADDRESS_FUNCTION macro. */
|
provide an "address metric" ADDRESS_FUNCTION macro. */
|
||||||
|
|
||||||
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||||
long i00afunc ();
|
long i00afunc ();
|
||||||
# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||||
# else
|
#else
|
||||||
# define ADDRESS_FUNCTION(arg) &(arg)
|
#define ADDRESS_FUNCTION(arg) &(arg)
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# if __STDC__
|
#if __STDC__
|
||||||
typedef void *pointer;
|
typedef void *pointer;
|
||||||
# else
|
#else
|
||||||
typedef char *pointer;
|
typedef char *pointer;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifndef NULL
|
#ifndef NULL
|
||||||
# define NULL 0
|
#define NULL 0
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
/* Different portions of Emacs need to call different versions of
|
/* Different portions of Emacs need to call different versions of
|
||||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||||
@@ -83,14 +83,13 @@ typedef char *pointer;
|
|||||||
hand, the utilities in lib-src need alloca to call malloc; some of
|
hand, the utilities in lib-src need alloca to call malloc; some of
|
||||||
them are very simple, and don't have an xmalloc routine.
|
them are very simple, and don't have an xmalloc routine.
|
||||||
|
|
||||||
Non-Emacs programs expect this to call xmalloc.
|
Non-Emacs programs expect this to call use xmalloc.
|
||||||
|
|
||||||
Callers below should use malloc. */
|
Callers below should use malloc. */
|
||||||
|
|
||||||
# ifndef emacs
|
#ifndef emacs
|
||||||
# undef malloc
|
#define malloc xmalloc
|
||||||
# define malloc xmalloc
|
#endif
|
||||||
# endif
|
|
||||||
extern pointer malloc ();
|
extern pointer malloc ();
|
||||||
|
|
||||||
/* Define STACK_DIRECTION if you know the direction of stack
|
/* Define STACK_DIRECTION if you know the direction of stack
|
||||||
@@ -101,18 +100,18 @@ extern pointer malloc ();
|
|||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||||
|
|
||||||
# ifndef STACK_DIRECTION
|
#ifndef STACK_DIRECTION
|
||||||
# define STACK_DIRECTION 0 /* Direction unknown. */
|
#define STACK_DIRECTION 0 /* Direction unknown. */
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# if STACK_DIRECTION != 0
|
#if STACK_DIRECTION != 0
|
||||||
|
|
||||||
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||||
|
|
||||||
# else /* STACK_DIRECTION == 0; need run-time code. */
|
#else /* STACK_DIRECTION == 0; need run-time code. */
|
||||||
|
|
||||||
static int stack_dir; /* 1 or -1 once known. */
|
static int stack_dir; /* 1 or -1 once known. */
|
||||||
# define STACK_DIR stack_dir
|
#define STACK_DIR stack_dir
|
||||||
|
|
||||||
static void
|
static void
|
||||||
find_stack_direction ()
|
find_stack_direction ()
|
||||||
@@ -136,7 +135,7 @@ find_stack_direction ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* STACK_DIRECTION == 0 */
|
#endif /* STACK_DIRECTION == 0 */
|
||||||
|
|
||||||
/* An "alloca header" is used to:
|
/* An "alloca header" is used to:
|
||||||
(a) chain together all alloca'ed blocks;
|
(a) chain together all alloca'ed blocks;
|
||||||
@@ -145,9 +144,9 @@ find_stack_direction ()
|
|||||||
It is very important that sizeof(header) agree with malloc
|
It is very important that sizeof(header) agree with malloc
|
||||||
alignment chunk size. The following default should work okay. */
|
alignment chunk size. The following default should work okay. */
|
||||||
|
|
||||||
# ifndef ALIGN_SIZE
|
#ifndef ALIGN_SIZE
|
||||||
# define ALIGN_SIZE sizeof(double)
|
#define ALIGN_SIZE sizeof(double)
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
typedef union hdr
|
typedef union hdr
|
||||||
{
|
{
|
||||||
@@ -169,15 +168,16 @@ static header *last_alloca_header = NULL; /* -> last alloca header. */
|
|||||||
implementations of C, for example under Gould's UTX/32. */
|
implementations of C, for example under Gould's UTX/32. */
|
||||||
|
|
||||||
pointer
|
pointer
|
||||||
alloca (size_t size)
|
alloca (size)
|
||||||
|
unsigned size;
|
||||||
{
|
{
|
||||||
auto char probe; /* Probes stack depth: */
|
auto char probe; /* Probes stack depth: */
|
||||||
register char *depth = ADDRESS_FUNCTION (probe);
|
register char *depth = ADDRESS_FUNCTION (probe);
|
||||||
|
|
||||||
# if STACK_DIRECTION == 0
|
#if STACK_DIRECTION == 0
|
||||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||||
find_stack_direction ();
|
find_stack_direction ();
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
/* Reclaim garbage, defined as all alloca'd storage that
|
/* Reclaim garbage, defined as all alloca'd storage that
|
||||||
was allocated from deeper in the stack than currently. */
|
was allocated from deeper in the stack than currently. */
|
||||||
@@ -185,9 +185,9 @@ alloca (size_t size)
|
|||||||
{
|
{
|
||||||
register header *hp; /* Traverses linked list. */
|
register header *hp; /* Traverses linked list. */
|
||||||
|
|
||||||
# ifdef emacs
|
#ifdef emacs
|
||||||
BLOCK_INPUT;
|
BLOCK_INPUT;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
for (hp = last_alloca_header; hp != NULL;)
|
for (hp = last_alloca_header; hp != NULL;)
|
||||||
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
||||||
@@ -204,9 +204,9 @@ alloca (size_t size)
|
|||||||
|
|
||||||
last_alloca_header = hp; /* -> last valid storage. */
|
last_alloca_header = hp; /* -> last valid storage. */
|
||||||
|
|
||||||
# ifdef emacs
|
#ifdef emacs
|
||||||
UNBLOCK_INPUT;
|
UNBLOCK_INPUT;
|
||||||
# endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
@@ -232,15 +232,15 @@ alloca (size_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||||
|
|
||||||
# ifdef DEBUG_I00AFUNC
|
#ifdef DEBUG_I00AFUNC
|
||||||
# include <stdio.h>
|
#include <stdio.h>
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifndef CRAY_STACK
|
#ifndef CRAY_STACK
|
||||||
# define CRAY_STACK
|
#define CRAY_STACK
|
||||||
# ifndef CRAY2
|
#ifndef CRAY2
|
||||||
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
||||||
struct stack_control_header
|
struct stack_control_header
|
||||||
{
|
{
|
||||||
@@ -292,7 +292,7 @@ struct stack_segment_linkage
|
|||||||
long sss7;
|
long sss7;
|
||||||
};
|
};
|
||||||
|
|
||||||
# else /* CRAY2 */
|
#else /* CRAY2 */
|
||||||
/* The following structure defines the vector of words
|
/* The following structure defines the vector of words
|
||||||
returned by the STKSTAT library routine. */
|
returned by the STKSTAT library routine. */
|
||||||
struct stk_stat
|
struct stk_stat
|
||||||
@@ -345,10 +345,10 @@ struct stk_trailer
|
|||||||
long unknown14;
|
long unknown14;
|
||||||
};
|
};
|
||||||
|
|
||||||
# endif /* CRAY2 */
|
#endif /* CRAY2 */
|
||||||
# endif /* not CRAY_STACK */
|
#endif /* not CRAY_STACK */
|
||||||
|
|
||||||
# ifdef CRAY2
|
#ifdef CRAY2
|
||||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||||
I doubt that "lint" will like this much. */
|
I doubt that "lint" will like this much. */
|
||||||
|
|
||||||
@@ -419,7 +419,7 @@ i00afunc (long *address)
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
# else /* not CRAY2 */
|
#else /* not CRAY2 */
|
||||||
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
||||||
Determine the number of the cell within the stack,
|
Determine the number of the cell within the stack,
|
||||||
given the address of the cell. The purpose of this
|
given the address of the cell. The purpose of this
|
||||||
@@ -464,9 +464,9 @@ i00afunc (long address)
|
|||||||
|
|
||||||
while (!(this_segment <= address && address <= stkl))
|
while (!(this_segment <= address && address <= stkl))
|
||||||
{
|
{
|
||||||
# ifdef DEBUG_I00AFUNC
|
#ifdef DEBUG_I00AFUNC
|
||||||
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
||||||
# endif
|
#endif
|
||||||
if (pseg == 0)
|
if (pseg == 0)
|
||||||
break;
|
break;
|
||||||
stkl = stkl - pseg;
|
stkl = stkl - pseg;
|
||||||
@@ -485,9 +485,9 @@ i00afunc (long address)
|
|||||||
|
|
||||||
while (pseg != 0)
|
while (pseg != 0)
|
||||||
{
|
{
|
||||||
# ifdef DEBUG_I00AFUNC
|
#ifdef DEBUG_I00AFUNC
|
||||||
fprintf (stderr, "%011o %011o\n", pseg, size);
|
fprintf (stderr, "%011o %011o\n", pseg, size);
|
||||||
# endif
|
#endif
|
||||||
stkl = stkl - pseg;
|
stkl = stkl - pseg;
|
||||||
ssptr = (struct stack_segment_linkage *) stkl;
|
ssptr = (struct stack_segment_linkage *) stkl;
|
||||||
size = ssptr->sssize;
|
size = ssptr->sssize;
|
||||||
@@ -497,8 +497,8 @@ i00afunc (long address)
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* not CRAY2 */
|
#endif /* not CRAY2 */
|
||||||
# endif /* CRAY */
|
#endif /* CRAY */
|
||||||
|
|
||||||
# endif /* no alloca */
|
#endif /* no alloca */
|
||||||
#endif /* not GCC version 2 */
|
#endif /* not GCC version 2 */
|
||||||
|
|||||||
+52
-182
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */
|
/* Copyright (C) 1989, 1997, 1998 Aladdin Enterprises. All rights reserved. */
|
||||||
|
|
||||||
/*$Id$*/
|
/*$Id$*/
|
||||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
||||||
@@ -37,62 +37,27 @@ program under the GPL.
|
|||||||
* There are no error messages.
|
* There are no error messages.
|
||||||
*
|
*
|
||||||
* ansi2knr recognizes function definitions by seeing a non-keyword
|
* ansi2knr recognizes function definitions by seeing a non-keyword
|
||||||
* identifier at the left margin, followed by a left parenthesis, with a
|
* identifier at the left margin, followed by a left parenthesis,
|
||||||
* right parenthesis as the last character on the line, and with a left
|
* with a right parenthesis as the last character on the line,
|
||||||
* brace as the first token on the following line (ignoring possible
|
* and with a left brace as the first token on the following line
|
||||||
* intervening comments and/or preprocessor directives), except that a line
|
* (ignoring possible intervening comments), except that a line
|
||||||
* consisting of only
|
* consisting of only
|
||||||
* identifier1(identifier2)
|
* identifier1(identifier2)
|
||||||
* will not be considered a function definition unless identifier2 is
|
* will not be considered a function definition unless identifier2 is
|
||||||
* the word "void", and a line consisting of
|
* the word "void". ansi2knr will recognize a multi-line header provided
|
||||||
* identifier1(identifier2, <<arbitrary>>)
|
* that no intervening line ends with a left or right brace or a semicolon.
|
||||||
* will not be considered a function definition.
|
* These algorithms ignore whitespace and comments, except that
|
||||||
* ansi2knr will recognize a multi-line header provided that no intervening
|
* the function name must be the first thing on the line.
|
||||||
* line ends with a left or right brace or a semicolon. These algorithms
|
* The following constructs will confuse it:
|
||||||
* ignore whitespace, comments, and preprocessor directives, except that
|
|
||||||
* the function name must be the first thing on the line. The following
|
|
||||||
* constructs will confuse it:
|
|
||||||
* - Any other construct that starts at the left margin and
|
* - Any other construct that starts at the left margin and
|
||||||
* follows the above syntax (such as a macro or function call).
|
* follows the above syntax (such as a macro or function call).
|
||||||
* - Some macros that tinker with the syntax of function headers.
|
* - Some macros that tinker with the syntax of the function header.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The original and principal author of ansi2knr is L. Peter Deutsch
|
* The original and principal author of ansi2knr is L. Peter Deutsch
|
||||||
* <[email protected]>. Other authors are noted in the change history
|
* <[email protected]>. Other authors are noted in the change history
|
||||||
* that follows (in reverse chronological order):
|
* that follows (in reverse chronological order):
|
||||||
|
|
||||||
lpd 2000-04-12 backs out Eggert's changes because of bugs:
|
|
||||||
- concatlits didn't declare the type of its bufend argument;
|
|
||||||
- concatlits didn't't recognize when it was inside a comment;
|
|
||||||
- scanstring could scan backward past the beginning of the string; when
|
|
||||||
- the check for \ + newline in scanstring was unnecessary.
|
|
||||||
|
|
||||||
2000-03-05 Paul Eggert <[email protected]>
|
|
||||||
|
|
||||||
Add support for concatenated string literals.
|
|
||||||
* ansi2knr.c (concatlits): New decl.
|
|
||||||
(main): Invoke concatlits to concatenate string literals.
|
|
||||||
(scanstring): Handle backslash-newline correctly. Work with
|
|
||||||
character constants. Fix bug when scanning backwards through
|
|
||||||
backslash-quote. Check for unterminated strings.
|
|
||||||
(convert1): Parse character constants, too.
|
|
||||||
(appendline, concatlits): New functions.
|
|
||||||
* ansi2knr.1: Document this.
|
|
||||||
|
|
||||||
lpd 1999-08-17 added code to allow preprocessor directives
|
|
||||||
wherever comments are allowed
|
|
||||||
lpd 1999-04-12 added minor fixes from Pavel Roskin
|
|
||||||
<[email protected]> for clean compilation with
|
|
||||||
gcc -W -Wall
|
|
||||||
lpd 1999-03-22 added hack to recognize lines consisting of
|
|
||||||
identifier1(identifier2, xxx) as *not* being procedures
|
|
||||||
lpd 1999-02-03 made indentation of preprocessor commands consistent
|
|
||||||
lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an
|
|
||||||
endless loop; quoted strings within an argument list
|
|
||||||
confused the parser
|
|
||||||
lpd 1999-01-24 added a check for write errors on the output,
|
|
||||||
suggested by Jim Meyering <[email protected]>
|
|
||||||
lpd 1998-11-09 added further hack to recognize identifier(void)
|
lpd 1998-11-09 added further hack to recognize identifier(void)
|
||||||
as being a procedure
|
as being a procedure
|
||||||
lpd 1998-10-23 added hack to recognize lines consisting of
|
lpd 1998-10-23 added hack to recognize lines consisting of
|
||||||
@@ -188,24 +153,19 @@ program under the GPL.
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define NULL (for *very* old compilers). */
|
|
||||||
#ifndef NULL
|
|
||||||
# define NULL (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The ctype macros don't always handle 8-bit characters correctly.
|
* The ctype macros don't always handle 8-bit characters correctly.
|
||||||
* Compensate for this here.
|
* Compensate for this here.
|
||||||
*/
|
*/
|
||||||
#ifdef isascii
|
#ifdef isascii
|
||||||
# undef HAVE_ISASCII /* just in case */
|
# undef HAVE_ISASCII /* just in case */
|
||||||
# define HAVE_ISASCII 1
|
# define HAVE_ISASCII 1
|
||||||
#else
|
#else
|
||||||
#endif
|
#endif
|
||||||
#if STDC_HEADERS || !HAVE_ISASCII
|
#if STDC_HEADERS || !HAVE_ISASCII
|
||||||
# define is_ascii(c) 1
|
# define is_ascii(c) 1
|
||||||
#else
|
#else
|
||||||
# define is_ascii(c) isascii(c)
|
# define is_ascii(c) isascii(c)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define is_space(c) (is_ascii(c) && isspace(c))
|
#define is_space(c) (is_ascii(c) && isspace(c))
|
||||||
@@ -217,10 +177,7 @@ program under the GPL.
|
|||||||
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
|
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
|
||||||
|
|
||||||
/* Forward references */
|
/* Forward references */
|
||||||
char *ppdirforward();
|
|
||||||
char *ppdirbackward();
|
|
||||||
char *skipspace();
|
char *skipspace();
|
||||||
char *scanstring();
|
|
||||||
int writeblanks();
|
int writeblanks();
|
||||||
int test1();
|
int test1();
|
||||||
int convert1();
|
int convert1();
|
||||||
@@ -233,8 +190,6 @@ main(argc, argv)
|
|||||||
{ FILE *in = stdin;
|
{ FILE *in = stdin;
|
||||||
FILE *out = stdout;
|
FILE *out = stdout;
|
||||||
char *filename = 0;
|
char *filename = 0;
|
||||||
char *program_name = argv[0];
|
|
||||||
char *output_name = 0;
|
|
||||||
#define bufsize 5000 /* arbitrary size */
|
#define bufsize 5000 /* arbitrary size */
|
||||||
char *buf;
|
char *buf;
|
||||||
char *line;
|
char *line;
|
||||||
@@ -250,7 +205,6 @@ main(argc, argv)
|
|||||||
* check for this switch for backward compatibility.
|
* check for this switch for backward compatibility.
|
||||||
*/
|
*/
|
||||||
int convert_varargs = 1;
|
int convert_varargs = 1;
|
||||||
int output_error;
|
|
||||||
|
|
||||||
while ( argc > 1 && argv[1][0] == '-' ) {
|
while ( argc > 1 && argv[1][0] == '-' ) {
|
||||||
if ( !strcmp(argv[1], "--varargs") ) {
|
if ( !strcmp(argv[1], "--varargs") ) {
|
||||||
@@ -265,8 +219,7 @@ main(argc, argv)
|
|||||||
argv += 2;
|
argv += 2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name,
|
fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
|
||||||
argv[1]);
|
|
||||||
fprintf(stderr, usage);
|
fprintf(stderr, usage);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -276,19 +229,16 @@ main(argc, argv)
|
|||||||
fprintf(stderr, usage);
|
fprintf(stderr, usage);
|
||||||
exit(0);
|
exit(0);
|
||||||
case 3:
|
case 3:
|
||||||
output_name = argv[2];
|
out = fopen(argv[2], "w");
|
||||||
out = fopen(output_name, "w");
|
|
||||||
if ( out == NULL ) {
|
if ( out == NULL ) {
|
||||||
fprintf(stderr, "%s: Cannot open output file %s\n",
|
fprintf(stderr, "Cannot open output file %s\n", argv[2]);
|
||||||
program_name, output_name);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
/* falls through */
|
/* falls through */
|
||||||
case 2:
|
case 2:
|
||||||
in = fopen(argv[1], "r");
|
in = fopen(argv[1], "r");
|
||||||
if ( in == NULL ) {
|
if ( in == NULL ) {
|
||||||
fprintf(stderr, "%s: Cannot open input file %s\n",
|
fprintf(stderr, "Cannot open input file %s\n", argv[1]);
|
||||||
program_name, argv[1]);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if ( filename == 0 )
|
if ( filename == 0 )
|
||||||
@@ -300,11 +250,6 @@ main(argc, argv)
|
|||||||
if ( filename )
|
if ( filename )
|
||||||
fprintf(out, "#line 1 \"%s\"\n", filename);
|
fprintf(out, "#line 1 \"%s\"\n", filename);
|
||||||
buf = malloc(bufsize);
|
buf = malloc(bufsize);
|
||||||
if ( buf == NULL )
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Unable to allocate read buffer!\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
line = buf;
|
line = buf;
|
||||||
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
|
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
|
||||||
{
|
{
|
||||||
@@ -321,7 +266,7 @@ f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
|
|||||||
goto wl;
|
goto wl;
|
||||||
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
|
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
|
||||||
goto wl;
|
goto wl;
|
||||||
switch ( *skipspace(ppdirforward(more), 1) )
|
switch ( *skipspace(more, 1) )
|
||||||
{
|
{
|
||||||
case '{':
|
case '{':
|
||||||
/* Definitely a function header. */
|
/* Definitely a function header. */
|
||||||
@@ -355,91 +300,32 @@ wl: fputs(buf, out);
|
|||||||
if ( line != buf )
|
if ( line != buf )
|
||||||
fputs(buf, out);
|
fputs(buf, out);
|
||||||
free(buf);
|
free(buf);
|
||||||
if ( output_name ) {
|
if ( out != stdout )
|
||||||
output_error = ferror(out);
|
fclose(out);
|
||||||
output_error |= fclose(out);
|
|
||||||
} else { /* out == stdout */
|
|
||||||
fflush(out);
|
|
||||||
output_error = ferror(out);
|
|
||||||
}
|
|
||||||
if ( output_error ) {
|
|
||||||
fprintf(stderr, "%s: error writing to %s\n", program_name,
|
|
||||||
(output_name ? output_name : "stdout"));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if ( in != stdin )
|
if ( in != stdin )
|
||||||
fclose(in);
|
fclose(in);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Skip over space and comments, in either direction. */
|
||||||
* Skip forward or backward over one or more preprocessor directives.
|
|
||||||
*/
|
|
||||||
char *
|
|
||||||
ppdirforward(p)
|
|
||||||
char *p;
|
|
||||||
{
|
|
||||||
for (; *p == '#'; ++p) {
|
|
||||||
for (; *p != '\r' && *p != '\n'; ++p)
|
|
||||||
if (*p == 0)
|
|
||||||
return p;
|
|
||||||
if (*p == '\r' && p[1] == '\n')
|
|
||||||
++p;
|
|
||||||
}
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
char *
|
|
||||||
ppdirbackward(p, limit)
|
|
||||||
char *p;
|
|
||||||
char *limit;
|
|
||||||
{
|
|
||||||
char *np = p;
|
|
||||||
|
|
||||||
for (;; p = --np) {
|
|
||||||
if (*np == '\n' && np[-1] == '\r')
|
|
||||||
--np;
|
|
||||||
for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
|
|
||||||
if (np[-1] == 0)
|
|
||||||
return np;
|
|
||||||
if (*np != '#')
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Skip over whitespace, comments, and preprocessor directives,
|
|
||||||
* in either direction.
|
|
||||||
*/
|
|
||||||
char *
|
char *
|
||||||
skipspace(p, dir)
|
skipspace(p, dir)
|
||||||
char *p;
|
register char *p;
|
||||||
int dir; /* 1 for forward, -1 for backward */
|
register int dir; /* 1 for forward, -1 for backward */
|
||||||
{
|
{ for ( ; ; )
|
||||||
for ( ; ; ) {
|
{ while ( is_space(*p) )
|
||||||
while ( is_space(*p) )
|
p += dir;
|
||||||
p += dir;
|
if ( !(*p == '/' && p[dir] == '*') )
|
||||||
if ( !(*p == '/' && p[dir] == '*') )
|
break;
|
||||||
break;
|
p += dir; p += dir;
|
||||||
p += dir; p += dir;
|
while ( !(*p == '*' && p[dir] == '/') )
|
||||||
while ( !(*p == '*' && p[dir] == '/') ) {
|
{ if ( *p == 0 )
|
||||||
if ( *p == 0 )
|
return p; /* multi-line comment?? */
|
||||||
return p; /* multi-line comment?? */
|
p += dir;
|
||||||
p += dir;
|
}
|
||||||
}
|
p += dir; p += dir;
|
||||||
p += dir; p += dir;
|
}
|
||||||
}
|
return p;
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Scan over a quoted string, in either direction. */
|
|
||||||
char *
|
|
||||||
scanstring(p, dir)
|
|
||||||
char *p;
|
|
||||||
int dir;
|
|
||||||
{
|
|
||||||
for (p += dir; ; p += dir)
|
|
||||||
if (*p == '"' && p[-dir] != '\\')
|
|
||||||
return p + dir;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -473,14 +359,14 @@ writeblanks(start, end)
|
|||||||
int
|
int
|
||||||
test1(buf)
|
test1(buf)
|
||||||
char *buf;
|
char *buf;
|
||||||
{ char *p = buf;
|
{ register char *p = buf;
|
||||||
char *bend;
|
char *bend;
|
||||||
char *endfn;
|
char *endfn;
|
||||||
int contin;
|
int contin;
|
||||||
|
|
||||||
if ( !isidfirstchar(*p) )
|
if ( !isidfirstchar(*p) )
|
||||||
return 0; /* no name at left margin */
|
return 0; /* no name at left margin */
|
||||||
bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
|
bend = skipspace(buf + strlen(buf) - 1, -1);
|
||||||
switch ( *bend )
|
switch ( *bend )
|
||||||
{
|
{
|
||||||
case ';': contin = 0 /*2*/; break;
|
case ';': contin = 0 /*2*/; break;
|
||||||
@@ -510,7 +396,7 @@ test1(buf)
|
|||||||
};
|
};
|
||||||
char **key = words;
|
char **key = words;
|
||||||
char *kp;
|
char *kp;
|
||||||
unsigned len = endfn - buf;
|
int len = endfn - buf;
|
||||||
|
|
||||||
while ( (kp = *key) != 0 )
|
while ( (kp = *key) != 0 )
|
||||||
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
|
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
|
||||||
@@ -523,16 +409,14 @@ test1(buf)
|
|||||||
int len;
|
int len;
|
||||||
/*
|
/*
|
||||||
* Check for identifier1(identifier2) and not
|
* Check for identifier1(identifier2) and not
|
||||||
* identifier1(void), or identifier1(identifier2, xxxx).
|
* identifier1(void).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while ( isidchar(*p) )
|
while ( isidchar(*p) )
|
||||||
p++;
|
p++;
|
||||||
len = p - id;
|
len = p - id;
|
||||||
p = skipspace(p, 1);
|
p = skipspace(p, 1);
|
||||||
if (*p == ',' ||
|
if ( *p == ')' && (len != 4 || strncmp(id, "void", 4)) )
|
||||||
(*p == ')' && (len != 4 || strncmp(id, "void", 4)))
|
|
||||||
)
|
|
||||||
return 0; /* not a function */
|
return 0; /* not a function */
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -559,7 +443,7 @@ convert1(buf, out, header, convert_varargs)
|
|||||||
int header; /* Boolean */
|
int header; /* Boolean */
|
||||||
int convert_varargs; /* Boolean */
|
int convert_varargs; /* Boolean */
|
||||||
{ char *endfn;
|
{ char *endfn;
|
||||||
char *p;
|
register char *p;
|
||||||
/*
|
/*
|
||||||
* The breaks table contains pointers to the beginning and end
|
* The breaks table contains pointers to the beginning and end
|
||||||
* of each argument.
|
* of each argument.
|
||||||
@@ -577,7 +461,7 @@ convert1(buf, out, header, convert_varargs)
|
|||||||
;
|
;
|
||||||
top: p = endfn;
|
top: p = endfn;
|
||||||
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
|
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
|
||||||
if ( breaks == NULL )
|
if ( breaks == 0 )
|
||||||
{ /* Couldn't allocate break table, give up */
|
{ /* Couldn't allocate break table, give up */
|
||||||
fprintf(stderr, "Unable to allocate break table!\n");
|
fprintf(stderr, "Unable to allocate break table!\n");
|
||||||
fputs(buf, out);
|
fputs(buf, out);
|
||||||
@@ -589,7 +473,7 @@ top: p = endfn;
|
|||||||
do
|
do
|
||||||
{ int level = 0;
|
{ int level = 0;
|
||||||
char *lp = NULL;
|
char *lp = NULL;
|
||||||
char *rp = NULL;
|
char *rp;
|
||||||
char *end = NULL;
|
char *end = NULL;
|
||||||
|
|
||||||
if ( bp >= btop )
|
if ( bp >= btop )
|
||||||
@@ -616,18 +500,14 @@ top: p = endfn;
|
|||||||
else rp = p;
|
else rp = p;
|
||||||
break;
|
break;
|
||||||
case '/':
|
case '/':
|
||||||
if (p[1] == '*')
|
p = skipspace(p, 1) - 1;
|
||||||
p = skipspace(p, 1) - 1;
|
|
||||||
break;
|
break;
|
||||||
case '"':
|
|
||||||
p = scanstring(p, 1) - 1;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Erase any embedded prototype parameters. */
|
/* Erase any embedded prototype parameters. */
|
||||||
if ( lp && rp )
|
if ( lp )
|
||||||
writeblanks(lp + 1, rp);
|
writeblanks(lp + 1, rp);
|
||||||
p--; /* back up over terminator */
|
p--; /* back up over terminator */
|
||||||
/* Find the name being declared. */
|
/* Find the name being declared. */
|
||||||
@@ -643,19 +523,9 @@ top: p = endfn;
|
|||||||
while ( level )
|
while ( level )
|
||||||
switch ( *--p )
|
switch ( *--p )
|
||||||
{
|
{
|
||||||
case ']': case ')':
|
case ']': case ')': level++; break;
|
||||||
level++;
|
case '[': case '(': level--; break;
|
||||||
break;
|
case '/': p = skipspace(p, -1) + 1; break;
|
||||||
case '[': case '(':
|
|
||||||
level--;
|
|
||||||
break;
|
|
||||||
case '/':
|
|
||||||
if (p > buf && p[-1] == '*')
|
|
||||||
p = skipspace(p, -1) + 1;
|
|
||||||
break;
|
|
||||||
case '"':
|
|
||||||
p = scanstring(p, -1) + 1;
|
|
||||||
break;
|
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
/* basename.c -- return the last element in a path
|
|
||||||
Copyright (C) 1990, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#ifndef FILESYSTEM_PREFIX_LEN
|
|
||||||
# define FILESYSTEM_PREFIX_LEN(Filename) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PARAMS
|
|
||||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
|
||||||
# define PARAMS(Args) Args
|
|
||||||
# else
|
|
||||||
# define PARAMS(Args) ()
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ISSLASH
|
|
||||||
# define ISSLASH(C) ((C) == '/')
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *base_name PARAMS ((char const *name));
|
|
||||||
|
|
||||||
/* In general, we can't use the builtin `basename' function if available,
|
|
||||||
since it has different meanings in different environments.
|
|
||||||
In some environments the builtin `basename' modifies its argument.
|
|
||||||
If NAME is all slashes, be sure to return `/'. */
|
|
||||||
|
|
||||||
char *
|
|
||||||
base_name (char const *name)
|
|
||||||
{
|
|
||||||
char const *base = name += FILESYSTEM_PREFIX_LEN (name);
|
|
||||||
int all_slashes = 1;
|
|
||||||
char const *p;
|
|
||||||
|
|
||||||
for (p = name; *p; p++)
|
|
||||||
{
|
|
||||||
if (ISSLASH (*p))
|
|
||||||
base = p + 1;
|
|
||||||
else
|
|
||||||
all_slashes = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If NAME is all slashes, arrange to return `/'. */
|
|
||||||
if (*base == '\0' && ISSLASH (*name) && all_slashes)
|
|
||||||
--base;
|
|
||||||
|
|
||||||
/* Make sure the last byte is not a slash. */
|
|
||||||
assert (all_slashes || !ISSLASH (*(p - 1)));
|
|
||||||
|
|
||||||
return (char *) base;
|
|
||||||
}
|
|
||||||
-189
@@ -1,189 +0,0 @@
|
|||||||
/* dirname.c -- return all but the last element in a path
|
|
||||||
Copyright (C) 1990, 1998, 2000 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef STDC_HEADERS
|
|
||||||
# include <stdlib.h>
|
|
||||||
#else
|
|
||||||
char *malloc ();
|
|
||||||
#endif
|
|
||||||
#if defined STDC_HEADERS || defined HAVE_STRING_H
|
|
||||||
# include <string.h>
|
|
||||||
#else
|
|
||||||
# include <strings.h>
|
|
||||||
# ifndef strrchr
|
|
||||||
# define strrchr rindex
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#ifndef HAVE_DECL_MEMRCHR
|
|
||||||
"this configure-time declaration test was not run"
|
|
||||||
#endif
|
|
||||||
#if !HAVE_DECL_MEMRCHR
|
|
||||||
void *memrchr ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "dirname.h"
|
|
||||||
|
|
||||||
#ifndef FILESYSTEM_PREFIX_LEN
|
|
||||||
# define FILESYSTEM_PREFIX_LEN(Filename) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ISSLASH
|
|
||||||
# define ISSLASH(C) ((C) == '/')
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BACKSLASH_IS_PATH_SEPARATOR ISSLASH ('\\')
|
|
||||||
|
|
||||||
/* Return the length of `dirname (PATH)' and set *RESULT to point
|
|
||||||
to PATH or to `"."', as appropriate. Works properly even if
|
|
||||||
there are trailing slashes (by effectively ignoring them).
|
|
||||||
WARNING: This function doesn't work for cwd-relative names like
|
|
||||||
`a:foo' that are specified with a drive-letter prefix. That case
|
|
||||||
is handled in the caller. */
|
|
||||||
static size_t
|
|
||||||
dir_name_r (char const *path, char const **result)
|
|
||||||
{
|
|
||||||
char const *slash;
|
|
||||||
size_t length; /* Length of result, not including NUL. */
|
|
||||||
|
|
||||||
slash = strrchr (path, '/');
|
|
||||||
if (BACKSLASH_IS_PATH_SEPARATOR)
|
|
||||||
{
|
|
||||||
char const *b = strrchr (path, '\\');
|
|
||||||
if (b && slash < b)
|
|
||||||
slash = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the last byte of PATH is a slash, decrement SLASH until it's
|
|
||||||
pointing at the leftmost in a sequence of trailing slashes. */
|
|
||||||
if (slash && slash[1] == 0)
|
|
||||||
{
|
|
||||||
while (path < slash && ISSLASH (slash[-1]))
|
|
||||||
{
|
|
||||||
--slash;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (path < slash)
|
|
||||||
{
|
|
||||||
size_t len = slash - path;
|
|
||||||
slash = memrchr (path, '/', len);
|
|
||||||
if (BACKSLASH_IS_PATH_SEPARATOR)
|
|
||||||
{
|
|
||||||
char const *b = memrchr (path, '\\', len);
|
|
||||||
if (b && slash < b)
|
|
||||||
slash = b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (slash == 0)
|
|
||||||
{
|
|
||||||
/* File is in the current directory. */
|
|
||||||
|
|
||||||
length = FILESYSTEM_PREFIX_LEN (path);
|
|
||||||
|
|
||||||
if (length == 0)
|
|
||||||
{
|
|
||||||
path = ".";
|
|
||||||
length = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Remove any trailing slashes from the result. If we have a
|
|
||||||
canonicalized "d:/path", leave alone the root case "d:/". */
|
|
||||||
char const *lim = path + FILESYSTEM_PREFIX_LEN (path);
|
|
||||||
|
|
||||||
while (lim < slash && ISSLASH (*slash))
|
|
||||||
--slash;
|
|
||||||
|
|
||||||
length = slash - path + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
*result = path;
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the leading directories part of PATH,
|
|
||||||
allocated with malloc. If out of memory, return 0.
|
|
||||||
Works properly even if there are trailing slashes
|
|
||||||
(by effectively ignoring them). */
|
|
||||||
|
|
||||||
char *
|
|
||||||
dir_name (char const *path)
|
|
||||||
{
|
|
||||||
char const *result;
|
|
||||||
size_t length = dir_name_r (path, &result);
|
|
||||||
int append_dot = (length && length == FILESYSTEM_PREFIX_LEN (newpath));
|
|
||||||
char *newpath = (char *) malloc (length + append_dot + 1);
|
|
||||||
if (newpath == 0)
|
|
||||||
return 0;
|
|
||||||
strncpy (newpath, result, length);
|
|
||||||
/* If PATH is "d:foo", return "d:.", the CWD on drive d: */
|
|
||||||
if (append_dot)
|
|
||||||
newpath[length++] = '.';
|
|
||||||
newpath[length] = 0;
|
|
||||||
return newpath;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef TEST_DIRNAME
|
|
||||||
/*
|
|
||||||
|
|
||||||
Run the test like this (expect no output):
|
|
||||||
gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall memrchr.c dirname.c
|
|
||||||
sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out
|
|
||||||
|
|
||||||
BEGIN-DATA
|
|
||||||
foo//// .
|
|
||||||
bar/foo//// bar
|
|
||||||
foo/ .
|
|
||||||
/ /
|
|
||||||
. .
|
|
||||||
a .
|
|
||||||
END-DATA
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
# define MAX_BUFF_LEN 1024
|
|
||||||
# include <stdio.h>
|
|
||||||
# include <stdlib.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
char buff[MAX_BUFF_LEN + 1];
|
|
||||||
|
|
||||||
buff[MAX_BUFF_LEN] = 0;
|
|
||||||
while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
|
|
||||||
{
|
|
||||||
char path[MAX_BUFF_LEN];
|
|
||||||
char expected_result[MAX_BUFF_LEN];
|
|
||||||
char const *result;
|
|
||||||
sscanf (buff, "%s %s", path, expected_result);
|
|
||||||
result = dir_name (path);
|
|
||||||
if (strcmp (result, expected_result))
|
|
||||||
printf ("%s: got %s, expected %s\n", path, result, expected_result);
|
|
||||||
}
|
|
||||||
exit (0);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/* Copyright (C) 1998 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
#ifndef DIRNAME_H_
|
|
||||||
# define DIRNAME_H_ 1
|
|
||||||
|
|
||||||
# ifndef PARAMS
|
|
||||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
|
||||||
# define PARAMS(Args) Args
|
|
||||||
# else
|
|
||||||
# define PARAMS(Args) ()
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
char *
|
|
||||||
dir_name PARAMS ((const char *path));
|
|
||||||
|
|
||||||
#endif /* not DIRNAME_H_ */
|
|
||||||
+74
-198
@@ -1,22 +1,23 @@
|
|||||||
/* Error handler for noninteractive utilities
|
/* Error handler for noninteractive utilities
|
||||||
Copyright (C) 1990-1998, 2000, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1990-1998, 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU C Library. Its master source is NOT part of
|
This file is part of the GNU C Library. Its master source is NOT part of
|
||||||
the C library, however. The master source lives in /gd/gnu/lib.
|
the C library, however. The master source lives in /gd/gnu/lib.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Library General Public License as
|
||||||
License as published by the Free Software Foundation; either
|
published by the Free Software Foundation; either version 2 of the
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Lesser General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with the GNU C Library; if not, write to the Free
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
02111-1307 USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
/* Written by David MacKenzie <[email protected]>. */
|
/* Written by David MacKenzie <[email protected]>. */
|
||||||
|
|
||||||
@@ -28,10 +29,6 @@
|
|||||||
#if HAVE_LIBINTL_H
|
#if HAVE_LIBINTL_H
|
||||||
# include <libintl.h>
|
# include <libintl.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef _LIBC
|
|
||||||
# include <wchar.h>
|
|
||||||
# define mbsrtowcs __mbsrtowcs
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
|
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
|
||||||
# if __STDC__
|
# if __STDC__
|
||||||
@@ -55,6 +52,13 @@ void exit ();
|
|||||||
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_DECL_STRERROR_R
|
||||||
|
"this configure-time declaration test was not run"
|
||||||
|
#endif
|
||||||
|
#if !HAVE_DECL_STRERROR_R
|
||||||
|
char *strerror_r ();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _
|
#ifndef _
|
||||||
# define _(String) String
|
# define _(String) String
|
||||||
#endif
|
#endif
|
||||||
@@ -79,12 +83,6 @@ unsigned int error_message_count;
|
|||||||
|
|
||||||
/* In GNU libc we want do not want to use the common name `error' directly.
|
/* In GNU libc we want do not want to use the common name `error' directly.
|
||||||
Instead make it a weak alias. */
|
Instead make it a weak alias. */
|
||||||
extern void __error (int status, int errnum, const char *message, ...)
|
|
||||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
|
||||||
extern void __error_at_line (int status, int errnum, const char *file_name,
|
|
||||||
unsigned int line_number, const char *message,
|
|
||||||
...)
|
|
||||||
__attribute__ ((__format__ (__printf__, 5, 6)));;
|
|
||||||
# define error __error
|
# define error __error
|
||||||
# define error_at_line __error_at_line
|
# define error_at_line __error_at_line
|
||||||
|
|
||||||
@@ -95,30 +93,21 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
|
|||||||
|
|
||||||
#else /* not _LIBC */
|
#else /* not _LIBC */
|
||||||
|
|
||||||
# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
|
|
||||||
# ifndef HAVE_DECL_STRERROR_R
|
|
||||||
"this configure-time declaration test was not run"
|
|
||||||
# endif
|
|
||||||
char *strerror_r ();
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* The calling program should define program_name and set it to the
|
/* The calling program should define program_name and set it to the
|
||||||
name of the executing program. */
|
name of the executing program. */
|
||||||
extern char *program_name;
|
extern char *program_name;
|
||||||
|
|
||||||
# if HAVE_STRERROR_R || defined strerror_r
|
# ifdef HAVE_STRERROR_R
|
||||||
# define __strerror_r strerror_r
|
# define __strerror_r strerror_r
|
||||||
# else
|
# else
|
||||||
# if HAVE_STRERROR
|
# if HAVE_STRERROR
|
||||||
# ifndef HAVE_DECL_STRERROR
|
# ifndef strerror /* On some systems, strerror is a macro */
|
||||||
"this configure-time declaration test was not run"
|
|
||||||
# endif
|
|
||||||
# if !HAVE_DECL_STRERROR
|
|
||||||
char *strerror ();
|
char *strerror ();
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
static char *
|
static char *
|
||||||
private_strerror (int errnum)
|
private_strerror (errnum)
|
||||||
|
int errnum;
|
||||||
{
|
{
|
||||||
extern char *sys_errlist[];
|
extern char *sys_errlist[];
|
||||||
extern int sys_nerr;
|
extern int sys_nerr;
|
||||||
@@ -129,118 +118,15 @@ private_strerror (int errnum)
|
|||||||
}
|
}
|
||||||
# define strerror private_strerror
|
# define strerror private_strerror
|
||||||
# endif /* HAVE_STRERROR */
|
# endif /* HAVE_STRERROR */
|
||||||
# endif /* HAVE_STRERROR_R || defined strerror_r */
|
# endif /* HAVE_STRERROR_R */
|
||||||
#endif /* not _LIBC */
|
#endif /* not _LIBC */
|
||||||
|
|
||||||
static void
|
|
||||||
print_errno_message (int errnum)
|
|
||||||
{
|
|
||||||
char const *s;
|
|
||||||
|
|
||||||
#if defined HAVE_STRERROR_R || _LIBC
|
|
||||||
char errbuf[1024];
|
|
||||||
# if STRERROR_R_CHAR_P || _LIBC
|
|
||||||
s = __strerror_r (errnum, errbuf, sizeof errbuf);
|
|
||||||
# else
|
|
||||||
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
|
|
||||||
s = errbuf;
|
|
||||||
else
|
|
||||||
s = 0;
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
s = strerror (errnum);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !_LIBC
|
|
||||||
if (! s)
|
|
||||||
s = _("Unknown system error");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if _LIBC && USE_IN_LIBIO
|
|
||||||
if (_IO_fwide (stderr, 0) > 0)
|
|
||||||
{
|
|
||||||
__fwprintf (stderr, L": %s", s);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fprintf (stderr, ": %s", s);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef VA_START
|
|
||||||
static void
|
|
||||||
error_tail (int status, int errnum, const char *message, va_list args)
|
|
||||||
{
|
|
||||||
# if HAVE_VPRINTF || _LIBC
|
|
||||||
# if _LIBC && USE_IN_LIBIO
|
|
||||||
if (_IO_fwide (stderr, 0) > 0)
|
|
||||||
{
|
|
||||||
# define ALLOCA_LIMIT 2000
|
|
||||||
size_t len = strlen (message) + 1;
|
|
||||||
wchar_t *wmessage = NULL;
|
|
||||||
mbstate_t st;
|
|
||||||
size_t res;
|
|
||||||
const char *tmp;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (len < ALLOCA_LIMIT)
|
|
||||||
wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (wmessage != NULL && len / 2 < ALLOCA_LIMIT)
|
|
||||||
wmessage = NULL;
|
|
||||||
|
|
||||||
wmessage = (wchar_t *) realloc (wmessage,
|
|
||||||
len * sizeof (wchar_t));
|
|
||||||
|
|
||||||
if (wmessage == NULL)
|
|
||||||
{
|
|
||||||
fputws_unlocked (L"out of memory\n", stderr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
memset (&st, '\0', sizeof (st));
|
|
||||||
tmp =message;
|
|
||||||
}
|
|
||||||
while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len);
|
|
||||||
|
|
||||||
if (res == (size_t) -1)
|
|
||||||
/* The string cannot be converted. */
|
|
||||||
wmessage = (wchar_t *) L"???";
|
|
||||||
|
|
||||||
__vfwprintf (stderr, wmessage, args);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
# endif
|
|
||||||
vfprintf (stderr, message, args);
|
|
||||||
# else
|
|
||||||
_doprnt (message, args, stderr);
|
|
||||||
# endif
|
|
||||||
va_end (args);
|
|
||||||
|
|
||||||
++error_message_count;
|
|
||||||
if (errnum)
|
|
||||||
print_errno_message (errnum);
|
|
||||||
# if _LIBC && USE_IN_LIBIO
|
|
||||||
if (_IO_fwide (stderr, 0) > 0)
|
|
||||||
putwc (L'\n', stderr);
|
|
||||||
else
|
|
||||||
# endif
|
|
||||||
putc ('\n', stderr);
|
|
||||||
fflush (stderr);
|
|
||||||
if (status)
|
|
||||||
exit (status);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Print the program name and error message MESSAGE, which is a printf-style
|
/* Print the program name and error message MESSAGE, which is a printf-style
|
||||||
format string with optional args.
|
format string with optional args.
|
||||||
If ERRNUM is nonzero, print its corresponding system error message.
|
If ERRNUM is nonzero, print its corresponding system error message.
|
||||||
Exit with status STATUS if it is nonzero. */
|
Exit with status STATUS if it is nonzero. */
|
||||||
/* VARARGS */
|
/* VARARGS */
|
||||||
|
|
||||||
void
|
void
|
||||||
#if defined VA_START && __STDC__
|
#if defined VA_START && __STDC__
|
||||||
error (int status, int errnum, const char *message, ...)
|
error (int status, int errnum, const char *message, ...)
|
||||||
@@ -256,48 +142,47 @@ error (status, errnum, message, va_alist)
|
|||||||
va_list args;
|
va_list args;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fflush (stdout);
|
|
||||||
#ifdef _LIBC
|
|
||||||
# ifdef USE_IN_LIBIO
|
|
||||||
_IO_flockfile (stderr);
|
|
||||||
# else
|
|
||||||
__flockfile (stderr);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
if (error_print_progname)
|
if (error_print_progname)
|
||||||
(*error_print_progname) ();
|
(*error_print_progname) ();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if _LIBC && USE_IN_LIBIO
|
fflush (stdout);
|
||||||
if (_IO_fwide (stderr, 0) > 0)
|
fprintf (stderr, "%s: ", program_name);
|
||||||
__fwprintf (stderr, L"%s: ", program_name);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
fprintf (stderr, "%s: ", program_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VA_START
|
#ifdef VA_START
|
||||||
VA_START (args, message);
|
VA_START (args, message);
|
||||||
error_tail (status, errnum, message, args);
|
# if HAVE_VPRINTF || _LIBC
|
||||||
|
vfprintf (stderr, message, args);
|
||||||
|
# else
|
||||||
|
_doprnt (message, args, stderr);
|
||||||
|
# endif
|
||||||
|
va_end (args);
|
||||||
#else
|
#else
|
||||||
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
|
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
#endif
|
||||||
|
|
||||||
++error_message_count;
|
++error_message_count;
|
||||||
if (errnum)
|
if (errnum)
|
||||||
print_errno_message (errnum);
|
{
|
||||||
|
#if defined HAVE_STRERROR_R || _LIBC
|
||||||
|
char errbuf[1024];
|
||||||
|
# if HAVE_WORKING_STRERROR_R || _LIBC
|
||||||
|
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
|
||||||
|
# else
|
||||||
|
/* Don't use __strerror_r's return value because on some systems
|
||||||
|
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
|
||||||
|
__strerror_r (errnum, errbuf, sizeof errbuf);
|
||||||
|
fprintf (stderr, ": %s", errbuf);
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
fprintf (stderr, ": %s", strerror (errnum));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
putc ('\n', stderr);
|
putc ('\n', stderr);
|
||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
if (status)
|
if (status)
|
||||||
exit (status);
|
exit (status);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# ifdef USE_IN_LIBIO
|
|
||||||
_IO_funlockfile (stderr);
|
|
||||||
# else
|
|
||||||
__funlockfile (stderr);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sometimes we want to have at most one error per line. This
|
/* Sometimes we want to have at most one error per line. This
|
||||||
@@ -327,9 +212,8 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
|
|||||||
static const char *old_file_name;
|
static const char *old_file_name;
|
||||||
static unsigned int old_line_number;
|
static unsigned int old_line_number;
|
||||||
|
|
||||||
if (old_line_number == line_number
|
if (old_line_number == line_number &&
|
||||||
&& (file_name == old_file_name
|
(file_name == old_file_name || !strcmp (old_file_name, file_name)))
|
||||||
|| strcmp (old_file_name, file_name) == 0))
|
|
||||||
/* Simply return and print nothing. */
|
/* Simply return and print nothing. */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -337,58 +221,50 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
|
|||||||
old_line_number = line_number;
|
old_line_number = line_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush (stdout);
|
|
||||||
#ifdef _LIBC
|
|
||||||
# ifdef USE_IN_LIBIO
|
|
||||||
_IO_flockfile (stderr);
|
|
||||||
# else
|
|
||||||
__flockfile (stderr);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
if (error_print_progname)
|
if (error_print_progname)
|
||||||
(*error_print_progname) ();
|
(*error_print_progname) ();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if _LIBC && USE_IN_LIBIO
|
fflush (stdout);
|
||||||
if (_IO_fwide (stderr, 0) > 0)
|
fprintf (stderr, "%s:", program_name);
|
||||||
__fwprintf (stderr, L"%s: ", program_name);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
fprintf (stderr, "%s:", program_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_name != NULL)
|
if (file_name != NULL)
|
||||||
{
|
fprintf (stderr, "%s:%d: ", file_name, line_number);
|
||||||
#if _LIBC && USE_IN_LIBIO
|
|
||||||
if (_IO_fwide (stderr, 0) > 0)
|
|
||||||
__fwprintf (stderr, L"%s:%d: ", file_name, line_number);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
fprintf (stderr, "%s:%d: ", file_name, line_number);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef VA_START
|
#ifdef VA_START
|
||||||
VA_START (args, message);
|
VA_START (args, message);
|
||||||
error_tail (status, errnum, message, args);
|
# if HAVE_VPRINTF || _LIBC
|
||||||
|
vfprintf (stderr, message, args);
|
||||||
|
# else
|
||||||
|
_doprnt (message, args, stderr);
|
||||||
|
# endif
|
||||||
|
va_end (args);
|
||||||
#else
|
#else
|
||||||
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
|
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
#endif
|
||||||
|
|
||||||
++error_message_count;
|
++error_message_count;
|
||||||
if (errnum)
|
if (errnum)
|
||||||
print_errno_message (errnum);
|
{
|
||||||
|
#if defined HAVE_STRERROR_R || _LIBC
|
||||||
|
char errbuf[1024];
|
||||||
|
# if HAVE_WORKING_STRERROR_R || _LIBC
|
||||||
|
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
|
||||||
|
# else
|
||||||
|
/* Don't use __strerror_r's return value because on some systems
|
||||||
|
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
|
||||||
|
__strerror_r (errnum, errbuf, sizeof errbuf);
|
||||||
|
fprintf (stderr, ": %s", errbuf);
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
fprintf (stderr, ": %s", strerror (errnum));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
putc ('\n', stderr);
|
putc ('\n', stderr);
|
||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
if (status)
|
if (status)
|
||||||
exit (status);
|
exit (status);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _LIBC
|
|
||||||
# ifdef USE_IN_LIBIO
|
|
||||||
_IO_funlockfile (stderr);
|
|
||||||
# else
|
|
||||||
__funlockfile (stderr);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _LIBC
|
#ifdef _LIBC
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#ifndef __attribute__
|
#ifndef __attribute__
|
||||||
/* This feature is available in gcc versions 2.5 and later. */
|
/* This feature is available in gcc versions 2.5 and later. */
|
||||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
|
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||||
# define __attribute__(Spec) /* empty */
|
# define __attribute__(Spec) /* empty */
|
||||||
# endif
|
# endif
|
||||||
/* The __-protected variants of `format' and `printf' attributes
|
/* The __-protected variants of `format' and `printf' attributes
|
||||||
|
|||||||
+40
-59
@@ -1,25 +1,23 @@
|
|||||||
/* Getopt for GNU.
|
/* Getopt for GNU.
|
||||||
NOTE: getopt is now part of the C library, so if you don't know what
|
NOTE: The canonical source of this file is maintained with the GNU
|
||||||
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
C Library. Bugs can be reported to bug-glibc@gnu.org.
|
||||||
before changing it!
|
|
||||||
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
|
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or modify it
|
||||||
modify it under the terms of the GNU Lesser General Public
|
under the terms of the GNU General Public License as published by the
|
||||||
License as published by the Free Software Foundation; either
|
Free Software Foundation; either version 2, or (at your option) any
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
later version.
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
Lesser General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU General Public License
|
||||||
License along with the GNU C Library; if not, write to the Free
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
02111-1307 USA. */
|
|
||||||
|
|
||||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||||
@@ -29,13 +27,13 @@
|
|||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#else
|
||||||
|
# if !defined __STDC__ || !__STDC__
|
||||||
#if !defined __STDC__ || !__STDC__
|
|
||||||
/* This is a separate conditional since some stdc systems
|
/* This is a separate conditional since some stdc systems
|
||||||
reject `defined (const)'. */
|
reject `defined (const)'. */
|
||||||
# ifndef const
|
# ifndef const
|
||||||
# define const
|
# define const
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -77,12 +75,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _
|
#ifndef _
|
||||||
/* This is for other GNU distributions with internationalized messages. */
|
/* This is for other GNU distributions with internationalized messages.
|
||||||
# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
|
When compiling libc, the _ macro is predefined. */
|
||||||
|
# ifdef HAVE_LIBINTL_H
|
||||||
# include <libintl.h>
|
# include <libintl.h>
|
||||||
# ifndef _
|
# define _(msgid) gettext (msgid)
|
||||||
# define _(msgid) gettext (msgid)
|
|
||||||
# endif
|
|
||||||
# else
|
# else
|
||||||
# define _(msgid) (msgid)
|
# define _(msgid) (msgid)
|
||||||
# endif
|
# endif
|
||||||
@@ -253,13 +250,11 @@ static int last_nonopt;
|
|||||||
/* Bash 2.0 gives us an environment variable containing flags
|
/* Bash 2.0 gives us an environment variable containing flags
|
||||||
indicating ARGV elements that should not be considered arguments. */
|
indicating ARGV elements that should not be considered arguments. */
|
||||||
|
|
||||||
#ifdef USE_NONOPTION_FLAGS
|
|
||||||
/* Defined in getopt_init.c */
|
/* Defined in getopt_init.c */
|
||||||
extern char *__getopt_nonoption_flags;
|
extern char *__getopt_nonoption_flags;
|
||||||
|
|
||||||
static int nonoption_flags_max_len;
|
static int nonoption_flags_max_len;
|
||||||
static int nonoption_flags_len;
|
static int nonoption_flags_len;
|
||||||
#endif
|
|
||||||
|
|
||||||
static int original_argc;
|
static int original_argc;
|
||||||
static char *const *original_argv;
|
static char *const *original_argv;
|
||||||
@@ -280,17 +275,13 @@ store_args_and_env (int argc, char *const *argv)
|
|||||||
text_set_element (__libc_subinit, store_args_and_env);
|
text_set_element (__libc_subinit, store_args_and_env);
|
||||||
# endif /* text_set_element */
|
# endif /* text_set_element */
|
||||||
|
|
||||||
# ifdef USE_NONOPTION_FLAGS
|
# define SWAP_FLAGS(ch1, ch2) \
|
||||||
# define SWAP_FLAGS(ch1, ch2) \
|
|
||||||
if (nonoption_flags_len > 0) \
|
if (nonoption_flags_len > 0) \
|
||||||
{ \
|
{ \
|
||||||
char __tmp = __getopt_nonoption_flags[ch1]; \
|
char __tmp = __getopt_nonoption_flags[ch1]; \
|
||||||
__getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
|
__getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
|
||||||
__getopt_nonoption_flags[ch2] = __tmp; \
|
__getopt_nonoption_flags[ch2] = __tmp; \
|
||||||
}
|
}
|
||||||
# else
|
|
||||||
# define SWAP_FLAGS(ch1, ch2)
|
|
||||||
# endif
|
|
||||||
#else /* !_LIBC */
|
#else /* !_LIBC */
|
||||||
# define SWAP_FLAGS(ch1, ch2)
|
# define SWAP_FLAGS(ch1, ch2)
|
||||||
#endif /* _LIBC */
|
#endif /* _LIBC */
|
||||||
@@ -322,7 +313,7 @@ exchange (argv)
|
|||||||
It leaves the longer segment in the right place overall,
|
It leaves the longer segment in the right place overall,
|
||||||
but it consists of two parts that need to be swapped next. */
|
but it consists of two parts that need to be swapped next. */
|
||||||
|
|
||||||
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
#ifdef _LIBC
|
||||||
/* First make sure the handling of the `__getopt_nonoption_flags'
|
/* First make sure the handling of the `__getopt_nonoption_flags'
|
||||||
string can work normally. Our top argument must be in the range
|
string can work normally. Our top argument must be in the range
|
||||||
of the string. */
|
of the string. */
|
||||||
@@ -426,7 +417,7 @@ _getopt_initialize (argc, argv, optstring)
|
|||||||
else
|
else
|
||||||
ordering = PERMUTE;
|
ordering = PERMUTE;
|
||||||
|
|
||||||
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
#ifdef _LIBC
|
||||||
if (posixly_correct == NULL
|
if (posixly_correct == NULL
|
||||||
&& argc == original_argc && argv == original_argv)
|
&& argc == original_argc && argv == original_argv)
|
||||||
{
|
{
|
||||||
@@ -524,13 +515,6 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
int *longind;
|
int *longind;
|
||||||
int long_only;
|
int long_only;
|
||||||
{
|
{
|
||||||
int print_errors = opterr;
|
|
||||||
if (optstring[0] == ':')
|
|
||||||
print_errors = 0;
|
|
||||||
|
|
||||||
if (argc < 1)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
optarg = NULL;
|
optarg = NULL;
|
||||||
|
|
||||||
if (optind == 0 || !__getopt_initialized)
|
if (optind == 0 || !__getopt_initialized)
|
||||||
@@ -545,7 +529,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
Either it does not have option syntax, or there is an environment flag
|
Either it does not have option syntax, or there is an environment flag
|
||||||
from the shell indicating it is not an option. The later information
|
from the shell indicating it is not an option. The later information
|
||||||
is only used when the used in the GNU libc. */
|
is only used when the used in the GNU libc. */
|
||||||
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
#ifdef _LIBC
|
||||||
# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
||||||
|| (optind < nonoption_flags_len \
|
|| (optind < nonoption_flags_len \
|
||||||
&& __getopt_nonoption_flags[optind] == '1'))
|
&& __getopt_nonoption_flags[optind] == '1'))
|
||||||
@@ -680,17 +664,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
pfound = p;
|
pfound = p;
|
||||||
indfound = option_index;
|
indfound = option_index;
|
||||||
}
|
}
|
||||||
else if (long_only
|
else
|
||||||
|| pfound->has_arg != p->has_arg
|
|
||||||
|| pfound->flag != p->flag
|
|
||||||
|| pfound->val != p->val)
|
|
||||||
/* Second or later nonexact match found. */
|
/* Second or later nonexact match found. */
|
||||||
ambig = 1;
|
ambig = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ambig && !exact)
|
if (ambig && !exact)
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
|
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
|
||||||
argv[0], argv[optind]);
|
argv[0], argv[optind]);
|
||||||
nextchar += strlen (nextchar);
|
nextchar += strlen (nextchar);
|
||||||
@@ -711,7 +692,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
optarg = nameend + 1;
|
optarg = nameend + 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
{
|
{
|
||||||
if (argv[optind - 1][1] == '-')
|
if (argv[optind - 1][1] == '-')
|
||||||
/* --option */
|
/* --option */
|
||||||
@@ -737,7 +718,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
optarg = argv[optind++];
|
optarg = argv[optind++];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: option `%s' requires an argument\n"),
|
_("%s: option `%s' requires an argument\n"),
|
||||||
argv[0], argv[optind - 1]);
|
argv[0], argv[optind - 1]);
|
||||||
@@ -764,7 +745,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
if (!long_only || argv[optind][1] == '-'
|
if (!long_only || argv[optind][1] == '-'
|
||||||
|| my_index (optstring, *nextchar) == NULL)
|
|| my_index (optstring, *nextchar) == NULL)
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
{
|
{
|
||||||
if (argv[optind][1] == '-')
|
if (argv[optind][1] == '-')
|
||||||
/* --option */
|
/* --option */
|
||||||
@@ -794,7 +775,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
|
|
||||||
if (temp == NULL || c == ':')
|
if (temp == NULL || c == ':')
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
{
|
{
|
||||||
if (posixly_correct)
|
if (posixly_correct)
|
||||||
/* 1003.2 specifies the format of this message. */
|
/* 1003.2 specifies the format of this message. */
|
||||||
@@ -828,7 +809,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
}
|
}
|
||||||
else if (optind == argc)
|
else if (optind == argc)
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
{
|
{
|
||||||
/* 1003.2 specifies the format of this message. */
|
/* 1003.2 specifies the format of this message. */
|
||||||
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
|
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
|
||||||
@@ -877,7 +858,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
}
|
}
|
||||||
if (ambig && !exact)
|
if (ambig && !exact)
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
|
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
|
||||||
argv[0], argv[optind]);
|
argv[0], argv[optind]);
|
||||||
nextchar += strlen (nextchar);
|
nextchar += strlen (nextchar);
|
||||||
@@ -895,7 +876,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
optarg = nameend + 1;
|
optarg = nameend + 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
fprintf (stderr, _("\
|
fprintf (stderr, _("\
|
||||||
%s: option `-W %s' doesn't allow an argument\n"),
|
%s: option `-W %s' doesn't allow an argument\n"),
|
||||||
argv[0], pfound->name);
|
argv[0], pfound->name);
|
||||||
@@ -910,7 +891,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
optarg = argv[optind++];
|
optarg = argv[optind++];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: option `%s' requires an argument\n"),
|
_("%s: option `%s' requires an argument\n"),
|
||||||
argv[0], argv[optind - 1]);
|
argv[0], argv[optind - 1]);
|
||||||
@@ -957,12 +938,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
|||||||
}
|
}
|
||||||
else if (optind == argc)
|
else if (optind == argc)
|
||||||
{
|
{
|
||||||
if (print_errors)
|
if (opterr)
|
||||||
{
|
{
|
||||||
/* 1003.2 specifies the format of this message. */
|
/* 1003.2 specifies the format of this message. */
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: option requires an argument -- %c\n"),
|
_("%s: option requires an argument -- %c\n"),
|
||||||
argv[0], c);
|
argv[0], c);
|
||||||
}
|
}
|
||||||
optopt = c;
|
optopt = c;
|
||||||
if (optstring[0] == ':')
|
if (optstring[0] == ':')
|
||||||
|
|||||||
+16
-27
@@ -1,21 +1,21 @@
|
|||||||
/* Declarations for getopt.
|
/* Declarations for getopt.
|
||||||
Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2, or (at your option) any
|
||||||
|
later version.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
This program is distributed in the hope that it will be useful,
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
Lesser General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU General Public License
|
||||||
License along with the GNU C Library; if not, write to the Free
|
along with this program; if not, write to the Free Software
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
02111-1307 USA. */
|
USA. */
|
||||||
|
|
||||||
#ifndef _GETOPT_H
|
#ifndef _GETOPT_H
|
||||||
|
|
||||||
@@ -23,17 +23,6 @@
|
|||||||
# define _GETOPT_H 1
|
# define _GETOPT_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If __GNU_LIBRARY__ is not already defined, either we are being used
|
|
||||||
standalone, or this is the first header included in the source file.
|
|
||||||
If we are being used with glibc, we need to include <features.h>, but
|
|
||||||
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
|
|
||||||
not defined, include <ctype.h>, which will pull in <features.h> for us
|
|
||||||
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
|
|
||||||
doesn't flood the namespace with stuff the way some other headers do.) */
|
|
||||||
#if !defined __GNU_LIBRARY__
|
|
||||||
# include <ctype.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -93,7 +82,7 @@ extern int optopt;
|
|||||||
|
|
||||||
struct option
|
struct option
|
||||||
{
|
{
|
||||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
# if defined __STDC__ && __STDC__
|
||||||
const char *name;
|
const char *name;
|
||||||
# else
|
# else
|
||||||
char *name;
|
char *name;
|
||||||
@@ -137,7 +126,7 @@ struct option
|
|||||||
arguments to the option '\0'. This behavior is specific to the GNU
|
arguments to the option '\0'. This behavior is specific to the GNU
|
||||||
`getopt'. */
|
`getopt'. */
|
||||||
|
|
||||||
#if (defined __STDC__ && __STDC__) || defined __cplusplus
|
#if defined __STDC__ && __STDC__
|
||||||
# ifdef __GNU_LIBRARY__
|
# ifdef __GNU_LIBRARY__
|
||||||
/* Many other libraries have conflicting prototypes for getopt, with
|
/* Many other libraries have conflicting prototypes for getopt, with
|
||||||
differences in the consts, in stdlib.h. To avoid compilation
|
differences in the consts, in stdlib.h. To avoid compilation
|
||||||
|
|||||||
+16
-16
@@ -1,29 +1,26 @@
|
|||||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
|
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or modify it
|
||||||
modify it under the terms of the GNU Lesser General Public
|
under the terms of the GNU General Public License as published by the
|
||||||
License as published by the Free Software Foundation; either
|
Free Software Foundation; either version 2, or (at your option) any
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
later version.
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
Lesser General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU General Public License
|
||||||
License along with the GNU C Library; if not, write to the Free
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
02111-1307 USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
#include "getopt.h"
|
|
||||||
|
|
||||||
#if !defined __STDC__ || !__STDC__
|
#if !defined __STDC__ || !__STDC__
|
||||||
/* This is a separate conditional since some stdc systems
|
/* This is a separate conditional since some stdc systems
|
||||||
reject `defined (const)'. */
|
reject `defined (const)'. */
|
||||||
@@ -31,6 +28,9 @@
|
|||||||
#define const
|
#define const
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "getopt.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|||||||
+293
@@ -0,0 +1,293 @@
|
|||||||
|
/* hash.c -- hash table maintenance
|
||||||
|
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||||
|
Written by Greg McGary <gkm@gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "hash.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "system.h"
|
||||||
|
#include "xalloc.h"
|
||||||
|
|
||||||
|
static void hash_rehash __P((struct hash_table* ht));
|
||||||
|
static unsigned long round_up_2 __P((unsigned long rough));
|
||||||
|
|
||||||
|
/* Implement double hashing with open addressing. The table size is
|
||||||
|
always a power of two. The secondary (`increment') hash function
|
||||||
|
is forced to return an odd-value, in order to be relatively prime
|
||||||
|
to the table size. This guarantees that the increment can
|
||||||
|
potentially hit every slot in the table during collision
|
||||||
|
resolution. */
|
||||||
|
|
||||||
|
void *hash_deleted_item = &hash_deleted_item;
|
||||||
|
|
||||||
|
/* Force the table size to be a power of two, possibly rounding up the
|
||||||
|
given size. */
|
||||||
|
|
||||||
|
void
|
||||||
|
hash_init (struct hash_table* ht, unsigned long size,
|
||||||
|
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp)
|
||||||
|
{
|
||||||
|
ht->ht_size = round_up_2 (size);
|
||||||
|
if (ht->ht_size > (128 * 1024)) /* prevent size from getting out of hand */
|
||||||
|
ht->ht_size /= 2;
|
||||||
|
ht->ht_vec = (void**) XCALLOC (struct token *, ht->ht_size);
|
||||||
|
if (ht->ht_vec == 0)
|
||||||
|
error (1, 0, _("can't allocate %ld bytes for hash table: memory exhausted"),
|
||||||
|
ht->ht_size * sizeof(struct token *));
|
||||||
|
ht->ht_capacity = ht->ht_size * 15 / 16; /* 93.75% loading factor */
|
||||||
|
ht->ht_fill = 0;
|
||||||
|
ht->ht_collisions = 0;
|
||||||
|
ht->ht_lookups = 0;
|
||||||
|
ht->ht_rehashes = 0;
|
||||||
|
ht->ht_hash_1 = hash_1;
|
||||||
|
ht->ht_hash_2 = hash_2;
|
||||||
|
ht->ht_compare = hash_cmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Load an array of items into `ht'. */
|
||||||
|
|
||||||
|
void
|
||||||
|
hash_load (struct hash_table* ht, void *item_table, unsigned long cardinality, unsigned long size)
|
||||||
|
{
|
||||||
|
char *items = (char *) item_table;
|
||||||
|
while (cardinality--)
|
||||||
|
{
|
||||||
|
hash_insert (ht, items);
|
||||||
|
items += size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Returns the address of the table slot matching `key'. If `key' is
|
||||||
|
not found, return the address of an empty slot suitable for
|
||||||
|
inserting `key'. The caller is responsible for incrementing
|
||||||
|
ht_fill on insertion. */
|
||||||
|
|
||||||
|
void **
|
||||||
|
hash_find_slot (struct hash_table* ht, void const *key)
|
||||||
|
{
|
||||||
|
void **slot;
|
||||||
|
void **deleted_slot = 0;
|
||||||
|
unsigned int hash_2 = 0;
|
||||||
|
unsigned int hash_1 = (*ht->ht_hash_1) (key);
|
||||||
|
|
||||||
|
ht->ht_lookups++;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
hash_1 %= ht->ht_size;
|
||||||
|
slot = &ht->ht_vec[hash_1];
|
||||||
|
|
||||||
|
if (*slot == 0)
|
||||||
|
return slot;
|
||||||
|
if (*slot == hash_deleted_item)
|
||||||
|
{
|
||||||
|
if (deleted_slot == 0)
|
||||||
|
deleted_slot = slot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (key == *slot)
|
||||||
|
return slot;
|
||||||
|
if ((*ht->ht_compare) (key, *slot) == 0)
|
||||||
|
return slot;
|
||||||
|
ht->ht_collisions++;
|
||||||
|
}
|
||||||
|
if (!hash_2)
|
||||||
|
hash_2 = (*ht->ht_hash_2) (key) | 1;
|
||||||
|
hash_1 += hash_2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
hash_find_item (struct hash_table* ht, void const *key)
|
||||||
|
{
|
||||||
|
void **slot = hash_find_slot (ht, key);
|
||||||
|
return ((HASH_VACANT (*slot)) ? 0 : *slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
hash_insert (struct hash_table* ht, void *item)
|
||||||
|
{
|
||||||
|
void **slot = hash_find_slot (ht, item);
|
||||||
|
return hash_insert_at (ht, item, slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
hash_insert_at (struct hash_table* ht, void *item, void const *slot)
|
||||||
|
{
|
||||||
|
void *old_item = *(void **) slot;
|
||||||
|
if (HASH_VACANT (old_item))
|
||||||
|
{
|
||||||
|
ht->ht_fill++;
|
||||||
|
old_item = item;
|
||||||
|
}
|
||||||
|
*(void const **) slot = item;
|
||||||
|
if (ht->ht_fill >= ht->ht_capacity)
|
||||||
|
hash_rehash (ht);
|
||||||
|
return old_item;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
hash_delete (struct hash_table* ht, void const *item)
|
||||||
|
{
|
||||||
|
void **slot = hash_find_slot (ht, item);
|
||||||
|
return hash_delete_at (ht, slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
hash_delete_at (struct hash_table* ht, void const *slot)
|
||||||
|
{
|
||||||
|
void *item = *(void **) slot;
|
||||||
|
if (!HASH_VACANT (item))
|
||||||
|
{
|
||||||
|
*(void const **) slot = hash_deleted_item;
|
||||||
|
ht->ht_fill--;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hash_free_items (struct hash_table* ht)
|
||||||
|
{
|
||||||
|
void **vec = ht->ht_vec;
|
||||||
|
void **end = &vec[ht->ht_size];
|
||||||
|
for (; vec < end; vec++)
|
||||||
|
{
|
||||||
|
void *item = *vec;
|
||||||
|
if (!HASH_VACANT (item))
|
||||||
|
free (item);
|
||||||
|
*vec = 0;
|
||||||
|
}
|
||||||
|
ht->ht_fill = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hash_delete_items (struct hash_table* ht)
|
||||||
|
{
|
||||||
|
void **vec = ht->ht_vec;
|
||||||
|
void **end = &vec[ht->ht_size];
|
||||||
|
for (; vec < end; vec++)
|
||||||
|
*vec = 0;
|
||||||
|
ht->ht_fill = 0;
|
||||||
|
ht->ht_collisions = 0;
|
||||||
|
ht->ht_lookups = 0;
|
||||||
|
ht->ht_rehashes = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hash_free (struct hash_table* ht, int free_items)
|
||||||
|
{
|
||||||
|
if (free_items)
|
||||||
|
hash_free_items (ht);
|
||||||
|
free (ht->ht_vec);
|
||||||
|
ht->ht_vec = 0;
|
||||||
|
ht->ht_fill = 0;
|
||||||
|
ht->ht_capacity = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hash_map (struct hash_table *ht, hash_map_func_t map)
|
||||||
|
{
|
||||||
|
void **slot;
|
||||||
|
void **end = &ht->ht_vec[ht->ht_size];
|
||||||
|
|
||||||
|
for (slot = ht->ht_vec; slot < end; slot++)
|
||||||
|
{
|
||||||
|
if (!HASH_VACANT (*slot))
|
||||||
|
(*map) (*slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Double the size of the hash table in the event of overflow... */
|
||||||
|
|
||||||
|
static void
|
||||||
|
hash_rehash (struct hash_table* ht)
|
||||||
|
{
|
||||||
|
unsigned long old_ht_size = ht->ht_size;
|
||||||
|
void **old_vec = ht->ht_vec;
|
||||||
|
void **ovp;
|
||||||
|
void **slot;
|
||||||
|
|
||||||
|
ht->ht_size *= 2;
|
||||||
|
ht->ht_rehashes++;
|
||||||
|
ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4);
|
||||||
|
ht->ht_vec = (void **) XCALLOC (struct token *, ht->ht_size);
|
||||||
|
|
||||||
|
for (ovp = old_vec; ovp < &old_vec[old_ht_size]; ovp++)
|
||||||
|
{
|
||||||
|
if (*ovp == 0)
|
||||||
|
continue;
|
||||||
|
slot = hash_find_slot (ht, *ovp);
|
||||||
|
*slot = *ovp;
|
||||||
|
}
|
||||||
|
free (old_vec);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hash_print_stats (struct hash_table *ht, FILE *out_FILE)
|
||||||
|
{
|
||||||
|
fprintf (out_FILE, _("Load=%ld/%ld=%.0f%%, "), ht->ht_fill, ht->ht_size,
|
||||||
|
100.0 * (double) ht->ht_fill / (double) ht->ht_size);
|
||||||
|
fprintf (out_FILE, _("Rehash=%d, "), ht->ht_rehashes);
|
||||||
|
fprintf (out_FILE, _("Collisions=%ld/%ld=%.0f%%"), ht->ht_collisions, ht->ht_lookups,
|
||||||
|
(ht->ht_lookups
|
||||||
|
? (100.0 * (double) ht->ht_collisions / (double) ht->ht_lookups)
|
||||||
|
: 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dump all items into a NULL-terminated vector. Use the
|
||||||
|
user-supplied vector, or malloc one. */
|
||||||
|
|
||||||
|
void**
|
||||||
|
hash_dump (struct hash_table *ht, void **vector_0, qsort_cmp_t compare)
|
||||||
|
{
|
||||||
|
void **vector;
|
||||||
|
void **slot;
|
||||||
|
void **end = &ht->ht_vec[ht->ht_size];
|
||||||
|
|
||||||
|
if (vector_0 == 0)
|
||||||
|
vector_0 = XMALLOC (void *, ht->ht_fill + 1);
|
||||||
|
vector = vector_0;
|
||||||
|
|
||||||
|
for (slot = ht->ht_vec; slot < end; slot++)
|
||||||
|
if (!HASH_VACANT (*slot))
|
||||||
|
*vector++ = *slot;
|
||||||
|
*vector = 0;
|
||||||
|
|
||||||
|
if (compare)
|
||||||
|
qsort (vector_0, ht->ht_fill, sizeof (void *), compare);
|
||||||
|
return vector_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Round a given number up to the nearest power of 2. */
|
||||||
|
|
||||||
|
static unsigned long
|
||||||
|
round_up_2 (unsigned long rough)
|
||||||
|
{
|
||||||
|
int round;
|
||||||
|
|
||||||
|
round = 1;
|
||||||
|
while (rough)
|
||||||
|
{
|
||||||
|
round <<= 1;
|
||||||
|
rough >>= 1;
|
||||||
|
}
|
||||||
|
return round;
|
||||||
|
}
|
||||||
+144
@@ -0,0 +1,144 @@
|
|||||||
|
/* hash.h -- decls for hash table
|
||||||
|
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||||
|
Written by Greg McGary <gkm@gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#ifndef _hash_h_
|
||||||
|
#define _hash_h_
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
typedef unsigned long (*hash_func_t) __P((void const *key));
|
||||||
|
typedef int (*hash_cmp_func_t) __P((void const *x, void const *y));
|
||||||
|
typedef void (*hash_map_func_t) __P((void const *item));
|
||||||
|
|
||||||
|
struct hash_table
|
||||||
|
{
|
||||||
|
void **ht_vec;
|
||||||
|
unsigned long ht_size; /* total number of slots (power of 2) */
|
||||||
|
unsigned long ht_capacity; /* usable slots, limited by loading-factor */
|
||||||
|
unsigned long ht_fill; /* items in table */
|
||||||
|
unsigned long ht_collisions; /* # of failed calls to comparison function */
|
||||||
|
unsigned long ht_lookups; /* # of queries */
|
||||||
|
unsigned int ht_rehashes; /* # of times we've expanded table */
|
||||||
|
hash_func_t ht_hash_1; /* primary hash function */
|
||||||
|
hash_func_t ht_hash_2; /* secondary hash function */
|
||||||
|
hash_cmp_func_t ht_compare; /* comparison function */
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef int (*qsort_cmp_t) __P((void const *, void const *));
|
||||||
|
|
||||||
|
void hash_init __P((struct hash_table *ht, unsigned long size,
|
||||||
|
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp));
|
||||||
|
void hash_load __P((struct hash_table *ht, void *item_table,
|
||||||
|
unsigned long cardinality, unsigned long size));
|
||||||
|
void **hash_find_slot __P((struct hash_table *ht, void const *key));
|
||||||
|
void *hash_find_item __P((struct hash_table *ht, void const *key));
|
||||||
|
void *hash_insert __P((struct hash_table *ht, void *item));
|
||||||
|
void *hash_insert_at __P((struct hash_table *ht, void *item, void const *slot));
|
||||||
|
void *hash_delete __P((struct hash_table *ht, void const *item));
|
||||||
|
void *hash_delete_at __P((struct hash_table *ht, void const *slot));
|
||||||
|
void hash_delete_items __P((struct hash_table *ht));
|
||||||
|
void hash_free_items __P((struct hash_table *ht));
|
||||||
|
void hash_free __P((struct hash_table *ht, int free_items));
|
||||||
|
void hash_map __P((struct hash_table *ht, hash_map_func_t map));
|
||||||
|
void hash_print_stats __P((struct hash_table *ht, FILE *out_FILE));
|
||||||
|
void **hash_dump __P((struct hash_table *ht, void **vector_0, qsort_cmp_t compare));
|
||||||
|
|
||||||
|
extern void *hash_deleted_item;
|
||||||
|
#define HASH_VACANT(item) ((item) == 0 || (void *) (item) == hash_deleted_item)
|
||||||
|
|
||||||
|
|
||||||
|
/* hash and comparison macros for string keys. */
|
||||||
|
|
||||||
|
#define STRING_HASH_1(_key_, _result_) { \
|
||||||
|
unsigned char const *kk = (unsigned char const *) (_key_) - 1; \
|
||||||
|
while (*++kk) \
|
||||||
|
(_result_) += (*kk << (kk[1] & 0xf)); \
|
||||||
|
} while (0)
|
||||||
|
#define return_STRING_HASH_1(_key_) do { \
|
||||||
|
unsigned long result = 0; \
|
||||||
|
STRING_HASH_1 ((_key_), result); \
|
||||||
|
return result; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define STRING_HASH_2(_key_, _result_) do { \
|
||||||
|
unsigned char const *kk = (unsigned char const *) (_key_) - 1; \
|
||||||
|
while (*++kk) \
|
||||||
|
(_result_) += (*kk << (kk[1] & 0x7)); \
|
||||||
|
} while (0)
|
||||||
|
#define return_STRING_HASH_2(_key_) do { \
|
||||||
|
unsigned long result = 0; \
|
||||||
|
STRING_HASH_2 ((_key_), result); \
|
||||||
|
return result; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define STRING_COMPARE(_x_, _y_, _result_) do { \
|
||||||
|
unsigned char const *xx = (unsigned char const *) (_x_) - 1; \
|
||||||
|
unsigned char const *yy = (unsigned char const *) (_y_) - 1; \
|
||||||
|
do { \
|
||||||
|
if (*++xx == '\0') { \
|
||||||
|
yy++; \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
|
} while (*xx == *++yy); \
|
||||||
|
(_result_) = *xx - *yy; \
|
||||||
|
} while (0)
|
||||||
|
#define return_STRING_COMPARE(_x_, _y_) do { \
|
||||||
|
int result; \
|
||||||
|
STRING_COMPARE (_x_, _y_, result); \
|
||||||
|
return result; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/* hash and comparison macros for integer keys. */
|
||||||
|
|
||||||
|
#define INTEGER_HASH_1(_key_, _result_) do { \
|
||||||
|
(_result_) += ((unsigned long)(_key_)); \
|
||||||
|
} while (0)
|
||||||
|
#define return_INTEGER_HASH_1(_key_) do { \
|
||||||
|
unsigned long result = 0; \
|
||||||
|
INTEGER_HASH_1 ((_key_), result); \
|
||||||
|
return result; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define INTEGER_HASH_2(_key_, _result_) do { \
|
||||||
|
(_result_) += ~((unsigned long)(_key_)); \
|
||||||
|
} while (0)
|
||||||
|
#define return_INTEGER_HASH_2(_key_) do { \
|
||||||
|
unsigned long result = 0; \
|
||||||
|
INTEGER_HASH_2 ((_key_), result); \
|
||||||
|
return result; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define INTEGER_COMPARE(_x_, _y_, _result_) do { \
|
||||||
|
(_result_) = _x_ - _y_; \
|
||||||
|
} while (0)
|
||||||
|
#define return_INTEGER_COMPARE(_x_, _y_) do { \
|
||||||
|
int result; \
|
||||||
|
INTEGER_COMPARE (_x_, _y_, result); \
|
||||||
|
return result; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/* hash and comparison macros for address keys. */
|
||||||
|
|
||||||
|
#define ADDRESS_HASH_1(_key_, _result_) INTEGER_HASH_1 (((unsigned long)(_key_)) >> 3, (_result_))
|
||||||
|
#define ADDRESS_HASH_2(_key_, _result_) INTEGER_HASH_2 (((unsigned long)(_key_)) >> 3, (_result_))
|
||||||
|
#define ADDRESS_COMPARE(_x_, _y_, _result_) INTEGER_COMPARE ((_x_), (_y_), (_result_))
|
||||||
|
#define return_ADDRESS_HASH_1(_key_) return_INTEGER_HASH_1 (((unsigned long)(_key_)) >> 3)
|
||||||
|
#define return_ADDRESS_HASH_2(_key_) return_INTEGER_HASH_2 (((unsigned long)(_key_)) >> 3)
|
||||||
|
#define return_ADDRESS_COMPARE(_x_, _y_) return_INTEGER_COMPARE ((_x_), (_y_))
|
||||||
|
|
||||||
|
#endif /* not _hash_h_ */
|
||||||
-209
@@ -1,209 +0,0 @@
|
|||||||
/* memrchr -- find the last occurrence of a byte in a memory block
|
|
||||||
Copyright (C) 1991, 93, 96, 97, 99, 2000 Free Software Foundation, Inc.
|
|
||||||
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
|
|
||||||
with help from Dan Sahlin (dan@sics.se) and
|
|
||||||
commentary by Jim Blandy (jimb@ai.mit.edu);
|
|
||||||
adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
|
|
||||||
and implemented by Roland McGrath (roland@ai.mit.edu).
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public License as
|
|
||||||
published by the Free Software Foundation; either version 2 of the
|
|
||||||
License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
||||||
Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#undef __ptr_t
|
|
||||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
|
||||||
# define __ptr_t void *
|
|
||||||
#else /* Not C++ or ANSI C. */
|
|
||||||
# define __ptr_t char *
|
|
||||||
#endif /* C++ or ANSI C. */
|
|
||||||
|
|
||||||
#if defined (_LIBC)
|
|
||||||
# include <string.h>
|
|
||||||
# include <memcopy.h>
|
|
||||||
#else
|
|
||||||
# define reg_char char
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (HAVE_LIMITS_H) || defined (_LIBC)
|
|
||||||
# include <limits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LONG_MAX_32_BITS 2147483647
|
|
||||||
|
|
||||||
#ifndef LONG_MAX
|
|
||||||
# define LONG_MAX LONG_MAX_32_BITS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#undef __memrchr
|
|
||||||
#undef memrchr
|
|
||||||
|
|
||||||
#ifndef weak_alias
|
|
||||||
# define __memrchr memrchr
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Search no more than N bytes of S for C. */
|
|
||||||
__ptr_t
|
|
||||||
__memrchr (s, c_in, n)
|
|
||||||
const __ptr_t s;
|
|
||||||
int c_in;
|
|
||||||
size_t n;
|
|
||||||
{
|
|
||||||
const unsigned char *char_ptr;
|
|
||||||
const unsigned long int *longword_ptr;
|
|
||||||
unsigned long int longword, magic_bits, charmask;
|
|
||||||
unsigned reg_char c;
|
|
||||||
|
|
||||||
c = (unsigned char) c_in;
|
|
||||||
|
|
||||||
/* Handle the last few characters by reading one character at a time.
|
|
||||||
Do this until CHAR_PTR is aligned on a longword boundary. */
|
|
||||||
for (char_ptr = (const unsigned char *) s + n;
|
|
||||||
n > 0 && ((unsigned long int) char_ptr
|
|
||||||
& (sizeof (longword) - 1)) != 0;
|
|
||||||
--n)
|
|
||||||
if (*--char_ptr == c)
|
|
||||||
return (__ptr_t) char_ptr;
|
|
||||||
|
|
||||||
/* All these elucidatory comments refer to 4-byte longwords,
|
|
||||||
but the theory applies equally well to 8-byte longwords. */
|
|
||||||
|
|
||||||
longword_ptr = (unsigned long int *) char_ptr;
|
|
||||||
|
|
||||||
/* Bits 31, 24, 16, and 8 of this number are zero. Call these bits
|
|
||||||
the "holes." Note that there is a hole just to the left of
|
|
||||||
each byte, with an extra at the end:
|
|
||||||
|
|
||||||
bits: 01111110 11111110 11111110 11111111
|
|
||||||
bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
|
|
||||||
|
|
||||||
The 1-bits make sure that carries propagate to the next 0-bit.
|
|
||||||
The 0-bits provide holes for carries to fall into. */
|
|
||||||
|
|
||||||
if (sizeof (longword) != 4 && sizeof (longword) != 8)
|
|
||||||
abort ();
|
|
||||||
|
|
||||||
#if LONG_MAX <= LONG_MAX_32_BITS
|
|
||||||
magic_bits = 0x7efefeff;
|
|
||||||
#else
|
|
||||||
magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set up a longword, each of whose bytes is C. */
|
|
||||||
charmask = c | (c << 8);
|
|
||||||
charmask |= charmask << 16;
|
|
||||||
#if LONG_MAX > LONG_MAX_32_BITS
|
|
||||||
charmask |= charmask << 32;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Instead of the traditional loop which tests each character,
|
|
||||||
we will test a longword at a time. The tricky part is testing
|
|
||||||
if *any of the four* bytes in the longword in question are zero. */
|
|
||||||
while (n >= sizeof (longword))
|
|
||||||
{
|
|
||||||
/* We tentatively exit the loop if adding MAGIC_BITS to
|
|
||||||
LONGWORD fails to change any of the hole bits of LONGWORD.
|
|
||||||
|
|
||||||
1) Is this safe? Will it catch all the zero bytes?
|
|
||||||
Suppose there is a byte with all zeros. Any carry bits
|
|
||||||
propagating from its left will fall into the hole at its
|
|
||||||
least significant bit and stop. Since there will be no
|
|
||||||
carry from its most significant bit, the LSB of the
|
|
||||||
byte to the left will be unchanged, and the zero will be
|
|
||||||
detected.
|
|
||||||
|
|
||||||
2) Is this worthwhile? Will it ignore everything except
|
|
||||||
zero bytes? Suppose every byte of LONGWORD has a bit set
|
|
||||||
somewhere. There will be a carry into bit 8. If bit 8
|
|
||||||
is set, this will carry into bit 16. If bit 8 is clear,
|
|
||||||
one of bits 9-15 must be set, so there will be a carry
|
|
||||||
into bit 16. Similarly, there will be a carry into bit
|
|
||||||
24. If one of bits 24-30 is set, there will be a carry
|
|
||||||
into bit 31, so all of the hole bits will be changed.
|
|
||||||
|
|
||||||
The one misfire occurs when bits 24-30 are clear and bit
|
|
||||||
31 is set; in this case, the hole at bit 31 is not
|
|
||||||
changed. If we had access to the processor carry flag,
|
|
||||||
we could close this loophole by putting the fourth hole
|
|
||||||
at bit 32!
|
|
||||||
|
|
||||||
So it ignores everything except 128's, when they're aligned
|
|
||||||
properly.
|
|
||||||
|
|
||||||
3) But wait! Aren't we looking for C, not zero?
|
|
||||||
Good point. So what we do is XOR LONGWORD with a longword,
|
|
||||||
each of whose bytes is C. This turns each byte that is C
|
|
||||||
into a zero. */
|
|
||||||
|
|
||||||
longword = *--longword_ptr ^ charmask;
|
|
||||||
|
|
||||||
/* Add MAGIC_BITS to LONGWORD. */
|
|
||||||
if ((((longword + magic_bits)
|
|
||||||
|
|
||||||
/* Set those bits that were unchanged by the addition. */
|
|
||||||
^ ~longword)
|
|
||||||
|
|
||||||
/* Look at only the hole bits. If any of the hole bits
|
|
||||||
are unchanged, most likely one of the bytes was a
|
|
||||||
zero. */
|
|
||||||
& ~magic_bits) != 0)
|
|
||||||
{
|
|
||||||
/* Which of the bytes was C? If none of them were, it was
|
|
||||||
a misfire; continue the search. */
|
|
||||||
|
|
||||||
const unsigned char *cp = (const unsigned char *) longword_ptr;
|
|
||||||
|
|
||||||
#if LONG_MAX > 2147483647
|
|
||||||
if (cp[7] == c)
|
|
||||||
return (__ptr_t) &cp[7];
|
|
||||||
if (cp[6] == c)
|
|
||||||
return (__ptr_t) &cp[6];
|
|
||||||
if (cp[5] == c)
|
|
||||||
return (__ptr_t) &cp[5];
|
|
||||||
if (cp[4] == c)
|
|
||||||
return (__ptr_t) &cp[4];
|
|
||||||
#endif
|
|
||||||
if (cp[3] == c)
|
|
||||||
return (__ptr_t) &cp[3];
|
|
||||||
if (cp[2] == c)
|
|
||||||
return (__ptr_t) &cp[2];
|
|
||||||
if (cp[1] == c)
|
|
||||||
return (__ptr_t) &cp[1];
|
|
||||||
if (cp[0] == c)
|
|
||||||
return (__ptr_t) cp;
|
|
||||||
}
|
|
||||||
|
|
||||||
n -= sizeof (longword);
|
|
||||||
}
|
|
||||||
|
|
||||||
char_ptr = (const unsigned char *) longword_ptr;
|
|
||||||
|
|
||||||
while (n-- > 0)
|
|
||||||
{
|
|
||||||
if (*--char_ptr == c)
|
|
||||||
return (__ptr_t) char_ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#ifdef weak_alias
|
|
||||||
weak_alias (__memrchr, memrchr)
|
|
||||||
#endif
|
|
||||||
+75
-94
@@ -1,25 +1,26 @@
|
|||||||
/* obstack.c - subroutines used implicitly by object stack macros
|
/* obstack.c - subroutines used implicitly by object stack macros
|
||||||
Copyright (C) 1988-1994,96,97,98,99,2000,2001 Free Software Foundation, Inc.
|
Copyright (C) 1988-1994,96,97,98,99,2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU C Library. Its master source is NOT part of
|
This file is part of the GNU C Library. Its master source is NOT part of
|
||||||
the C library, however. The master source lives in /gd/gnu/lib.
|
the C library, however. The master source lives in /gd/gnu/lib.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Library General Public License as
|
||||||
License as published by the Free Software Foundation; either
|
published by the Free Software Foundation; either version 2 of the
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Lesser General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with the GNU C Library; if not, write to the Free
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
02111-1307 USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "obstack.h"
|
#include "obstack.h"
|
||||||
@@ -39,43 +40,40 @@
|
|||||||
files, it is simpler to just do this in the source for each such file. */
|
files, it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
|
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
|
||||||
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
|
||||||
# include <gnu-versions.h>
|
#include <gnu-versions.h>
|
||||||
# if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
|
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
|
||||||
# define ELIDE_CODE
|
#define ELIDE_CODE
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _LIBC && defined USE_IN_LIBIO
|
|
||||||
# include <wchar.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ELIDE_CODE
|
#ifndef ELIDE_CODE
|
||||||
|
|
||||||
|
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
# define POINTER void *
|
#define POINTER void *
|
||||||
# else
|
#else
|
||||||
# define POINTER char *
|
#define POINTER char *
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
/* Determine default alignment. */
|
/* Determine default alignment. */
|
||||||
struct fooalign {char x; double d;};
|
struct fooalign {char x; double d;};
|
||||||
# define DEFAULT_ALIGNMENT \
|
#define DEFAULT_ALIGNMENT \
|
||||||
((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
|
((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
|
||||||
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
|
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
|
||||||
But in fact it might be less smart and round addresses to as much as
|
But in fact it might be less smart and round addresses to as much as
|
||||||
DEFAULT_ROUNDING. So we prepare for it to do that. */
|
DEFAULT_ROUNDING. So we prepare for it to do that. */
|
||||||
union fooround {long x; double d;};
|
union fooround {long x; double d;};
|
||||||
# define DEFAULT_ROUNDING (sizeof (union fooround))
|
#define DEFAULT_ROUNDING (sizeof (union fooround))
|
||||||
|
|
||||||
/* When we copy a long block of data, this is the unit to do it with.
|
/* When we copy a long block of data, this is the unit to do it with.
|
||||||
On some machines, copying successive ints does not work;
|
On some machines, copying successive ints does not work;
|
||||||
in such a case, redefine COPYING_UNIT to `long' (if that works)
|
in such a case, redefine COPYING_UNIT to `long' (if that works)
|
||||||
or `char' as a last resort. */
|
or `char' as a last resort. */
|
||||||
# ifndef COPYING_UNIT
|
#ifndef COPYING_UNIT
|
||||||
# define COPYING_UNIT int
|
#define COPYING_UNIT int
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* The functions allocating more room by calling `obstack_chunk_alloc'
|
/* The functions allocating more room by calling `obstack_chunk_alloc'
|
||||||
@@ -84,21 +82,21 @@ union fooround {long x; double d;};
|
|||||||
abort gracefully or use longjump - but shouldn't return. This
|
abort gracefully or use longjump - but shouldn't return. This
|
||||||
variable by default points to the internal function
|
variable by default points to the internal function
|
||||||
`print_and_abort'. */
|
`print_and_abort'. */
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
static void print_and_abort (void);
|
static void print_and_abort (void);
|
||||||
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
|
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
|
||||||
# else
|
#else
|
||||||
static void print_and_abort ();
|
static void print_and_abort ();
|
||||||
void (*obstack_alloc_failed_handler) () = print_and_abort;
|
void (*obstack_alloc_failed_handler) () = print_and_abort;
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
/* Exit value used when `print_and_abort' is used. */
|
/* Exit value used when `print_and_abort' is used. */
|
||||||
# if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
|
#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
|
||||||
# include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# endif
|
#endif
|
||||||
# ifndef EXIT_FAILURE
|
#ifndef EXIT_FAILURE
|
||||||
# define EXIT_FAILURE 1
|
#define EXIT_FAILURE 1
|
||||||
# endif
|
#endif
|
||||||
int obstack_exit_failure = EXIT_FAILURE;
|
int obstack_exit_failure = EXIT_FAILURE;
|
||||||
|
|
||||||
/* The non-GNU-C macros copy the obstack into this global variable
|
/* The non-GNU-C macros copy the obstack into this global variable
|
||||||
@@ -112,33 +110,33 @@ struct obstack *_obstack;
|
|||||||
For free, do not use ?:, since some compilers, like the MIPS compilers,
|
For free, do not use ?:, since some compilers, like the MIPS compilers,
|
||||||
do not allow (expr) ? void : void. */
|
do not allow (expr) ? void : void. */
|
||||||
|
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
# define CALL_CHUNKFUN(h, size) \
|
#define CALL_CHUNKFUN(h, size) \
|
||||||
(((h) -> use_extra_arg) \
|
(((h) -> use_extra_arg) \
|
||||||
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
||||||
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
|
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
|
||||||
|
|
||||||
# define CALL_FREEFUN(h, old_chunk) \
|
#define CALL_FREEFUN(h, old_chunk) \
|
||||||
do { \
|
do { \
|
||||||
if ((h) -> use_extra_arg) \
|
if ((h) -> use_extra_arg) \
|
||||||
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
||||||
else \
|
else \
|
||||||
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
|
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
# else
|
#else
|
||||||
# define CALL_CHUNKFUN(h, size) \
|
#define CALL_CHUNKFUN(h, size) \
|
||||||
(((h) -> use_extra_arg) \
|
(((h) -> use_extra_arg) \
|
||||||
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
||||||
: (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
|
: (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
|
||||||
|
|
||||||
# define CALL_FREEFUN(h, old_chunk) \
|
#define CALL_FREEFUN(h, old_chunk) \
|
||||||
do { \
|
do { \
|
||||||
if ((h) -> use_extra_arg) \
|
if ((h) -> use_extra_arg) \
|
||||||
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
||||||
else \
|
else \
|
||||||
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
|
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
|
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
|
||||||
@@ -154,13 +152,13 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
|
|||||||
struct obstack *h;
|
struct obstack *h;
|
||||||
int size;
|
int size;
|
||||||
int alignment;
|
int alignment;
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
POINTER (*chunkfun) (long);
|
POINTER (*chunkfun) (long);
|
||||||
void (*freefun) (void *);
|
void (*freefun) (void *);
|
||||||
# else
|
#else
|
||||||
POINTER (*chunkfun) ();
|
POINTER (*chunkfun) ();
|
||||||
void (*freefun) ();
|
void (*freefun) ();
|
||||||
# endif
|
#endif
|
||||||
{
|
{
|
||||||
register struct _obstack_chunk *chunk; /* points to new chunk */
|
register struct _obstack_chunk *chunk; /* points to new chunk */
|
||||||
|
|
||||||
@@ -183,13 +181,13 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
|
|||||||
size = 4096 - extra;
|
size = 4096 - extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
|
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
|
||||||
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
||||||
# else
|
#else
|
||||||
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
||||||
h->freefun = freefun;
|
h->freefun = freefun;
|
||||||
# endif
|
#endif
|
||||||
h->chunk_size = size;
|
h->chunk_size = size;
|
||||||
h->alignment_mask = alignment - 1;
|
h->alignment_mask = alignment - 1;
|
||||||
h->use_extra_arg = 0;
|
h->use_extra_arg = 0;
|
||||||
@@ -212,13 +210,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
|
|||||||
struct obstack *h;
|
struct obstack *h;
|
||||||
int size;
|
int size;
|
||||||
int alignment;
|
int alignment;
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
POINTER (*chunkfun) (POINTER, long);
|
POINTER (*chunkfun) (POINTER, long);
|
||||||
void (*freefun) (POINTER, POINTER);
|
void (*freefun) (POINTER, POINTER);
|
||||||
# else
|
#else
|
||||||
POINTER (*chunkfun) ();
|
POINTER (*chunkfun) ();
|
||||||
void (*freefun) ();
|
void (*freefun) ();
|
||||||
# endif
|
#endif
|
||||||
POINTER arg;
|
POINTER arg;
|
||||||
{
|
{
|
||||||
register struct _obstack_chunk *chunk; /* points to new chunk */
|
register struct _obstack_chunk *chunk; /* points to new chunk */
|
||||||
@@ -242,13 +240,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
|
|||||||
size = 4096 - extra;
|
size = 4096 - extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined(__STDC__) && __STDC__
|
||||||
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
|
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
|
||||||
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
||||||
# else
|
#else
|
||||||
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
||||||
h->freefun = freefun;
|
h->freefun = freefun;
|
||||||
# endif
|
#endif
|
||||||
h->chunk_size = size;
|
h->chunk_size = size;
|
||||||
h->alignment_mask = alignment - 1;
|
h->alignment_mask = alignment - 1;
|
||||||
h->extra_arg = arg;
|
h->extra_arg = arg;
|
||||||
@@ -343,11 +341,11 @@ _obstack_newchunk (h, length)
|
|||||||
This is here for debugging.
|
This is here for debugging.
|
||||||
If you use it in a program, you are probably losing. */
|
If you use it in a program, you are probably losing. */
|
||||||
|
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
|
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
|
||||||
obstack.h because it is just for debugging. */
|
obstack.h because it is just for debugging. */
|
||||||
int _obstack_allocated_p (struct obstack *h, POINTER obj);
|
int _obstack_allocated_p (struct obstack *h, POINTER obj);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
_obstack_allocated_p (h, obj)
|
_obstack_allocated_p (h, obj)
|
||||||
@@ -372,7 +370,7 @@ _obstack_allocated_p (h, obj)
|
|||||||
/* Free objects in obstack H, including OBJ and everything allocate
|
/* Free objects in obstack H, including OBJ and everything allocate
|
||||||
more recently than OBJ. If OBJ is zero, free everything in H. */
|
more recently than OBJ. If OBJ is zero, free everything in H. */
|
||||||
|
|
||||||
# undef obstack_free
|
#undef obstack_free
|
||||||
|
|
||||||
/* This function has two names with identical definitions.
|
/* This function has two names with identical definitions.
|
||||||
This is the first one, called from non-ANSI code. */
|
This is the first one, called from non-ANSI code. */
|
||||||
@@ -458,54 +456,37 @@ _obstack_memory_used (h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Define the error handler. */
|
/* Define the error handler. */
|
||||||
# ifndef _
|
#ifndef _
|
||||||
# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
|
# if defined HAVE_LIBINTL_H || defined _LIBC
|
||||||
# include <libintl.h>
|
# include <libintl.h>
|
||||||
# ifndef _
|
# ifndef _
|
||||||
# define _(Str) gettext (Str)
|
# define _(Str) gettext (Str)
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define _(Str) (Str)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# if defined _LIBC && defined USE_IN_LIBIO
|
|
||||||
# include <libio/iolibio.h>
|
|
||||||
# define fputs(s, f) _IO_fputs (s, f)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifndef __attribute__
|
|
||||||
/* This feature is available in gcc versions 2.5 and later. */
|
|
||||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
|
|
||||||
# define __attribute__(Spec) /* empty */
|
|
||||||
# endif
|
# endif
|
||||||
|
# else
|
||||||
|
# define _(Str) (Str)
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
#if defined _LIBC && defined USE_IN_LIBIO
|
||||||
|
# include <libio/iolibio.h>
|
||||||
|
# define fputs(s, f) _IO_fputs (s, f)
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
__attribute__ ((noreturn))
|
|
||||||
print_and_abort ()
|
print_and_abort ()
|
||||||
{
|
{
|
||||||
/* Don't change any of these strings. Yes, it would be possible to add
|
fputs (_("memory exhausted"), stderr);
|
||||||
the newline to the string and use fputs or so. But this must not
|
fputc ('\n', stderr);
|
||||||
happen because the "memory exhausted" message appears in other places
|
|
||||||
like this and the translation should be reused instead of creating
|
|
||||||
a very similar string which requires a separate translation. */
|
|
||||||
# if defined _LIBC && defined USE_IN_LIBIO
|
|
||||||
if (_IO_fwide (stderr, 0) > 0)
|
|
||||||
__fwprintf (stderr, L"%s\n", _("memory exhausted"));
|
|
||||||
else
|
|
||||||
# endif
|
|
||||||
fprintf (stderr, "%s\n", _("memory exhausted"));
|
|
||||||
exit (obstack_exit_failure);
|
exit (obstack_exit_failure);
|
||||||
}
|
}
|
||||||
|
|
||||||
# if 0
|
#if 0
|
||||||
/* These are now turned off because the applications do not use it
|
/* These are now turned off because the applications do not use it
|
||||||
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
|
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
|
||||||
|
|
||||||
/* Now define the functional versions of the obstack macros.
|
/* Now define the functional versions of the obstack macros.
|
||||||
Define them to simply use the corresponding macros to do the job. */
|
Define them to simply use the corresponding macros to do the job. */
|
||||||
|
|
||||||
# if defined __STDC__ && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
/* These function definitions do not work with non-ANSI preprocessors;
|
/* These function definitions do not work with non-ANSI preprocessors;
|
||||||
they won't pass through the macro names in parentheses. */
|
they won't pass through the macro names in parentheses. */
|
||||||
|
|
||||||
@@ -616,8 +597,8 @@ POINTER (obstack_copy0) (obstack, address, length)
|
|||||||
return obstack_copy0 (obstack, address, length);
|
return obstack_copy0 (obstack, address, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* __STDC__ */
|
#endif /* __STDC__ */
|
||||||
|
|
||||||
# endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
#endif /* !ELIDE_CODE */
|
#endif /* !ELIDE_CODE */
|
||||||
|
|||||||
+8
-11
@@ -4,23 +4,20 @@
|
|||||||
This file is part of the GNU C Library. Its master source is NOT part of
|
This file is part of the GNU C Library. Its master source is NOT part of
|
||||||
the C library, however. The master source lives in /gd/gnu/lib.
|
the C library, however. The master source lives in /gd/gnu/lib.
|
||||||
|
|
||||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
Bugs can be reported to bug-glibc@gnu.org.
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
under the terms of the GNU General Public License as published by the
|
|
||||||
Free Software Foundation; either version 2, or (at your option) any
|
|
||||||
later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
Library General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this program; if not, write to the Free Software
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
/* Summary:
|
/* Summary:
|
||||||
|
|
||||||
|
|||||||
+2
-22
@@ -1,32 +1,12 @@
|
|||||||
/* quote.c - quote arguments for output
|
|
||||||
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
/* Written by Paul Eggert <[email protected]> */
|
/* Written by Paul Eggert <[email protected]> */
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
#if HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_STDDEF_H
|
|
||||||
# include <stddef.h> /* For the definition of size_t on windows w/MSVC. */
|
|
||||||
#endif
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "quotearg.h"
|
#include <quotearg.h>
|
||||||
#include "quote.h"
|
#include <quote.h>
|
||||||
|
|
||||||
/* Return an unambiguous printable representated, allocated in slot N,
|
/* Return an unambiguous printable representated, allocated in slot N,
|
||||||
for NAME, suitable for diagnostics. */
|
for NAME, suitable for diagnostics. */
|
||||||
|
|||||||
+1
-17
@@ -1,20 +1,4 @@
|
|||||||
/* quote.h - prototypes for quote.c
|
/* prototypes for quote.c */
|
||||||
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software Foundation,
|
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef PARAMS
|
#ifndef PARAMS
|
||||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||||
|
|||||||
+12
-25
@@ -25,8 +25,8 @@
|
|||||||
# include <stddef.h> /* For the definition of size_t on windows w/MSVC. */
|
# include <stddef.h> /* For the definition of size_t on windows w/MSVC. */
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "quotearg.h"
|
#include <quotearg.h>
|
||||||
#include "xalloc.h"
|
#include <xalloc.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
@@ -44,15 +44,9 @@
|
|||||||
#ifndef CHAR_BIT
|
#ifndef CHAR_BIT
|
||||||
# define CHAR_BIT 8
|
# define CHAR_BIT 8
|
||||||
#endif
|
#endif
|
||||||
#ifndef SIZE_MAX
|
|
||||||
# define SIZE_MAX ((size_t) -1)
|
|
||||||
#endif
|
|
||||||
#ifndef UCHAR_MAX
|
#ifndef UCHAR_MAX
|
||||||
# define UCHAR_MAX ((unsigned char) -1)
|
# define UCHAR_MAX ((unsigned char) -1)
|
||||||
#endif
|
#endif
|
||||||
#ifndef UINT_MAX
|
|
||||||
# define UINT_MAX ((unsigned int) -1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_C_BACKSLASH_A
|
#if HAVE_C_BACKSLASH_A
|
||||||
# define ALERT_CHAR '\a'
|
# define ALERT_CHAR '\a'
|
||||||
@@ -545,7 +539,6 @@ quotearg_n_options (int n, char const *arg,
|
|||||||
one small component of a "memory exhausted" message in slot 0. */
|
one small component of a "memory exhausted" message in slot 0. */
|
||||||
static char slot0[256];
|
static char slot0[256];
|
||||||
static unsigned int nslots = 1;
|
static unsigned int nslots = 1;
|
||||||
unsigned int n0 = n;
|
|
||||||
struct slotvec
|
struct slotvec
|
||||||
{
|
{
|
||||||
size_t size;
|
size_t size;
|
||||||
@@ -554,26 +547,20 @@ quotearg_n_options (int n, char const *arg,
|
|||||||
static struct slotvec slotvec0 = {sizeof slot0, slot0};
|
static struct slotvec slotvec0 = {sizeof slot0, slot0};
|
||||||
static struct slotvec *slotvec = &slotvec0;
|
static struct slotvec *slotvec = &slotvec0;
|
||||||
|
|
||||||
if (n < 0)
|
if (nslots <= n)
|
||||||
abort ();
|
|
||||||
|
|
||||||
if (nslots <= n0)
|
|
||||||
{
|
{
|
||||||
unsigned int n1 = n0 + 1;
|
int n1 = n + 1;
|
||||||
size_t s = n1 * sizeof *slotvec;
|
size_t s = n1 * sizeof (struct slotvec);
|
||||||
|
if (! (0 < n1 && n1 == s / sizeof (struct slotvec)))
|
||||||
if (SIZE_MAX / UINT_MAX <= sizeof *slotvec
|
abort ();
|
||||||
&& n1 != s / sizeof *slotvec)
|
|
||||||
xalloc_die ();
|
|
||||||
|
|
||||||
if (slotvec == &slotvec0)
|
if (slotvec == &slotvec0)
|
||||||
{
|
{
|
||||||
slotvec = (struct slotvec *) xmalloc (sizeof *slotvec);
|
slotvec = (struct slotvec *) xmalloc (sizeof (struct slotvec));
|
||||||
*slotvec = slotvec0;
|
*slotvec = slotvec0;
|
||||||
}
|
}
|
||||||
slotvec = (struct slotvec *) xrealloc (slotvec, s);
|
slotvec = (struct slotvec *) xrealloc (slotvec, s);
|
||||||
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof *slotvec);
|
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof (struct slotvec));
|
||||||
nslots = n1;
|
nslots = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -593,7 +580,7 @@ quotearg_n_options (int n, char const *arg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
quotearg_n (int n, char const *arg)
|
quotearg_n (unsigned int n, char const *arg)
|
||||||
{
|
{
|
||||||
return quotearg_n_options (n, arg, &default_quoting_options);
|
return quotearg_n_options (n, arg, &default_quoting_options);
|
||||||
}
|
}
|
||||||
@@ -605,7 +592,7 @@ quotearg (char const *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
quotearg_n_style (int n, enum quoting_style s, char const *arg)
|
quotearg_n_style (unsigned int n, enum quoting_style s, char const *arg)
|
||||||
{
|
{
|
||||||
struct quoting_options o;
|
struct quoting_options o;
|
||||||
o.style = s;
|
o.style = s;
|
||||||
|
|||||||
+3
-2
@@ -89,7 +89,7 @@ size_t quotearg_buffer PARAMS ((char *buffer, size_t buffersize,
|
|||||||
The returned value points to static storage that can be
|
The returned value points to static storage that can be
|
||||||
reused by the next call to this function with the same value of N.
|
reused by the next call to this function with the same value of N.
|
||||||
N must be nonnegative. */
|
N must be nonnegative. */
|
||||||
char *quotearg_n PARAMS ((int n, char const *arg));
|
char *quotearg_n PARAMS ((unsigned int n, char const *arg));
|
||||||
|
|
||||||
/* Equivalent to quotearg_n (0, ARG). */
|
/* Equivalent to quotearg_n (0, ARG). */
|
||||||
char *quotearg PARAMS ((char const *arg));
|
char *quotearg PARAMS ((char const *arg));
|
||||||
@@ -97,7 +97,8 @@ char *quotearg PARAMS ((char const *arg));
|
|||||||
/* Use style S and storage slot N to return a quoted version of the string ARG.
|
/* Use style S and storage slot N to return a quoted version of the string ARG.
|
||||||
This is like quotearg_n (N, ARG), except that it uses S with no other
|
This is like quotearg_n (N, ARG), except that it uses S with no other
|
||||||
options to specify the quoting method. */
|
options to specify the quoting method. */
|
||||||
char *quotearg_n_style PARAMS ((int n, enum quoting_style s, char const *arg));
|
char *quotearg_n_style PARAMS ((unsigned int n, enum quoting_style s,
|
||||||
|
char const *arg));
|
||||||
|
|
||||||
/* Equivalent to quotearg_n_style (0, S, ARG). */
|
/* Equivalent to quotearg_n_style (0, S, ARG). */
|
||||||
char *quotearg_style PARAMS ((enum quoting_style s, char const *arg));
|
char *quotearg_style PARAMS ((enum quoting_style s, char const *arg));
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
/* Copyright (C) 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public License
|
|
||||||
as published by the Free Software Foundation; either version 2 of
|
|
||||||
the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but
|
|
||||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this program; see the file COPYING.LIB. If not,
|
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place -
|
|
||||||
Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_STRING_H
|
|
||||||
# include <string.h>
|
|
||||||
#else
|
|
||||||
# include <strings.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *
|
|
||||||
strchr (const char *s, int c)
|
|
||||||
{
|
|
||||||
return index (s, c);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
/* Copyright (C) 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
This program is free software; you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published by the
|
under the terms of the GNU General Public License as published by the
|
||||||
@@ -14,19 +17,19 @@
|
|||||||
along with this program; if not, write to the Free Software Foundation,
|
along with this program; if not, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include "config.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#if STDC_HEADERS || HAVE_STRING_H
|
|
||||||
# include <string.h>
|
|
||||||
#else
|
|
||||||
# include <strings.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "xalloc.h"
|
#if defined _LIBC || defined STDC_HEADERS
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <string.h>
|
||||||
|
#else
|
||||||
|
char *malloc ();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_DECL_STRNLEN
|
#ifndef HAVE_DECL_STRNLEN
|
||||||
"this configure-time declaration test was not run"
|
"this configure-time declaration test was not run"
|
||||||
@@ -35,13 +38,18 @@
|
|||||||
size_t strnlen ();
|
size_t strnlen ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *xstrndup (const char *s, size_t n);
|
#undef __strndup
|
||||||
|
#undef strndup
|
||||||
|
|
||||||
|
#ifndef weak_alias
|
||||||
|
# define __strndup strndup
|
||||||
|
#endif
|
||||||
|
|
||||||
char *
|
char *
|
||||||
xstrndup (const char *s, size_t n)
|
__strndup (const char *s, size_t n)
|
||||||
{
|
{
|
||||||
size_t len = strnlen (s, n);
|
size_t len = strnlen (s, n);
|
||||||
char *new = xmalloc (len + 1);
|
char *new = malloc (len + 1);
|
||||||
|
|
||||||
if (new == NULL)
|
if (new == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -49,3 +57,6 @@ xstrndup (const char *s, size_t n)
|
|||||||
new[len] = '\0';
|
new[len] = '\0';
|
||||||
return (char *) memcpy (new, s, len);
|
return (char *) memcpy (new, s, len);
|
||||||
}
|
}
|
||||||
|
#ifdef weak_alias
|
||||||
|
weak_alias (__strndup, strndup)
|
||||||
|
#endif
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/* Find the length of STRING, but scan at most MAXLEN characters.
|
/* Find the length of STRING, but scan at most MAXLEN characters.
|
||||||
Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@@ -51,7 +51,7 @@ size_t
|
|||||||
__strnlen (const char *string, size_t maxlen)
|
__strnlen (const char *string, size_t maxlen)
|
||||||
{
|
{
|
||||||
const char *end = memchr (string, '\0', maxlen);
|
const char *end = memchr (string, '\0', maxlen);
|
||||||
return end ? (size_t) (end - string) : maxlen;
|
return end ? end - string : maxlen;
|
||||||
}
|
}
|
||||||
#ifdef weak_alias
|
#ifdef weak_alias
|
||||||
weak_alias (__strnlen, strnlen)
|
weak_alias (__strnlen, strnlen)
|
||||||
|
|||||||
+2
-2
@@ -47,11 +47,11 @@ void free ();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_DONE_WORKING_MALLOC_CHECK
|
#ifndef HAVE_DONE_WORKING_MALLOC_CHECK
|
||||||
"you must run the autoconf test for a properly working malloc -- see malloc.m4"
|
you must run the autoconf test for a properly working malloc -- see malloc.m4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_DONE_WORKING_REALLOC_CHECK
|
#ifndef HAVE_DONE_WORKING_REALLOC_CHECK
|
||||||
"you must run the autoconf test for a properly working realloc --see realloc.m4"
|
you must run the autoconf test for a properly working realloc -- see realloc.m4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Exit value when the requested amount of memory is not available.
|
/* Exit value when the requested amount of memory is not available.
|
||||||
|
|||||||
+10
-2
@@ -1,5 +1,5 @@
|
|||||||
/* xstrdup.c -- copy a string with out of memory checking
|
/* xstrdup.c -- copy a string with out of memory checking
|
||||||
Copyright (C) 1990, 1996, 1998, 2001 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1996, 1998 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,6 +19,14 @@
|
|||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef PARAMS
|
||||||
|
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||||
|
# define PARAMS(Args) Args
|
||||||
|
# else
|
||||||
|
# define PARAMS(Args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if STDC_HEADERS || HAVE_STRING_H
|
#if STDC_HEADERS || HAVE_STRING_H
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
#else
|
#else
|
||||||
@@ -27,7 +35,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "xalloc.h"
|
char *xmalloc PARAMS ((size_t n));
|
||||||
|
|
||||||
/* Return a newly allocated copy of STRING. */
|
/* Return a newly allocated copy of STRING. */
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ glibc21.m4 \
|
|||||||
iconv.m4 \
|
iconv.m4 \
|
||||||
isc-posix.m4 \
|
isc-posix.m4 \
|
||||||
lcmessage.m4 \
|
lcmessage.m4 \
|
||||||
|
m4.m4 \
|
||||||
malloc.m4 \
|
malloc.m4 \
|
||||||
mbrtowc.m4 \
|
mbrtowc.m4 \
|
||||||
mbstate_t.m4 \
|
mbstate_t.m4 \
|
||||||
|
|||||||
-242
@@ -1,242 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.5c from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
|
|
||||||
srcdir = @srcdir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
|
|
||||||
bindir = @bindir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
datadir = @datadir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
libdir = @libdir@
|
|
||||||
infodir = @infodir@
|
|
||||||
mandir = @mandir@
|
|
||||||
includedir = @includedir@
|
|
||||||
oldincludedir = /usr/include
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
top_builddir = ..
|
|
||||||
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = @program_transform_name@
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_triplet = @host@
|
|
||||||
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AUTOM4TE = @AUTOM4TE@
|
|
||||||
AWK = @AWK@
|
|
||||||
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
|
||||||
CATALOGS = @CATALOGS@
|
|
||||||
CATOBJEXT = @CATOBJEXT@
|
|
||||||
CC = @CC@
|
|
||||||
CPP = @CPP@
|
|
||||||
DATADIRNAME = @DATADIRNAME@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
GCC = @GCC@
|
|
||||||
GENCAT = @GENCAT@
|
|
||||||
GLIBC21 = @GLIBC21@
|
|
||||||
GMOFILES = @GMOFILES@
|
|
||||||
GMSGFMT = @GMSGFMT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
INSTOBJEXT = @INSTOBJEXT@
|
|
||||||
INTLBISON = @INTLBISON@
|
|
||||||
INTLLIBS = @INTLLIBS@
|
|
||||||
INTLOBJS = @INTLOBJS@
|
|
||||||
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
|
||||||
LIB = @LIB@
|
|
||||||
LIBICONV = @LIBICONV@
|
|
||||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
||||||
MSGFMT = @MSGFMT@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
POFILES = @POFILES@
|
|
||||||
POSUB = @POSUB@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
U = @U@
|
|
||||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
|
||||||
USE_NLS = @USE_NLS@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
|
||||||
WERROR_CFLAGS = @WERROR_CFLAGS@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
EXTRA_DIST = \
|
|
||||||
c-bs-a.m4 \
|
|
||||||
codeset.m4 \
|
|
||||||
dmalloc.m4 \
|
|
||||||
error.m4 \
|
|
||||||
gettext.m4 \
|
|
||||||
glibc21.m4 \
|
|
||||||
iconv.m4 \
|
|
||||||
isc-posix.m4 \
|
|
||||||
lcmessage.m4 \
|
|
||||||
malloc.m4 \
|
|
||||||
mbrtowc.m4 \
|
|
||||||
mbstate_t.m4 \
|
|
||||||
prereq.m4 \
|
|
||||||
progtest.m4 \
|
|
||||||
realloc.m4 \
|
|
||||||
strerror_r.m4 \
|
|
||||||
warning.m4
|
|
||||||
|
|
||||||
subdir = m4
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
DIST_COMMON = Makefile.am Makefile.in
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
|
||||||
cd $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu m4/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
|
||||||
uninstall-info-am:
|
|
||||||
tags: TAGS
|
|
||||||
TAGS:
|
|
||||||
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
|
|
||||||
top_distdir = ..
|
|
||||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
@for file in $(DISTFILES); do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
|
||||||
dir="/$$dir"; \
|
|
||||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
|
||||||
else \
|
|
||||||
dir=''; \
|
|
||||||
fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
cp -pR $$d/$$file $(distdir)$$dir \
|
|
||||||
|| exit 1; \
|
|
||||||
else \
|
|
||||||
test -f $(distdir)/$$file \
|
|
||||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile
|
|
||||||
|
|
||||||
installdirs:
|
|
||||||
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
INSTALL_STRIP_FLAG=-s \
|
|
||||||
`test -z '$(STRIP)' || \
|
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
uninstall-am: uninstall-info-am
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
|
||||||
distclean-generic distdir dvi dvi-am info info-am install \
|
|
||||||
install-am install-data install-data-am install-exec \
|
|
||||||
install-exec-am install-info install-info-am install-man \
|
|
||||||
install-strip installcheck installcheck-am installdirs \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic uninstall uninstall-am uninstall-info-am
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
#serial 4
|
#serial 3
|
||||||
|
|
||||||
dnl From Paul Eggert.
|
dnl From Paul Eggert.
|
||||||
|
|
||||||
AC_DEFUN([AC_C_BACKSLASH_A],
|
AC_DEFUN(AC_C_BACKSLASH_A,
|
||||||
[
|
[
|
||||||
AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
|
AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
|
||||||
[AC_TRY_COMPILE([],
|
[AC_TRY_COMPILE([],
|
||||||
|
|||||||
+4
-5
@@ -1,13 +1,12 @@
|
|||||||
#serial 4
|
#serial 1
|
||||||
|
|
||||||
dnl FIXME: put these prerequisite-only *.m4 files in a separate
|
dnl FIXME: put these prerequisite-only *.m4 files in a separate
|
||||||
dnl directory -- otherwise, they'll conflict with existing files.
|
dnl directory -- otherwise, they'll conflict with existing files.
|
||||||
|
|
||||||
dnl These are the prerequisite macros for GNU's error.c file.
|
dnl These are the prerequisite macros for GNU's error.c file.
|
||||||
AC_DEFUN([jm_PREREQ_ERROR],
|
AC_DEFUN(jm_PREREQ_ERROR,
|
||||||
[
|
[
|
||||||
AC_CHECK_FUNCS(strerror vprintf doprnt)
|
AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
|
||||||
AC_CHECK_DECLS([strerror])
|
|
||||||
AC_FUNC_STRERROR_R
|
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
|
AC_FUNC_STRERROR_R
|
||||||
])
|
])
|
||||||
|
|||||||
+5
-7
@@ -3,12 +3,10 @@
|
|||||||
#
|
#
|
||||||
# This file can be copied and used freely without restrictions. It can
|
# This file can be copied and used freely without restrictions. It can
|
||||||
# be used in projects which are not available under the GNU General Public
|
# be used in projects which are not available under the GNU General Public
|
||||||
# License or the GNU Library General Public License but which still want
|
# License but which still want to provide support for the GNU gettext
|
||||||
# to provide support for the GNU gettext functionality.
|
# functionality.
|
||||||
# Please note that the actual code of the GNU gettext library is covered
|
# Please note that the actual code of GNU gettext is covered by the GNU
|
||||||
# by the GNU Library General Public License, and the rest of the GNU
|
# General Public License and is *not* in the public domain.
|
||||||
# gettext package package is covered by the GNU General Public License.
|
|
||||||
# They are *not* in the public domain.
|
|
||||||
|
|
||||||
# serial 10
|
# serial 10
|
||||||
|
|
||||||
@@ -243,7 +241,7 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
|
|||||||
dnl Found it, now check the version.
|
dnl Found it, now check the version.
|
||||||
AC_MSG_CHECKING([version of bison])
|
AC_MSG_CHECKING([version of bison])
|
||||||
changequote(<<,>>)dnl
|
changequote(<<,>>)dnl
|
||||||
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
|
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
|
||||||
case $ac_prog_version in
|
case $ac_prog_version in
|
||||||
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
|
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
|
||||||
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
|
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
|
||||||
|
|||||||
+4
-6
@@ -3,12 +3,10 @@
|
|||||||
#
|
#
|
||||||
# This file can be copied and used freely without restrictions. It can
|
# This file can be copied and used freely without restrictions. It can
|
||||||
# be used in projects which are not available under the GNU General Public
|
# be used in projects which are not available under the GNU General Public
|
||||||
# License or the GNU Library General Public License but which still want
|
# License but which still want to provide support for the GNU gettext
|
||||||
# to provide support for the GNU gettext functionality.
|
# functionality.
|
||||||
# Please note that the actual code of the GNU gettext library is covered
|
# Please note that the actual code of GNU gettext is covered by the GNU
|
||||||
# by the GNU Library General Public License, and the rest of the GNU
|
# General Public License and is *not* in the public domain.
|
||||||
# gettext package package is covered by the GNU General Public License.
|
|
||||||
# They are *not* in the public domain.
|
|
||||||
|
|
||||||
# serial 2
|
# serial 2
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# serial 1 -*- Autoconf -*-
|
||||||
|
|
||||||
|
# BISON_AC_PROG_GNU_M4
|
||||||
|
# --------------------
|
||||||
|
# Check for GNU m4, at least 1.3 (supports frozen files).
|
||||||
|
AC_DEFUN([BISON_AC_PROG_GNU_M4],
|
||||||
|
[AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
|
||||||
|
AC_CACHE_CHECK([whether m4 supports frozen files],
|
||||||
|
[ac_cv_prog_gnu_m4],
|
||||||
|
[ac_cv_prog_gnu_m4=no
|
||||||
|
if test x"$M4" != x; then
|
||||||
|
case `$M4 --help < /dev/null 2>&1` in
|
||||||
|
*reload-state*) ac_cv_prog_gnu_m4=yes ;;
|
||||||
|
esac
|
||||||
|
fi])
|
||||||
|
])# BISON_AC_PROG_GNU_M4
|
||||||
+7
-6
@@ -1,16 +1,16 @@
|
|||||||
#serial 5
|
#serial 3
|
||||||
|
|
||||||
dnl From Jim Meyering.
|
dnl From Jim Meyering.
|
||||||
dnl Determine whether malloc accepts 0 as its argument.
|
dnl Determine whether malloc accepts 0 as its argument.
|
||||||
dnl If it doesn't, arrange to use the replacement function.
|
dnl If it doesn't, arrange to use the replacement function.
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([jm_FUNC_MALLOC],
|
AC_DEFUN(jm_FUNC_MALLOC,
|
||||||
[
|
[
|
||||||
dnl xmalloc.c requires that this symbol be defined so it doesn't
|
dnl xmalloc.c requires that this symbol be defined so it doesn't
|
||||||
dnl mistakenly use a broken malloc -- as it might if this test were omitted.
|
dnl mistakenly use a broken malloc -- as it might if this test were omitted.
|
||||||
AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
|
AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
|
||||||
[Define if the malloc check has been performed. ])
|
[Define if the malloc check has been performed. ])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
|
AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
|
||||||
[AC_TRY_RUN([
|
[AC_TRY_RUN([
|
||||||
@@ -27,8 +27,9 @@ AC_DEFUN([jm_FUNC_MALLOC],
|
|||||||
jm_cv_func_working_malloc=no)
|
jm_cv_func_working_malloc=no)
|
||||||
])
|
])
|
||||||
if test $jm_cv_func_working_malloc = no; then
|
if test $jm_cv_func_working_malloc = no; then
|
||||||
AC_LIBOBJ(malloc)
|
AC_SUBST(LIBOBJS)
|
||||||
AC_DEFINE(malloc, rpl_malloc,
|
LIBOBJS="$LIBOBJS malloc.$ac_objext"
|
||||||
|
AC_DEFINE_UNQUOTED(malloc, rpl_malloc,
|
||||||
[Define to rpl_malloc if the replacement function should be used.])
|
[Define to rpl_malloc if the replacement function should be used.])
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
# serial 9
|
# serial 8
|
||||||
|
|
||||||
# From Paul Eggert.
|
# From Paul Eggert.
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
|
# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
|
||||||
# a syntax error in wchar.h due to the use of undefined __int32_t.
|
# a syntax error in wchar.h due to the use of undefined __int32_t.
|
||||||
|
|
||||||
AC_DEFUN([AC_MBSTATE_T],
|
AC_DEFUN(AC_MBSTATE_T,
|
||||||
[
|
[
|
||||||
AC_CHECK_HEADERS(stdlib.h)
|
AC_CHECK_HEADERS(stdlib.h)
|
||||||
|
|
||||||
|
|||||||
+4
-6
@@ -3,12 +3,10 @@
|
|||||||
#
|
#
|
||||||
# This file can be copied and used freely without restrictions. It can
|
# This file can be copied and used freely without restrictions. It can
|
||||||
# be used in projects which are not available under the GNU General Public
|
# be used in projects which are not available under the GNU General Public
|
||||||
# License or the GNU Library General Public License but which still want
|
# License but which still want to provide support for the GNU gettext
|
||||||
# to provide support for the GNU gettext functionality.
|
# functionality.
|
||||||
# Please note that the actual code of the GNU gettext library is covered
|
# Please note that the actual code of GNU gettext is covered by the GNU
|
||||||
# by the GNU Library General Public License, and the rest of the GNU
|
# General Public License and is *not* in the public domain.
|
||||||
# gettext package package is covered by the GNU General Public License.
|
|
||||||
# They are *not* in the public domain.
|
|
||||||
|
|
||||||
# serial 2
|
# serial 2
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -1,16 +1,16 @@
|
|||||||
#serial 5
|
#serial 3
|
||||||
|
|
||||||
dnl From Jim Meyering.
|
dnl From Jim Meyering.
|
||||||
dnl Determine whether realloc works when both arguments are 0.
|
dnl Determine whether realloc works when both arguments are 0.
|
||||||
dnl If it doesn't, arrange to use the replacement function.
|
dnl If it doesn't, arrange to use the replacement function.
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AC_DEFUN([jm_FUNC_REALLOC],
|
AC_DEFUN(jm_FUNC_REALLOC,
|
||||||
[
|
[
|
||||||
dnl xmalloc.c requires that this symbol be defined so it doesn't
|
dnl xmalloc.c requires that this symbol be defined so it doesn't
|
||||||
dnl mistakenly use a broken realloc -- as it might if this test were omitted.
|
dnl mistakenly use a broken realloc -- as it might if this test were omitted.
|
||||||
AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
|
AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
|
||||||
[Define if the realloc check has been performed. ])
|
[Define if the realloc check has been performed. ])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
|
AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
|
||||||
[AC_TRY_RUN([
|
[AC_TRY_RUN([
|
||||||
@@ -27,8 +27,9 @@ AC_DEFUN([jm_FUNC_REALLOC],
|
|||||||
jm_cv_func_working_realloc=no)
|
jm_cv_func_working_realloc=no)
|
||||||
])
|
])
|
||||||
if test $jm_cv_func_working_realloc = no; then
|
if test $jm_cv_func_working_realloc = no; then
|
||||||
AC_LIBOBJ(realloc)
|
AC_SUBST(LIBOBJS)
|
||||||
AC_DEFINE(realloc, rpl_realloc,
|
LIBOBJS="$LIBOBJS realloc.$ac_objext"
|
||||||
|
AC_DEFINE_UNQUOTED(realloc, rpl_realloc,
|
||||||
[Define to rpl_realloc if the replacement function should be used.])
|
[Define to rpl_realloc if the replacement function should be used.])
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|||||||
+45
-38
@@ -1,23 +1,9 @@
|
|||||||
#serial 1003
|
#serial 1002
|
||||||
# Experimental replacement for the function in the latest CVS autoconf.
|
# Experimental replacement for the function in the latest CVS autoconf.
|
||||||
|
# If the compile-test says strerror_r doesn't work, then resort to a
|
||||||
|
# `run'-test that works on BeOS and segfaults on DEC Unix.
|
||||||
# Use with the error.c file in ../lib.
|
# Use with the error.c file in ../lib.
|
||||||
|
|
||||||
# Copyright 2001 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
undefine([AC_FUNC_STRERROR_R])
|
undefine([AC_FUNC_STRERROR_R])
|
||||||
|
|
||||||
# AC_FUNC_STRERROR_R
|
# AC_FUNC_STRERROR_R
|
||||||
@@ -25,35 +11,56 @@ undefine([AC_FUNC_STRERROR_R])
|
|||||||
AC_DEFUN([AC_FUNC_STRERROR_R],
|
AC_DEFUN([AC_FUNC_STRERROR_R],
|
||||||
[AC_CHECK_DECLS([strerror_r])
|
[AC_CHECK_DECLS([strerror_r])
|
||||||
AC_CHECK_FUNCS([strerror_r])
|
AC_CHECK_FUNCS([strerror_r])
|
||||||
AC_CACHE_CHECK([whether strerror_r returns char *],
|
if test $ac_cv_func_strerror_r = yes; then
|
||||||
ac_cv_func_strerror_r_char_p,
|
AC_CHECK_HEADERS(string.h)
|
||||||
|
AC_CACHE_CHECK([for working strerror_r],
|
||||||
|
ac_cv_func_strerror_r_works,
|
||||||
[
|
[
|
||||||
ac_cv_func_strerror_r_char_p=no
|
AC_TRY_COMPILE(
|
||||||
if test $ac_cv_have_decl_strerror_r = yes; then
|
[
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
|
# include <stdio.h>
|
||||||
[[
|
# if HAVE_STRING_H
|
||||||
char buf[100];
|
# include <string.h>
|
||||||
char x = *strerror_r (0, buf, sizeof buf);
|
# endif
|
||||||
char *p = strerror_r (0, buf, sizeof buf);
|
],
|
||||||
]])],
|
[
|
||||||
ac_cv_func_strerror_r_char_p=yes)
|
char buf[100];
|
||||||
else
|
char x = *strerror_r (0, buf, sizeof buf);
|
||||||
# strerror_r is not declared. Choose between
|
],
|
||||||
|
ac_cv_func_strerror_r_works=yes,
|
||||||
|
ac_cv_func_strerror_r_works=no
|
||||||
|
)
|
||||||
|
if test $ac_cv_func_strerror_r_works = no; then
|
||||||
|
# strerror_r seems not to work, but now we have to choose between
|
||||||
# systems that have relatively inaccessible declarations for the
|
# systems that have relatively inaccessible declarations for the
|
||||||
# function. BeOS and DEC UNIX 4.0 fall in this category, but the
|
# function. BeOS and DEC UNIX 4.0 fall in this category, but the
|
||||||
# former has a strerror_r that returns char*, while the latter
|
# former has a strerror_r that returns char*, while the latter
|
||||||
# has a strerror_r that returns `int'.
|
# has a strerror_r that returns `int'.
|
||||||
# This test should segfault on the DEC system.
|
# This test should segfault on the DEC system.
|
||||||
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
|
AC_TRY_RUN(
|
||||||
extern char *strerror_r ();],
|
[
|
||||||
[[char buf[100];
|
# include <stdio.h>
|
||||||
|
# include <string.h>
|
||||||
|
# include <ctype.h>
|
||||||
|
|
||||||
|
extern char *strerror_r ();
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
char buf[100];
|
||||||
char x = *strerror_r (0, buf, sizeof buf);
|
char x = *strerror_r (0, buf, sizeof buf);
|
||||||
exit (!isalpha (x));]])],
|
exit (!isalpha (x));
|
||||||
ac_cv_func_strerror_r_char_p=yes, , :)
|
}
|
||||||
|
],
|
||||||
|
ac_cv_func_strerror_r_works=yes,
|
||||||
|
ac_cv_func_strerror_r_works=no,
|
||||||
|
ac_cv_func_strerror_r_works=no)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
if test $ac_cv_func_strerror_r_char_p = yes; then
|
if test $ac_cv_func_strerror_r_works = yes; then
|
||||||
AC_DEFINE([STRERROR_R_CHAR_P], 1,
|
AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
|
||||||
[Define to 1 if strerror_r returns char *.])
|
[Define to 1 if `strerror_r' returns a string.])
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
])# AC_FUNC_STRERROR_R
|
])# AC_FUNC_STRERROR_R
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
ChangeLog
|
ChangeLog
|
||||||
Makefile Makefile.in
|
Makefile
|
||||||
|
Makefile.in
|
||||||
POTFILES
|
POTFILES
|
||||||
bison.pot
|
bison.pot
|
||||||
stamp-cat-id
|
stamp-cat-id
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
2002-01-21 gettextize <[email protected]>
|
2001-10-04 gettextize <[email protected]>
|
||||||
|
|
||||||
* Makefile.in.in: Upgrade to gettext-0.10.40.
|
* Makefile.in.in: Upgrade to gettext-0.10.40.
|
||||||
|
* cat-id-tbl.c: Remove file.
|
||||||
|
|
||||||
2001-09-27 gettextize <[email protected]>
|
2001-09-27 gettextize <[email protected]>
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
src/LR0.c
|
src/LR0.c
|
||||||
src/complain.c
|
src/complain.c
|
||||||
src/conflicts.c
|
src/conflicts.c
|
||||||
|
src/derives.c
|
||||||
src/files.c
|
src/files.c
|
||||||
src/getargs.c
|
src/getargs.c
|
||||||
src/lalr.c
|
src/lalr.c
|
||||||
src/lex.c
|
src/lex.c
|
||||||
|
src/main.c
|
||||||
|
src/nullable.c
|
||||||
src/output.c
|
src/output.c
|
||||||
src/print.c
|
src/print.c
|
||||||
src/print_graph.c
|
src/print_graph.c
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user