Removed bison and flex as both are now part of the development package.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24786 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Bruno G. Albuquerque 2008-04-04 00:15:41 +00:00
parent 702421fa41
commit f040ef9a84
266 changed files with 0 additions and 161727 deletions

View File

@ -159,7 +159,6 @@ SubInclude HAIKU_TOP src bin addattr ;
SubInclude HAIKU_TOP src bin bash ;
SubInclude HAIKU_TOP src bin bc ;
SubInclude HAIKU_TOP src bin bemail_utils ;
SubInclude HAIKU_TOP src bin bison ;
SubInclude HAIKU_TOP src bin chkbfs ;
SubInclude HAIKU_TOP src bin compress ;
SubInclude HAIKU_TOP src bin coreutils ;
@ -167,7 +166,6 @@ SubInclude HAIKU_TOP src bin ctags ;
SubInclude HAIKU_TOP src bin desklink ;
SubInclude HAIKU_TOP src bin diffutils ;
SubInclude HAIKU_TOP src bin findutils ;
SubInclude HAIKU_TOP src bin flex ;
SubInclude HAIKU_TOP src bin fwcontrol ;
SubInclude HAIKU_TOP src bin gawk ;
SubInclude HAIKU_TOP src bin gdb ;

View File

@ -1,625 +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.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
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 `sv-request@li.org', 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 `translation@iro.umontreal.ca' 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 May 2003.
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 am az be bg ca cs da de el en en_GB eo es
+-------------------------------------------+
a2ps | [] [] [] [] |
aegis | () |
anubis | |
ap-utils | |
bash | [] [] [] |
batchelor | |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] |
bluez-pin | [] [] |
clisp | |
clisp | [] [] [] |
coreutils | [] [] [] [] |
cpio | [] [] [] |
darkstat | () [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] [] |
fetchmail | [] () [] [] [] [] |
fileutils | [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] |
gas | [] |
gawk | [] [] [] [] |
gcal | [] |
gcc | [] [] |
gettext | [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] [] [] [] |
gliv | |
glunarclock | [] [] [] |
gnucash | () [] |
gnucash-glossary | [] () [] |
gnupg | [] () [] [] [] [] |
gpe-calendar | [] |
gpe-conf | [] |
gpe-contacts | [] |
gpe-edit | |
gpe-login | [] |
gpe-ownerinfo | [] |
gpe-sketchbook | [] |
gpe-timesheet | |
gpe-today | [] |
gpe-todo | [] |
gphoto2 | [] [] [] [] |
gprof | [] [] |
gpsdrive | () () () |
grep | [] [] [] [] [] |
gretl | [] |
hello | [] [] [] [] [] [] |
id-utils | [] [] |
indent | [] [] [] [] |
jpilot | [] [] [] [] |
jwhois | [] |
kbd | [] [] [] [] [] |
ld | [] [] |
libc | [] [] [] [] [] [] |
libgpewidget | [] |
libiconv | [] [] [] [] [] |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lingoteach_lessons | () () |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] |
man-db | [] () [] [] () |
mysecretdiary | [] [] [] |
nano | [] () [] [] [] |
nano_1_0 | [] () [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] [] |
ptx | [] [] [] [] [] |
python | |
radius | |
recode | [] [] [] [] [] [] |
screem | |
sed | [] [] [] [] [] |
sh-utils | [] [] [] |
sharutils | [] [] [] [] [] [] |
sketch | [] () [] |
soundtracker | [] [] [] |
sp | [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] [] |
tin | () () |
util-linux | [] [] [] [] [] |
vorbis-tools | [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | [] [] [] [] [] [] [] |
xchat | [] [] [] |
xpad | |
+-------------------------------------------+
am az be bg ca cs da de el en en_GB eo es
0 1 4 2 31 17 54 60 14 1 4 12 56
et fa fi fr ga gl he hr hu id it ja ko
+----------------------------------------+
a2ps | [] [] [] () () |
aegis | |
anubis | [] |
ap-utils | [] |
bash | [] [] |
batchelor | [] |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] [] |
bluez-pin | [] [] [] [] |
clisp | |
clisp | [] |
coreutils | [] [] [] [] |
cpio | [] [] [] [] |
darkstat | () [] [] [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | |
enscript | [] [] |
error | [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] [] [] [] [] [] [] [] |
flex | [] [] |
gas | [] |
gawk | [] [] |
gcal | [] |
gcc | [] |
gettext | [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] |
gimp-print | [] [] |
gliv | () |
glunarclock | [] [] [] [] |
gnucash | [] |
gnucash-glossary | [] |
gnupg | [] [] [] [] [] [] [] |
gpe-calendar | [] |
gpe-conf | |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-login | [] |
gpe-ownerinfo | [] [] [] |
gpe-sketchbook | [] |
gpe-timesheet | [] [] [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] |
gprof | [] [] |
gpsdrive | () [] () () |
grep | [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
indent | [] [] [] [] [] [] [] [] |
jpilot | [] () |
jwhois | [] [] [] [] |
kbd | [] |
ld | [] |
libc | [] [] [] [] [] [] |
libgpewidget | [] [] [] |
libiconv | [] [] [] [] [] [] [] [] |
lifelines | () |
lilypond | [] |
lingoteach | [] [] |
lingoteach_lessons | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | |
make | [] [] [] [] [] [] |
man-db | [] () () |
mysecretdiary | [] [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | |
recode | [] [] [] [] [] [] |
screem | |
sed | [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] |
sharutils | [] [] [] [] [] |
sketch | [] |
soundtracker | [] [] [] |
sp | [] () |
tar | [] [] [] [] [] [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
util-linux | [] [] [] [] () [] |
vorbis-tools | [] |
wastesedge | () |
wdiff | [] [] [] [] [] |
wget | [] [] [] [] [] [] [] [] |
xchat | [] [] [] |
xpad | |
+----------------------------------------+
et fa fi fr ga gl he hr hu id it ja ko
20 1 15 73 14 24 8 10 30 31 19 31 9
lg lt lv ms nb nl nn no pl pt pt_BR ro
+----------------------------------------+
a2ps | [] [] () () () [] [] |
aegis | () |
anubis | [] [] |
ap-utils | () |
bash | [] |
batchelor | |
bfd | |
binutils | |
bison | [] [] [] [] |
bluez-pin | [] |
clisp | |
clisp | [] |
coreutils | [] |
cpio | [] [] [] |
darkstat | [] [] [] [] |
diffutils | [] [] [] |
e2fsprogs | |
enscript | [] [] |
error | [] [] |
fetchmail | () () |
fileutils | [] |
findutils | [] [] [] [] |
flex | [] |
gas | |
gawk | [] |
gcal | |
gcc | |
gettext | [] |
gettext-runtime | [] |
gettext-tools | |
gimp-print | [] |
gliv | [] |
glunarclock | [] |
gnucash | |
gnucash-glossary | [] [] |
gnupg | |
gpe-calendar | [] [] |
gpe-conf | [] [] |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-timesheet | [] [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | |
gprof | [] |
gpsdrive | () () () |
grep | [] [] [] [] |
gretl | |
hello | [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
indent | [] [] [] |
jpilot | () () |
jwhois | [] [] [] |
kbd | |
ld | |
libc | [] [] [] [] |
libgpewidget | [] [] |
libiconv | [] [] |
lifelines | |
lilypond | [] |
lingoteach | |
lingoteach_lessons | |
lynx | [] [] |
m4 | [] [] [] [] |
mailutils | |
make | [] [] |
man-db | [] |
mysecretdiary | [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | |
recode | [] [] [] |
screem | |
sed | [] [] |
sh-utils | [] |
sharutils | [] |
sketch | [] |
soundtracker | |
sp | |
tar | [] [] [] [] [] [] |
texinfo | [] |
textutils | [] |
tin | |
util-linux | [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] |
wget | [] [] [] |
xchat | [] [] |
xpad | [] |
+----------------------------------------+
lg lt lv ms nb nl nn no pl pt pt_BR ro
0 0 2 11 7 26 3 4 18 15 34 34
ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
+-------------------------------------------+
a2ps | [] [] [] [] [] | 16
aegis | () | 0
anubis | [] [] | 5
ap-utils | () | 1
bash | [] | 7
batchelor | | 1
bfd | [] [] [] | 7
binutils | [] [] [] | 7
bison | [] [] | 13
bluez-pin | | 7
clisp | | 0
clisp | | 5
coreutils | [] [] [] [] [] | 14
cpio | [] [] [] | 13
darkstat | [] () () | 9
diffutils | [] [] [] [] | 21
e2fsprogs | [] | 3
enscript | [] [] [] | 11
error | [] [] [] | 14
fetchmail | [] | 7
fileutils | [] [] [] [] [] [] | 15
findutils | [] [] [] [] [] [] | 27
flex | [] [] [] | 10
gas | [] | 3
gawk | [] [] | 9
gcal | [] [] | 4
gcc | [] | 4
gettext | [] [] [] [] [] [] | 15
gettext-runtime | [] [] [] [] [] [] | 16
gettext-tools | [] [] | 5
gimp-print | [] [] | 10
gliv | | 1
glunarclock | [] [] [] | 11
gnucash | [] [] | 4
gnucash-glossary | [] [] [] | 8
gnupg | [] [] [] [] | 16
gpe-calendar | [] | 5
gpe-conf | | 3
gpe-contacts | [] | 4
gpe-edit | [] | 5
gpe-login | [] | 5
gpe-ownerinfo | [] | 7
gpe-sketchbook | [] | 5
gpe-timesheet | [] | 6
gpe-today | [] | 6
gpe-todo | [] | 6
gphoto2 | [] [] | 9
gprof | [] [] | 7
gpsdrive | [] [] | 3
grep | [] [] [] [] | 24
gretl | | 2
hello | [] [] [] [] [] | 33
id-utils | [] [] [] | 11
indent | [] [] [] [] | 19
jpilot | [] [] [] [] [] | 10
jwhois | () () [] [] | 10
kbd | [] [] | 8
ld | [] [] | 5
libc | [] [] [] [] | 20
libgpewidget | | 6
libiconv | [] [] [] [] [] [] | 21
lifelines | [] | 2
lilypond | [] | 4
lingoteach | | 2
lingoteach_lessons | () | 0
lynx | [] [] [] [] | 14
m4 | [] [] [] | 15
mailutils | | 2
make | [] [] [] [] | 15
man-db | [] | 6
mysecretdiary | [] [] | 8
nano | [] [] [] | 15
nano_1_0 | [] [] [] | 15
opcodes | [] [] | 9
parted | [] [] | 13
ptx | [] [] [] | 22
python | | 0
radius | | 0
recode | [] [] [] [] | 19
screem | [] | 1
sed | [] [] [] [] [] | 20
sh-utils | [] [] [] | 13
sharutils | [] [] [] [] | 16
sketch | [] | 5
soundtracker | [] | 7
sp | [] | 3
tar | [] [] [] [] [] | 24
texinfo | [] [] [] [] | 13
textutils | [] [] [] [] [] | 15
tin | | 1
util-linux | [] [] | 14
vorbis-tools | [] | 7
wastesedge | | 0
wdiff | [] [] [] [] | 17
wget | [] [] [] [] [] [] [] | 25
xchat | [] [] [] | 11
xpad | | 1
+-------------------------------------------+
50 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
97 domains 32 19 16 0 56 0 48 10 1 1 12 23 913
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 May 2003 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
the 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
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.

View File

@ -1,8 +0,0 @@
Authors of GNU Bison.
Bison was written primarily by Robert Corbett.
Richard Stallman made it Yacc-compatible.
Wilfred Hansen of Carnegie Mellon University added multicharacter
string literals and other features.

View File

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +0,0 @@
# Having a separate GNUmakefile lets me `include' the dynamically
# generated rules created via Makefile.maint as well as Makefile.maint itself.
# This makefile is used only if you run GNU Make.
# It is necessary if you want to build targets usually of interest
# only to the maintainer.
# Copyright (C) 2001, 2003 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 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Systems where /bin/sh is not the default shell need this. The $(shell)
# command below won't work with e.g. stock DOS/Windows shells.
ifeq ($(wildcard /bin/s[h]),/bin/sh)
SHELL = /bin/sh
else
# will be used only with the next shell-test line, then overwritten
# by a configured-in value
SHELL = sh
endif
have-Makefile := $(shell test -f Makefile && echo yes)
# If the user runs GNU make but has not yet run ./configure,
# give them a diagnostic.
ifeq ($(have-Makefile),yes)
# Make tar archive easier to reproduce.
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
include Makefile
include $(srcdir)/Makefile.cfg
include $(srcdir)/Makefile.maint
else
all:
@echo There seems to be no Makefile in this directory.
@echo "You must run ./configure before running \`make'."
@exit 1
endif
# Tell version 3.79 and up of GNU make to not build goals in this
# directory in parallel. This is necessary in case someone tries to
# build multiple targets on one command line.
.NOTPARALLEL:

View File

@ -1,236 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, 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
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
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
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
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
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'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
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
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
`configure' recognizes the following options to control how it 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'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -1,5 +0,0 @@
SubDir HAIKU_TOP src bin bison ;
SubInclude HAIKU_TOP src bin bison data ;
SubInclude HAIKU_TOP src bin bison lib ;
SubInclude HAIKU_TOP src bin bison src ;

View File

@ -1,37 +0,0 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
## Copyright (C) 2001, 2002, 2003, 2004, 2005 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = build-aux po runtime-po lib data src doc examples tests
# Files installed for use by Automake.
aclocaldir = @aclocaldir@
aclocal_DATA = m4/bison-i18n.m4
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
OChangeLog PACKAGING \
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
djgpp/fnchange.lst
.PHONY: maintainer-check
maintainer-check:
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@

View File

@ -1,48 +0,0 @@
# Customize Makefile.maint for Bison. -*- makefile -*-
# Copyright (C) 2003, 2005, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
build_aux_dir = $(srcdir)/build-aux
prev_version_file = $(build_aux_dir)/prev-version.txt
announce_gen = $(build_aux_dir)/announce-gen
release_archive_dir = releases
# Use alpha.gnu.org for alpha and beta releases.
# Use ftp.gnu.org for major releases.
gnu_ftp_host-alpha = alpha
gnu_ftp_host-beta = alpha
gnu_ftp_host-major = ftp
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
url_dir_list = \
ftp://$(gnu_rel_host).gnu.org/gnu/bison
# Files to update automatically.
wget_files = \
$(build_aux_dir)/config.guess \
$(build_aux_dir)/config.sub \
$(build_aux_dir)/texinfo.tex \
cvs_files = \
$(build_aux_dir)/install-sh \
$(build_aux_dir)/mdate-sh \
$(build_aux_dir)/missing \
$(build_aux_dir)/mkinstalldirs
# Tests not to run.
local-checks-to-skip = \
changelog-check

View File

@ -1,704 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.hin \
$(top_srcdir)/configure ABOUT-NLS AUTHORS COPYING ChangeLog \
INSTALL NEWS THANKS TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/bison-i18n.m4 \
$(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/cxx.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dmalloc.m4 \
$(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext_gl.m4 \
$(top_srcdir)/m4/gnulib.m4 $(top_srcdir)/m4/hard-locale.m4 \
$(top_srcdir)/m4/hash.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/inttypes_h_gl.m4 \
$(top_srcdir)/m4/lib-ld_gl.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix_gl.m4 $(top_srcdir)/m4/m4.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/onceonly.m4 \
$(top_srcdir)/m4/po_gl.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint_h_gl.m4 \
$(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stpcpy.m4 \
$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
$(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
$(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoul.m4 \
$(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/subpipe.m4 \
$(top_srcdir)/m4/timevar.m4 $(top_srcdir)/m4/uintmax_t_gl.m4 \
$(top_srcdir)/m4/ulonglong_gl.m4 \
$(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
$(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/warning.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xstrndup.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(aclocaldir)"
aclocalDATA_INSTALL = $(INSTALL_DATA)
DATA = $(aclocal_DATA)
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOM4TE = @AUTOM4TE@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BISON_CXX_WORKS = @BISON_CXX_WORKS@
BISON_CXX_WORKS_FALSE = @BISON_CXX_WORKS_FALSE@
BISON_CXX_WORKS_TRUE = @BISON_CXX_WORKS_TRUE@
BISON_LOCALEDIR = @BISON_LOCALEDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GCC = @GCC@
GETOPT_H = @GETOPT_H@
GMSGFMT = @GMSGFMT@
HAVE__BOOL = @HAVE__BOOL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
O0CFLAGS = @O0CFLAGS@
O0CXXFLAGS = @O0CXXFLAGS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
UNISTD_H = @UNISTD_H@
USE_NLS = @USE_NLS@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
WARNING_CXXFLAGS = @WARNING_CXXFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
YACC_LIBRARY = @YACC_LIBRARY@
YACC_SCRIPT = @YACC_SCRIPT@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
# Files installed for use by Automake.
aclocaldir = @aclocaldir@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = build-aux po runtime-po lib data src doc examples tests
aclocal_DATA = m4/bison-i18n.m4
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
OChangeLog PACKAGING \
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
djgpp/fnchange.lst
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
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: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
uninstall-info-am:
install-aclocalDATA: $(aclocal_DATA)
@$(NORMAL_INSTALL)
test -z "$(aclocaldir)" || $(mkdir_p) "$(DESTDIR)$(aclocaldir)"
@list='$(aclocal_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(aclocalDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(aclocaldir)/$$f'"; \
$(aclocalDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(aclocaldir)/$$f"; \
done
uninstall-aclocalDATA:
@$(NORMAL_UNINSTALL)
@list='$(aclocal_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(aclocaldir)/$$f'"; \
rm -f "$(DESTDIR)$(aclocaldir)/$$f"; \
done
# 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):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
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) \
|| eval $$failcom; \
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:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
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) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
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
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$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; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
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 "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_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 tags
distdir: $(DISTFILES)
@case `sed 15q $(srcdir)/NEWS` in \
*"$(VERSION)"*) : ;; \
*) \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1;; \
esac
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/djgpp $(distdir)/m4 $(distdir)/po $(distdir)/runtime-po $(distdir)/tests
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
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"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(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
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | 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
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
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 | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(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 \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
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 in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(aclocaldir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
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 $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am: install-aclocalDATA
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-aclocalDATA uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-recursive ctags \
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
dist-tarZ dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-recursive distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-aclocalDATA 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 installdirs-am \
maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-aclocalDATA uninstall-am uninstall-info-am
.PHONY: maintainer-check
maintainer-check:
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
# 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:

View File

@ -1,639 +0,0 @@
# -*-Makefile-*-
# This Makefile fragment is shared between the coreutils,
# CPPI, Bison, and Autoconf.
## Copyright (C) 2001-2006 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., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
# This is reported not to work with make-3.79.1
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ME := Makefile.maint
# Do not save the original name or timestamp in the .tar.gz file.
# Use --rsyncable if available.
gzip_rsyncable = \
(gzip --help|grep rsyncable) >/dev/null 2>&1 && echo --rsyncable
GZIP_ENV = "--no-name --best `$(gzip_rsyncable)`"
CVS = cvs
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
CVS_LIST = sh -c ' \
if test -x $(srcdir)/build-aux/cvsu; then \
$(srcdir)/build-aux/cvsu --find --types=AFGM $$*; \
else \
awk -F/ '\''{ \
if (!$$1 && $$3 !~ /^-/) { \
f=FILENAME; \
sub(/CVS\/Entries/, "", f); \
print f $$2; \
}}'\'' \
$$(find $${*-*} -name Entries -print) /dev/null; \
fi \
' dummy
CVS_LIST_EXCEPT = \
$(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
ifeq ($(origin prev_version_file), undefined)
prev_version_file = .prev-version
endif
PREV_VERSION := $(shell cat $(prev_version_file))
VERSION_REGEXP = $(subst .,\.,$(VERSION))
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
tag-this-version = $(subst .,_,$(VERSION))
this-cvs-tag = $(tag-package)-$(tag-this-version)
my_distdir = $(PACKAGE)-$(VERSION)
# Old releases are stored here.
# Used for diffs and xdeltas.
release_archive_dir ?= ../release
# Prevent programs like 'sort' from considering distinct strings to be equal.
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
export LC_ALL = C
## --------------- ##
## Sanity checks. ##
## --------------- ##
# FIXME: add a check to prohibit definition in src/*.c of symbols defined
# in system.h. E.g. today I removed from tail.c a useless definition of
# ENOSYS. It was useless because system.h ensures it's defined.
# Checks that don't require cvs.
# Run `changelog-check' last, as previous test may reveal problems requiring
# new ChangeLog entries.
local-checks-available = \
po-check copyright-check writable-files m4-check author_mark_check \
changelog-check strftime-check $(syntax-check-rules) \
makefile_path_separator_check \
makefile-check
.PHONY: $(local-checks-available)
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
.PHONY: $(syntax-check-rules)
syntax-check-rules = \
sc_cast_of_argument_to_free \
sc_cast_of_x_alloc_return_value \
sc_cast_of_alloca_return_value \
sc_changelog \
sc_dd_max_sym_length \
sc_error_exit_success \
sc_file_system \
sc_no_if_have_config_h \
sc_obsolete_symbols \
sc_prohibit_atoi_atof \
sc_prohibit_jm_in_m4 \
sc_prohibit_assert_without_use \
sc_require_config_h \
sc_root_tests \
sc_space_tab \
sc_sun_os_names \
sc_system_h_headers \
sc_tight_scope \
sc_trailing_blank \
sc_two_space_separator_in_usage \
sc_unmarked_diagnostics \
sc_useless_cpp_parens
syntax-check: $(syntax-check-rules)
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
# $$(find -type f -name '*.[chly]') && \
# { echo '$(ME): found conditional include' 1>&2; \
# exit 1; } || :
# grep -nE '^# *include <(string|stdlib)\.h>' \
# $(srcdir)/{lib,src}/*.[chy] && \
# { echo '$(ME): FIXME' 1>&2; \
# exit 1; } || :
# FIXME: don't allow `#include .strings\.h' anywhere
sc_cast_of_argument_to_free:
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
exit 1; } || :
sc_cast_of_x_alloc_return_value:
@grep -nE --exclude=$(srcdir)/lib/regex.c \
'\*\) *x(m|c|re)alloc\>' \
$(srcdir)/{lib,src}/*.[chy] && \
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
exit 1; } || :
sc_cast_of_alloca_return_value:
@grep -nE '\*\) *alloca\>' \
$(srcdir)/src/*.[chy] && \
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
exit 1; } || :
sc_space_tab:
@grep -n '[ ] ' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
1>&2; exit 1; } || :
# Don't use the old ato* functions in `real' code.
# They provide no error checking mechanism.
# Instead, use strto* functions.
sc_prohibit_atoi_atof:
@grep -nE '\<ato([filq]|ll)\>' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
1>&2; exit 1; } || :
# Using EXIT_SUCCESS as the first argument to error is misleading,
# since when that parameter is 0, error does not exit. Use `0' instead.
sc_error_exit_success:
@grep -nF 'error (EXIT_SUCCESS,' \
$$(find -type f -name '*.[chly]') && \
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
exit 1; } || :
sc_file_system:
@grep -ni 'file''system' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found use of "file''system";' \
'rewrite to use "file system"' 1>&2; \
exit 1; } || :
sc_no_if_have_config_h:
@grep -n '^# *if HAVE_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \
1>&2; exit 1; } || :
# Nearly all .c files must include <config.h>.
sc_require_config_h:
@grep -L '^# *include <config\.h>' \
$$($(CVS_LIST_EXCEPT) | grep '\.c$$') \
| grep . && \
{ echo '$(ME): the above files do not include <config.h>' \
1>&2; exit 1; } || :
# Prohibit the inclusion of assert.h without an actual use of assert.
sc_prohibit_assert_without_use:
@files=$$(grep -l '# *include <assert\.h>' \
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
grep -L '\<assert (' $$files \
| grep . && \
{ echo "$(ME): the above files include <assert.h> but don't use it" \
1>&2; exit 1; } || :
sc_obsolete_symbols:
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
1>&2; exit 1; } || :
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
# Each nonempty line must start with a year number, or a TAB.
sc_changelog:
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
exit 1; } || :
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
# with the strings from the two affected variables.
dd_c = $(srcdir)/src/dd.c
sc_dd_max_sym_length:
ifneq ($(wildcard $(dd_c)),)
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
| wc --max-line-length); \
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|tr -d '"' | wc --max-line-length); \
if test "$$len" = "$$max"; then :; else \
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
exit 1; \
fi
endif
# Many m4 macros names once began with `jm_'.
# On 2004-04-13, they were all changed to start with gl_ instead.
# Make sure that none are inadvertently reintroduced.
sc_prohibit_jm_in_m4:
@grep -nE 'jm_[A-Z]' \
$$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
{ echo '$(ME): do not use jm_ in m4 macro names' \
1>&2; exit 1; } || :
sc_root_tests:
@t1=sc-root.expected; t2=sc-root.actual; \
grep -nl '^PRIV_CHECK_ARG=require-root' \
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
$(srcdir)/tests/Makefile.am |sort > $$t2; \
diff -u $$t1 $$t2 || diff=1; \
rm -f $$t1 $$t2; \
test "$$diff" \
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
exit 1; } || :
# Create a list of regular expressions matching the names
# of files included from system.h. Exclude a couple.
.re-list:
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
| grep -Ev 'sys/(param|file)\.h' \
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
> $@-t
@mv $@-t $@
# Files in src/ should not include directly any of
# the headers already included via system.h.
sc_system_h_headers: .re-list
@if test -f $(srcdir)/src/system.h; then \
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
grep -nE -f .re-list \
$$($(CVS_LIST) src | \
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
&& { echo '$(ME): the above are already included via system.h'\
1>&2; exit 1; } || :; \
fi
sc_sun_os_names:
@grep -nEi \
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
exit 1; } || :
sc_tight_scope:
$(MAKE) -C src $@
sc_trailing_blank:
@grep -n '[ ]$$' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found trailing blank(s)' \
1>&2; exit 1; } || :
sc_two_space_separator_in_usage:
@grep -n '^ *--[a-z][0-9A-Za-z-]* [^ ].*\\$$' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo "$(ME): help2man requires at least two spaces between"; \
echo "$(ME): an option and its description"; \
1>&2; exit 1; } || :
# Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line.
sc_unmarked_diagnostics:
@grep -nE \
'\<error \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \
| grep -v '_''(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
# Avoid useless parentheses like those in this example:
# #if defined (SYMBOL) || defined (SYM2)
sc_useless_cpp_parens:
@grep -n '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found useless parentheses in cpp directive' \
1>&2; exit 1; } || :
# Ensure that date's --help output stays in sync with the info
# documentation for GNU strftime. The only exception is %N,
# which date accepts but GNU strftime does not.
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
strftime-check:
if test -f $(srcdir)/src/date.c; then \
grep '^ %. ' $(srcdir)/src/date.c | sort \
| $(extract_char) > $@-src; \
{ echo N; \
info libc date calendar format | grep '^ `%.'\' \
| $(extract_char); } | sort > $@-info; \
diff -u $@-src $@-info || exit 1; \
rm -f $@-src $@-info; \
fi
# Ensure that we use only the standard $(VAR) notation,
# not @...@ in Makefile.am, now that we can rely on automake
# to emit a definition for each substituted variable.
makefile-check:
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
news-date-check: NEWS
today=`date +%Y-%m-%d`; \
if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
>/dev/null; then \
:; \
else \
echo "version or today's date is not in NEWS" 1>&2; \
exit 1; \
fi
changelog-check:
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
>/dev/null; then \
:; \
else \
echo "$(VERSION) not in ChangeLog" 1>&2; \
exit 1; \
fi
m4-check:
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
exit 1; } || :
# Verify that all source files using _() are listed in po/POTFILES.in.
# FIXME: don't hard-code file names below; use a more general mechanism.
po-check:
if test -f po/POTFILES.in; then \
grep -E -v '^(#|$$)' po/POTFILES.in \
| grep -v '^src/false\.c$$' | sort > $@-1; \
files=; \
for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \
case $$file in \
djgpp/* | man/*) continue;; \
esac; \
case $$file in \
*.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \
{ test -f $$base.l || test -f $$base.y; } && continue;; \
esac; \
files="$$files $$file"; \
done; \
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort -u > $@-2; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
fi
# In a definition of #define AUTHORS "... and ..." where the RHS contains
# the English word `and', the string must be marked with `N_ (...)' so that
# gettext recognizes it as a string requiring translation.
author_mark_check:
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
exit 1; } || :
# Sometimes it is useful to change the PATH environment variable
# in Makefiles. When doing so, it's better not to use the Unix-centric
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
# and there probably aren't many projects with so many Makefile.am files
# that we'd have to worry about limits on command line length.
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
makefile_path_separator_check:
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
&& { echo $(msg) 1>&2; exit 1; } || :
# Check that `make alpha' will not fail at the end of the process.
writable-files:
if test -d $(release_archive_dir); then :; else \
mkdir $(release_archive_dir); \
fi
for file in $(distdir).tar.gz $(xd-delta) \
$(release_archive_dir)/$(distdir).tar.gz \
$(release_archive_dir)/$(xd-delta); do \
test -e $$file || continue; \
test -w $$file \
|| { echo ERROR: $$file is not writable; fail=1; }; \
done; \
test "$$fail" && exit 1 || :
v_etc_file = lib/version-etc.c
# Make sure that the copyright date in $(v_etc_file) is up to date.
copyright-check:
@if test -f $(v_etc_file); then \
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
>/dev/null \
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
exit 1; }; \
fi
# Sanity checks with the CVS repository.
cvs-tag-check:
echo $(this-cvs-tag); \
if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \
echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \
exit 1; \
else :; fi
cvs-diff-check:
if $(CVS) diff >cvs-diffs; then \
rm cvs-diffs; \
else \
echo "Some files are locally modified:" 1>&2; \
cat cvs-diffs; \
exit 1; \
fi
cvs-check: cvs-diff-check cvs-tag-check
maintainer-distcheck: changelog-check
$(MAKE) distcheck
$(MAKE) my-distcheck
# Tag before making distribution. Also, don't make a distribution if
# checks fail. Also, make sure the NEWS file is up-to-date.
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
cvs-dist: $(local-check) cvs-check maintainer-distcheck
$(CVS) update po
$(CVS) tag -c $(this-cvs-tag)
$(MAKE) dist
# Use this to make sure we don't run these programs when building
# from a virgin tgz file, below.
null_AM_MAKEFLAGS = \
ACLOCAL=false \
AUTOCONF=false \
AUTOMAKE=false \
AUTOHEADER=false \
MAKEINFO=false
# Detect format-string/arg-list mismatches that would normally be obscured
# by the use of _(). The --disable-nls effectively defines away that macro,
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
# treated as a failure. Also, check for shadowing problems with -Wshadow.
# These CFLAGS are pretty strict. If you build this target, you probably
# have to have a recent version of gcc and glibc headers.
TMPDIR ?= /tmp
t=$(TMPDIR)/$(PACKAGE)/test
my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
-rm -rf $(t)
mkdir -p $(t)
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
cd $(t)/$(distdir) \
&& ./configure --disable-nls \
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) distclean
(cd $(t) && mv $(distdir) $(distdir).old \
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
-rm -rf $(t)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
WGET = wget
WGETFLAGS = -C off
rel-check:
tarz=/tmp/rel-check-tarz-$$$$; \
md5_tmp=/tmp/rel-check-md5-$$$$; \
set -e; \
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
echo "$(md5) -" > $$md5_tmp; \
md5sum -c $$md5_tmp < $$tarz
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
rel-files = $(xd-delta) $(DIST_ARCHIVES)
announcement: NEWS ChangeLog $(rel-files)
@./announce-gen \
--release-type=$(RELEASE_TYPE) \
--package=$(PACKAGE) \
--prev=$(PREV_VERSION) \
--curr=$(VERSION) \
--release-archive-directory=$(release_archive_dir) \
--gpg-key-id=$(gpg_key_ID) \
--news=NEWS \
$(addprefix --url-dir=, $(url_dir_list)) \
## ---------------- ##
## Updating files. ##
## ---------------- ##
ftp-gnu = ftp://ftp.gnu.org/gnu
www-gnu = http://www.gnu.org
# Use mv, if you don't have/want move-if-change.
move_if_change ?= move-if-change
# --------------------- #
# Updating everything. #
# --------------------- #
.PHONY: update
local_updates ?= wget-update cvs-update po-update
update: $(local_updates)
# ------------------- #
# Updating PO files. #
# ------------------- #
po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
.PHONY: do-po-update po-update
do-po-update:
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
rm -rf $$tmppo && \
mkdir $$tmppo && \
(cd $$tmppo && \
$(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
cp $$tmppo/*.po po
cd po && $(MAKE) update-po
$(MAKE) po-check
po-update:
if test -d "po"; then \
$(MAKE) do-po-update; \
fi
# -------------------------- #
# Updating GNU build tools. #
# -------------------------- #
# The following pseudo table associates a local directory and a URL
# with each of the files that belongs to some other package and is
# regularly updated from the specified URL.
wget_files ?= \
$(srcdir)/build-aux/config.guess \
$(srcdir)/build-aux/config.sub \
$(srcdir)/build-aux/texinfo.tex \
$(srcdir)/src/ansi2knr.c
get-targets = $(patsubst %, get-%, $(wget_files))
config.guess-url_prefix = $(ftp-gnu)/build-aux/
config.sub-url_prefix = $(ftp-gnu)/build-aux/
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
standards.texi-url_prefix = $(www-gnu)/prep/
make-stds.texi-url_prefix = $(standards.texi-url_prefix)
target = $(patsubst get-%, %, $@)
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
.PHONY: $(get-targets)
$(get-targets):
$(WGET) $(WGETFLAGS) $(url) -O $(target).t \
&& $(move_if_change) $(target).t $(target)
cvs_files ?= \
$(srcdir)/build-aux/depcomp \
$(srcdir)/build-aux/install-sh \
$(srcdir)/build-aux/missing \
$(srcdir)/build-aux/mkinstalldirs \
$(srcdir)/src/ansi2knr.c
automake_repo=:pserver:anoncvs:anoncvs@sources.redhat.com:/cvs/automake
.PHONY: wget-update
wget-update: $(get-targets)
.PHONY: cvs-update
cvs-update:
fail=; \
for f in $(cvs_files); do \
test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
cvs diff $$f > /dev/null \
|| { echo "*** $$f is locally modified; skipping it" 1>&2; \
fail=yes; continue; }; \
file=$$(basename $$f); \
echo checking out $$file...; \
$(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
&& $(move_if_change) $$f.t $$f; \
done; \
test "$$fail" && exit 1
emit_upload_commands:
@echo =====================================
@echo =====================================
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
@echo " --to $(gnu_rel_host):coreutils \\"
@echo " $(rel-files)"
@echo '# send the /tmp/announcement e-mail'
@echo =====================================
@echo =====================================
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
xdelta delta -9 $^ $@ || :
.PHONY: alpha beta major
alpha beta major: news-date-check $(local-check)
$(MAKE) cvs-dist
$(MAKE) $(xd-delta)
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
ln $(rel-files) $(release_archive_dir)
chmod a-w $(rel-files)
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
echo $(VERSION) > $(prev_version_file)
$(CVS) ci -m. $(prev_version_file)

View File

@ -1,732 +0,0 @@
Bison News
----------
Changes in version 2.3, 2006-06-05:
* GLR grammars should now use `YYRECOVERING ()' instead of `YYRECOVERING',
for compatibility with LALR(1) grammars.
* It is now documented that any definition of YYSTYPE or YYLTYPE should
be to a type name that does not contain parentheses or brackets.
Changes in version 2.2, 2006-05-19:
* The distribution terms for all Bison-generated parsers now permit
using the parsers in nonfree programs. Previously, this permission
was granted only for Bison-generated LALR(1) parsers in C.
* %name-prefix changes the namespace name in C++ outputs.
* The C++ parsers export their token_type.
* Bison now allows multiple %union declarations, and concatenates
their contents together.
* New warning: unused values
Right-hand side symbols whose values are not used are reported,
if the symbols have destructors. For instance:
exp: exp "?" exp ":" exp { $1 ? $1 : $3; }
| exp "+" exp
;
will trigger a warning about $$ and $5 in the first rule, and $3 in
the second ($1 is copied to $$ by the default rule). This example
most likely contains three errors, and could be rewritten as:
exp: exp "?" exp ":" exp
{ $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); }
| exp "+" exp
{ $$ = $1 ? $1 : $3; if ($1) free ($3); }
;
However, if the original actions were really intended, memory leaks
and all, the warnings can be suppressed by letting Bison believe the
values are used, e.g.:
exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); }
| exp "+" exp { $$ = $1; (void) $3; }
;
If there are mid-rule actions, the warning is issued if no action
uses it. The following triggers no warning: $1 and $3 are used.
exp: exp { push ($1); } '+' exp { push ($3); sum (); };
The warning is intended to help catching lost values and memory leaks.
If a value is ignored, its associated memory typically is not reclaimed.
* %destructor vs. YYABORT, YYACCEPT, and YYERROR.
Destructors are now called when user code invokes YYABORT, YYACCEPT,
and YYERROR, for all objects on the stack, other than objects
corresponding to the right-hand side of the current rule.
* %expect, %expect-rr
Incorrect numbers of expected conflicts are now actual errors,
instead of warnings.
* GLR, YACC parsers.
The %parse-params are available in the destructors (and the
experimental printers) as per the documentation.
* Bison now warns if it finds a stray `$' or `@' in an action.
* %require "VERSION"
This specifies that the grammar file depends on features implemented
in Bison version VERSION or higher.
* lalr1.cc: The token and value types are now class members.
The tokens were defined as free form enums and cpp macros. YYSTYPE
was defined as a free form union. They are now class members:
tokens are enumerations of the `yy::parser::token' struct, and the
semantic values have the `yy::parser::semantic_type' type.
If you do not want or can update to this scheme, the directive
`%define "global_tokens_and_yystype" "1"' triggers the global
definition of tokens and YYSTYPE. This change is suitable both
for previous releases of Bison, and this one.
If you wish to update, then make sure older version of Bison will
fail using `%require "2.2"'.
* DJGPP support added.
Changes in version 2.1, 2005-09-16:
* The C++ lalr1.cc skeleton supports %lex-param.
* Bison-generated parsers now support the translation of diagnostics like
"syntax error" into languages other than English. The default
language is still English. For details, please see the new
Internationalization section of the Bison manual. Software
distributors should also see the new PACKAGING file. Thanks to
Bruno Haible for this new feature.
* Wording in the Bison-generated parsers has been changed slightly to
simplify translation. In particular, the message "memory exhausted"
has replaced "parser stack overflow", as the old message was not
always accurate for modern Bison-generated parsers.
* Destructors are now called when the parser aborts, for all symbols left
behind on the stack. Also, the start symbol is now destroyed after a
successful parse. In both cases, the behavior was formerly inconsistent.
* When generating verbose diagnostics, Bison-generated parsers no longer
quote the literal strings associated with tokens. For example, for
a syntax error associated with '%token NUM "number"' they might
print 'syntax error, unexpected number' instead of 'syntax error,
unexpected "number"'.
Changes in version 2.0, 2004-12-25:
* Possibly-incompatible changes
- Bison-generated parsers no longer default to using the alloca function
(when available) to extend the parser stack, due to widespread
problems in unchecked stack-overflow detection. You can "#define
YYSTACK_USE_ALLOCA 1" to require the use of alloca, but please read
the manual to determine safe values for YYMAXDEPTH in that case.
- Error token location.
During error recovery, the location of the syntax error is updated
to cover the whole sequence covered by the error token: it includes
the shifted symbols thrown away during the first part of the error
recovery, and the lookahead rejected during the second part.
- Semicolon changes:
. Stray semicolons are no longer allowed at the start of a grammar.
. Semicolons are now required after in-grammar declarations.
- Unescaped newlines are no longer allowed in character constants or
string literals. They were never portable, and GCC 3.4.0 has
dropped support for them. Better diagnostics are now generated if
forget a closing quote.
- NUL bytes are no longer allowed in Bison string literals, unfortunately.
* New features
- GLR grammars now support locations.
- New directive: %initial-action.
This directive allows the user to run arbitrary code (including
initializing @$) from yyparse before parsing starts.
- A new directive "%expect-rr N" specifies the expected number of
reduce/reduce conflicts in GLR parsers.
- %token numbers can now be hexadecimal integers, e.g., `%token FOO 0x12d'.
This is a GNU extension.
- The option `--report=lookahead' was changed to `--report=look-ahead'.
The old spelling still works, but is not documented and will be
removed.
- Experimental %destructor support has been added to lalr1.cc.
- New configure option --disable-yacc, to disable installation of the
yacc command and -ly library introduced in 1.875 for POSIX conformance.
* Bug fixes
- For now, %expect-count violations are now just warnings, not errors.
This is for compatibility with Bison 1.75 and earlier (when there are
reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
are too many or too few shift/reduce conflicts). However, in future
versions of Bison we plan to improve the %expect machinery so that
these violations will become errors again.
- Within Bison itself, numbers (e.g., goto numbers) are no longer
arbitrarily limited to 16-bit counts.
- Semicolons are now allowed before "|" in grammar rules, as POSIX requires.
Changes in version 1.875, 2003-01-01:
* The documentation license has been upgraded to version 1.2
of the GNU Free Documentation License.
* syntax error processing
- In Yacc-style parsers YYLLOC_DEFAULT is now used to compute error
locations too. This fixes bugs in error-location computation.
- %destructor
It is now possible to reclaim the memory associated to symbols
discarded during error recovery. This feature is still experimental.
- %error-verbose
This new directive is preferred over YYERROR_VERBOSE.
- #defining yyerror to steal internal variables is discouraged.
It is not guaranteed to work forever.
* POSIX conformance
- Semicolons are once again optional at the end of grammar rules.
This reverts to the behavior of Bison 1.33 and earlier, and improves
compatibility with Yacc.
- `parse error' -> `syntax error'
Bison now uniformly uses the term `syntax error'; formerly, the code
and manual sometimes used the term `parse error' instead. POSIX
requires `syntax error' in diagnostics, and it was thought better to
be consistent.
- The documentation now emphasizes that yylex and yyerror must be
declared before use. C99 requires this.
- Bison now parses C99 lexical constructs like UCNs and
backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires.
- File names are properly escaped in C output. E.g., foo\bar.y is
output as "foo\\bar.y".
- Yacc command and library now available
The Bison distribution now installs a `yacc' command, as POSIX requires.
Also, Bison now installs a small library liby.a containing
implementations of Yacc-compatible yyerror and main functions.
This library is normally not useful, but POSIX requires it.
- Type clashes now generate warnings, not errors.
- If the user does not define YYSTYPE as a macro, Bison now declares it
using typedef instead of defining it as a macro.
For consistency, YYLTYPE is also declared instead of defined.
* Other compatibility issues
- %union directives can now have a tag before the `{', e.g., the
directive `%union foo {...}' now generates the C code
`typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
The default union tag is `YYSTYPE', for compatibility with Solaris 9 Yacc.
For consistency, YYLTYPE's struct tag is now `YYLTYPE' not `yyltype'.
This is for compatibility with both Yacc and Bison 1.35.
- `;' is output before the terminating `}' of an action, for
compatibility with Bison 1.35.
- Bison now uses a Yacc-style format for conflict reports, e.g.,
`conflicts: 2 shift/reduce, 1 reduce/reduce'.
- `yystype' and `yyltype' are now obsolescent macros instead of being
typedefs or tags; they are no longer documented and are planned to be
withdrawn in a future release.
* GLR parser notes
- GLR and inline
Users of Bison have to decide how they handle the portability of the
C keyword `inline'.
- `parsing stack overflow...' -> `parser stack overflow'
GLR parsers now report `parser stack overflow' as per the Bison manual.
* Bison now warns if it detects conflicting outputs to the same file,
e.g., it generates a warning for `bison -d -o foo.h foo.y' since
that command outputs both code and header to foo.h.
* #line in output files
- --no-line works properly.
* Bison can no longer be built by a K&R C compiler; it requires C89 or
later to be built. This change originally took place a few versions
ago, but nobody noticed until we recently asked someone to try
building Bison with a K&R C compiler.
Changes in version 1.75, 2002-10-14:
* Bison should now work on 64-bit hosts.
* Indonesian translation thanks to Tedi Heriyanto.
* GLR parsers
Fix spurious parse errors.
* Pure parsers
Some people redefine yyerror to steal yyparse' private variables.
Reenable this trick until an official feature replaces it.
* Type Clashes
In agreement with POSIX and with other Yaccs, leaving a default
action is valid when $$ is untyped, and $1 typed:
untyped: ... typed;
but the converse remains an error:
typed: ... untyped;
* Values of mid-rule actions
The following code:
foo: { ... } { $$ = $1; } ...
was incorrectly rejected: $1 is defined in the second mid-rule
action, and is equal to the $$ of the first mid-rule action.
Changes in version 1.50, 2002-10-04:
* GLR parsing
The declaration
%glr-parser
causes Bison to produce a Generalized LR (GLR) parser, capable of handling
almost any context-free grammar, ambiguous or not. The new declarations
%dprec and %merge on grammar rules allow parse-time resolution of
ambiguities. Contributed by Paul Hilfinger.
Unfortunately Bison 1.50 does not work properly on 64-bit hosts
like the Alpha, so please stick to 32-bit hosts for now.
* Output Directory
When not in Yacc compatibility mode, when the output file was not
specified, running `bison foo/bar.y' created `foo/bar.c'. It
now creates `bar.c'.
* Undefined token
The undefined token was systematically mapped to 2 which prevented
the use of 2 by the user. This is no longer the case.
* Unknown token numbers
If yylex returned an out of range value, yyparse could die. This is
no longer the case.
* Error token
According to POSIX, the error token must be 256.
Bison extends this requirement by making it a preference: *if* the
user specified that one of her tokens is numbered 256, then error
will be mapped onto another number.
* Verbose error messages
They no longer report `..., expecting error or...' for states where
error recovery is possible.
* End token
Defaults to `$end' instead of `$'.
* Error recovery now conforms to documentation and to POSIX
When a Bison-generated parser encounters a syntax error, it now pops
the stack until it finds a state that allows shifting the error
token. Formerly, it popped the stack until it found a state that
allowed some non-error action other than a default reduction on the
error token. The new behavior has long been the documented behavior,
and has long been required by POSIX. For more details, please see
Paul Eggert, "Reductions during Bison error handling" (2002-05-20)
<http://lists.gnu.org/archive/html/bug-bison/2002-05/msg00038.html>.
* Traces
Popped tokens and nonterminals are now reported.
* Larger grammars
Larger grammars are now supported (larger token numbers, larger grammar
size (= sum of the LHS and RHS lengths), larger LALR tables).
Formerly, many of these numbers ran afoul of 16-bit limits;
now these limits are 32 bits on most hosts.
* Explicit initial rule
Bison used to play hacks with the initial rule, which the user does
not write. It is now explicit, and visible in the reports and
graphs as rule 0.
* Useless rules
Before, Bison reported the useless rules, but, although not used,
included them in the parsers. They are now actually removed.
* Useless rules, useless nonterminals
They are now reported, as a warning, with their locations.
* Rules never reduced
Rules that can never be reduced because of conflicts are now
reported.
* Incorrect `Token not used'
On a grammar such as
%token useless useful
%%
exp: '0' %prec useful;
where a token was used to set the precedence of the last rule,
bison reported both `useful' and `useless' as useless tokens.
* Revert the C++ namespace changes introduced in 1.31
as they caused too many portability hassles.
* Default locations
By an accident of design, the default computation of @$ was
performed after another default computation was performed: @$ = @1.
The latter is now removed: YYLLOC_DEFAULT is fully responsible of
the computation of @$.
* Token end-of-file
The token end of file may be specified by the user, in which case,
the user symbol is used in the reports, the graphs, and the verbose
error messages instead of `$end', which remains being the default.
For instance
%token MYEOF 0
or
%token MYEOF 0 "end of file"
* Semantic parser
This old option, which has been broken for ages, is removed.
* New translations
Brazilian Portuguese, thanks to Alexandre Folle de Menezes.
Croatian, thanks to Denis Lackovic.
* Incorrect token definitions
When given `%token 'a' "A"', Bison used to output `#define 'a' 65'.
* Token definitions as enums
Tokens are output both as the traditional #define's, and, provided
the compiler supports ANSI C or is a C++ compiler, as enums.
This lets debuggers display names instead of integers.
* Reports
In addition to --verbose, bison supports --report=THINGS, which
produces additional information:
- itemset
complete the core item sets with their closure
- lookahead [changed to `look-ahead' in 1.875e and later]
explicitly associate look-ahead tokens to items
- solved
describe shift/reduce conflicts solving.
Bison used to systematically output this information on top of
the report. Solved conflicts are now attached to their states.
* Type clashes
Previous versions don't complain when there is a type clash on
the default action if the rule has a mid-rule action, such as in:
%type <foo> bar
%%
bar: '0' {} '0';
This is fixed.
* GNU M4 is now required when using Bison.
Changes in version 1.35, 2002-03-25:
* C Skeleton
Some projects use Bison's C parser with C++ compilers, and define
YYSTYPE as a class. The recent adjustment of C parsers for data
alignment and 64 bit architectures made this impossible.
Because for the time being no real solution for C++ parser
generation exists, kludges were implemented in the parser to
maintain this use. In the future, when Bison has C++ parsers, this
kludge will be disabled.
This kludge also addresses some C++ problems when the stack was
extended.
Changes in version 1.34, 2002-03-12:
* File name clashes are detected
$ bison foo.y -d -o foo.x
fatal error: header and parser would both be named `foo.x'
* A missing `;' at the end of a rule triggers a warning
In accordance with POSIX, and in agreement with other
Yacc implementations, Bison will mandate this semicolon in the 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.
* yyparse now returns 2 if memory is exhausted; formerly it dumped core.
* 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 optional argument which is the
output file name. `-d' and `-g' do not change; they do not take any
argument.
* `%source_extension' and `%header_extension' are removed, failed
experiment.
* Portability fixes.
Changes in version 1.29, 2001-09-07:
* The output file does not define const, as this caused problems when used
with common autoconfiguration schemes. If you still use ancient compilers
that lack const, compile with the equivalent of the C compiler option
`-Dconst='. autoconf's AC_C_CONST macro provides one way to do this.
* Added `-g' and `--graph'.
* The Bison manual is now distributed under the terms of the GNU FDL.
* The input and the output files has automatically a similar extension.
* Russian translation added.
* NLS support updated; should hopefully be less troublesome.
* Added the old Bison reference card.
* Added `--locations' and `%locations'.
* Added `-S' and `--skeleton'.
* `%raw', `-r', `--raw' is disabled.
* Special characters are escaped when output. This solves the problems
of the #line lines with path names including backslashes.
* New directives.
`%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose',
`%debug', `%source_extension' and `%header_extension'.
* @$
Automatic location tracking.
Changes in version 1.28, 1999-07-06:
* Should compile better now with K&R compilers.
* Added NLS.
* Fixed a problem with escaping the double quote character.
* There is now a FAQ.
Changes in version 1.27:
* The make rule which prevented bison.simple from being created on
some systems has been fixed.
Changes in version 1.26:
* Bison now uses automake.
* New mailing lists: <bug-bison@gnu.org> and <help-bison@gnu.org>.
* Token numbers now start at 257 as previously documented, not 258.
* Bison honors the TMPDIR environment variable.
* A couple of buffer overruns have been fixed.
* Problems when closing files should now be reported.
* Generated parsers should now work even on operating systems which do
not provide alloca().
Changes in version 1.25, 1995-10-16:
* Errors in the input grammar are not fatal; Bison keeps reading
the grammar file, and reports all the errors found in it.
* Tokens can now be specified as multiple-character strings: for
example, you could use "<=" for a token which looks like <=, instead
of chosing a name like LESSEQ.
* The %token_table declaration says to write a table of tokens (names
and numbers) into the parser file. The yylex function can use this
table to recognize multiple-character string tokens, or for other
purposes.
* The %no_lines declaration says not to generate any #line preprocessor
directives in the parser file.
* The %raw declaration says to use internal Bison token numbers, not
Yacc-compatible token numbers, when token names are defined as macros.
* The --no-parser option produces the parser tables without including
the parser engine; a project can now use its own parser engine.
The actions go into a separate file called NAME.act, in the form of
a switch statement body.
Changes in version 1.23:
The user can define YYPARSE_PARAM as the name of an argument to be
passed into yyparse. The argument should have type void *. It should
actually point to an object. Grammar actions can access the variable
by casting it to the proper pointer type.
Line numbers in output file corrected.
Changes in version 1.22:
--help option added.
Changes in version 1.20:
Output file does not redefine const for C++.
Local Variables:
mode: outline
End:
-----
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison 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.
Bison 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 autoconf; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +0,0 @@
Packaging hints for binary package distributors
===============================================
Although the source of the bison package comes as a single package,
in distributions of binary packages the installed files should
be split into two packages:
bison-runtime
Contents: Runtime libraries and programs.
Audience: Anyone who wants to run internationalized programs
that contain Bison-generated parsers.
bison
Contents: Tools and documentation for developers that use Bison.
Audience: Anyone who wants to develop programs that use parsers.
Dependencies: requires bison-runtime.
The 'bison-runtime' binary package is much smaller than the 'bison'
binary package. It should be included in any distribution that
contains localized programs that use the diagnostics contained in
Bison-generated parsers.
If you want to install both packages at the same time, you simply do
at the toplevel directory:
./configure
make
make install
After installation, the file
$prefix/share/locale/*/LC_MESSAGES/bison-runtime.mo
belongs to the bison-runtime package; all other installed files belong
to the bison package.
-----
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison 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.
Bison 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 autoconf; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

View File

@ -1,41 +0,0 @@
This directory contains the Bison parser generator.
See the file INSTALL for generic compilation and installation instructions.
See the file doc/FAQ for frequently asked questions.
Bison requires GNU m4 1.4.3 or later. See:
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
sufficiently patched, but if you encounter a bug with an older
distribution and report a bug we will probably suggest that you
upgrade to 1.4.3 as the first step in trying to fix it.
Please send bug reports to <bug-bison@gnu.org>. Please include the
version number from `bison --version', and a complete, self-contained
test case in each bug report.
If you have questions about using Bison and the documentation does
not answer them, please send mail to <help-bison@gnu.org>.
-----
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison 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.
Bison 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 autoconf; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

View File

@ -1,90 +0,0 @@
Bison was originally written by Robert Corbett. It would not be what
it is today without the invaluable help of these people:
Airy Andre Airy.Andre@edf.fr
Akim Demaille akim@freefriends.org
Albert Chin-A-Young china@thewrittenword.com
Alexander Belopolsky alexb@rentec.com
Alexandre Duret-Lutz adl@src.lip6.fr
Andreas Schwab schwab@suse.de
Andrew Suffield asuffield@users.sourceforge.net
Anthony Heading ajrh@ajrh.net
Arnold Robbins arnold@skeeve.com
Art Haas ahaas@neosoft.com
Baron Schwartz baron@sequent.org
Benoit Perrot benoit.perrot@epita.fr
Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be
Bruce Lilly blilly@erols.com
Bruno Haible bruno@clisp.org
Charles-Henri de Boysson de-boy_c@epita.fr
Cris Bailiff c.bailiff+bison@awayweb.com
Cris van Pelt cris@amf03054.office.wxs.nl
Daniel Hagerty hag@gnu.org
David J. MacKenzie djm@gnu.org
Derek M. Jones derek@knosof.co.uk
Dick Streefland dick.streefland@altium.nl
Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de
Evgeny Stambulchik fnevgeny@plasma-gate.weizmann.ac.il
Fabrice Bauzac noon@cote-dazur.com
Florian Krohm florian@edamail.fishkill.ibm.com
Frank Heckenbach frank@g-n-u.de
Guido Trentalancia trentalg@aston.ac.uk
H. Merijn Brand h.m.brand@hccnet.nl
Hans Aberg haberg@matematik.su.se
Jan Nieuwenhuizen janneke@gnu.org
Jesse Thilo jthilo@gnu.org
Jim Kent jkent@arch.sel.sony.com
Jim Meyering jim@meyering.net
Joel E. Denny jdenny@ces.clemson.edu
Juan Manuel Guerrero ST001906@HRZ1.HRZ.TU-Darmstadt.De
Kees Zeelenberg kzlg@users.sourceforge.net
Keith Browne kbrowne@legato.com
Laurent Mascherpa laurent.mascherpa@epita.fr
Magnus Fromreide magfr@lysator.liu.se
Marc Autret autret_m@epita.fr
Martin Mokrejs mmokrejs@natur.cuni.cz
Martin Nylin martin.nylin@linuxmail.org
Matt Kraai kraai@alumni.cmu.edu
Matt Rosing rosing@peakfive.com
Michael Hayes m.hayes@elec.canterbury.ac.nz
Mickael Labau labau_m@epita.fr
Mike Castle dalgoda@ix.netcom.com
Neil Booth NeilB@earthling.net
Nelson H. F. Beebe beebe@math.utah.edu
Nicolas Burrus nicolas.burrus@epita.fr
Nicolas Tisserand nicolas.tisserand@epita.fr
Noah Friedman friedman@gnu.org
Oleg Smolsky oleg.smolsky@pacific-simulators.co.nz
Pascal Bart pascal.bart@epita.fr
Paul Eggert eggert@cs.ucla.edu
Paul Hilfinger Hilfinger@CS.Berkeley.EDU
Per Allansson per@appgate.com
Peter Fales psfales@lucent.com
Peter Hamorsky hamo@upjs.sk
Piotr Gackiewicz gacek@intertel.com.pl
Quoc Peyrot chojin@lrde.epita.fr
R Blake blakers@mac.com
Raja R Harinath harinath@cs.umn.edu
Richard Stallman rms@gnu.org
Robert Anisko anisko_r@epita.fr
Shura debil_urod@ngs.ru
Steve Murphy murf@parsetree.com
Tim Josling tej@melbpc.org.au
Tim Van Holder tim.van.holder@pandora.be
Tom Lane tgl@sss.pgh.pa.us
Tom Tromey tromey@cygnus.com
Tommy Nordgren tommy.nordgren@chello.se
Troy A. Johnson troyj@ecn.purdue.edu
Vin Shelton acs@alumni.princeton.edu
Wayne Green wayne@infosavvy.com
Wolfram Wagner ww@mpi-sb.mpg.de
Wwp subscript@free.fr
Zack Weinberg zack@codesourcery.com
twlevo@xs4all.nl
Many people are not named here because we lost track of them. We
thank them! Please, help us keeping this list up to date.
Local Variables:
mode: text
End:

View File

@ -1,328 +0,0 @@
-*- outline -*-
* Header guards
From Franc,ois: should we keep the directory part in the CPP guard?
* Yacc.c: CPP Macros
Do some people use YYPURE, YYLSP_NEEDED like we do in the test suite?
They should not: it is not documented. But if they need to, let's
find something clean (not like YYLSP_NEEDED...).
* Documentation
Before releasing, make sure the documentation ("Understanding your
parser") refers to the current `output' format.
* lalr1.cc
** vector
Move to using vector, drop stack.hh.
** I18n
Catch up with yacc.c.
* Report
** GLR
How would Paul like to display the conflicted actions? In particular,
what when two reductions are possible on a given look-ahead token, but one is
part of $default. Should we make the two reductions explicit, or just
keep $default? See the following point.
** Disabled Reductions
See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
what we want to do.
** Documentation
Extend with error productions. The hard part will probably be finding
the right rule so that a single state does not exhibit too many yet
undocumented ``features''. Maybe an empty action ought to be
presented too. Shall we try to make a single grammar with all these
features, or should we have several very small grammars?
** --report=conflict-path
Provide better assistance for understanding the conflicts by providing
a sample text exhibiting the (LALR) ambiguity. See the paper from
DeRemer and Penello: they already provide the algorithm.
* Extensions
** Labeling the symbols
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
can name the values. This is much more pleasant. For instance:
exp (res): exp (a) '+' exp (b) { $res = $a + $b; };
I love this. I have been bitten too often by the removal of the
symbol, and forgetting to shift all the $n to $n-1. If you are
unlucky, it compiles...
But instead of using $a etc., we can use regular variables. And
instead of using (), I propose to use `:' (again). Paul suggests
supporting `->' in addition to `:' to separate LHS and RHS. In other
words:
r:exp -> a:exp '+' b:exp { r = a + b; };
That requires an significant improvement of the grammar parser. Using
GLR would be nice. It also requires that Bison know the type of the
symbols (which will be useful for %include anyway). So we have some
time before...
Note that there remains the problem of locations: `@r'?
** $-1
We should find a means to provide an access to values deep in the
stack. For instance, instead of
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
we should be able to have:
foo($foo) bar($bar) baz($bar): qux($qux) { $baz = $foo + $bar + $qux; }
Or something like this.
** %if and the like
It should be possible to have %if/%else/%endif. The implementation is
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
must be in the scanner: we must not parse what is in a switched off
part of %if. Akim Demaille thinks it should be in the parser, so as
to avoid falling into another CPP mistake.
** -D, --define-muscle NAME=VALUE
To define muscles via cli. Or maybe support directly NAME=VALUE?
** XML Output
There are couple of available extensions of Bison targeting some XML
output. Some day we should consider including them. One issue is
that they seem to be quite orthogonal to the parsing technique, and
seem to depend mostly on the possibility to have some code triggered
for each reduction. As a matter of fact, such hooks could also be
used to generate the yydebug traces. Some generic scheme probably
exists in there.
XML output for GNU Bison and gcc
http://www.cs.may.ie/~jpower/Research/bisonXML/
XML output for GNU Bison
http://yaxx.sourceforge.net/
* Unit rules
Maybe we could expand unit rules, i.e., transform
exp: arith | bool;
arith: exp '+' exp;
bool: exp '&' exp;
into
exp: exp '+' exp | exp '&' exp;
when there are no actions. This can significantly speed up some
grammars. I can't find the papers. In particular the book `LR
parsing: Theory and Practice' is impossible to find, but according to
`Parsing Techniques: a Practical Guide', it includes information about
this issue. Does anybody have it?
* Documentation
** History/Bibliography
Some history of Bison and some bibliography would be most welcome.
Are there any Texinfo standards for bibliography?
* Java, Fortran, etc.
** Java
There are a couple of proposed outputs:
- BYACC/J
which is based on Byacc.
<http://troi.lincom-asg.com/~rjamison/byacc/>
- Bison Java
which is based on Bison.
<http://www.goice.co.jp/member/mo/hack-progs/bison-java.html>
Sebastien Serrurier (serrur_s@epita.fr) is working on this: he is
expected to contact the authors, design the output, and implement it
into Bison.
* Coding system independence
Paul notes:
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
255). It also assumes that the 8-bit character encoding is
the same for the invocation of 'bison' as it is for the
invocation of 'cc', but this is not necessarily true when
people run bison on an ASCII host and then use cc on an EBCDIC
host. I don't think these topics are worth our time
addressing (unless we find a gung-ho volunteer for EBCDIC or
PDP-10 ports :-) but they should probably be documented
somewhere.
More importantly, Bison does not currently allow NUL bytes in
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
the source code. This should get fixed.
* --graph
Show reductions.
* Broken options ?
** %no-parser
** %token-table
** Skeleton strategy
Must we keep %no-parser? %token-table?
* src/print_graph.c
Find the best graph parameters.
* BTYacc
See if we can integrate backtracking in Bison. Charles-Henri de
Boysson <de-boy_c@epita.fr> is working on this, and already has some
results. Vadim Maslow, the maintainer of BTYacc was contacted, and we
stay in touch with him. Adjusting the Bison grammar parser will be
needed to support some extra BTYacc features. This is less urgent.
** Keeping the conflicted actions
First, analyze the differences between byacc and btyacc (I'm referring
to the executables). Find where the conflicts are preserved.
** Compare with the GLR tables
See how isomorphic the way BTYacc and the way the GLR adjustments in
Bison are compatible. *As much as possible* one should try to use the
same implementation in the Bison executables. I insist: it should be
very feasible to use the very same conflict tables.
** Adjust the skeletons
Import the skeletons for C and C++.
** Improve the skeletons
Have them support yysymprint, yydestruct and so forth.
* Precedence
** Partial order
It is unfortunate that there is a total order for precedence. It
makes it impossible to have modular precedence information. We should
move to partial orders (sounds like series/parallel orders to me).
This will be possible with a Bison parser for the grammar, as it will
make it much easier to extend the grammar.
** Correlation b/w precedence and associativity
Also, I fail to understand why we have to assign the same
associativity to operators with the same precedence. For instance,
why can't I decide that the precedence of * and / is the same, but the
latter is nonassoc?
If there is really no profound motivation, we should find a new syntax
to allow specifying this.
** RR conflicts
See if we can use precedence between rules to solve RR conflicts. See
what POSIX says.
* $undefined
From Hans:
- If the Bison generated parser experiences an undefined number in the
character range, that character is written out in diagnostic messages, an
addition to the $undefined value.
Suggest: Change the name $undefined to undefined; looks better in outputs.
* Default Action
From Hans:
- For use with my C++ parser, I transported the "switch (yyn)" statement
that Bison writes to the bison.simple skeleton file. This way, I can remove
the current default rule $$ = $1 implementation, which causes a double
assignment to $$ which may not be OK under C++, replacing it with a
"default:" part within the switch statement.
Note that the default rule $$ = $1, when typed, is perfectly OK under C,
but in the C++ implementation I made, this rule is different from
$<type_name>$ = $<type_name>1. I therefore think that one should implement
a Bison option where every typed default rule is explicitly written out
(same typed ruled can of course be grouped together).
Note: Robert Anisko handles this. He knows how to do it.
* Warnings
It would be nice to have warning support. See how Autoconf handles
them, it is fairly well described there. It would be very nice to
implement this in such a way that other programs could use
lib/warnings.[ch].
Don't work on this without first announcing you do, as I already have
thought about it, and know many of the components that can be used to
implement it.
* Pre and post actions.
From: Florian Krohm <florian@edamail.fishkill.ibm.com>
Subject: YYACT_EPILOGUE
To: bug-bison@gnu.org
X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
The other day I had the need for explicitly building the parse tree. I
used %locations for that and defined YYLLOC_DEFAULT to call a function
that returns the tree node for the production. Easy. But I also needed
to assign the S-attribute to the tree node. That cannot be done in
YYLLOC_DEFAULT, because it is invoked before the action is executed.
The way I solved this was to define a macro YYACT_EPILOGUE that would
be invoked after the action. For reasons of symmetry I also added
YYACT_PROLOGUE. Although I had no use for that I can envision how it
might come in handy for debugging purposes.
All is needed is to add
#if YYLSP_NEEDED
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
#else
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
#endif
at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
to bison. If you're interested, I'll work on a patch.
* Move to Graphviz
Well, VCG seems really dead. Move to Graphviz instead. Also, equip
the parser with a means to create the (visual) parse tree.
-----
Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison 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.
Bison 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 Bison; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

View File

@ -1,924 +0,0 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file 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.
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.6])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# serial 4
# This was merged into AC_PROG_CC in Autoconf.
AU_DEFUN([AM_PROG_CC_STDC],
[AC_PROG_CC
AC_DIAGNOSE([obsolete], [$0:
your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
`ac_cv_prog_cc_stdc'. Remove this warning and the assignment when
you adjust the code. You can also remove the above call to
AC_PROG_CC if you already called it elsewhere.])
am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
])
AU_DEFUN([fp_PROG_CC_STDC])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file 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.
#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# serial 12
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.58])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# serial 3
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file 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.
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
#
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
# This was a mistake. There are at least two reasons why we must not
# use `-m 0755':
# - it causes special bits like SGID to be ignored,
# - it may be too restrictive (some setups expect 775 directories).
#
# Do not use -m 0755 and let people choose whatever they expect by
# setting umask.
#
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
# Some implementations (such as Solaris 8's) are not thread-safe: if a
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
# concurrently, both version can detect that a/ is missing, but only
# one can create it and the other will error out. Consequently we
# restrict ourselves to GNU make (using the --version option ensures
# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# We used to keeping the `.' as first argument, in order to
# allow $(mkdir_p) to be used without argument. As in
# $(mkdir_p) $(somedir)
# where $(somedir) is conditionally defined. However this is wrong
# for two reasons:
# 1. if the package is installed by a user who cannot write `.'
# make install will fail,
# 2. the above comment should most certainly read
# $(mkdir_p) $(DESTDIR)$(somedir)
# so it does not work when $(somedir) is undefined and
# $(DESTDIR) is not.
# To support the latter case, we have to write
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
# so the `.' trick is pointless.
mkdir_p='mkdir -p --'
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
for d in ./-p ./--version;
do
test -d $d && rmdir $d
done
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
if test -f "$ac_aux_dir/mkinstalldirs"; then
mkdir_p='$(mkinstalldirs)'
else
mkdir_p='$(install_sh) -d'
fi
fi
AC_SUBST([mkdir_p])])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file 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.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file 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.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/bison-i18n.m4])
m4_include([m4/c-working.m4])
m4_include([m4/cxx.m4])
m4_include([m4/dirname.m4])
m4_include([m4/dmalloc.m4])
m4_include([m4/dos.m4])
m4_include([m4/error.m4])
m4_include([m4/exitfail.m4])
m4_include([m4/extensions.m4])
m4_include([m4/getopt.m4])
m4_include([m4/gettext_gl.m4])
m4_include([m4/gnulib.m4])
m4_include([m4/hard-locale.m4])
m4_include([m4/hash.m4])
m4_include([m4/iconv.m4])
m4_include([m4/inttypes_h_gl.m4])
m4_include([m4/lib-ld_gl.m4])
m4_include([m4/lib-link.m4])
m4_include([m4/lib-prefix_gl.m4])
m4_include([m4/m4.m4])
m4_include([m4/mbrtowc.m4])
m4_include([m4/mbstate_t.m4])
m4_include([m4/mbswidth.m4])
m4_include([m4/nls.m4])
m4_include([m4/obstack.m4])
m4_include([m4/onceonly.m4])
m4_include([m4/po_gl.m4])
m4_include([m4/progtest.m4])
m4_include([m4/quote.m4])
m4_include([m4/quotearg.m4])
m4_include([m4/stdbool.m4])
m4_include([m4/stdint_h_gl.m4])
m4_include([m4/stdio-safer.m4])
m4_include([m4/stpcpy.m4])
m4_include([m4/strdup.m4])
m4_include([m4/strerror.m4])
m4_include([m4/strndup.m4])
m4_include([m4/strnlen.m4])
m4_include([m4/strtol.m4])
m4_include([m4/strtoul.m4])
m4_include([m4/strverscmp.m4])
m4_include([m4/subpipe.m4])
m4_include([m4/timevar.m4])
m4_include([m4/uintmax_t_gl.m4])
m4_include([m4/ulonglong_gl.m4])
m4_include([m4/unistd-safer.m4])
m4_include([m4/unistd_h.m4])
m4_include([m4/unlocked-io.m4])
m4_include([m4/warning.m4])
m4_include([m4/xalloc.m4])
m4_include([m4/xstrndup.m4])

View File

@ -1,352 +0,0 @@
/* config.h. Generated by configure. */
/* config.hin. Generated from configure.ac by autoheader. */
/* Define to 1 if translation of program messages to the user's native
language is requested. */
/* #undef ENABLE_NLS */
/* Define on systems for which file names may have a so-called `drive letter'
prefix, define this to compute the length of that prefix, including the
colon. */
#define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX 0
/* Define if the backslash character may also serve as a file name component
separator. */
#define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR 0
#if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
# define FILE_SYSTEM_PREFIX_LEN(Filename) \
((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
#else
# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
#endif
/* Define to 1 if the system has the type `clock_t'. */
#define HAVE_CLOCK_T 1
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
/* #undef HAVE_DCGETTEXT */
/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_CLEARERR_UNLOCKED 1
/* Define to 1 if you have the declaration of `clock', and to 0 if you don't.
*/
#define HAVE_DECL_CLOCK 1
/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
don't. */
#define HAVE_DECL_FEOF_UNLOCKED 1
/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FERROR_UNLOCKED 1
/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FFLUSH_UNLOCKED 1
/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FGETS_UNLOCKED 0
/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FPUTC_UNLOCKED 1
/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FPUTS_UNLOCKED 0
/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FREAD_UNLOCKED 1
/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FWRITE_UNLOCKED 1
/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_GETCHAR_UNLOCKED 1
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
don't. */
#define HAVE_DECL_GETC_UNLOCKED 1
/* Define to 1 if you have the declaration of `getrusage', and to 0 if you
don't. */
#define HAVE_DECL_GETRUSAGE 1
/* Define to 1 if you have a declaration of mbswidth() in <wchar.h>, and to 0
otherwise. */
#define HAVE_DECL_MBSWIDTH_IN_WCHAR_H 0
/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_PUTCHAR_UNLOCKED 1
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
#define HAVE_DECL_PUTC_UNLOCKED 1
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#define HAVE_DECL_STRERROR_R 1
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
don't. */
/* #undef HAVE_DECL_STRNLEN */
#define HAVE_DECL_STRNLEN 1
/* Define to 1 if you have the declaration of `sysconf', and to 0 if you
don't. */
#define HAVE_DECL_SYSCONF 1
/* Define to 1 if you have the declaration of `times', and to 0 if you don't.
*/
#define HAVE_DECL_TIMES 1
/* Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.
*/
#define HAVE_DECL_WCWIDTH 1
/* Define to 1 if you have the `dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
/* Define if the GNU gettext() function is already present or preinstalled. */
/* #undef HAVE_GETTEXT */
/* Define if you have the iconv() function. */
/* #undef HAVE_ICONV */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `isascii' function. */
#define HAVE_ISASCII 1
/* Define to 1 if you have the `iswcntrl' function. */
#define HAVE_ISWCNTRL 1
/* Define to 1 if you have the `iswprint' function. */
#define HAVE_ISWPRINT 1
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#define HAVE_MALLOC 1
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
/* #undef HAVE_MBRTOWC */
/* Define to 1 if you have the `mbsinit' function. */
#define HAVE_MBSINIT 1
/* Define to 1 if <wchar.h> declares mbstate_t. */
/* #undef HAVE_MBSTATE_T */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if libc includes obstacks. */
#define HAVE_OBSTACK 1
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
/* Define to 1 if stdbool.h conforms to C99. */
/* #undef HAVE_STDBOOL_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. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `stpcpy' function. */
#define HAVE_STPCPY 1
/* Define to 1 if you have the `strerror_r' function. */
#define HAVE_STRERROR_R 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */
#define HAVE_STRNDUP 1
/* Define to 1 if the system has the type `struct tms'. */
#define HAVE_STRUCT_TMS 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/times.h> header file. */
#define HAVE_SYS_TIMES_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the `times' function. */
#define HAVE_TIMES 1
/* Define to 1 if the system has the type `uintptr_t'. */
#define HAVE_UINTPTR_T 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vfork' function. */
//#define HAVE_VFORK 1
/* Define to 1 if you have the <vfork.h> header file. */
/* #undef HAVE_VFORK_H */
/* Define to 1 if you have the `waitpid' function. */
#define HAVE_WAITPID 1
/* Define to 1 if you have the <wchar.h> header file. */
#define HAVE_WCHAR_H 1
/* Define to 1 if you have the <wctype.h> header file. */
/* #undef HAVE_WCTYPE_H */
/* Define to 1 if you have the `wcwidth' function. */
#define HAVE_WCWIDTH 1
/* Define to 1 if `fork' works. */
#define HAVE_WORKING_FORK 1
/* Define to 1 if `vfork' works. */
//#define HAVE_WORKING_VFORK 1
/* Define to 1 if the system has the type `_Bool'. */
/* #undef HAVE__BOOL */
#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
#else
# define ISSLASH(C) ((C) == '/')
#endif
/* Define to the GNU M4 executable name. */
#define M4 "/bin/m4"
/* Name of package */
#define PACKAGE "bison"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "bug-bison@gnu.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "GNU Bison"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "GNU Bison 2.3"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "bison"
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.3"
/* 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. */
#define STDC_HEADERS 1
/* Define to 1 if strerror_r returns char *. */
#define STRERROR_R_CHAR_P 1
/* Version number of package */
#define VERSION "2.3"
/* Define if using the dmalloc debugging malloc package */
/* #undef WITH_DMALLOC */
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#define YYTEXT_POINTER 1
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* # undef _ALL_SOURCE */
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* 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 */
/* Enable extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to 1 if the compiler is checking for lint. */
/* #undef lint */
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */
/* Define to a type if <wchar.h> does not define. */
//#define mbstate_t int
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */
/* Define to rpl_strnlen if the replacement function should be used. */
/* #undef strnlen */
/* Define as `fork' if `vfork' does not work. */
/* #undef vfork */

View File

@ -1,413 +0,0 @@
/* config.hin. Generated from configure.ac by autoheader. */
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
/* Define on systems for which file names may have a so-called `drive letter'
prefix, define this to compute the length of that prefix, including the
colon. */
#undef FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
/* Define if the backslash character may also serve as a file name component
separator. */
#undef FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
#if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
# define FILE_SYSTEM_PREFIX_LEN(Filename) \
((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
#else
# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
#endif
/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
#undef HAVE_CFLOCALECOPYCURRENT
/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
/* Define to 1 if the system has the type `clock_t'. */
#undef HAVE_CLOCK_T
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_CLEARERR_UNLOCKED
/* Define to 1 if you have the declaration of `clock', and to 0 if you don't.
*/
#undef HAVE_DECL_CLOCK
/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_FEOF_UNLOCKED
/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FERROR_UNLOCKED
/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FFLUSH_UNLOCKED
/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FGETS_UNLOCKED
/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FPUTC_UNLOCKED
/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FPUTS_UNLOCKED
/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FREAD_UNLOCKED
/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FWRITE_UNLOCKED
/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_GETCHAR_UNLOCKED
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_GETC_UNLOCKED
/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
*/
#undef HAVE_DECL_GETENV
/* Define to 1 if you have the declaration of `getrusage', and to 0 if you
don't. */
#undef HAVE_DECL_GETRUSAGE
/* Define to 1 if you have a declaration of mbswidth() in <wchar.h>, and to 0
otherwise. */
#undef HAVE_DECL_MBSWIDTH_IN_WCHAR_H
/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_PUTCHAR_UNLOCKED
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_PUTC_UNLOCKED
/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't.
*/
#undef HAVE_DECL_STRDUP
/* 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 `strndup', and to 0 if you
don't. */
#undef HAVE_DECL_STRNDUP
/* 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 `sysconf', and to 0 if you
don't. */
#undef HAVE_DECL_SYSCONF
/* Define to 1 if you have the declaration of `times', and to 0 if you don't.
*/
#undef HAVE_DECL_TIMES
/* Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.
*/
#undef HAVE_DECL_WCWIDTH
/* Define to 1 if you have the `dup2' function. */
#undef HAVE_DUP2
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `getopt_long_only' function. */
#undef HAVE_GETOPT_LONG_ONLY
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* 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 if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
declares uintmax_t. */
#undef HAVE_INTTYPES_H_WITH_UINTMAX
/* Define to 1 if you have the `isascii' function. */
#undef HAVE_ISASCII
/* Define to 1 if you have the `iswcntrl' function. */
#undef HAVE_ISWCNTRL
/* Define to 1 if you have the `iswprint' function. */
#undef HAVE_ISWPRINT
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* 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 <wchar.h> declares mbstate_t. */
#undef HAVE_MBSTATE_T
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if libc includes obstacks. */
#undef HAVE_OBSTACK
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
uintmax_t. */
#undef HAVE_STDINT_H_WITH_UINTMAX
/* 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 `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 if you have the strndup() function and it works. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define to 1 if the system has the type `struct tms'. */
#undef HAVE_STRUCT_TMS
/* Define to 1 if you have the `strverscmp' function. */
#undef HAVE_STRVERSCMP
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_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/times.h> header file. */
#undef HAVE_SYS_TIMES_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the `times' function. */
#undef HAVE_TIMES
/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
#undef HAVE_UINTMAX_T
/* Define to 1 if the system has the type `uintptr_t'. */
#undef HAVE_UINTPTR_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the 'unsigned long long' type. */
#undef HAVE_UNSIGNED_LONG_LONG
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID
/* 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 `wcwidth' function. */
#undef HAVE_WCWIDTH
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
#else
# define ISSLASH(C) ((C) == '/')
#endif
/* Define to the GNU M4 executable name. */
#undef M4
/* 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 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
/* Define to 1 if you want getc etc. to use unlocked I/O if available.
Unlocked I/O can improve performance in unithreaded apps, but it is not
safe for multithreaded apps. */
#undef USE_UNLOCKED_IO
/* Version number of package */
#undef VERSION
/* Define if using the dmalloc debugging malloc package */
#undef WITH_DMALLOC
/* Define to 1 to internationalize bison runtime messages. */
#undef YYENABLE_NLS
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* 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
/* Enable extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Define to rpl_ if the getopt replacement functions and variables should be
used. */
#undef __GETOPT_PREFIX
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to 1 if the compiler is checking for lint. */
#undef lint
/* 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 `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to rpl_strndup if the replacement function should be used, */
#undef strndup
/* Define to rpl_strnlen if the replacement function should be used. */
#undef strnlen
/* Define to unsigned long or unsigned long long if <stdint.h> and
<inttypes.h> don't define. */
#undef uintmax_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork

17646
src/bin/bison/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,144 +0,0 @@
# Configure template for GNU Bison. -*-Autoconf-*-
#
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
# This file uses AC_CONFIG_MACRO_DIR, so we need Autoconf 2.58 or better.
# But Autoconf 2.58 has a bug in the way that it generates tests: it
# puts the wrong absolute path names in the tests. So we need at
# least Autoconf 2.59.
AC_PREREQ(2.59)
AC_INIT([GNU Bison], [2.3], [bug-bison@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
AC_CONFIG_HEADERS([config.h:config.hin])
gl_USE_SYSTEM_EXTENSIONS
# Checks for the compiler.
AC_PROG_CC
AM_PROG_CC_STDC
AC_ARG_ENABLE(gcc-warnings,
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
[case "${enableval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
esac],
[enableval=no])
if test "${enableval}" = yes; then
BISON_WARNING(-Werror)
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
WARNING_CFLAGS=
BISON_WARNING(-W)
BISON_WARNING(-Wall)
BISON_WARNING(-Wcast-align)
BISON_WARNING(-Wcast-qual)
BISON_WARNING(-Wformat)
BISON_WARNING(-Wwrite-strings)
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
# The following warnings are not suitable for C++.
BISON_WARNING(-Wbad-function-cast)
BISON_WARNING(-Wmissing-declarations)
BISON_WARNING(-Wmissing-prototypes)
BISON_WARNING(-Wshadow)
BISON_WARNING(-Wstrict-prototypes)
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
fi
BISON_TEST_FOR_WORKING_C_COMPILER
AC_ARG_ENABLE([yacc],
[AC_HELP_STRING([--disable-yacc],
[do not build a yacc command or an -ly library])],
, [enable_yacc=yes])
case $enable_yacc in
yes)
YACC_SCRIPT=yacc
YACC_LIBRARY=liby.a;;
*)
YACC_SCRIPT=
YACC_LIBRARY=;;
esac
AC_SUBST([YACC_SCRIPT])
AC_SUBST([YACC_LIBRARY])
# Checks for programs.
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_RANLIB
BISON_PROG_GNU_M4
if test x"$ac_cv_prog_gnu_m4" != xyes; then
AC_MSG_ERROR([GNU M4 1.4 is required])
fi
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
# Checks for header files.
AC_CHECK_HEADERS_ONCE([locale.h])
AM_STDBOOL_H
# Checks for compiler characteristics.
AC_C_INLINE
# Checks for types.
AC_CHECK_TYPES([uintptr_t])
# Checks for library functions.
AC_CHECK_FUNCS_ONCE([setlocale])
AM_WITH_DMALLOC
BISON_PREREQ_SUBPIPE
BISON_PREREQ_TIMEVAR
# gnulib and gettext.
GNULIB_AUTOCONF_SNIPPET
# We use po/Makevars, so we need at least gettext 0.12.
AM_GNU_GETTEXT_VERSION([0.12])
BISON_I18N
# Internationalized parsers.
AC_CONFIG_FILES([runtime-po/Makefile.in])
# Autoconf macros for packages using internationalized parsers.
aclocaldir='${datadir}/aclocal'
AC_SUBST([aclocaldir])
# Initialize the test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
AC_CHECK_PROGS([VALGRIND], [valgrind])
AC_PROG_CXX
BISON_TEST_FOR_WORKING_CXX_COMPILER
AM_MISSING_PROG([AUTOM4TE], [autom4te])
# Needed by tests/atlocal.in.
AC_SUBST([GCC])
O0CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]] *//'`
AC_SUBST([O0CFLAGS])
O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
AC_SUBST([O0CXXFLAGS])
AC_CONFIG_FILES([Makefile
build-aux/Makefile
po/Makefile.in
data/Makefile
examples/Makefile
examples/calc++/Makefile
lib/Makefile src/Makefile doc/Makefile])
AC_OUTPUT

View File

@ -1,24 +0,0 @@
SubDir HAIKU_TOP src bin bison data ;
# TODO: This must be done in HaikuImage.
# MakeLocate <etc>c.m4 : $(HAIKU_ETC_DIR) ;
# File <etc>c.m4 : c.m4 ;
# LocalClean clean : <etc>c.m4 ;
#
# MakeLocate <etc>glr.c : $(HAIKU_ETC_DIR) ;
# File <etc>glr.c : glr.c ;
# LocalClean clean : <etc>glr.c ;
#
# MakeLocate <etc>lalr1.cc : $(HAIKU_ETC_DIR) ;
# File <etc>lalr1.cc : lalr1.cc ;
# LocalClean clean : <etc>lalr1.cc ;
#
# MakeLocate <etc>yacc.c : $(HAIKU_ETC_DIR) ;
# File <etc>yacc.c : yacc.c ;
# LocalClean clean : <etc>yacc.c ;
#
# MakeLocate <etc>m4sugar.m4 : [ FDirName $(HAIKU_ETC_DIR) m4sugar ] ;
# File <etc>m4sugar.m4 : m4sugar.m4 ;
# LocalClean clean : <etc>m4sugar.m4 ;
#
# SEARCH on m4sugar.m4 = [ FDirName $(SUBDIR) m4sugar ] ;

View File

@ -1,23 +0,0 @@
## Copyright (C) 2002, 2005 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
dist_pkgdata_DATA = README \
c.m4 yacc.c glr.c \
c++.m4 location.cc lalr1.cc glr.cc
m4sugardir = $(pkgdatadir)/m4sugar
dist_m4sugar_DATA = m4sugar/m4sugar.m4

View File

@ -1,412 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = data
DIST_COMMON = README $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/bison-i18n.m4 \
$(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/cxx.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dmalloc.m4 \
$(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext_gl.m4 \
$(top_srcdir)/m4/gnulib.m4 $(top_srcdir)/m4/hard-locale.m4 \
$(top_srcdir)/m4/hash.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/inttypes_h_gl.m4 \
$(top_srcdir)/m4/lib-ld_gl.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix_gl.m4 $(top_srcdir)/m4/m4.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/onceonly.m4 \
$(top_srcdir)/m4/po_gl.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint_h_gl.m4 \
$(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stpcpy.m4 \
$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
$(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
$(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoul.m4 \
$(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/subpipe.m4 \
$(top_srcdir)/m4/timevar.m4 $(top_srcdir)/m4/uintmax_t_gl.m4 \
$(top_srcdir)/m4/ulonglong_gl.m4 \
$(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
$(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/warning.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xstrndup.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)"
dist_m4sugarDATA_INSTALL = $(INSTALL_DATA)
dist_pkgdataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(dist_m4sugar_DATA) $(dist_pkgdata_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOM4TE = @AUTOM4TE@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BISON_CXX_WORKS = @BISON_CXX_WORKS@
BISON_CXX_WORKS_FALSE = @BISON_CXX_WORKS_FALSE@
BISON_CXX_WORKS_TRUE = @BISON_CXX_WORKS_TRUE@
BISON_LOCALEDIR = @BISON_LOCALEDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GCC = @GCC@
GETOPT_H = @GETOPT_H@
GMSGFMT = @GMSGFMT@
HAVE__BOOL = @HAVE__BOOL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
O0CFLAGS = @O0CFLAGS@
O0CXXFLAGS = @O0CXXFLAGS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
UNISTD_H = @UNISTD_H@
USE_NLS = @USE_NLS@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
WARNING_CXXFLAGS = @WARNING_CXXFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
YACC_LIBRARY = @YACC_LIBRARY@
YACC_SCRIPT = @YACC_SCRIPT@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
aclocaldir = @aclocaldir@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
dist_pkgdata_DATA = README \
c.m4 yacc.c glr.c \
c++.m4 location.cc lalr1.cc glr.cc
m4sugardir = $(pkgdatadir)/m4sugar
dist_m4sugar_DATA = m4sugar/m4sugar.m4
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu data/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
uninstall-info-am:
install-dist_m4sugarDATA: $(dist_m4sugar_DATA)
@$(NORMAL_INSTALL)
test -z "$(m4sugardir)" || $(mkdir_p) "$(DESTDIR)$(m4sugardir)"
@list='$(dist_m4sugar_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(dist_m4sugarDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(m4sugardir)/$$f'"; \
$(dist_m4sugarDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(m4sugardir)/$$f"; \
done
uninstall-dist_m4sugarDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_m4sugar_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(m4sugardir)/$$f'"; \
rm -f "$(DESTDIR)$(m4sugardir)/$$f"; \
done
install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)"
@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
$(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
uninstall-dist_pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/m4sugar
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
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"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
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 $(DATA)
installdirs:
for dir in "$(DESTDIR)$(m4sugardir)" "$(DESTDIR)$(pkgdatadir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
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
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-dist_m4sugarDATA install-dist_pkgdataDATA
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-dist_m4sugarDATA uninstall-dist_pkgdataDATA \
uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \
install-dist_m4sugarDATA install-dist_pkgdataDATA 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 pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-dist_m4sugarDATA uninstall-dist_pkgdataDATA \
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:

View File

@ -1,45 +0,0 @@
-*- outline -*-
This directory contains Bison skeletons: the general shapes of the
different parser kinds, that are specialized for specific grammars by
the bison program.
Currently, there are only three supported skeletons:
- yacc.c
It used to be named bison.simple: it corresponds to C Yacc
compatible LALR(1) parsers.
- lalr1.cc
Produces a C++ parser class. It is still very experimental, and not
yet supported. Please, subscribe to bison-patches@gnu.org.
- glr.c
A Generalized LR C parser based on Bison's LALR(1) tables.
These skeletons are the only ones supported by the Bison team.
Because the interface between skeletons and the bison program is not
finished, *we are not bound to it*. In particular, Bison is not
mature enough for us to consider that ``foreign skeletons'' are
supported.
-----
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Bison.
GNU Bison 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.
GNU Bison 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 Bison; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

View File

@ -1,122 +0,0 @@
m4_divert(-1) -*- Autoconf -*-
# C++ skeleton for Bison
# Copyright (C) 2002, 2003, 2004, 2005, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
m4_include(b4_pkgdatadir/[c.m4])
## ---------------- ##
## Default values. ##
## ---------------- ##
# Default parser class name.
m4_define_default([b4_parser_class_name], [parser])
m4_define_default([b4_location_type], [location])
m4_define_default([b4_filename_type], [std::string])
m4_define_default([b4_namespace], m4_defn([b4_prefix]))
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -----------------------------------------------------
# Output the definition of the tokens as enums.
m4_define([b4_token_enums],
[/* Tokens. */
enum yytokentype {
m4_map_sep([ b4_token_enum], [,
],
[$@])
};
])
## ----------------- ##
## Semantic Values. ##
## ----------------- ##
# b4_lhs_value([TYPE])
# --------------------
# Expansion of $<TYPE>$.
m4_define([b4_lhs_value],
[(yyval[]m4_ifval([$1], [.$1]))])
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
# --------------------------------------
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
# symbols on RHS.
m4_define([b4_rhs_value],
[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))])
# b4_lhs_location()
# -----------------
# Expansion of @$.
m4_define([b4_lhs_location],
[(yyloc)])
# b4_rhs_location(RULE-LENGTH, NUM)
# ---------------------------------
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
# on RHS.
m4_define([b4_rhs_location],
[(yylocation_stack_@{($1) - ($2)@})])
# b4_parse_param_decl
# -------------------
# Extra formal arguments of the constructor.
# Change the parameter names from "foo" into "foo_yyarg", so that
# there is no collision bw the user chosen attribute name, and the
# argument name in the constructor.
m4_define([b4_parse_param_decl],
[m4_ifset([b4_parse_param],
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
m4_define([b4_parse_param_decl_1],
[$1_yyarg])
# b4_parse_param_cons
# -------------------
# Extra initialisations of the constructor.
m4_define([b4_parse_param_cons],
[m4_ifset([b4_parse_param],
[,
b4_cc_constructor_calls(b4_parse_param)])])
m4_define([b4_cc_constructor_calls],
[m4_map_sep([b4_cc_constructor_call], [,
], [$@])])
m4_define([b4_cc_constructor_call],
[$2 ($2_yyarg)])
# b4_parse_param_vars
# -------------------
# Extra instance variables.
m4_define([b4_parse_param_vars],
[m4_ifset([b4_parse_param],
[
/* User arguments. */
b4_cc_var_decls(b4_parse_param)])])
m4_define([b4_cc_var_decls],
[m4_map_sep([b4_cc_var_decl], [
], [$@])])
m4_define([b4_cc_var_decl],
[ $1;])

View File

@ -1,534 +0,0 @@
m4_divert(-1) -*- Autoconf -*-
# C M4 Macros for Bison.
# Copyright (C) 2002, 2004, 2005, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
## ---------------- ##
## Identification. ##
## ---------------- ##
# b4_copyright(TITLE, YEARS)
# --------------------------
m4_define([b4_copyright],
[/* A Bison parser, made by GNU Bison b4_version. */
/* $1
m4_text_wrap([Copyright (C) $2 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., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */])
# b4_identification
# -----------------
m4_define([b4_identification],
[/* Identify Bison output. */
[#]define YYBISON 1
/* Bison version. */
[#]define YYBISON_VERSION "b4_version"
/* Skeleton name. */
[#]define YYSKELETON_NAME b4_skeleton
/* Pure parsers. */
[#]define YYPURE b4_pure_flag
/* Using locations. */
[#]define YYLSP_NEEDED b4_locations_flag
])
## ---------------- ##
## Default values. ##
## ---------------- ##
m4_define_default([b4_epilogue], [])
## ------------------------ ##
## Pure/impure interfaces. ##
## ------------------------ ##
# b4_user_args
# ------------
m4_define([b4_user_args],
[m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])])
# b4_parse_param
# --------------
# If defined, b4_parse_param arrives double quoted, but below we prefer
# it to be single quoted.
m4_define_default([b4_parse_param])
m4_define([b4_parse_param],
b4_parse_param))
# b4_parse_param_for(DECL, FORMAL, BODY)
# ---------------------------------------
# Iterate over the user parameters, binding the declaration to DECL,
# the formal name to FORMAL, and evaluating the BODY.
m4_define([b4_parse_param_for],
[m4_foreach([$1_$2], m4_defn([b4_parse_param]),
[m4_pushdef([$1], m4_fst($1_$2))dnl
m4_pushdef([$2], m4_shift($1_$2))dnl
$3[]dnl
m4_popdef([$2])dnl
m4_popdef([$1])dnl
])])
# b4_parse_param_use
# ------------------
# `YYUSE' all the parse-params.
m4_define([b4_parse_param_use],
[b4_parse_param_for([Decl], [Formal], [ YYUSE (Formal);
])dnl
])
## ------------ ##
## Data Types. ##
## ------------ ##
# b4_ints_in(INT1, INT2, LOW, HIGH)
# ---------------------------------
# Return 1 iff both INT1 and INT2 are in [LOW, HIGH], 0 otherwise.
m4_define([b4_ints_in],
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
# b4_int_type(MIN, MAX)
# ---------------------
# Return the smallest int type able to handle numbers ranging from
# MIN to MAX (included).
m4_define([b4_int_type],
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
b4_ints_in($@, [-128], [127]), [1], [signed char],
b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
b4_ints_in($@, [-32768], [32767]), [1], [short int],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
# b4_int_type_for(NAME)
# ---------------------
# Return the smallest int type able to handle numbers ranging from
# `NAME_min' to `NAME_max' (included).
m4_define([b4_int_type_for],
[b4_int_type($1_min, $1_max)])
## ------------------ ##
## Decoding options. ##
## ------------------ ##
# b4_flag_if(FLAG, IF-TRUE, IF-FALSE)
# -----------------------------------
# Run IF-TRUE if b4_FLAG_flag is 1, IF-FALSE if FLAG is 0, otherwise fail.
m4_define([b4_flag_if],
[m4_case(b4_$1_flag,
[0], [$3],
[1], [$2],
[m4_fatal([invalid $1 value: ]$1)])])
# b4_define_flag_if(FLAG)
# -----------------------
# Define "b4_FLAG_if(IF-TRUE, IF-FALSE)" that depends on the
# value of the Boolean FLAG.
m4_define([b4_define_flag_if],
[_b4_define_flag_if($[1], $[2], [$1])])
# _b4_define_flag_if($1, $2, FLAG)
# --------------------------------
# This macro works around the impossibility to define macros
# inside macros, because issuing `[$1]' is not possible in M4 :(.
# This sucks hard, GNU M4 should really provide M5 like $$1.
m4_define([_b4_define_flag_if],
[m4_if([$1$2], $[1]$[2], [],
[m4_fatal([$0: Invalid arguments: $@])])dnl
m4_define([b4_$3_if],
[b4_flag_if([$3], [$1], [$2])])])
# b4_FLAG_if(IF-TRUE, IF-FALSE)
# -----------------------------
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
b4_define_flag_if([defines]) # Whether headers are requested.
b4_define_flag_if([error_verbose]) # Wheter error are verbose.
b4_define_flag_if([locations]) # Whether locations are tracked.
b4_define_flag_if([pure]) # Whether the interface is pure.
## ------------------------- ##
## Assigning token numbers. ##
## ------------------------- ##
# b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
# -----------------------------------------
# Output the definition of this token as #define.
m4_define([b4_token_define],
[#define $1 $2
])
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -------------------------------------------------------
# Output the definition of the tokens (if there are) as #defines.
m4_define([b4_token_defines],
[m4_if([$@], [[]], [],
[/* Tokens. */
m4_map([b4_token_define], [$@])])
])
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
# ---------------------------------------
# Output the definition of this token as an enum.
m4_define([b4_token_enum],
[$1 = $2])
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -----------------------------------------------------
# Output the definition of the tokens (if there are) as enums.
m4_define([b4_token_enums],
[m4_if([$@], [[]], [],
[/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
m4_map_sep([ b4_token_enum], [,
],
[$@])
};
#endif
])])
# b4_token_enums_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
# -------------------------------------------------------------
# Output the definition of the tokens (if there are) as enums and #defines.
m4_define([b4_token_enums_defines],
[b4_token_enums($@)b4_token_defines($@)
])
## --------------------------------------------- ##
## Defining C functions in both K&R and ANSI-C. ##
## --------------------------------------------- ##
# b4_modern_c
# -----------
# A predicate useful in #if to determine whether C is ancient or modern.
#
# If __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run
# as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic
# reasons, but it defines __C99__FUNC__ so check that as well.
# Microsoft C normally doesn't define these macros, but it defines _MSC_VER.
# Consider a C++ compiler to be modern if it defines __cplusplus.
#
m4_define([b4_c_modern],
[[(defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)]])
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ----------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_function_def],
[#if b4_c_modern
b4_c_ansi_function_def($@)
#else
$2
$1 (b4_c_knr_formal_names(m4_shiftn(2, $@)))
b4_c_knr_formal_decls(m4_shiftn(2, $@))
#endif[]dnl
])
# b4_c_ansi_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ---------------------------------------------------------------
# Declare the function NAME in ANSI.
m4_define([b4_c_ansi_function_def],
[$2
$1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
])
# b4_c_ansi_formals([DECL1, NAME1], ...)
# --------------------------------------
# Output the arguments ANSI-C definition.
m4_define([b4_c_ansi_formals],
[m4_case([$@],
[], [void],
[[]], [void],
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
m4_define([b4_c_ansi_formal],
[$1])
# b4_c_knr_formal_names([DECL1, NAME1], ...)
# ------------------------------------------
# Output the argument names.
m4_define([b4_c_knr_formal_names],
[m4_map_sep([b4_c_knr_formal_name], [, ], [$@])])
m4_define([b4_c_knr_formal_name],
[$2])
# b4_c_knr_formal_decls([DECL1, NAME1], ...)
# ------------------------------------------
# Output the K&R argument declarations.
m4_define([b4_c_knr_formal_decls],
[m4_map_sep([b4_c_knr_formal_decl],
[
],
[$@])])
m4_define([b4_c_knr_formal_decl],
[ $1;])
## ------------------------------------------------------------ ##
## Declaring (prototyping) C functions in both K&R and ANSI-C. ##
## ------------------------------------------------------------ ##
# b4_c_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# -----------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_function_decl],
[#if defined __STDC__ || defined __cplusplus
b4_c_ansi_function_decl($@)
#else
$2 $1 ();
#endif[]dnl
])
# b4_c_ansi_function_decl(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ----------------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_ansi_function_decl],
[$2 $1 (b4_c_ansi_formals(m4_shiftn(2, $@)));[]dnl
])
## --------------------- ##
## Calling C functions. ##
## --------------------- ##
# b4_c_function_call(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# -----------------------------------------------------------
# Call the function NAME with arguments NAME1, NAME2 etc.
m4_define([b4_c_function_call],
[$1 (b4_c_args(m4_shiftn(2, $@)))[]dnl
])
# b4_c_args([DECL1, NAME1], ...)
# ------------------------------
# Output the arguments NAME1, NAME2...
m4_define([b4_c_args],
[m4_map_sep([b4_c_arg], [, ], [$@])])
m4_define([b4_c_arg],
[$2])
## ----------- ##
## Synclines. ##
## ----------- ##
# b4_syncline(LINE, FILE)
# -----------------------
m4_define([b4_syncline],
[b4_flag_if([synclines], [[#]line $1 $2])])
## -------------- ##
## User actions. ##
## -------------- ##
# b4_symbol_actions(FILENAME, LINENO,
# SYMBOL-TAG, SYMBOL-NUM,
# SYMBOL-ACTION, SYMBOL-TYPENAME)
# -------------------------------------------------
m4_define([b4_symbol_actions],
[m4_pushdef([b4_dollar_dollar],
[m4_ifval([$6], [(yyvaluep->$6)], [(*yyvaluep)])])dnl
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
case $4: /* $3 */
b4_syncline([$2], [$1])
$5;
b4_syncline([@oline@], [@ofile@])
break;
m4_popdef([b4_at_dollar])dnl
m4_popdef([b4_dollar_dollar])dnl
])
# b4_yydestruct_generate(FUNCTION-DECLARATOR)
# -------------------------------------------
# Generate the "yydestruct" function, which declaration is issued using
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
# or "b4_c_function_def" for K&R.
m4_define_default([b4_yydestruct_generate],
[[/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
/*ARGSUSED*/
]$1([yydestruct],
[static void],
[[const char *yymsg], [yymsg]],
[[int yytype], [yytype]],
[[YYSTYPE *yyvaluep], [yyvaluep]][]dnl
b4_locations_if( [, [[YYLTYPE *yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
YYUSE (yyvaluep);
]b4_locations_if([ YYUSE (yylocationp);
])dnl
b4_parse_param_use[]dnl
[
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
default:
break;
}
}]dnl
])
# b4_yy_symbol_print_generate(FUNCTION-DECLARATOR)
# ------------------------------------------------
# Generate the "yy_symbol_print" function, which declaration is issued using
# FUNCTION-DECLARATOR, which may be "b4_c_ansi_function_def" for ISO C
# or "b4_c_function_def" for K&R.
m4_define_default([b4_yy_symbol_print_generate],
[[
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
/*ARGSUSED*/
]$1([yy_symbol_value_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
if (!yyvaluep)
return;
]b4_locations_if([ YYUSE (yylocationp);
])dnl
b4_parse_param_use[]dnl
[# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
YYUSE (yyoutput);
# endif
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
}
}
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
]$1([yy_symbol_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[YYSTYPE const * const yyvaluep], [yyvaluep]][]dnl
b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
if (yytype < YYNTOKENS)
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
]b4_locations_if([ YY_LOCATION_PRINT (yyoutput, *yylocationp);
YYFPRINTF (yyoutput, ": ");
])dnl
[ yy_symbol_value_print (yyoutput, yytype, yyvaluep]dnl
b4_locations_if([, yylocationp])[]b4_user_args[);
YYFPRINTF (yyoutput, ")");
}]dnl
])

File diff suppressed because it is too large Load Diff

View File

@ -1,389 +0,0 @@
m4_divert(-1) -*- C -*-
# C++ GLR skeleton for Bison
# Copyright (C) 2002, 2003, 2004, 2005, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
# This skeleton produces a C++ class that encapsulates a C glr parser.
# This is in order to reduce the maintenance burden. The glr.c
# skeleton is clean and pure enough so that there are no real
# problems. The C++ interface is the same as that of lalr1.cc. In
# fact, glr.c can replace yacc.c without the user noticing any
# difference, and similarly for glr.cc replacing lalr1.cc.
#
# The passing of parse-params
#
# The additional arguments are stored as members of the parser
# object, yyparser. The C routines need to carry yyparser
# throughout the C parser; that easy: just let yyparser become an
# additional parse-param. But because the C++ skeleton needs to
# know the "real" original parse-param, we save them
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
# (and c.m4 strips one level of quotes). This is a PITA, and
# explains why there are so many levels of quotes.
#
# The locations
#
# We use location.cc just like lalr1.cc, but because glr.c stores
# the locations in a (C++) union, the position and location classes
# must not have a constructor. Therefore, contrary to lalr1.cc, we
# must not define "b4_location_constructors". As a consequence the
# user must initialize the first positions (in particular the
# filename member).
# We require a pure interface using locations.
m4_define([b4_locations_flag], [1])
m4_define([b4_pure_flag], [1])
# The header is mandatory.
b4_defines_if([],
[m4_fatal(b4_skeleton[: using %defines is mandatory])])
m4_include(b4_pkgdatadir/[c++.m4])
m4_include(b4_pkgdatadir/[location.cc])
# Save the parse parameters.
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
# b4_yy_symbol_print_generate
# ---------------------------
# Bypass the default implementation to generate the "yy_symbol_print"
# and "yy_symbol_value_print" functions.
m4_define([b4_yy_symbol_print_generate],
[[
/*--------------------.
| Print this symbol. |
`--------------------*/
]b4_c_ansi_function_def([yy_symbol_print],
[static void],
[[FILE *], []],
[[int yytype], [yytype]],
[[const b4_namespace::b4_parser_class_name::semantic_type *yyvaluep],
[yyvaluep]],
[[const b4_namespace::b4_parser_class_name::location_type *yylocationp],
[yylocationp]],
b4_parse_param)[
{
]b4_parse_param_use[]dnl
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
}
]])
# Declare yyerror.
m4_append([b4_post_prologue],
[/* Line __line__ of glr.cc. */
b4_syncline([@oline@], [@ofile@])
b4_c_ansi_function_decl([yyerror],
[static void],
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
b4_parse_param,
[[const char* msg], [msg]])])
# Define yyerror.
m4_append([b4_epilogue],
[/* Line __line__ of glr.cc. */
b4_syncline([@oline@], [@ofile@])[
/*------------------.
| Report an error. |
`------------------*/
]b4_c_ansi_function_def([yyerror],
[static void],
[[b4_namespace::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
b4_parse_param,
[[const char* msg], [msg]])[
{
]b4_parse_param_use[]dnl
[ yyparser.error (*yylocationp, msg);
}
namespace ]b4_namespace[
{
]dnl In this section, the parse param are the original parse_params.
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
[ /// Build a parser object.
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)
: yycdebug_ (&std::cerr)]b4_parse_param_cons[
{
}
]b4_parser_class_name::~b4_parser_class_name[ ()
{
}
int
]b4_parser_class_name[::parse ()
{
return ::yyparse (*this]b4_user_args[);
}
#if YYDEBUG
/*--------------------.
| Print this symbol. |
`--------------------*/
inline void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
{
/* Pacify ``unused variable'' warnings. */
YYUSE (yyvaluep);
YYUSE (yylocationp);
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
}
}
void
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
{
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
<< ' ' << yytname[yytype] << " ("
<< *yylocationp << ": ";
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
*yycdebug_ << ')';
}
std::ostream&
]b4_parser_class_name[::debug_stream () const
{
return *yycdebug_;
}
void
]b4_parser_class_name[::set_debug_stream (std::ostream& o)
{
yycdebug_ = &o;
}
]b4_parser_class_name[::debug_level_type
]b4_parser_class_name[::debug_level () const
{
return ::yydebug;
}
void
]b4_parser_class_name[::set_debug_level (debug_level_type l)
{
::yydebug = l;
}
#endif /* ! YYDEBUG */
]m4_popdef([b4_parse_param])dnl
[} // namespace ]b4_namespace[
]])
# Let glr.c believe that the user arguments include the parser itself.
m4_ifset([b4_parse_param],
[m4_pushdef([b4_parse_param],
m4_dquote([[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]],]
m4_defn([b4_parse_param])))],
[m4_pushdef([b4_parse_param],
[[[[b4_namespace::b4_parser_class_name& yyparser], [[yyparser]]]]])
])
m4_include(b4_pkgdatadir/[glr.c])
m4_popdef([b4_parse_param])
@output @output_header_name@
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
[2002, 2003, 2004, 2005, 2006])[
/* C++ GLR parser skeleton written by Akim Demaille. */
#ifndef PARSER_HEADER_H
# define PARSER_HEADER_H
#include <string>
#include <iostream>
/* Using locations. */
#define YYLSP_NEEDED ]b4_locations_flag[
namespace ]b4_namespace[
{
class position;
class location;
}
/* Copy the first part of user declarations. */
]b4_pre_prologue[
]/* Line __line__ of glr.cc. */
b4_syncline([@oline@], [@ofile@])[
#include "location.hh"
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_debug_flag[
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE ]b4_error_verbose_flag[
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE ]b4_token_table[
#endif
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
(Current).end = YYRHSLOC (Rhs, N).end; \
} \
else \
{ \
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
} \
while (/*CONSTCOND*/ 0)
#endif
namespace ]b4_namespace[
{
/// A Bison parser.
class ]b4_parser_class_name[
{
public:
/// Symbol semantic values.
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[ union semantic_type
b4_stype
/* Line __line__ of lalr1.cc. */
b4_syncline([@oline@], [@ofile@])
;],
[ typedef int semantic_type;])[
#else
typedef YYSTYPE semantic_type;
#endif
/// Symbol locations.
typedef ]b4_location_type[ location_type;
/// Tokens.
struct token
{
]b4_token_enums(b4_tokens)[
};
/// Token type.
typedef token::yytokentype token_type;
/// Build a parser object.
]b4_parser_class_name[ (]b4_parse_param_decl[);
virtual ~]b4_parser_class_name[ ();
/// Parse.
/// \returns 0 iff parsing succeeded.
virtual int parse ();
/// The current debugging stream.
std::ostream& debug_stream () const;
/// Set the current debugging stream.
void set_debug_stream (std::ostream &);
/// Type for debugging levels.
typedef int debug_level_type;
/// The current debugging level.
debug_level_type debug_level () const;
/// Set the current debugging level.
void set_debug_level (debug_level_type l);
private:
public:
/// Report a syntax error.
/// \param loc where the syntax error is found.
/// \param msg a description of the syntax error.
virtual void error (const location_type& loc, const std::string& msg);
private:
#if YYDEBUG
public:
/// \brief Report a symbol value on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
private:
#endif /* ! YYDEBUG */
/// \brief Reclaim the memory associated to a symbol.
/// \param yymsg Why this token is reclaimed.
/// \param yytype The symbol type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
inline void yydestruct_ (const char* yymsg,
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
/* Debugging. */
std::ostream* yycdebug_;
]b4_parse_param_vars[
};
]dnl Redirections for glr.c.
m4_ifset([b4_global_tokens_and_yystype],
[b4_token_defines(b4_tokens)])
[
#ifndef YYSTYPE
# define YYSTYPE ]b4_namespace[::]b4_parser_class_name[::semantic_type
#endif
#ifndef YYLTYPE
# define YYLTYPE ]b4_namespace[::]b4_parser_class_name[::location_type
#endif
}
#endif /* ! defined PARSER_HEADER_H */]

File diff suppressed because it is too large Load Diff

View File

@ -1,253 +0,0 @@
m4_divert(-1)
# C++ skeleton for Bison
# Copyright (C) 2002, 2003, 2004, 2005, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
# We do want M4 expansion after # for CPP macros.
m4_changecom()
m4_divert(0)dnl
@output b4_dir_prefix[]position.hh
b4_copyright([Positions for Bison parsers in C++],
[2002, 2003, 2004, 2005, 2006])[
/**
** \file position.hh
** Define the ]b4_namespace[::position class.
*/
#ifndef BISON_POSITION_HH
# define BISON_POSITION_HH
# include <iostream>
# include <string>
namespace ]b4_namespace[
{
/// Abstract a position.
class position
{
public:
]m4_ifdef([b4_location_constructors], [
/// Construct a position.
position ()
: filename (0), line (1), column (0)
{
}
])[
/// Initialization.
inline void initialize (]b4_filename_type[* fn)
{
filename = fn;
line = 1;
column = 0;
}
/** \name Line and Column related manipulators
** \{ */
public:
/// (line related) Advance to the COUNT next lines.
inline void lines (int count = 1)
{
column = 0;
line += count;
}
/// (column related) Advance to the COUNT next columns.
inline void columns (int count = 1)
{
int leftmost = 0;
int current = column;
if (leftmost <= current + count)
column += count;
else
column = 0;
}
/** \} */
public:
/// File name to which this position refers.
]b4_filename_type[* filename;
/// Current line number.
unsigned int line;
/// Current column number.
unsigned int column;
};
/// Add and assign a position.
inline const position&
operator+= (position& res, const int width)
{
res.columns (width);
return res;
}
/// Add two position objects.
inline const position
operator+ (const position& begin, const int width)
{
position res = begin;
return res += width;
}
/// Add and assign a position.
inline const position&
operator-= (position& res, const int width)
{
return res += -width;
}
/// Add two position objects.
inline const position
operator- (const position& begin, const int width)
{
return begin + -width;
}
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param pos a reference to the position to redirect
*/
inline std::ostream&
operator<< (std::ostream& ostr, const position& pos)
{
if (pos.filename)
ostr << *pos.filename << ':';
return ostr << pos.line << '.' << pos.column;
}
}
#endif // not BISON_POSITION_HH]
@output b4_dir_prefix[]location.hh
b4_copyright([Locations for Bison parsers in C++],
[2002, 2003, 2004, 2005, 2006])[
/**
** \file location.hh
** Define the ]b4_namespace[::location class.
*/
#ifndef BISON_LOCATION_HH
# define BISON_LOCATION_HH
# include <iostream>
# include <string>
# include "position.hh"
namespace ]b4_namespace[
{
/// Abstract a location.
class location
{
public:
]m4_ifdef([b4_location_constructors], [
/// Construct a location.
location ()
: begin (), end ()
{
}
])[
/// Initialization.
inline void initialize (]b4_filename_type[* fn)
{
begin.initialize (fn);
end = begin;
}
/** \name Line and Column related manipulators
** \{ */
public:
/// Reset initial location to final location.
inline void step ()
{
begin = end;
}
/// Extend the current location to the COUNT next columns.
inline void columns (unsigned int count = 1)
{
end += count;
}
/// Extend the current location to the COUNT next lines.
inline void lines (unsigned int count = 1)
{
end.lines (count);
}
/** \} */
public:
/// Beginning of the located region.
position begin;
/// End of the located region.
position end;
};
/// Join two location objects to create a location.
inline const location operator+ (const location& begin, const location& end)
{
location res = begin;
res.end = end.end;
return res;
}
/// Add two location objects.
inline const location operator+ (const location& begin, unsigned int width)
{
location res = begin;
res.columns (width);
return res;
}
/// Add and assign a location.
inline location& operator+= (location& res, unsigned int width)
{
res.columns (width);
return res;
}
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param loc a reference to the location to redirect
**
** Avoid duplicate information.
*/
inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
{
position last = loc.end - 1;
ostr << loc.begin;
if (last.filename
&& (!loc.begin.filename
|| *loc.begin.filename != *last.filename))
ostr << '-' << last;
else if (loc.begin.line != last.line)
ostr << '-' << last.line << '.' << last.column;
else if (loc.begin.column != last.column)
ostr << '-' << last.column;
return ostr;
}
}
#endif // not BISON_LOCATION_HH]
m4_divert(-1)
m4_changecom([#])

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +0,0 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
## Copyright (C) 2001, 2002, 2003, 2005, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
AM_MAKEINFOFLAGS = --no-split
info_TEXINFOS = bison.texinfo
man_MANS = bison.1
bison_TEXINFOS = gpl.texi fdl.texi
EXTRA_DIST = bison.1 refcard.tex
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
clean-local:
rm -rf *.t2d
refcard.dvi: refcard.tex
tex refcard.tex
refcard.ps: refcard.dvi

View File

@ -1,597 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
DIST_COMMON = $(bison_TEXINFOS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/stamp-vti \
$(srcdir)/version.texi
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/bison-i18n.m4 \
$(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/cxx.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dmalloc.m4 \
$(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext_gl.m4 \
$(top_srcdir)/m4/gnulib.m4 $(top_srcdir)/m4/hard-locale.m4 \
$(top_srcdir)/m4/hash.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/inttypes_h_gl.m4 \
$(top_srcdir)/m4/lib-ld_gl.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix_gl.m4 $(top_srcdir)/m4/m4.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/onceonly.m4 \
$(top_srcdir)/m4/po_gl.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint_h_gl.m4 \
$(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stpcpy.m4 \
$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
$(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
$(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoul.m4 \
$(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/subpipe.m4 \
$(top_srcdir)/m4/timevar.m4 $(top_srcdir)/m4/uintmax_t_gl.m4 \
$(top_srcdir)/m4/ulonglong_gl.m4 \
$(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
$(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/warning.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xstrndup.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
INFO_DEPS = $(srcdir)/bison.info
TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
DVIS = bison.dvi
PDFS = bison.pdf
PSS = bison.ps
HTMLS = bison.html
TEXINFOS = bison.texinfo
TEXI2DVI = texi2dvi
TEXI2PDF = $(TEXI2DVI) --pdf --batch
MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
DVIPS = dvips
am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOM4TE = @AUTOM4TE@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BISON_CXX_WORKS = @BISON_CXX_WORKS@
BISON_CXX_WORKS_FALSE = @BISON_CXX_WORKS_FALSE@
BISON_CXX_WORKS_TRUE = @BISON_CXX_WORKS_TRUE@
BISON_LOCALEDIR = @BISON_LOCALEDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GCC = @GCC@
GETOPT_H = @GETOPT_H@
GMSGFMT = @GMSGFMT@
HAVE__BOOL = @HAVE__BOOL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
O0CFLAGS = @O0CFLAGS@
O0CXXFLAGS = @O0CXXFLAGS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
UNISTD_H = @UNISTD_H@
USE_NLS = @USE_NLS@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
WARNING_CXXFLAGS = @WARNING_CXXFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
YACC_LIBRARY = @YACC_LIBRARY@
YACC_SCRIPT = @YACC_SCRIPT@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
aclocaldir = @aclocaldir@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AM_MAKEINFOFLAGS = --no-split
info_TEXINFOS = bison.texinfo
man_MANS = bison.1
bison_TEXINFOS = gpl.texi fdl.texi
EXTRA_DIST = bison.1 refcard.tex
CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
all: all-am
.SUFFIXES:
.SUFFIXES: .dvi .html .info .pdf .ps .texinfo
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
.texinfo.info:
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
am__cwd=`pwd` && cd $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
cd "$$am__cwd"; \
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $@ $<; \
then \
rc=0; \
cd $(srcdir); \
else \
rc=$$?; \
cd $(srcdir) && \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
.texinfo.dvi:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2DVI) $<
.texinfo.pdf:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2PDF) $<
.texinfo.html:
rm -rf $(@:.html=.htp)
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $(@:.html=.htp) $<; \
then \
rm -rf $@; \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
else \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
exit 1; \
fi
$(srcdir)/bison.info: bison.texinfo $(srcdir)/version.texi $(bison_TEXINFOS)
bison.dvi: bison.texinfo $(srcdir)/version.texi $(bison_TEXINFOS)
bison.pdf: bison.texinfo $(srcdir)/version.texi $(bison_TEXINFOS)
bison.html: bison.texinfo $(srcdir)/version.texi $(bison_TEXINFOS)
$(srcdir)/version.texi: $(srcdir)/stamp-vti
$(srcdir)/stamp-vti: bison.texinfo $(top_srcdir)/configure
@(dir=.; test -f ./bison.texinfo || dir=$(srcdir); \
set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/bison.texinfo`; \
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
echo "@set VERSION $(VERSION)") > vti.tmp
@cmp -s vti.tmp $(srcdir)/version.texi \
|| (echo "Updating $(srcdir)/version.texi"; \
cp vti.tmp $(srcdir)/version.texi)
-@rm -f vti.tmp
@cp $(srcdir)/version.texi $@
mostlyclean-vti:
-rm -f vti.tmp
maintainer-clean-vti:
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
.dvi.ps:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
$(DVIPS) -o $@ $<
uninstall-info-am:
@$(PRE_UNINSTALL)
@if (install-info --version && \
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
(if cd "$(DESTDIR)$(infodir)"; then \
echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
else :; fi); \
done
dist-info: $(INFO_DEPS)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for base in $$list; do \
case $$base in \
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
for file in $$d/$$base*; do \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f $(distdir)/$$relfile || \
cp -p $$file $(distdir)/$$relfile; \
done; \
done
mostlyclean-aminfo:
-rm -rf bison.aux bison.cp bison.cps bison.fn bison.ky bison.kys bison.log \
bison.pg bison.pgs bison.tmp bison.toc bison.tp bison.vr \
bison.dvi bison.pdf bison.ps bison.html
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
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"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-info
check-am: all-am
check: check-am
all-am: Makefile $(INFO_DEPS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
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-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am: $(DVIS)
html: html-am
html-am: $(HTMLS)
info: info-am
info-am: $(INFO_DEPS)
install-data-am: install-info-am install-man
install-exec-am:
install-info: install-info-am
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
$(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if (install-info --version && \
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
done; \
else : ; fi
install-man: install-man1
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti
pdf: pdf-am
pdf-am: $(PDFS)
ps: ps-am
ps-am: $(PSS)
uninstall-am: uninstall-info-am uninstall-man
uninstall-man: uninstall-man1
.PHONY: all all-am check check-am clean clean-generic clean-local \
dist-info distclean distclean-generic distdir dvi dvi-am html \
html-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-man1 install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-aminfo maintainer-clean-generic \
maintainer-clean-vti mostlyclean mostlyclean-aminfo \
mostlyclean-generic mostlyclean-vti pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-info-am uninstall-man \
uninstall-man1
clean-local:
rm -rf *.t2d
refcard.dvi: refcard.tex
tex refcard.tex
refcard.ps: refcard.dvi
# 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:

View File

@ -1,369 +0,0 @@
.TH BISON 1 local
.SH NAME
bison \- GNU Project parser generator (yacc replacement)
.SH SYNOPSIS
.B bison
[
.BI \-b " file-prefix"
] [
.BI \-\-file-prefix= file-prefix
] [
.B \-d
] [
.BI \-\-defines= defines-file
] [
.B \-g
] [
.BI \-\-graph= graph-file
] [
.B \-k
] [
.B \-\-token-table
] [
.B \-l
] [
.B \-\-no-lines
] [
.B \-n
] [
.B \-\-no-parser
] [
.BI \-o " outfile"
] [
.BI \-\-output-file= outfile
] [
.BI \-p " prefix"
] [
.BI \-\-name-prefix= prefix
] [
.B \-t
] [
.B \-\-debug
] [
.B \-v
] [
.B \-\-verbose
] [
.B \-V
] [
.B \-\-version
] [
.B \-y
] [
.B \-\-yacc
] [
.B \-h
] [
.B \-\-help
] [
.B \-\-fixed-output-files
]
file
.br
.B yacc
[
.I "similar options and operands"
]
.SH DESCRIPTION
.I Bison
is a parser generator in the style of
.IR yacc (1).
It should be upwardly compatible with input files designed
for
.IR yacc .
.PP
Input files should follow the
.I yacc
convention of ending in
.BR .y .
Unlike
.IR yacc ,
the generated files do not have fixed names, but instead use the prefix
of the input file.
Moreover, if you need to put
.I C++
code in the input file, you can end his name by a C++-like extension
(.ypp or .y++), then bison will follow your extension to name the
output file (.cpp or .c++).
For instance, a grammar description file named
.B parse.yxx
would produce the generated parser in a file named
.BR parse.tab.cxx ,
instead of
.IR yacc 's
.B y.tab.c
or old
.I Bison
version's
.BR parse.tab.c .
.PP
This description of the options that can be given to
.I bison
is adapted from the node
.B Invocation
in the
.B bison.texinfo
manual, which should be taken as authoritative.
.PP
.I Bison
supports both traditional single-letter options and mnemonic long
option names. Long option names are indicated with
.B \-\-
instead of
.BR \- .
Abbreviations for option names are allowed as long as they
are unique. When a long option takes an argument, like
.BR \-\-file-prefix ,
connect the option name and the argument with
.BR = .
.SS OPTIONS
.TP
.BI \-b " file-prefix"
.br
.ns
.TP
.BI \-\-file-prefix= file-prefix
Specify a prefix to use for all
.I bison
output file names. The names are
chosen as if the input file were named
\fIfile-prefix\fP\fB.c\fP.
.TP
.B \-d
.br
.ns
Write an extra output file containing macro definitions for the token
type names defined in the grammar and the semantic value type
.BR YYSTYPE ,
as well as a few
.B extern
variable declarations.
.sp
If the parser output file is named
.IB name .c
then this file
is named
\fIname\fP\fB.h\fP.
.sp
This output file is essential if you wish to put the definition of
.B yylex
in a separate source file, because
.B yylex
needs to be able to refer to token type codes and the variable
.BR yylval .
.TP
.BI \-\-defines= defines-file
The behavior of
.B \-\-defines
is the same than
.B \-d
option.
The only difference is that it has an optional argument which is
the name of the output filename.
.TP
.BI \-g
.br
.ns
Output a VCG definition of the LALR(1) grammar automaton computed by
Bison. If the grammar file is
.BR foo.y
, the VCG output file will be
.BR foo.vcg .
.TP
.BI \-\-graph= graph-file
The behavior of
.BI \-\-graph
is the same than
.BI \-g
option. The only difference is that it has an optional argument which
is the name of the output graph filename.
.TP
.B \-k
.br
.ns
.TP
.B \-\-token-table
This switch causes the
.IB name .tab.c
output to include a list of
token names in order by their token numbers; this is defined in the array
.IR yytname .
Also generated
are #defines for
.IR YYNTOKENS ,
.IR YYNNTS ,
.IR YYNRULES ,
and
.IR YYNSTATES .
.TP
.B \-l
.br
.ns
.TP
.B \-\-no-lines
Don't put any
.B #line
preprocessor commands in the parser file.
Ordinarily
.I bison
puts them in the parser file so that the C compiler
and debuggers will associate errors with your source file, the
grammar file. This option causes them to associate errors with the
parser file, treating it an independent source file in its own right.
.TP
.B \-n
.br
.ns
.TP
.B \-\-no-parser
Do not generate the parser code into the output; generate only
declarations. The generated
.IB name .tab.c
file will have only
constant declarations. In addition, a
.IB name .act
file is
generated containing a switch statement body containing all the
translated actions.
.TP
.BI \-o " outfile"
.br
.ns
.TP
.BI \-\-output-file= outfile
Specify the name
.I outfile
for the parser file.
.sp
The other output files' names are constructed from
.I outfile
as described under the
.B \-v
and
.B \-d
switches.
.TP
.BI \-p " prefix"
.br
.ns
.TP
.BI \-\-name-prefix= prefix
Rename the external symbols used in the parser so that they start with
.I prefix
instead of
.BR yy .
The precise list of symbols renamed is
.BR yyparse ,
.BR yylex ,
.BR yyerror ,
.BR yylval ,
.BR yychar ,
and
.BR yydebug .
.sp
For example, if you use
.BR "\-p c" ,
the names become
.BR cparse ,
.BR clex ,
and so on.
.TP
.B \-t
.br
.ns
.TP
.B \-\-debug
In the parser file, define the macro
.B YYDEBUG
to 1 if it is not already defined,
so that the debugging facilities are compiled.
.TP
.B \-v
.br
.ns
.TP
.B \-\-verbose
Write an extra output file containing verbose descriptions of the
parser states and what is done for each type of look-ahead token in
that state.
.sp
This file also describes all the conflicts, both those resolved by
operator precedence and the unresolved ones.
.sp
The file's name is made by removing
.B .tab.c
or
.B .c
from the parser output file name, and adding
.B .output
instead.
.sp
Therefore, if the input file is
.BR foo.y ,
then the parser file is called
.B foo.tab.c
by default. As a consequence, the verbose
output file is called
.BR foo.output .
.TP
.B \-V
.br
.ns
.TP
.B \-\-version
Print the version number of
.I bison
and exit.
.TP
.B \-h
.br
.ns
.TP
.B \-\-help
Print a summary of the options to
.I bison
and exit.
.TP
.B \-y
.br
.ns
.TP
.B \-\-yacc
.br
.ns
.TP
.B \-\-fixed-output-files
Equivalent to
.BR "\-o y.tab.c" ;
the parser output file is called
.BR y.tab.c ,
and the other outputs are called
.B y.output
and
.BR y.tab.h .
The purpose of this switch is to imitate
.IR yacc 's
output file name conventions.
Thus, the following shell script can substitute for
.I yacc
and is often installed as
.IR yacc :
.sp
.RS
.ft B
bison \-y "$@"
.ft R
.sp
.RE
.SH SEE ALSO
.IR yacc (1)
.br
The
.IR "Bison Reference Manual" ,
included as the file
.B bison.texinfo
in the
.I bison
source distribution.
.SH DIAGNOSTICS
Self explanatory.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,452 +0,0 @@
@node GNU Free Documentation License
@appendixsec GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@center Version 1.2, November 2002
@display
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
PostScript or @acronym{PDF} produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
@end enumerate
@page
@appendixsubsec ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with...Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:

View File

@ -1,392 +0,0 @@
@node Copying
@unnumbered GNU GENERAL PUBLIC LICENSE
@center Version 2, June 1991
@c This file is intended to be included in another file.
@display
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@unnumberedsec Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software---to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
@iftex
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end iftex
@ifinfo
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end ifinfo
@enumerate 0
@item
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The ``Program'', below,
refers to any such program or work, and a ``work based on the Program''
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term ``modification''.) Each licensee is addressed as ``you''.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
@item
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
@item
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
@enumerate a
@item
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
@item
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
@item
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
@end enumerate
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
@item
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
@enumerate a
@item
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
@item
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
@item
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
@end enumerate
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
@item
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
@item
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
@item
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
@item
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
@item
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
@item
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and ``any
later version'', you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
@item
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
@iftex
@heading NO WARRANTY
@end iftex
@ifinfo
@center NO WARRANTY
@end ifinfo
@item
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
@item
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
@end enumerate
@iftex
@heading END OF TERMS AND CONDITIONS
@end iftex
@ifinfo
@center END OF TERMS AND CONDITIONS
@end ifinfo
@page
@unnumberedsec Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the ``copyright'' line and a pointer to where the full notice is found.
@smallexample
@var{one line to give the program's name and a brief idea of what it does.}
Copyright (C) @var{yyyy} @var{name of author}
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@end smallexample
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
@smallexample
Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@end smallexample
The hypothetical commands @samp{show w} and @samp{show c} should show
the appropriate parts of the General Public License. Of course, the
commands you use may be called something other than @samp{show w} and
@samp{show c}; they could even be mouse-clicks or menu items---whatever
suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the program, if
necessary. Here is a sample; alter the names:
@example
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
@var{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
@end example
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -1,512 +0,0 @@
% Bison Quick Reference
%**start of header
\newcount\columnsperpage
% This file can be printed with 1 or 2 columns per page (see below).
% Specify how many you want here. Nothing else needs to be changed
% unless you are maintaining the documentation.
% For printing reference cards to use in books, specify one column
% per page and reduce to 80%.
% Note that if columnsperpage is set to 2, there will be a few overfull
% boxes, but they are not serious. Just uncomment \finalout.
\columnsperpage=1
% comment out this line if you want page numbers to appear.
\nopagenumbers
\def\finalout{\overfullrule=0pt}
%\finalout
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
%
% This file is part of Bison.
%
% Bison is free software; you can redistribute them and/or modify them
% 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.
%
% Bison 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 either Flex or Bison; see the file COPYING. If not, write
% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
% Boston, MA 02110-1301, USA.
%
% This file is intended to be processed by plain TeX (TeX82).
%
% The final reference card has two columns:
% This file can be used to produce it in any of three ways:
% 1 column per page
% produces two separate pages, each of which needs to be reduced to 80%.
% This gives the best resolution.
% 2 columns per page
% produces a single page.
% You will still need to cut and paste.
% Which mode to use is controlled by setting \columnsperpage above.
%
% Authors:
% Brendan Kehoe
% UUCP: widener!brendan
% Internet: brendan@cs.widener.edu
%
% Gavin Nicol
% Internet: nick@nsis.cl.co.jp
%
% This refcard format was created by Steve Gildea.
%
% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
% for their many good ideas.
% We only change the following to change the version numbers and
% such.
\def\bisonversion{1.31} % the bison version
\def\refcardversion{0.5} % reference card version
\def\month{November} % month
\def\year{2001} % year
\def\version{\month\ \year, Bison Refcard Version \refcardversion}
% for copyright notices
\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
\def\medium{\mediumfont\textfont2=\mediumsy\baselineskip=.8\baselineskip}
\def\copyrightnotice{
\vskip .15ex plus .25 fill
\begingroup\medium
\centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
\vskip .2\baselineskip
\centerline{\version}
\vskip .2\baselineskip
\centerline{designed by Brendan Kehoe and Gavin Nicol}
\vskip .2\baselineskip
\centerline{for Bison \bisonversion}
Permission is granted to make and distribute copies of this card
provided the copyright notice and this permission notice
are preserved on all copies.
\vskip .2\baselineskip
For information, write to the:
\vskip .2\baselineskip
\centerline{Free Software Foundation, Inc.}
\vskip .2\baselineskip
\centerline{51 Franklin Street, Fifth Floor}
\vskip .2\baselineskip
\centerline{Boston, MA 02110-1301 USA}
\endgroup}
%%%% smallcopyrightnotice for two column printing on one page.
\def\smallcopyrightnotice{
\vskip .15ex plus .25 fill
\begingroup\small
\centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
\vskip .2\baselineskip
\centerline{\version}
\vskip .2\baselineskip
\centerline{designed by Brendan Kehoe and Gavin Nicol}
\vskip .2\baselineskip
\centerline{for Bison \bisonversion}
Permission is granted to make and distribute copies of this card
provided the copyright notice and this permission notice
are preserved on all copies.
\vskip .2\baselineskip
For information, write to the:
\vskip .2\baselineskip
\centerline{Free Software Foundation, Inc.}
\vskip .2\baselineskip
\centerline{51 Franklin Street, Fifth Floor}
\vskip .2\baselineskip
\centerline{Boston, MA 02110-1301 USA}
\endgroup}
% make \bye not \outer so that the \def\bye in the \else clause below
% can be scanned without complaint.
\def\bye{\par\vfill\supereject\end}
\newdimen\intercolumnskip
\newbox\columna
\newbox\columnb
\def\ncolumns{\the\columnsperpage}
\message{[\ncolumns\space
column\if 1\ncolumns\else s\fi\space per page]}
\def\scaledmag#1{ scaled \magstep #1}
% This multi-way format was designed by Stephen Gildea
% October 1986.
\if 1\ncolumns
\hsize 4in
\vsize 10in
% We want output .3 inch *from top of paper edge*; i.e. -.7in from TeX default
\voffset -.7in % Comment out for xdvi viewing; include for printing.
\font\titlefont=\fontname\tenbf \scaledmag3
\font\headingfont=\fontname\tenbf \scaledmag2
\font\smallfont=cmr6
\font\smallsy=cmsy6
\font\mediumfont=cmr10
\font\mediumsy=cmsy10
% two lines below commented out in Yet Another Attempt to eliminate
% page numbers from the output.
\footline{\hss}
% \footline{\hss\folio}
\def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
\else
\hsize 3.2in
\vsize 7.95in
\hoffset -.75in
\voffset -.745in
\font\titlefont=cmbx10 \scaledmag2
\font\headingfont=cmbx10 \scaledmag1
\font\smallfont=cmr6
\font\smallsy=cmsy6
\font\eightrm=cmr8
\font\eightbf=cmbx8
\font\eightit=cmti8
\font\eighttt=cmtt8
\font\eightsy=cmsy8
\textfont0=\eightrm
\textfont2=\eightsy
\def\rm{\eightrm}
\def\bf{\eightbf}
\def\it{\eightit}
\def\tt{\eighttt}
%%%% Reduce skip from .8 to .75 to permit printing on two pages.
\normalbaselineskip=.75\normalbaselineskip
\normallineskip=.75\normallineskip
\normallineskiplimit=.75\normallineskiplimit
\normalbaselines\rm %make definitions take effect
\if 2\ncolumns
\let\maxcolumn=b
\footline{\hss\rm\folio\hss}
\def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
\font\mediumfont=cmr10
\font\mediumsy=cmsy10
% Leave 3 column code here in case size increases.
\else \if 3\ncolumns
\let\maxcolumn=c
\nopagenumbers
\font\mediumfont=cmr10
\font\mediumsy=cmsy10
\else
\errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
\errmessage{Illegal number of columns per page}
\fi\fi
\intercolumnskip=.46in
\def\abc{a}
\output={%
% This next line is useful when designing the layout.
%\immediate\write16{Column \folio\abc\space starts with \firstmark}
\if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
\else\if a\abc
\global\setbox\columna\columnbox \global\def\abc{b}
%% in case we never use \columnb (two-column mode)
\global\setbox\columnb\hbox to -\intercolumnskip{}
\else
\global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
\def\multicolumnformat{\shipout\vbox{\makeheadline
\hbox{\box\columna\hskip\intercolumnskip
\box\columnb\hskip\intercolumnskip\columnbox}
\makefootline}\advancepageno}
\def\columnbox{\leftline{\pagebody}}
\def\bye{\par\vfill\supereject
\if a\abc \else\null\vfill\eject\fi
\if a\abc \else\null\vfill\eject\fi
\end}
\fi
% we won't be using math mode much, so redefine some of the characters
% we might want to talk about
\catcode`\^=12
\catcode`\_=12
\chardef\\=`\\
\chardef\{=`\{
\chardef\}=`\}
\hyphenation{mini-buf-fer}
\parindent 0pt
% \parskip 1ex plus .5ex minus .5ex
\parskip 0.5ex plus .25ex minus .25ex
\outer\def\newcolumn{\vfill\eject}
\outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
\outer\def\section#1{\par\filbreak
\vskip 1.5ex plus 1ex minus 1ex {\headingfont #1}\mark{#1}%
\vskip 1ex plus .5ex minus 0.75ex}
\newdimen\keyindent
\def\beginindentedkeys{\keyindent=1em}
\def\endindentedkeys{\keyindent=0em}
\endindentedkeys
\def\paralign{\vskip\parskip\halign}
\def\<#1>{$\langle${\rm #1}$\rangle$}
\def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
\def\beginexample{\par\leavevmode\begingroup
\obeylines\obeyspaces\parskip0pt\tt}
{\obeyspaces\global\let =\ }
\def\endexample{\endgroup}
\def\begincexample{%
\par\leavevmode\begingroup%
\obeylines\obeyspaces%
% bpk--added indentation
\advance\leftskip.25truein
% \parskip0pt%
\tt}
{\obeyspaces\global\let =\ }
\def\endcexample{\endgroup}
%%%%% Prime definition of key; redefined below to prevent overful hboxes
\def\key#1#2{\leavevmode\hbox to \hsize
{\vtop {\hsize=.67\hsize \rightskip=1em #1}
\kbd{#2}\hfil}}
\newbox\metaxbox
\setbox\metaxbox\hbox{\kbd{M-x }}
\newdimen\metaxwidth
\metaxwidth=\wd\metaxbox
\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
{\hskip\keyindent\relax#1\hfil}%
\hskip -\metaxwidth minus 1fil
\kbd{#2}\hfil}}
\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
&\kbd{#3}\quad\cr}
%**end of header
% ************
% ** BISON **
% ************
\title{Bison Quick Reference}
\section{Starting Bison}
%***********************
To use Bison, type: \kbd{bison {\it filename}}
Options can be used as: \kbd{bison {\it options} {\it filename}}
\section{Command Line Options}
%*****************************
\key{Display usage information.} {-h}
\key{Display version information.} {-V}
\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{Specify the output file.} {-o {\it filename}}
\key{Debug or {\it trace} mode.} {-t}
\key{Verbose description of the parser.} {-v}
\key{Emulate {\tt yacc} (generate {\tt y.tab.*} files).} {-y}
\vskip .10truein
{\bf Note:} The token and {\tt YYSTYPE} definitions are generated
to a file called {\tt y.tab.h} if the {\tt -y} option is used,
otherwise it will have the format {\tt {\it name}.tab.h}, where
{\it name} is the leading part of the parser definition filename.
\section{Definitions}
%********************
\key{Declare a terminal symbol.}{\%token <{\it t\/}>
{\it n}}
\key{Declare a terminal symbol, and define its association.}
{{\it association} <{\it t\/}> {\it n}}
\vskip .2\baselineskip
\key{Generate a reentrant (pure) parser.}
{\%pure_parser}
\key{Define the union of all data types used in the parser.}
{\%union\{{\it field list}\} }
\vskip .2\baselineskip
\key{Tell {\tt bison} where to start parsing.}
{\%start {\it m}}
\key{Tell {\tt bison} the data type of symbols.}
{\%type <{\it t\/}> {\it s1}\dots{\it sn}}
\vskip .10truein
In the above, {\it t} is a {\it type} defined in the {\tt \%union}
definition, {\it n} is a {\it terminal} symbol name, {\it m} is a
{\it non-terminal} symbol name, and {\it association} can be one of
{\tt \%left}, {\tt \%right}, or {\tt \%nonassoc}.
\vskip .10truein
The {\tt <{\it t\/}>} after {\tt \%token, \%left, \%right} and {\tt
\%nonassoc} is optional. Additionally, precedence may be overridden
in the rules with {\tt \%prec} commands.
\section{Parser Definition Files}
%*********************************
The general form for a parser definition is:
\begincexample
\{\%
/* Initial C code. */
\%\}
{\it Token and type definitions}
\%\%
Rule definition 1
\vdots
Rule definition {\it n}
\%\%
/* Other C code. */
\endcexample
% Decrease standard baselineskip for the second page
\baselineskip = .9\baselineskip
\section {Rule definitions}
%**************************
Rules take the form:
\vskip -\baselineskip
\beginexample
non-terminal : {\it statement} 1
| {\it statement} 2
\vdots
| {\it statement n}
;
\endexample
Where {\it statements} can be either empty, or contain
a mixture of C code (enclosed in {\tt \{...\}}), and the
symbols that make up the non-terminal. For example:
\vskip -\baselineskip
\beginexample
expression : number '$+$' number \{ \$\$ $=$ \$1 $+$ \$3 \}
| number '$-$' number \{ \$\$ $=$ \$1 $-$ \$3 \}
| number '$/$' number \{ \$\$ $=$ \$1 $/$ \$3 \}
| number '$*$' number \{ \$\$ $=$ \$1 $*$ \$3 \}
;
\endexample
For altering the precedence of a symbol use:
\vskip -\baselineskip
\beginexample
\%prec name
\endexample
For example:
\vskip -\baselineskip
\beginexample
foo : gnu bar gnu \%prec bar
;
\endexample
\section{Grammar Variables and Symbols}
%**************************************
\key{Recognize an error \& continue parsing.}{error}
\key{Access data associated with a symbol.} {\$\$, \$0\dots\${\it n}}
\key{Access a field of the data union.} {\$\$.{\it t},
\$0.{\it t}\dots\${\it n}.{\it t}}
\key{Access symbol's location.} {@\$, @0\dots@{\it n}}
\key{Access data's line location.} {@{\it x}.{\it line\_spec}}
\key{Access data's column location.} {@{\it x}.{\it column\_spec}}
\vskip .10truein
%
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
first_line} and {\tt last_line}, and {\it column\_spec} is specified
as either {\tt first_column} or {\tt last_column}.
\section {Variables and Types}
%*****************************
\key{Current look ahead token.} {yychar}
\key{Debug mode flag.} {yydebug}
\key{Data associated with the current token.} {yylval}
\key{Source position of current token.} {yylloc}
\key{Number of errors encountered.} {yynerrs}
\key{Position information type.} {YYLTYPE}
\key{Data type associated with symbols.} {YYSTYPE}
\section {Functions}
%*******************
% Redefine to prevent overfull hboxes
\def\key#1#2{\leavevmode\hbox to \hsize
{\vtop {\hsize=.625\hsize \rightskip=1em #1}
\kbd{#2}\hfil}}
\key{User defined error handler.} {int yyerror(char *)}
\key{User defined lexical analyzer.} {int yylex()}
\key{The grammar parser.} {int yyparse()}
% Return to previous size
\def\key#1#2{\leavevmode\hbox to \hsize
{\vtop {\hsize=.67\hsize \rightskip=1em #1}
\kbd{#2}\hfil}}
\section{Macros}
%***************
\key{Quit parsing immediately. Return 1.} {YYABORT}
\key{Quit parsing immediately. Return 0.} {YYACCEPT}
\key{Pretend a syntax error occurred.} {YYERROR}
\key{Value in {\tt yychar} if no look-ahead token.} {YYEMPTY}
\key{Clear previous look ahead token.} {yyclearin}
\key{Recover normally from an error.} {yyerrok}
% **************
% ** The end **
% **************
\vskip \baselineskip
\if 1\ncolumns
\copyrightnotice
\else
\smallcopyrightnotice
\fi
\bye
% Local variables:
% compile-command: "tex refcard"
% End:

View File

@ -1,4 +0,0 @@
@set UPDATED 30 May 2006
@set UPDATED-MONTH May 2006
@set EDITION 2.3
@set VERSION 2.3

View File

@ -1,4 +0,0 @@
@set UPDATED 30 May 2006
@set UPDATED-MONTH May 2006
@set EDITION 2.3
@set VERSION 2.3

View File

@ -1,46 +0,0 @@
SubDir HAIKU_TOP src bin bison lib ;
SubDirCcFlags -DHAVE_CONFIG_H ;
SubDirSysHdrs $(SUBDIR) ;
SubDirSysHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ;
StaticLibrary libbison.a :
abitset.c
# alloca.c
argmatch.c
basename.c
bitset.c
bitset_stats.c
bitsetv-print.c
bitsetv.c
dirname.c
dup-safer.c
ebitset.c
error.c
exitfail.c
fd-safer.c
fopen-safer.c
get-errno.c
getopt.c
getopt1.c
hard-locale.c
hash.c
lbitset.c
malloc.c
mbswidth.c
obstack.c
quote.c
quotearg.c
stpcpy.c
stripslash.c
strndup.c
strnlen.c
strverscmp.c
subpipe.c
timevar.c
vbitset.c
xmalloc.c
xalloc-die.c
xstrndup.c
;

View File

@ -1,53 +0,0 @@
## Copyright (C) 2001, 2002, 2003, 2004 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 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., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
AM_CFLAGS = $(WARNING_CFLAGS)
BUILT_SOURCES =
EXTRA_DIST =
MOSTLYCLEANFILES =
lib_LIBRARIES = $(YACC_LIBRARY)
EXTRA_LIBRARIES = liby.a
noinst_LIBRARIES = libbison.a
liby_a_SOURCES = main.c yyerror.c
libbison_a_SOURCES = $(lib_SOURCES)
lib_SOURCES = \
get-errno.h get-errno.c \
subpipe.h subpipe.c \
$(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
# Implementation of bitsets
bitsets_sources = \
abitset.c abitset.h bbitset.h bitset.c bitset.h bitset_stats.c \
bitset_stats.h bitsetv.c bitsetv.h ebitset.c ebitset.h lbitset.c \
lbitset.h libiberty.h vbitset.c vbitset.h
# Additional bitset operations.
additional_bitsets_sources = \
bitsetv-print.h bitsetv-print.c
# timevars, stolen from GCC.
timevars_sources = \
timevar.h timevar.c timevar.def
libbison_a_LIBADD = $(LIBOBJS) $(ALLOCA)
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
include gnulib.mk

View File

@ -1,623 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/gnulib.mk dirname.c dirname.h dup-safer.c error.c \
error.h exitfail.c exitfail.h fd-safer.c fopen-safer.c \
getopt.c getopt1.c hard-locale.c hard-locale.h hash.c hash.h \
malloc.c obstack.c obstack.h pipe-safer.c quote.c quote.h \
quotearg.c quotearg.h stdio--.h stdio-safer.h stpcpy.c \
strdup.c strdup.h strerror.c strndup.c strndup.h strnlen.c \
strnlen.h strtol.c strtoul.c strverscmp.c strverscmp.h \
unistd--.h unistd-safer.h unlocked-io.h xalloc.h xmalloc.c
subdir = lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/bison-i18n.m4 \
$(top_srcdir)/m4/c-working.m4 $(top_srcdir)/m4/cxx.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dmalloc.m4 \
$(top_srcdir)/m4/dos.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext_gl.m4 \
$(top_srcdir)/m4/gnulib.m4 $(top_srcdir)/m4/hard-locale.m4 \
$(top_srcdir)/m4/hash.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/inttypes_h_gl.m4 \
$(top_srcdir)/m4/lib-ld_gl.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix_gl.m4 $(top_srcdir)/m4/m4.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/nls.m4 \
$(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/onceonly.m4 \
$(top_srcdir)/m4/po_gl.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint_h_gl.m4 \
$(top_srcdir)/m4/stdio-safer.m4 $(top_srcdir)/m4/stpcpy.m4 \
$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
$(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
$(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoul.m4 \
$(top_srcdir)/m4/strverscmp.m4 $(top_srcdir)/m4/subpipe.m4 \
$(top_srcdir)/m4/timevar.m4 $(top_srcdir)/m4/uintmax_t_gl.m4 \
$(top_srcdir)/m4/ulonglong_gl.m4 \
$(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
$(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/warning.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xstrndup.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)"
libLIBRARIES_INSTALL = $(INSTALL_DATA)
LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
libbison_a_AR = $(AR) $(ARFLAGS)
am__DEPENDENCIES_1 = @LIBOBJS@
am__objects_1 = abitset.$(OBJEXT) bitset.$(OBJEXT) \
bitset_stats.$(OBJEXT) bitsetv.$(OBJEXT) ebitset.$(OBJEXT) \
lbitset.$(OBJEXT) vbitset.$(OBJEXT)
am__objects_2 = bitsetv-print.$(OBJEXT)
am__objects_3 = timevar.$(OBJEXT)
am__objects_4 = get-errno.$(OBJEXT) subpipe.$(OBJEXT) $(am__objects_1) \
$(am__objects_2) $(am__objects_3) argmatch.$(OBJEXT) \
basename.$(OBJEXT) stripslash.$(OBJEXT) mbswidth.$(OBJEXT) \
xalloc-die.$(OBJEXT) xstrndup.$(OBJEXT)
am_libbison_a_OBJECTS = $(am__objects_4)
libbison_a_OBJECTS = $(am_libbison_a_OBJECTS)
liby_a_AR = $(AR) $(ARFLAGS)
liby_a_LIBADD =
am_liby_a_OBJECTS = main.$(OBJEXT) yyerror.$(OBJEXT)
liby_a_OBJECTS = $(am_liby_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libbison_a_SOURCES) $(liby_a_SOURCES)
DIST_SOURCES = $(libbison_a_SOURCES) $(liby_a_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOM4TE = @AUTOM4TE@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BISON_CXX_WORKS = @BISON_CXX_WORKS@
BISON_CXX_WORKS_FALSE = @BISON_CXX_WORKS_FALSE@
BISON_CXX_WORKS_TRUE = @BISON_CXX_WORKS_TRUE@
BISON_LOCALEDIR = @BISON_LOCALEDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GCC = @GCC@
GETOPT_H = @GETOPT_H@
GMSGFMT = @GMSGFMT@
HAVE__BOOL = @HAVE__BOOL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
O0CFLAGS = @O0CFLAGS@
O0CXXFLAGS = @O0CXXFLAGS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
UNISTD_H = @UNISTD_H@
USE_NLS = @USE_NLS@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
WARNING_CFLAGS = @WARNING_CFLAGS@
WARNING_CXXFLAGS = @WARNING_CXXFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
YACC_LIBRARY = @YACC_LIBRARY@
YACC_SCRIPT = @YACC_SCRIPT@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
aclocaldir = @aclocaldir@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AM_CFLAGS = $(WARNING_CFLAGS)
BUILT_SOURCES = $(GETOPT_H) $(STDBOOL_H) $(UNISTD_H)
EXTRA_DIST = getopt_.h getopt_int.h stdbool_.h
MOSTLYCLEANFILES = getopt.h getopt.h-t stdbool.h stdbool.h-t unistd.h
lib_LIBRARIES = $(YACC_LIBRARY)
EXTRA_LIBRARIES = liby.a
noinst_LIBRARIES = libbison.a
liby_a_SOURCES = main.c yyerror.c
libbison_a_SOURCES = $(lib_SOURCES)
# This file is generated automatically by "bootstrap".
# This is for those projects which use "gettextize --intl" to put a source-code
# copy of libintl into their package. In such projects, every Makefile.am needs
# -I$(top_builddir)/intl, so that <libintl.h> can be found in this directory.
# For the Makefile.ams in other directories it is the maintainer's
# responsibility; for the one from gnulib we do it here.
# This option has no effect when the user disables NLS (because then the intl
# directory contains no libintl.h file) or when the project does not use
# "gettextize --intl".
# (commented out by bootstrap) AM_CPPFLAGS += -I$(top_builddir)/intl
lib_SOURCES = get-errno.h get-errno.c subpipe.h subpipe.c \
$(bitsets_sources) $(additional_bitsets_sources) \
$(timevars_sources) argmatch.h argmatch.c basename.c \
stripslash.c exit.h gettext.h mbswidth.h mbswidth.c stpcpy.h \
verify.h xalloc-die.c xstrndup.h xstrndup.c
# Implementation of bitsets
bitsets_sources = \
abitset.c abitset.h bbitset.h bitset.c bitset.h bitset_stats.c \
bitset_stats.h bitsetv.c bitsetv.h ebitset.c ebitset.h lbitset.c \
lbitset.h libiberty.h vbitset.c vbitset.h
# Additional bitset operations.
additional_bitsets_sources = \
bitsetv-print.h bitsetv-print.c
# timevars, stolen from GCC.
timevars_sources = \
timevar.h timevar.c timevar.def
libbison_a_LIBADD = $(LIBOBJS) $(ALLOCA)
libbison_a_DEPENDENCIES = $(libbison_a_LIBADD)
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu lib/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
@$(POST_INSTALL)
@list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
p=$(am__strip_dir) \
echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \
$(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \
else :; fi; \
done
uninstall-libLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \
rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLIBRARIES:
-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
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
liby.a: $(liby_a_OBJECTS) $(liby_a_DEPENDENCIES)
-rm -f liby.a
$(liby_a_AR) liby.a $(liby_a_OBJECTS) $(liby_a_LIBADD)
$(RANLIB) liby.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dirname.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dup-safer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/error.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/exitfail.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fd-safer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fopen-safer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/hard-locale.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/hash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/malloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/obstack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pipe-safer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/quote.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/quotearg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/stpcpy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strdup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strndup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strnlen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtol.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strverscmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/xmalloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abitset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argmatch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitset_stats.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitsetv-print.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitsetv.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ebitset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get-errno.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbitset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbswidth.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subpipe.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timevar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vbitset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yyerror.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
uninstall-info-am:
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
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; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(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 "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_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 tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
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"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
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: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf $(DEPDIR) ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-libLIBRARIES
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf $(DEPDIR) ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-libLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLIBRARIES clean-noinstLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-libLIBRARIES install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-libLIBRARIES
# We need the following in order to create <getopt.h> when the system
# doesn't have one that works with the given compiler.
getopt.h: getopt_.h
cp $(srcdir)/getopt_.h $@-t
mv $@-t $@
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool_.h
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t
mv $@-t $@
# We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one.
unistd.h:
echo '/* Empty placeholder for $@. */' >$@
# 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:

View File

@ -1,828 +0,0 @@
/* Array bitsets.
Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "abitset.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
/* This file implements fixed size bitsets stored as an array
of words. Any unused bits in the last word must be zero. */
#define ABITSET_N_WORDS(N) (((N) + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
#define ABITSET_WORDS(X) ((X)->a.words)
static bitset_bindex
abitset_resize (bitset src, bitset_bindex size)
{
/* These bitsets have a fixed size. */
if (BITSET_SIZE_ (src) != size)
abort ();
return size;
}
/* Find list of up to NUM bits set in BSET starting from and including
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
abitset_small_list (bitset src, bitset_bindex *list,
bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex count;
bitset_windex size;
bitset_word word;
word = ABITSET_WORDS (src)[0];
/* Short circuit common case. */
if (!word)
return 0;
size = BITSET_SIZE_ (src);
bitno = *next;
if (bitno >= size)
return 0;
word >>= bitno;
/* If num is 1, we could speed things up with a binary search
of the word of interest. */
if (num >= BITSET_WORD_BITS)
{
for (count = 0; word; bitno++)
{
if (word & 1)
list[count++] = bitno;
word >>= 1;
}
}
else
{
for (count = 0; word; bitno++)
{
if (word & 1)
{
list[count++] = bitno;
if (count >= num)
{
bitno++;
break;
}
}
word >>= 1;
}
}
*next = bitno;
return count;
}
/* Set bit BITNO in bitset DST. */
static void
abitset_set (bitset dst ATTRIBUTE_UNUSED, bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always hit
the cache. It is likely someone is trying to access outside the
bounds of the bitset. */
abort ();
}
/* Reset bit BITNO in bitset DST. */
static void
abitset_reset (bitset dst ATTRIBUTE_UNUSED,
bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always hit
the cache. It is likely someone is trying to access outside the
bounds of the bitset. Since the bit is zero anyway, let it pass. */
}
/* Test bit BITNO in bitset SRC. */
static bool
abitset_test (bitset src ATTRIBUTE_UNUSED,
bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always
hit the cache. */
return false;
}
/* Find list of up to NUM bits set in BSET in reverse order, starting
from and including NEXT and store in array LIST. Return with
actual number of bits found and with *NEXT indicating where search
stopped. */
static bitset_bindex
abitset_list_reverse (bitset src, bitset_bindex *list,
bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex rbitno;
bitset_bindex count;
bitset_windex windex;
unsigned int bitcnt;
bitset_bindex bitoff;
bitset_word *srcp = ABITSET_WORDS (src);
bitset_bindex n_bits = BITSET_SIZE_ (src);
rbitno = *next;
/* If num is 1, we could speed things up with a binary search
of the word of interest. */
if (rbitno >= n_bits)
return 0;
count = 0;
bitno = n_bits - (rbitno + 1);
windex = bitno / BITSET_WORD_BITS;
bitcnt = bitno % BITSET_WORD_BITS;
bitoff = windex * BITSET_WORD_BITS;
do
{
bitset_word word;
word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);
for (; word; bitcnt--)
{
if (word & BITSET_MSB)
{
list[count++] = bitoff + bitcnt;
if (count >= num)
{
*next = n_bits - (bitoff + bitcnt);
return count;
}
}
word <<= 1;
}
bitoff -= BITSET_WORD_BITS;
bitcnt = BITSET_WORD_BITS - 1;
}
while (windex--);
*next = n_bits - (bitoff + 1);
return count;
}
/* Find list of up to NUM bits set in BSET starting from and including
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
abitset_list (bitset src, bitset_bindex *list,
bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex count;
bitset_windex windex;
bitset_bindex bitoff;
bitset_windex size = src->b.csize;
bitset_word *srcp = ABITSET_WORDS (src);
bitset_word word;
bitno = *next;
count = 0;
if (!bitno)
{
/* Many bitsets are zero, so make this common case fast. */
for (windex = 0; windex < size && !srcp[windex]; windex++)
continue;
if (windex >= size)
return 0;
/* If num is 1, we could speed things up with a binary search
of the current word. */
bitoff = windex * BITSET_WORD_BITS;
}
else
{
if (bitno >= BITSET_SIZE_ (src))
return 0;
windex = bitno / BITSET_WORD_BITS;
bitno = bitno % BITSET_WORD_BITS;
if (bitno)
{
/* Handle the case where we start within a word.
Most often, this is executed with large bitsets
with many set bits where we filled the array
on the previous call to this function. */
bitoff = windex * BITSET_WORD_BITS;
word = srcp[windex] >> bitno;
for (bitno = bitoff + bitno; word; bitno++)
{
if (word & 1)
{
list[count++] = bitno;
if (count >= num)
{
*next = bitno + 1;
return count;
}
}
word >>= 1;
}
windex++;
}
bitoff = windex * BITSET_WORD_BITS;
}
for (; windex < size; windex++, bitoff += BITSET_WORD_BITS)
{
if (!(word = srcp[windex]))
continue;
if ((count + BITSET_WORD_BITS) < num)
{
for (bitno = bitoff; word; bitno++)
{
if (word & 1)
list[count++] = bitno;
word >>= 1;
}
}
else
{
for (bitno = bitoff; word; bitno++)
{
if (word & 1)
{
list[count++] = bitno;
if (count >= num)
{
*next = bitno + 1;
return count;
}
}
word >>= 1;
}
}
}
*next = bitoff;
return count;
}
/* Ensure that any unused bits within the last word are clear. */
static inline void
abitset_unused_clear (bitset dst)
{
unsigned int last_bit;
last_bit = BITSET_SIZE_ (dst) % BITSET_WORD_BITS;
if (last_bit)
ABITSET_WORDS (dst)[dst->b.csize - 1] &=
((bitset_word) 1 << last_bit) - 1;
}
static void
abitset_ones (bitset dst)
{
bitset_word *dstp = ABITSET_WORDS (dst);
size_t bytes;
bytes = sizeof (bitset_word) * dst->b.csize;
memset (dstp, -1, bytes);
abitset_unused_clear (dst);
}
static void
abitset_zero (bitset dst)
{
bitset_word *dstp = ABITSET_WORDS (dst);
size_t bytes;
bytes = sizeof (bitset_word) * dst->b.csize;
memset (dstp, 0, bytes);
}
static bool
abitset_empty_p (bitset dst)
{
bitset_windex i;
bitset_word *dstp = ABITSET_WORDS (dst);
for (i = 0; i < dst->b.csize; i++)
if (dstp[i])
return false;
return true;
}
static void
abitset_copy1 (bitset dst, bitset src)
{
bitset_word *srcp = ABITSET_WORDS (src);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
if (srcp == dstp)
return;
memcpy (dstp, srcp, sizeof (bitset_word) * size);
}
static void
abitset_not (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = ~(*srcp++);
abitset_unused_clear (dst);
}
static bool
abitset_equal_p (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
if (*srcp++ != *dstp++)
return false;
return true;
}
static bool
abitset_subset_p (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++, srcp++)
if (*dstp != (*srcp | *dstp))
return false;
return true;
}
static bool
abitset_disjoint_p (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
if (*srcp++ & *dstp++)
return false;
return true;
}
static void
abitset_and (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = *src1p++ & *src2p++;
}
static bool
abitset_and_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bool changed = false;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++)
{
bitset_word tmp = *src1p++ & *src2p++;
if (*dstp != tmp)
{
changed = true;
*dstp = tmp;
}
}
return changed;
}
static void
abitset_andn (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = *src1p++ & ~(*src2p++);
}
static bool
abitset_andn_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bool changed = false;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++)
{
bitset_word tmp = *src1p++ & ~(*src2p++);
if (*dstp != tmp)
{
changed = true;
*dstp = tmp;
}
}
return changed;
}
static void
abitset_or (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = *src1p++ | *src2p++;
}
static bool
abitset_or_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bool changed = false;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++)
{
bitset_word tmp = *src1p++ | *src2p++;
if (*dstp != tmp)
{
changed = true;
*dstp = tmp;
}
}
return changed;
}
static void
abitset_xor (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = *src1p++ ^ *src2p++;
}
static bool
abitset_xor_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bool changed = false;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++)
{
bitset_word tmp = *src1p++ ^ *src2p++;
if (*dstp != tmp)
{
changed = true;
*dstp = tmp;
}
}
return changed;
}
static void
abitset_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *src3p = ABITSET_WORDS (src3);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = (*src1p++ & *src2p++) | *src3p++;
}
static bool
abitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bool changed = false;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *src3p = ABITSET_WORDS (src3);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++)
{
bitset_word tmp = (*src1p++ & *src2p++) | *src3p++;
if (*dstp != tmp)
{
changed = true;
*dstp = tmp;
}
}
return changed;
}
static void
abitset_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *src3p = ABITSET_WORDS (src3);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = (*src1p++ & ~(*src2p++)) | *src3p++;
}
static bool
abitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bool changed = false;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *src3p = ABITSET_WORDS (src3);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++)
{
bitset_word tmp = (*src1p++ & ~(*src2p++)) | *src3p++;
if (*dstp != tmp)
{
changed = true;
*dstp = tmp;
}
}
return changed;
}
static void
abitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *src3p = ABITSET_WORDS (src3);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++)
*dstp++ = (*src1p++ | *src2p++) & *src3p++;
}
static bool
abitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bool changed = false;
bitset_word *src1p = ABITSET_WORDS (src1);
bitset_word *src2p = ABITSET_WORDS (src2);
bitset_word *src3p = ABITSET_WORDS (src3);
bitset_word *dstp = ABITSET_WORDS (dst);
bitset_windex size = dst->b.csize;
for (i = 0; i < size; i++, dstp++)
{
bitset_word tmp = (*src1p++ | *src2p++) & *src3p++;
if (*dstp != tmp)
{
changed = true;
*dstp = tmp;
}
}
return changed;
}
static void
abitset_copy (bitset dst, bitset src)
{
if (BITSET_COMPATIBLE_ (dst, src))
abitset_copy1 (dst, src);
else
bitset_copy_ (dst, src);
}
/* Vector of operations for single word bitsets. */
struct bitset_vtable abitset_small_vtable = {
abitset_set,
abitset_reset,
bitset_toggle_,
abitset_test,
abitset_resize,
bitset_size_,
bitset_count_,
abitset_empty_p,
abitset_ones,
abitset_zero,
abitset_copy,
abitset_disjoint_p,
abitset_equal_p,
abitset_not,
abitset_subset_p,
abitset_and,
abitset_and_cmp,
abitset_andn,
abitset_andn_cmp,
abitset_or,
abitset_or_cmp,
abitset_xor,
abitset_xor_cmp,
abitset_and_or,
abitset_and_or_cmp,
abitset_andn_or,
abitset_andn_or_cmp,
abitset_or_and,
abitset_or_and_cmp,
abitset_small_list,
abitset_list_reverse,
NULL,
BITSET_ARRAY
};
/* Vector of operations for multiple word bitsets. */
struct bitset_vtable abitset_vtable = {
abitset_set,
abitset_reset,
bitset_toggle_,
abitset_test,
abitset_resize,
bitset_size_,
bitset_count_,
abitset_empty_p,
abitset_ones,
abitset_zero,
abitset_copy,
abitset_disjoint_p,
abitset_equal_p,
abitset_not,
abitset_subset_p,
abitset_and,
abitset_and_cmp,
abitset_andn,
abitset_andn_cmp,
abitset_or,
abitset_or_cmp,
abitset_xor,
abitset_xor_cmp,
abitset_and_or,
abitset_and_or_cmp,
abitset_andn_or,
abitset_andn_or_cmp,
abitset_or_and,
abitset_or_and_cmp,
abitset_list,
abitset_list_reverse,
NULL,
BITSET_ARRAY
};
size_t
abitset_bytes (bitset_bindex n_bits)
{
bitset_windex size;
size_t bytes;
size_t header_size = offsetof (union bitset_union, a.words);
struct bitset_align_struct { char a; union bitset_union b; };
size_t bitset_alignment = offsetof (struct bitset_align_struct, b);
size = ABITSET_N_WORDS (n_bits);
bytes = header_size + size * sizeof (bitset_word);
/* Align the size properly for a vector of abitset objects. */
if (header_size % bitset_alignment != 0
|| sizeof (bitset_word) % bitset_alignment != 0)
{
bytes += bitset_alignment - 1;
bytes -= bytes % bitset_alignment;
}
return bytes;
}
bitset
abitset_init (bitset bset, bitset_bindex n_bits)
{
bitset_windex size;
size = ABITSET_N_WORDS (n_bits);
BITSET_NBITS_ (bset) = n_bits;
/* Use optimized routines if bitset fits within a single word.
There is probably little merit if using caching since
the small bitset will always fit in the cache. */
if (size == 1)
bset->b.vtable = &abitset_small_vtable;
else
bset->b.vtable = &abitset_vtable;
bset->b.cindex = 0;
bset->b.csize = size;
bset->b.cdata = ABITSET_WORDS (bset);
return bset;
}

View File

@ -1,28 +0,0 @@
/* Functions to support abitsets.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _ABITSET_H
#define _ABITSET_H
#include "bitset.h"
extern size_t abitset_bytes (bitset_bindex);
extern bitset abitset_init (bitset, bitset_bindex);
#endif

View File

@ -1,281 +0,0 @@
/* argmatch.c -- find a match for a string in an array
Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by David MacKenzie <djm@ai.mit.edu>
Modified by Akim Demaille <demaille@inf.enst.fr> */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "argmatch.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "error.h"
#include "exit.h"
#include "quotearg.h"
#include "quote.h"
#if USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
/* When reporting an invalid argument, show nonprinting characters
by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use
literal_quoting_style. */
#ifndef ARGMATCH_QUOTING_STYLE
# define ARGMATCH_QUOTING_STYLE locale_quoting_style
#endif
/* Non failing version of argmatch call this function after failing. */
#ifndef ARGMATCH_DIE
# include "exitfail.h"
# define ARGMATCH_DIE exit (exit_failure)
#endif
#ifdef ARGMATCH_DIE_DECL
ARGMATCH_DIE_DECL;
#endif
static void
__argmatch_die (void)
{
ARGMATCH_DIE;
}
/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h.
Default to __argmatch_die, but allow caller to change this at run-time. */
argmatch_exit_fn argmatch_die = __argmatch_die;
/* If ARG is an unambiguous match for an element of the
NULL-terminated array ARGLIST, return the index in ARGLIST
of the matched element, else -1 if it does not match any element
or -2 if it is ambiguous (is a prefix of more than one element).
If VALLIST is none null, use it to resolve ambiguities limited to
synonyms, i.e., for
"yes", "yop" -> 0
"no", "nope" -> 1
"y" is a valid argument, for `0', and "n" for `1'. */
ptrdiff_t
argmatch (const char *arg, const char *const *arglist,
const char *vallist, size_t valsize)
{
size_t i; /* Temporary index in ARGLIST. */
size_t arglen; /* Length of ARG. */
ptrdiff_t matchind = -1; /* Index of first nonexact match. */
bool ambiguous = false; /* If true, multiple nonexact match(es). */
arglen = strlen (arg);
/* Test all elements for either exact match or abbreviated matches. */
for (i = 0; arglist[i]; i++)
{
if (!strncmp (arglist[i], arg, arglen))
{
if (strlen (arglist[i]) == arglen)
/* Exact match found. */
return i;
else if (matchind == -1)
/* First nonexact match found. */
matchind = i;
else
{
/* Second nonexact match found. */
if (vallist == NULL
|| memcmp (vallist + valsize * matchind,
vallist + valsize * i, valsize))
{
/* There is a real ambiguity, or we could not
disambiguate. */
ambiguous = true;
}
}
}
}
if (ambiguous)
return -2;
else
return matchind;
}
/* Error reporting for argmatch.
CONTEXT is a description of the type of entity that was being matched.
VALUE is the invalid value that was given.
PROBLEM is the return value from argmatch. */
void
argmatch_invalid (const char *context, const char *value, ptrdiff_t problem)
{
char const *format = (problem == -1
? _("invalid argument %s for %s")
: _("ambiguous argument %s for %s"));
error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value),
quote_n (1, context));
}
/* List the valid arguments for argmatch.
ARGLIST is the same as in argmatch.
VALLIST is a pointer to an array of values.
VALSIZE is the size of the elements of VALLIST */
void
argmatch_valid (const char *const *arglist,
const char *vallist, size_t valsize)
{
size_t i;
const char *last_val = NULL;
/* We try to put synonyms on the same line. The assumption is that
synonyms follow each other */
fprintf (stderr, _("Valid arguments are:"));
for (i = 0; arglist[i]; i++)
if ((i == 0)
|| memcmp (last_val, vallist + valsize * i, valsize))
{
fprintf (stderr, "\n - `%s'", arglist[i]);
last_val = vallist + valsize * i;
}
else
{
fprintf (stderr, ", `%s'", arglist[i]);
}
putc ('\n', stderr);
}
/* Never failing versions of the previous functions.
CONTEXT is the context for which argmatch is called (e.g.,
"--version-control", or "$VERSION_CONTROL" etc.). Upon failure,
calls the (supposed never to return) function EXIT_FN. */
ptrdiff_t
__xargmatch_internal (const char *context,
const char *arg, const char *const *arglist,
const char *vallist, size_t valsize,
argmatch_exit_fn exit_fn)
{
ptrdiff_t res = argmatch (arg, arglist, vallist, valsize);
if (res >= 0)
/* Success. */
return res;
/* We failed. Explain why. */
argmatch_invalid (context, arg, res);
argmatch_valid (arglist, vallist, valsize);
(*exit_fn) ();
return -1; /* To please the compilers. */
}
/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and
return the first corresponding argument in ARGLIST */
const char *
argmatch_to_argument (const char *value,
const char *const *arglist,
const char *vallist, size_t valsize)
{
size_t i;
for (i = 0; arglist[i]; i++)
if (!memcmp (value, vallist + valsize * i, valsize))
return arglist[i];
return NULL;
}
#ifdef TEST
/*
* Based on "getversion.c" by David MacKenzie <djm@gnu.ai.mit.edu>
*/
char *program_name;
/* When to make backup files. */
enum backup_type
{
/* Never make backups. */
no_backups,
/* Make simple backups of every file. */
simple_backups,
/* Make numbered backups of files that already have numbered backups,
and simple backups of the others. */
numbered_existing_backups,
/* Make numbered backups of every file. */
numbered_backups
};
/* Two tables describing arguments (keys) and their corresponding
values */
static const char *const backup_args[] =
{
"no", "none", "off",
"simple", "never",
"existing", "nil",
"numbered", "t",
0
};
static const enum backup_type backup_vals[] =
{
no_backups, no_backups, no_backups,
simple_backups, simple_backups,
numbered_existing_backups, numbered_existing_backups,
numbered_backups, numbered_backups
};
int
main (int argc, const char *const *argv)
{
const char *cp;
enum backup_type backup_type = no_backups;
program_name = (char *) argv[0];
if (argc > 2)
{
fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name);
exit (1);
}
if ((cp = getenv ("VERSION_CONTROL")))
backup_type = XARGMATCH ("$VERSION_CONTROL", cp,
backup_args, backup_vals);
if (argc == 2)
backup_type = XARGMATCH (program_name, argv[1],
backup_args, backup_vals);
printf ("The version control is `%s'\n",
ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals));
return 0;
}
#endif

View File

@ -1,103 +0,0 @@
/* argmatch.h -- definitions and prototypes for argmatch.c
Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by David MacKenzie <djm@ai.mit.edu>
Modified by Akim Demaille <demaille@inf.enst.fr> */
#ifndef ARGMATCH_H_
# define ARGMATCH_H_ 1
# include <stddef.h>
# include "verify.h"
# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
/* Assert there are as many real arguments as there are values
(argument list ends with a NULL guard). */
# define ARGMATCH_VERIFY(Arglist, Vallist) \
verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1)
/* Return the index of the element of ARGLIST (NULL terminated) that
matches with ARG. If VALLIST is not NULL, then use it to resolve
false ambiguities (i.e., different matches of ARG but corresponding
to the same values in VALLIST). */
ptrdiff_t argmatch (char const *arg, char const *const *arglist,
char const *vallist, size_t valsize);
# define ARGMATCH(Arg, Arglist, Vallist) \
argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist))
/* xargmatch calls this function when it fails. This function should not
return. By default, this is a function that calls ARGMATCH_DIE which
in turn defaults to `exit (exit_failure)'. */
typedef void (*argmatch_exit_fn) (void);
extern argmatch_exit_fn argmatch_die;
/* Report on stderr why argmatch failed. Report correct values. */
void argmatch_invalid (char const *context, char const *value,
ptrdiff_t problem);
/* Left for compatibility with the old name invalid_arg */
# define invalid_arg(Context, Value, Problem) \
argmatch_invalid (Context, Value, Problem)
/* Report on stderr the list of possible arguments. */
void argmatch_valid (char const *const *arglist,
char const *vallist, size_t valsize);
# define ARGMATCH_VALID(Arglist, Vallist) \
argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist))
/* Same as argmatch, but upon failure, reports a explanation on the
failure, and exits using the function EXIT_FN. */
ptrdiff_t __xargmatch_internal (char const *context,
char const *arg, char const *const *arglist,
char const *vallist, size_t valsize,
argmatch_exit_fn exit_fn);
/* Programmer friendly interface to __xargmatch_internal. */
# define XARGMATCH(Context, Arg, Arglist, Vallist) \
((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \
(char const *) (Vallist), \
sizeof *(Vallist), \
argmatch_die)])
/* Convert a value into a corresponding argument. */
char const *argmatch_to_argument (char const *value,
char const *const *arglist,
char const *vallist, size_t valsize);
# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \
argmatch_to_argument (Value, Arglist, \
(char const *) (Vallist), sizeof *(Vallist))
#endif /* ARGMATCH_H_ */

View File

@ -1,79 +0,0 @@
/* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "dirname.h"
#include <string.h>
/* 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.
Return the address of the last file name component of NAME. If
NAME has no file name components because it is all slashes, return
NAME if it is empty, the address of its last slash otherwise. */
char *
base_name (char const *name)
{
char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
char const *p;
for (p = base; *p; p++)
{
if (ISSLASH (*p))
{
/* Treat multiple adjacent slashes like a single slash. */
do p++;
while (ISSLASH (*p));
/* If the file name ends in slash, use the trailing slash as
the basename if no non-slashes have been found. */
if (! *p)
{
if (ISSLASH (*base))
base = p - 1;
break;
}
/* *P is a non-slash preceded by a slash. */
base = p;
}
}
return (char *) base;
}
/* Return the length of of the basename NAME. Typically NAME is the
value returned by base_name. Act like strlen (NAME), except omit
redundant trailing slashes. */
size_t
base_len (char const *name)
{
size_t len;
for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
continue;
return len;
}

View File

@ -1,302 +0,0 @@
/* Base bitset stuff.
Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _BBITSET_H
#define _BBITSET_H
#include "libiberty.h"
#include <stdbool.h>
#include <limits.h>
#include <stddef.h>
/* Currently we support five flavours of bitsets:
BITSET_ARRAY: Array of bits (fixed size, fast for dense bitsets).
Memory for bit array and bitset structure allocated
contiguously.
BITSET_LIST: Linked list of arrays of bits (variable size, least storage
for large very sparse sets).
BITSET_TABLE: Expandable table of pointers to arrays of bits
(variable size, less storage for large sparse sets).
Faster than BITSET_LIST for random access.
BITSET_VARRAY: Variable array of bits (variable size, fast for
dense bitsets).
BITSET_STATS: Wrapper bitset for internal use only. Used for gathering
statistics and/or better run-time checking.
*/
enum bitset_type {BITSET_ARRAY, BITSET_LIST, BITSET_TABLE, BITSET_VARRAY,
BITSET_TYPE_NUM, BITSET_STATS};
#define BITSET_TYPE_NAMES {"abitset", "lbitset", "ebitset", "vbitset"}
extern const char * const bitset_type_names[];
enum bitset_alloc_type {BITSET_MALLOC, BITSET_OBALLOC};
/* Data type used to store a word of bits. */
typedef unsigned long int bitset_word;
#define BITSET_WORD_BITS ((unsigned int) (CHAR_BIT * sizeof (bitset_word)))
/* Bit index. In theory we might need a type wider than size_t, but
in practice we lose at most a factor of CHAR_BIT by going with
size_t, and that is good enough. If this type is changed to be
wider than size_t, the code needs to be modified to check for
overflow when converting bit counts to byte or word counts.
The bit and word index types must be unsigned. */
typedef size_t bitset_bindex;
/* Word index. */
typedef size_t bitset_windex;
/* Maximum values for commonly-used unsigned types. BITSET_SIZE_MAX
always equals SIZE_MAX, but some older systems lack SIZE_MAX. */
#define BITSET_BINDEX_MAX ((bitset_bindex) -1)
/* Limit max word index to the maximum value of a signed integer
to simplify cache disabling. */
#define BITSET_WINDEX_MAX (((bitset_windex) -1) >> 1)
#define BITSET_SIZE_MAX ((size_t) -1)
#define BITSET_MSB ((bitset_word) 1 << (BITSET_WORD_BITS - 1))
#define BITSET_LIST_SIZE 1024
enum bitset_ops {BITSET_OP_ZERO, BITSET_OP_ONES,
BITSET_OP_COPY, BITSET_OP_NOT,
BITSET_OP_EMPTY_P, BITSET_OP_EQUAL_P,
BITSET_OP_SUBSET_P, BITSET_OP_DISJOINT_P,
BITSET_OP_AND, BITSET_OP_OR, BITSET_OP_XOR, BITSET_OP_ANDN,
BITSET_OP_OR_AND, BITSET_OP_AND_OR, BITSET_OP_ANDN_OR};
struct bbitset_struct
{
const struct bitset_vtable *vtable;
bitset_windex cindex; /* Cache word index. */
bitset_windex csize; /* Cache size in words. */
bitset_word *cdata; /* Cache data pointer. */
bitset_bindex n_bits; /* Number of bits. */
/* Perhaps we could sacrifice another word to indicate
that the bitset is known to be zero, that a bit has been set
in the cache, and that a bit has been cleared in the cache.
This would speed up some of the searches but slightly slow down
bit set/reset operations of cached bits. */
};
typedef union bitset_union *bitset;
/* Private accessor macros to bitset structure. */
#define BITSET_VTABLE_(SRC) (SRC)->b.vtable
#define BITSET_CINDEX_(SRC) (SRC)->b.cindex
#define BITSET_CDATA_(SRC) (SRC)->b.cdata
#define BITSET_CSIZE_(SRC) (SRC)->b.csize
#define BITSET_NBITS_(SRC) (SRC)->b.n_bits
/* The contents of this structure should be considered private. */
struct bitset_vtable
{
void (*set) (bitset, bitset_bindex);
void (*reset) (bitset, bitset_bindex);
bool (*toggle) (bitset, bitset_bindex);
bool (*test) (bitset, bitset_bindex);
bitset_bindex (*resize) (bitset, bitset_bindex);
bitset_bindex (*size) (bitset);
bitset_bindex (*count) (bitset);
bool (*empty_p) (bitset);
void (*ones) (bitset);
void (*zero) (bitset);
void (*copy) (bitset, bitset);
bool (*disjoint_p) (bitset, bitset);
bool (*equal_p) (bitset, bitset);
void (*not_) (bitset, bitset);
bool (*subset_p) (bitset, bitset);
void (*and_) (bitset, bitset, bitset);
bool (*and_cmp) (bitset, bitset, bitset);
void (*andn) (bitset, bitset, bitset);
bool (*andn_cmp) (bitset, bitset, bitset);
void (*or_) (bitset, bitset, bitset);
bool (*or_cmp) (bitset, bitset, bitset);
void (*xor_) (bitset, bitset, bitset);
bool (*xor_cmp) (bitset, bitset, bitset);
void (*and_or) (bitset, bitset, bitset, bitset);
bool (*and_or_cmp) (bitset, bitset, bitset, bitset);
void (*andn_or) (bitset, bitset, bitset, bitset);
bool (*andn_or_cmp) (bitset, bitset, bitset, bitset);
void (*or_and) (bitset, bitset, bitset, bitset);
bool (*or_and_cmp) (bitset, bitset, bitset, bitset);
bitset_bindex (*list) (bitset, bitset_bindex *, bitset_bindex,
bitset_bindex *);
bitset_bindex (*list_reverse) (bitset, bitset_bindex *, bitset_bindex,
bitset_bindex *);
void (*free) (bitset);
enum bitset_type type;
};
#define BITSET_COMPATIBLE_(BSET1, BSET2) \
((BSET1)->b.vtable == (BSET2)->b.vtable)
#define BITSET_CHECK2_(DST, SRC) \
if (!BITSET_COMPATIBLE_ (DST, SRC)) abort ();
#define BITSET_CHECK3_(DST, SRC1, SRC2) \
if (!BITSET_COMPATIBLE_ (DST, SRC1) \
|| !BITSET_COMPATIBLE_ (DST, SRC2)) abort ();
#define BITSET_CHECK4_(DST, SRC1, SRC2, SRC3) \
if (!BITSET_COMPATIBLE_ (DST, SRC1) || !BITSET_COMPATIBLE_ (DST, SRC2) \
|| !BITSET_COMPATIBLE_ (DST, SRC3)) abort ();
/* Redefine number of bits in bitset DST. */
#define BITSET_RESIZE_(DST, SIZE) (DST)->b.vtable->resize (DST, SIZE)
/* Return size in bits of bitset SRC. */
#define BITSET_SIZE_(SRC) (SRC)->b.vtable->size (SRC)
/* Return number of bits set in bitset SRC. */
#define BITSET_COUNT_(SRC) (SRC)->b.vtable->count (SRC)
/* Return type of bitset SRC. */
#define BITSET_TYPE_(DST) (DST)->b.vtable->type
/* Set bit BITNO in bitset DST. */
#define BITSET_SET_(DST, BITNO) (DST)->b.vtable->set (DST, BITNO)
/* Reset bit BITNO in bitset DST. */
#define BITSET_RESET_(DST, BITNO) (DST)->b.vtable->reset (DST, BITNO)
/* Toggle bit BITNO in bitset DST. */
#define BITSET_TOGGLE_(DST, BITNO) (DST)->b.vtable->toggle (DST, BITNO)
/* Return non-zero if bit BITNO in bitset SRC is set. */
#define BITSET_TEST_(SRC, BITNO) (SRC)->b.vtable->test (SRC, BITNO)
/* Free bitset SRC. */
#define BITSET_FREE_(SRC)\
((SRC)->b.vtable->free ? (SRC)->b.vtable->free (SRC) :(void)0)
/* Return SRC == 0. */
#define BITSET_EMPTY_P_(SRC) (SRC)->b.vtable->empty_p (SRC)
/* DST = ~0. */
#define BITSET_ONES_(DST) (DST)->b.vtable->ones (DST)
/* DST = 0. */
#define BITSET_ZERO_(DST) (DST)->b.vtable->zero (DST)
/* DST = SRC. */
#define BITSET_COPY_(DST, SRC) (SRC)->b.vtable->copy (DST, SRC)
/* Return DST & SRC == 0. */
#define BITSET_DISJOINT_P_(DST, SRC) (SRC)->b.vtable->disjoint_p (DST, SRC)
/* Return DST == SRC. */
#define BITSET_EQUAL_P_(DST, SRC) (SRC)->b.vtable->equal_p (DST, SRC)
/* DST = ~SRC. */
#define BITSET_NOT_(DST, SRC) (SRC)->b.vtable->not_ (DST, SRC)
/* Return DST == DST | SRC. */
#define BITSET_SUBSET_P_(DST, SRC) (SRC)->b.vtable->subset_p (DST, SRC)
/* DST = SRC1 & SRC2. */
#define BITSET_AND_(DST, SRC1, SRC2) (SRC1)->b.vtable->and_ (DST, SRC1, SRC2)
#define BITSET_AND_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->and_cmp (DST, SRC1, SRC2)
/* DST = SRC1 & ~SRC2. */
#define BITSET_ANDN_(DST, SRC1, SRC2) (SRC1)->b.vtable->andn (DST, SRC1, SRC2)
#define BITSET_ANDN_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->andn_cmp (DST, SRC1, SRC2)
/* DST = SRC1 | SRC2. */
#define BITSET_OR_(DST, SRC1, SRC2) (SRC1)->b.vtable->or_ (DST, SRC1, SRC2)
#define BITSET_OR_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->or_cmp (DST, SRC1, SRC2)
/* DST = SRC1 ^ SRC2. */
#define BITSET_XOR_(DST, SRC1, SRC2) (SRC1)->b.vtable->xor_ (DST, SRC1, SRC2)
#define BITSET_XOR_CMP_(DST, SRC1, SRC2) (SRC1)->b.vtable->xor_cmp (DST, SRC1, SRC2)
/* DST = (SRC1 & SRC2) | SRC3. Return non-zero if
DST != (SRC1 & SRC2) | SRC3. */
#define BITSET_AND_OR_(DST, SRC1, SRC2, SRC3) \
(SRC1)->b.vtable->and_or (DST, SRC1, SRC2, SRC3)
#define BITSET_AND_OR_CMP_(DST, SRC1, SRC2, SRC3) \
(SRC1)->b.vtable->and_or_cmp (DST, SRC1, SRC2, SRC3)
/* DST = (SRC1 & ~SRC2) | SRC3. Return non-zero if
DST != (SRC1 & ~SRC2) | SRC3. */
#define BITSET_ANDN_OR_(DST, SRC1, SRC2, SRC3) \
(SRC1)->b.vtable->andn_or (DST, SRC1, SRC2, SRC3)
#define BITSET_ANDN_OR_CMP_(DST, SRC1, SRC2, SRC3) \
(SRC1)->b.vtable->andn_or_cmp (DST, SRC1, SRC2, SRC3)
/* DST = (SRC1 | SRC2) & SRC3. Return non-zero if
DST != (SRC1 | SRC2) & SRC3. */
#define BITSET_OR_AND_(DST, SRC1, SRC2, SRC3) \
(SRC1)->b.vtable->or_and (DST, SRC1, SRC2, SRC3)
#define BITSET_OR_AND_CMP_(DST, SRC1, SRC2, SRC3) \
(SRC1)->b.vtable->or_and_cmp (DST, SRC1, SRC2, SRC3)
/* Find list of up to NUM bits set in BSET starting from and including
*NEXT. Return with actual number of bits found and with *NEXT
indicating where search stopped. */
#define BITSET_LIST_(BSET, LIST, NUM, NEXT) \
(BSET)->b.vtable->list (BSET, LIST, NUM, NEXT)
/* Find reverse list of up to NUM bits set in BSET starting from and
including NEXT. Return with actual number of bits found and with
*NEXT indicating where search stopped. */
#define BITSET_LIST_REVERSE_(BSET, LIST, NUM, NEXT) \
(BSET)->b.vtable->list_reverse (BSET, LIST, NUM, NEXT)
/* Private functions for bitset implementations. */
extern bool bitset_toggle_ (bitset, bitset_bindex);
extern bitset_bindex bitset_count_ (bitset);
extern bitset_bindex bitset_size_ (bitset);
extern bool bitset_copy_ (bitset, bitset);
extern void bitset_and_or_ (bitset, bitset, bitset, bitset);
extern bool bitset_and_or_cmp_ (bitset, bitset, bitset, bitset);
extern void bitset_andn_or_ (bitset, bitset, bitset, bitset);
extern bool bitset_andn_or_cmp_ (bitset, bitset, bitset, bitset);
extern void bitset_or_and_ (bitset, bitset, bitset, bitset);
extern bool bitset_or_and_cmp_ (bitset, bitset, bitset, bitset);
#endif /* _BBITSET_H */

View File

@ -1,505 +0,0 @@
/* General bitsets.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
#include "bitset.h"
#include "abitset.h"
#include "lbitset.h"
#include "ebitset.h"
#include "vbitset.h"
#include "bitset_stats.h"
#include "obstack.h"
const char * const bitset_type_names[] = BITSET_TYPE_NAMES;
/* Return number of bytes required to create a N_BIT bitset
of TYPE. The bitset may grow to require more bytes than this. */
size_t
bitset_bytes (enum bitset_type type, bitset_bindex n_bits)
{
size_t bytes;
if (bitset_stats_enabled)
return bitset_stats_bytes ();
switch (type)
{
default:
abort ();
case BITSET_ARRAY:
bytes = abitset_bytes (n_bits);
break;
case BITSET_LIST:
bytes = lbitset_bytes (n_bits);
break;
case BITSET_TABLE:
bytes = ebitset_bytes (n_bits);
break;
case BITSET_VARRAY:
bytes = vbitset_bytes (n_bits);
break;
}
return bytes;
}
/* Initialise bitset BSET of TYPE for N_BITS. */
bitset
bitset_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
{
if (bitset_stats_enabled)
return bitset_stats_init (bset, n_bits, type);
switch (type)
{
default:
abort ();
case BITSET_ARRAY:
return abitset_init (bset, n_bits);
case BITSET_LIST:
return lbitset_init (bset, n_bits);
case BITSET_TABLE:
return ebitset_init (bset, n_bits);
case BITSET_VARRAY:
return vbitset_init (bset, n_bits);
}
}
/* Select a bitset type for a set of N_BITS and with attribute hints
specified by ATTR. For variable size bitsets, N_BITS is only a
hint and may be zero. */
enum bitset_type
bitset_type_choose (bitset_bindex n_bits ATTRIBUTE_UNUSED, unsigned int attr)
{
/* Check attributes. */
if (attr & BITSET_FIXED && attr & BITSET_VARIABLE)
abort ();
if (attr & BITSET_SPARSE && attr & BITSET_DENSE)
abort ();
/* Choose the type of bitset. Note that sometimes we will be asked
for a zero length fixed size bitset. */
/* If no attributes selected, choose a good compromise. */
if (!attr)
return BITSET_VARRAY;
if (attr & BITSET_SPARSE)
return BITSET_LIST;
if (attr & BITSET_FIXED)
return BITSET_ARRAY;
if (attr & BITSET_GREEDY)
return BITSET_TABLE;
return BITSET_VARRAY;
}
/* Create a bitset of N_BITS of type TYPE. */
bitset
bitset_alloc (bitset_bindex n_bits, enum bitset_type type)
{
size_t bytes;
bitset bset;
bytes = bitset_bytes (type, n_bits);
bset = xcalloc (1, bytes);
/* The cache is disabled until some elements are allocated. If we
have variable length arrays, then we may need to allocate a dummy
element. */
return bitset_init (bset, n_bits, type);
}
/* Create a bitset of N_BITS of type TYPE. */
bitset
bitset_obstack_alloc (struct obstack *bobstack,
bitset_bindex n_bits, enum bitset_type type)
{
size_t bytes;
bitset bset;
bytes = bitset_bytes (type, n_bits);
bset = obstack_alloc (bobstack, bytes);
memset (bset, 0, bytes);
return bitset_init (bset, n_bits, type);
}
/* Create a bitset of N_BITS and with attribute hints specified by
ATTR. */
bitset
bitset_create (bitset_bindex n_bits, unsigned int attr)
{
enum bitset_type type;
type = bitset_type_choose (n_bits, attr);
return bitset_alloc (n_bits, type);
}
/* Free bitset BSET. */
void
bitset_free (bitset bset)
{
BITSET_FREE_ (bset);
free (bset);
}
/* Free bitset BSET allocated on obstack. */
void
bitset_obstack_free (bitset bset)
{
BITSET_FREE_ (bset);
}
/* Return bitset type. */
enum bitset_type
bitset_type_get (bitset bset)
{
enum bitset_type type;
type = BITSET_TYPE_ (bset);
if (type != BITSET_STATS)
return type;
return bitset_stats_type_get (bset);
}
/* Return name of bitset type. */
const char *
bitset_type_name_get (bitset bset)
{
enum bitset_type type;
type = bitset_type_get (bset);
return bitset_type_names[type];
}
/* Find next bit set in SRC starting from and including BITNO.
Return BITSET_BINDEX_MAX if SRC empty. */
bitset_bindex
bitset_next (bitset src, bitset_bindex bitno)
{
bitset_bindex val;
bitset_bindex next = bitno;
if (!bitset_list (src, &val, 1, &next))
return BITSET_BINDEX_MAX;
return val;
}
/* Return true if both bitsets are of the same type and size. */
extern bool
bitset_compatible_p (bitset bset1, bitset bset2)
{
return BITSET_COMPATIBLE_ (bset1, bset2);
}
/* Find previous bit set in SRC starting from and including BITNO.
Return BITSET_BINDEX_MAX if SRC empty. */
bitset_bindex
bitset_prev (bitset src, bitset_bindex bitno)
{
bitset_bindex val;
bitset_bindex next = bitno;
if (!bitset_list_reverse (src, &val, 1, &next))
return BITSET_BINDEX_MAX;
return val;
}
/* Find first set bit. */
bitset_bindex
bitset_first (bitset src)
{
return bitset_next (src, 0);
}
/* Find last set bit. */
bitset_bindex
bitset_last (bitset src)
{
return bitset_prev (src, 0);
}
/* Is BITNO in SRC the only set bit? */
bool
bitset_only_set_p (bitset src, bitset_bindex bitno)
{
bitset_bindex val[2];
bitset_bindex next = 0;
if (bitset_list (src, val, 2, &next) != 1)
return false;
return val[0] == bitno;
}
/* Print contents of bitset BSET to FILE. */
static void
bitset_print (FILE *file, bitset bset, bool verbose)
{
unsigned int pos;
bitset_bindex i;
bitset_iterator iter;
if (verbose)
fprintf (file, "n_bits = %lu, set = {",
(unsigned long int) bitset_size (bset));
pos = 30;
BITSET_FOR_EACH (iter, bset, i, 0)
{
if (pos > 70)
{
fprintf (file, "\n");
pos = 0;
}
fprintf (file, "%lu ", (unsigned long int) i);
pos += 1 + (i >= 10) + (i >= 100);
};
if (verbose)
fprintf (file, "}\n");
}
/* Dump bitset BSET to FILE. */
void
bitset_dump (FILE *file, bitset bset)
{
bitset_print (file, bset, false);
}
/* Release memory associated with bitsets. */
void
bitset_release_memory (void)
{
lbitset_release_memory ();
ebitset_release_memory ();
}
/* Toggle bit BITNO in bitset BSET and the new value of the bit. */
bool
bitset_toggle_ (bitset bset, bitset_bindex bitno)
{
/* This routine is for completeness. It could be optimized if
required. */
if (bitset_test (bset, bitno))
{
bitset_reset (bset, bitno);
return false;
}
else
{
bitset_set (bset, bitno);
return true;
}
}
/* Return number of bits in bitset SRC. */
bitset_bindex
bitset_size_ (bitset src)
{
return BITSET_NBITS_ (src);
}
/* Return number of bits set in bitset SRC. */
bitset_bindex
bitset_count_ (bitset src)
{
bitset_bindex list[BITSET_LIST_SIZE];
bitset_bindex next;
bitset_bindex num;
bitset_bindex count;
/* This could be greatly sped up by adding a count method for each
bitset implementation that uses a direct technique (based on
masks) for counting the number of bits set in a word. */
next = 0;
for (count = 0; (num = bitset_list (src, list, BITSET_LIST_SIZE, &next));
count += num)
continue;
return count;
}
/* DST = SRC. Return true if DST != SRC.
This is a fallback for the case where SRC and DST are different
bitset types. */
bool
bitset_copy_ (bitset dst, bitset src)
{
bitset_bindex i;
bitset_iterator iter;
/* Convert bitset types. We assume that the DST bitset
is large enough to hold the SRC bitset. */
bitset_zero (dst);
BITSET_FOR_EACH (iter, src, i, 0)
{
bitset_set (dst, i);
};
return true;
}
/* This is a fallback for implementations that do not support
four operand operations. */
static inline bool
bitset_op4_cmp (bitset dst, bitset src1, bitset src2, bitset src3,
enum bitset_ops op)
{
bool changed = false;
bool stats_enabled_save;
bitset tmp;
/* Create temporary bitset. */
stats_enabled_save = bitset_stats_enabled;
bitset_stats_enabled = false;
tmp = bitset_alloc (0, bitset_type_get (dst));
bitset_stats_enabled = stats_enabled_save;
switch (op)
{
default:
abort ();
case BITSET_OP_OR_AND:
bitset_or (tmp, src1, src2);
changed = bitset_and_cmp (dst, src3, tmp);
break;
case BITSET_OP_AND_OR:
bitset_and (tmp, src1, src2);
changed = bitset_or_cmp (dst, src3, tmp);
break;
case BITSET_OP_ANDN_OR:
bitset_andn (tmp, src1, src2);
changed = bitset_or_cmp (dst, src3, tmp);
break;
}
bitset_free (tmp);
return changed;
}
/* DST = (SRC1 & SRC2) | SRC3. */
void
bitset_and_or_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_and_or_cmp_ (dst, src1, src2, src3);
}
/* DST = (SRC1 & SRC2) | SRC3. Return non-zero if
DST != (SRC1 & SRC2) | SRC3. */
bool
bitset_and_or_cmp_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
return bitset_op4_cmp (dst, src1, src2, src3, BITSET_OP_AND_OR);
}
/* DST = (SRC1 & ~SRC2) | SRC3. */
void
bitset_andn_or_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_andn_or_cmp_ (dst, src1, src2, src3);
}
/* DST = (SRC1 & ~SRC2) | SRC3. Return non-zero if
DST != (SRC1 & ~SRC2) | SRC3. */
bool
bitset_andn_or_cmp_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
return bitset_op4_cmp (dst, src1, src2, src3, BITSET_OP_ANDN_OR);
}
/* DST = (SRC1 | SRC2) & SRC3. */
void
bitset_or_and_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_or_and_cmp_ (dst, src1, src2, src3);
}
/* DST = (SRC1 | SRC2) & SRC3. Return non-zero if
DST != (SRC1 | SRC2) & SRC3. */
bool
bitset_or_and_cmp_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
return bitset_op4_cmp (dst, src1, src2, src3, BITSET_OP_OR_AND);
}
/* Function to be called from debugger to print bitset. */
void
debug_bitset (bitset bset)
{
if (bset)
bitset_print (stderr, bset, true);
}

View File

@ -1,392 +0,0 @@
/* Generic bitsets.
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _BITSET_H
#define _BITSET_H
/* This file is the public interface to the bitset abstract data type.
Only use the functions and macros defined in this file. */
#include "bbitset.h"
#include "obstack.h"
#include <stdio.h>
#if USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
/* Attributes used to select a bitset implementation. */
enum bitset_attr {BITSET_FIXED = 1, /* Bitset size fixed. */
BITSET_VARIABLE = 2, /* Bitset size variable. */
BITSET_DENSE = 4, /* Bitset dense. */
BITSET_SPARSE = 8, /* Bitset sparse. */
BITSET_FRUGAL = 16, /* Prefer most compact. */
BITSET_GREEDY = 32}; /* Prefer fastest at memory expense. */
typedef unsigned int bitset_attrs;
/* The contents of the union should be considered to be private.
While I would like to make this union opaque, it needs to be
visible for the inline bit set/test functions, and for delegation
to the proper implementation. */
union bitset_union
{
/* This must be the first member of every other structure that is a
member of this union. */
struct bbitset_struct b; /* Base bitset data. */
struct abitset_struct
{
struct bbitset_struct b;
bitset_word words[1]; /* The array of bits. */
} a;
struct ebitset_struct
{
struct bbitset_struct b;
bitset_windex size; /* Number of elements. */
struct ebitset_elt_struct **elts; /* Expanding array of ptrs to elts. */
} e;
struct lbitset_struct
{
struct bbitset_struct b;
struct lbitset_elt_struct *head; /* First element in linked list. */
struct lbitset_elt_struct *tail; /* Last element in linked list. */
} l;
struct bitset_stats_struct
{
struct bbitset_struct b;
bitset bset;
} s;
struct vbitset_struct
{
struct bbitset_struct b;
bitset_windex size; /* Allocated size of array. */
} v;
};
/* The contents of this structure should be considered private.
It is used for iterating over set bits. */
typedef struct
{
bitset_bindex list[BITSET_LIST_SIZE];
bitset_bindex next;
bitset_bindex num;
bitset_bindex i;
} bitset_iterator;
/* Return bytes required for bitset of desired type and size. */
extern size_t bitset_bytes (enum bitset_type, bitset_bindex);
/* Initialise a bitset with desired type and size. */
extern bitset bitset_init (bitset, bitset_bindex, enum bitset_type);
/* Select an implementation type based on the desired bitset size
and attributes. */
extern enum bitset_type bitset_type_choose (bitset_bindex, bitset_attrs);
/* Create a bitset of desired type and size. The bitset is zeroed. */
extern bitset bitset_alloc (bitset_bindex, enum bitset_type);
/* Free bitset. */
extern void bitset_free (bitset);
/* Create a bitset of desired type and size using an obstack. The
bitset is zeroed. */
extern bitset bitset_obstack_alloc (struct obstack *bobstack,
bitset_bindex, enum bitset_type);
/* Free bitset allocated on obstack. */
extern void bitset_obstack_free (bitset);
/* Create a bitset of desired size and attributes. The bitset is zeroed. */
extern bitset bitset_create (bitset_bindex, bitset_attrs);
/* Return bitset type. */
extern enum bitset_type bitset_type_get (bitset);
/* Return bitset type name. */
extern const char *bitset_type_name_get (bitset);
/* Set bit BITNO in bitset BSET. */
static inline void
bitset_set (bitset bset, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
bitset_windex offset = windex - bset->b.cindex;
if (offset < bset->b.csize)
bset->b.cdata[offset] |= ((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
else
BITSET_SET_ (bset, bitno);
}
/* Reset bit BITNO in bitset BSET. */
static inline void
bitset_reset (bitset bset, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
bitset_windex offset = windex - bset->b.cindex;
if (offset < bset->b.csize)
bset->b.cdata[offset] &= ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
else
BITSET_RESET_ (bset, bitno);
}
/* Test bit BITNO in bitset BSET. */
static inline bool
bitset_test (bitset bset, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
bitset_windex offset = windex - bset->b.cindex;
if (offset < bset->b.csize)
return (bset->b.cdata[offset] >> (bitno % BITSET_WORD_BITS)) & 1;
else
return BITSET_TEST_ (bset, bitno);
}
/* Toggle bit BITNO in bitset BSET and return non-zero if now set. */
#define bitset_toggle(bset, bitno) BITSET_TOGGLE_ (bset, bitno)
/* Return size in bits of bitset SRC. */
#define bitset_size(SRC) BITSET_SIZE_ (SRC)
/* Change size of bitset. */
extern void bitset_resize (bitset, bitset_bindex);
/* Return number of bits set in bitset SRC. */
#define bitset_count(SRC) BITSET_COUNT_ (SRC)
/* Return SRC == 0. */
#define bitset_empty_p(SRC) BITSET_EMPTY_P_ (SRC)
/* DST = ~0. */
#define bitset_ones(DST) BITSET_ONES_ (DST)
/* DST = 0. */
#define bitset_zero(DST) BITSET_ZERO_ (DST)
/* DST = SRC. */
#define bitset_copy(DST, SRC) BITSET_COPY_ (DST, SRC)
/* Return DST & SRC == 0. */
#define bitset_disjoint_p(DST, SRC) BITSET_DISJOINT_P_ (DST, SRC)
/* Return DST == SRC. */
#define bitset_equal_p(DST, SRC) BITSET_EQUAL_P_ (DST, SRC)
/* DST = ~SRC. */
#define bitset_not(DST, SRC) BITSET_NOT_ (DST, SRC)
/* Return DST == DST | SRC. */
#define bitset_subset_p(DST, SRC) BITSET_SUBSET_P_ (DST, SRC)
/* DST = SRC1 & SRC2. */
#define bitset_and(DST, SRC1, SRC2) BITSET_AND_ (DST, SRC1, SRC2)
/* DST = SRC1 & SRC2. Return non-zero if DST != SRC1 & SRC2. */
#define bitset_and_cmp(DST, SRC1, SRC2) BITSET_AND_CMP_ (DST, SRC1, SRC2)
/* DST = SRC1 & ~SRC2. */
#define bitset_andn(DST, SRC1, SRC2) BITSET_ANDN_ (DST, SRC1, SRC2)
/* DST = SRC1 & ~SRC2. Return non-zero if DST != SRC1 & ~SRC2. */
#define bitset_andn_cmp(DST, SRC1, SRC2) BITSET_ANDN_CMP_ (DST, SRC1, SRC2)
/* DST = SRC1 | SRC2. */
#define bitset_or(DST, SRC1, SRC2) BITSET_OR_ (DST, SRC1, SRC2)
/* DST = SRC1 | SRC2. Return non-zero if DST != SRC1 | SRC2. */
#define bitset_or_cmp(DST, SRC1, SRC2) BITSET_OR_CMP_ (DST, SRC1, SRC2)
/* DST = SRC1 ^ SRC2. */
#define bitset_xor(DST, SRC1, SRC2) BITSET_XOR_ (DST, SRC1, SRC2)
/* DST = SRC1 ^ SRC2. Return non-zero if DST != SRC1 ^ SRC2. */
#define bitset_xor_cmp(DST, SRC1, SRC2) BITSET_XOR_CMP_ (DST, SRC1, SRC2)
/* DST = (SRC1 & SRC2) | SRC3. */
#define bitset_and_or(DST, SRC1, SRC2, SRC3) \
BITSET_AND_OR_ (DST, SRC1, SRC2, SRC3)
/* DST = (SRC1 & SRC2) | SRC3. Return non-zero if
DST != (SRC1 & SRC2) | SRC3. */
#define bitset_and_or_cmp(DST, SRC1, SRC2, SRC3) \
BITSET_AND_OR_CMP_ (DST, SRC1, SRC2, SRC3)
/* DST = (SRC1 & ~SRC2) | SRC3. */
#define bitset_andn_or(DST, SRC1, SRC2, SRC3) \
BITSET_ANDN_OR_ (DST, SRC1, SRC2, SRC3)
/* DST = (SRC1 & ~SRC2) | SRC3. Return non-zero if
DST != (SRC1 & ~SRC2) | SRC3. */
#define bitset_andn_or_cmp(DST, SRC1, SRC2, SRC3) \
BITSET_ANDN_OR_CMP_ (DST, SRC1, SRC2, SRC3)
/* DST = (SRC1 | SRC2) & SRC3. */
#define bitset_or_and(DST, SRC1, SRC2, SRC3)\
BITSET_OR_AND_ (DST, SRC1, SRC2, SRC3)
/* DST = (SRC1 | SRC2) & SRC3. Return non-zero if
DST != (SRC1 | SRC2) & SRC3. */
#define bitset_or_and_cmp(DST, SRC1, SRC2, SRC3)\
BITSET_OR_AND_CMP_ (DST, SRC1, SRC2, SRC3)
/* Find list of up to NUM bits set in BSET starting from and including
*NEXT. Return with actual number of bits found and with *NEXT
indicating where search stopped. */
#define bitset_list(BSET, LIST, NUM, NEXT) \
BITSET_LIST_ (BSET, LIST, NUM, NEXT)
/* Find reverse list of up to NUM bits set in BSET starting from and
including NEXT. Return with actual number of bits found and with
*NEXT indicating where search stopped. */
#define bitset_list_reverse(BSET, LIST, NUM, NEXT) \
BITSET_LIST_REVERSE_ (BSET, LIST, NUM, NEXT)
/* Return true if both bitsets are of the same type and size. */
extern bool bitset_compatible_p (bitset bset1, bitset bset2);
/* Find next set bit from the given bit index. */
extern bitset_bindex bitset_next (bitset, bitset_bindex);
/* Find previous set bit from the given bit index. */
extern bitset_bindex bitset_prev (bitset, bitset_bindex);
/* Find first set bit. */
extern bitset_bindex bitset_first (bitset);
/* Find last set bit. */
extern bitset_bindex bitset_last (bitset);
/* Return nonzero if this is the only set bit. */
extern bool bitset_only_set_p (bitset, bitset_bindex);
/* Dump bitset. */
extern void bitset_dump (FILE *, bitset);
/* Loop over all elements of BSET, starting with MIN, setting INDEX
to the index of each set bit. For example, the following will print
the bits set in a bitset:
bitset_bindex i;
bitset_iterator iter;
BITSET_FOR_EACH (iter, src, i, 0)
{
printf ("%lu ", (unsigned long int) i);
};
*/
#define BITSET_FOR_EACH(ITER, BSET, INDEX, MIN) \
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
(ITER.num == BITSET_LIST_SIZE) \
&& (ITER.num = bitset_list (BSET, ITER.list, \
BITSET_LIST_SIZE, &ITER.next));) \
for (ITER.i = 0; \
ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
ITER.i++)
/* Loop over all elements of BSET, in reverse order starting with
MIN, setting INDEX to the index of each set bit. For example, the
following will print the bits set in a bitset in reverse order:
bitset_bindex i;
bitset_iterator iter;
BITSET_FOR_EACH_REVERSE (iter, src, i, 0)
{
printf ("%lu ", (unsigned long int) i);
};
*/
#define BITSET_FOR_EACH_REVERSE(ITER, BSET, INDEX, MIN) \
for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
(ITER.num == BITSET_LIST_SIZE) \
&& (ITER.num = bitset_list_reverse (BSET, ITER.list, \
BITSET_LIST_SIZE, &ITER.next));) \
for (ITER.i = 0; \
ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
ITER.i++)
/* Define set operations in terms of logical operations. */
#define bitset_diff(DST, SRC1, SRC2) bitset_andn (DST, SRC1, SRC2)
#define bitset_diff_cmp(DST, SRC1, SRC2) bitset_andn_cmp (DST, SRC1, SRC2)
#define bitset_intersection(DST, SRC1, SRC2) bitset_and (DST, SRC1, SRC2)
#define bitset_intersection_cmp(DST, SRC1, SRC2) bitset_and_cmp (DST, SRC1, SRC2)
#define bitset_union(DST, SRC1, SRC2) bitset_or (DST, SRC1, SRC2)
#define bitset_union_cmp(DST, SRC1, SRC2) bitset_or_cmp (DST, SRC1, SRC2)
/* Symmetrical difference. */
#define bitset_symdiff(DST, SRC1, SRC2) bitset_xor (DST, SRC1, SRC2)
#define bitset_symdiff_cmp(DST, SRC1, SRC2) bitset_xor_cmp (DST, SRC1, SRC2)
/* Union of difference. */
#define bitset_diff_union(DST, SRC1, SRC2, SRC3) \
bitset_andn_or (DST, SRC1, SRC2, SRC3)
#define bitset_diff_union_cmp(DST, SRC1, SRC2, SRC3) \
bitset_andn_or_cmp (DST, SRC1, SRC2, SRC3)
/* Release any memory tied up with bitsets. */
extern void bitset_release_memory (void);
/* Enable bitset stats gathering. */
extern void bitset_stats_enable (void);
/* Disable bitset stats gathering. */
extern void bitset_stats_disable (void);
/* Read bitset stats file of accummulated stats. */
void bitset_stats_read (const char *file_name);
/* Write bitset stats file of accummulated stats. */
void bitset_stats_write (const char *file_name);
/* Dump bitset stats. */
extern void bitset_stats_dump (FILE *);
/* Function to debug bitset from debugger. */
extern void debug_bitset (bitset);
/* Function to debug bitset stats from debugger. */
extern void debug_bitset_stats (void);
#endif /* _BITSET_H */

View File

@ -1,730 +0,0 @@
/* Bitset statistics.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file is a wrapper bitset implementation for the other bitset
implementations. It provides bitset compatibility checking and
statistics gathering without having to instrument the bitset
implementations. When statistics gathering is enabled, the bitset
operations get vectored through here and we then call the appropriate
routines. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "bbitset.h"
#include "abitset.h"
#include "ebitset.h"
#include "lbitset.h"
#include "vbitset.h"
#include "bitset_stats.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "gettext.h"
#define _(Msgid) gettext (Msgid)
/* Configuration macros. */
#define BITSET_STATS_FILE "bitset.dat"
#define BITSET_LOG_COUNT_BINS 10
#define BITSET_LOG_SIZE_BINS 16
#define BITSET_DENSITY_BINS 20
/* Accessor macros. */
#define BITSET_STATS_ALLOCS_INC(TYPE) \
bitset_stats_info->types[(TYPE)].allocs++
#define BITSET_STATS_FREES_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].frees++
#define BITSET_STATS_SETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].sets++
#define BITSET_STATS_CACHE_SETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_sets++
#define BITSET_STATS_RESETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].resets++
#define BITSET_STATS_CACHE_RESETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_resets++
#define BITSET_STATS_TESTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].tests++
#define BITSET_STATS_CACHE_TESTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_tests++
#define BITSET_STATS_LISTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].lists++
#define BITSET_STATS_LIST_COUNTS_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_counts[(I)]++
#define BITSET_STATS_LIST_SIZES_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_sizes[(I)]++
#define BITSET_STATS_LIST_DENSITY_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_density[(I)]++
struct bitset_type_info_struct
{
unsigned int allocs;
unsigned int frees;
unsigned int lists;
unsigned int sets;
unsigned int cache_sets;
unsigned int resets;
unsigned int cache_resets;
unsigned int tests;
unsigned int cache_tests;
unsigned int list_counts[BITSET_LOG_COUNT_BINS];
unsigned int list_sizes[BITSET_LOG_SIZE_BINS];
unsigned int list_density[BITSET_DENSITY_BINS];
};
struct bitset_stats_info_struct
{
unsigned int runs;
struct bitset_type_info_struct types[BITSET_TYPE_NUM];
};
struct bitset_stats_info_struct bitset_stats_info_data;
struct bitset_stats_info_struct *bitset_stats_info;
bool bitset_stats_enabled = false;
/* Print a percentage histogram with message MSG to FILE. */
static void
bitset_percent_histogram_print (FILE *file, const char *name, const char *msg,
unsigned int n_bins, unsigned int *bins)
{
unsigned int i;
unsigned int total;
total = 0;
for (i = 0; i < n_bins; i++)
total += bins[i];
if (!total)
return;
fprintf (file, "%s %s", name, msg);
for (i = 0; i < n_bins; i++)
fprintf (file, "%.0f-%.0f%%\t%8u (%5.1f%%)\n",
i * 100.0 / n_bins,
(i + 1) * 100.0 / n_bins, bins[i],
(100.0 * bins[i]) / total);
}
/* Print a log histogram with message MSG to FILE. */
static void
bitset_log_histogram_print (FILE *file, const char *name, const char *msg,
unsigned int n_bins, unsigned int *bins)
{
unsigned int i;
unsigned int total;
unsigned int max_width;
total = 0;
for (i = 0; i < n_bins; i++)
total += bins[i];
if (!total)
return;
/* Determine number of useful bins. */
for (i = n_bins; i > 3 && ! bins[i - 1]; i--)
continue;
n_bins = i;
/* 2 * ceil (log10 (2) * (N - 1)) + 1. */
max_width = 2 * (unsigned int) (0.30103 * (n_bins - 1) + 0.9999) + 1;
fprintf (file, "%s %s", name, msg);
for (i = 0; i < 2; i++)
fprintf (file, "%*d\t%8u (%5.1f%%)\n",
max_width, i, bins[i], 100.0 * bins[i] / total);
for (; i < n_bins; i++)
fprintf (file, "%*lu-%lu\t%8u (%5.1f%%)\n",
max_width - ((unsigned int) (0.30103 * (i) + 0.9999) + 1),
1UL << (i - 1),
(1UL << i) - 1,
bins[i],
(100.0 * bins[i]) / total);
}
/* Print bitset statistics to FILE. */
static void
bitset_stats_print_1 (FILE *file, const char *name,
struct bitset_type_info_struct *stats)
{
if (!stats)
return;
fprintf (file, "%s:\n", name);
fprintf (file, _("%u bitset_allocs, %u freed (%.2f%%).\n"),
stats->allocs, stats->frees,
stats->allocs ? 100.0 * stats->frees / stats->allocs : 0);
fprintf (file, _("%u bitset_sets, %u cached (%.2f%%)\n"),
stats->sets, stats->cache_sets,
stats->sets ? 100.0 * stats->cache_sets / stats->sets : 0);
fprintf (file, _("%u bitset_resets, %u cached (%.2f%%)\n"),
stats->resets, stats->cache_resets,
stats->resets ? 100.0 * stats->cache_resets / stats->resets : 0);
fprintf (file, _("%u bitset_tests, %u cached (%.2f%%)\n"),
stats->tests, stats->cache_tests,
stats->tests ? 100.0 * stats->cache_tests / stats->tests : 0);
fprintf (file, _("%u bitset_lists\n"), stats->lists);
bitset_log_histogram_print (file, name, _("count log histogram\n"),
BITSET_LOG_COUNT_BINS, stats->list_counts);
bitset_log_histogram_print (file, name, _("size log histogram\n"),
BITSET_LOG_SIZE_BINS, stats->list_sizes);
bitset_percent_histogram_print (file, name, _("density histogram\n"),
BITSET_DENSITY_BINS, stats->list_density);
}
/* Print all bitset statistics to FILE. */
static void
bitset_stats_print (FILE *file, bool verbose ATTRIBUTE_UNUSED)
{
int i;
if (!bitset_stats_info)
return;
fprintf (file, _("Bitset statistics:\n\n"));
if (bitset_stats_info->runs > 1)
fprintf (file, _("Accumulated runs = %u\n"), bitset_stats_info->runs);
for (i = 0; i < BITSET_TYPE_NUM; i++)
bitset_stats_print_1 (file, bitset_type_names[i],
&bitset_stats_info->types[i]);
}
/* Initialise bitset statistics logging. */
void
bitset_stats_enable (void)
{
if (!bitset_stats_info)
bitset_stats_info = &bitset_stats_info_data;
bitset_stats_enabled = true;
}
void
bitset_stats_disable (void)
{
bitset_stats_enabled = false;
}
/* Read bitset statistics file. */
void
bitset_stats_read (const char *file_name)
{
FILE *file;
if (!bitset_stats_info)
return;
if (!file_name)
file_name = BITSET_STATS_FILE;
file = fopen (file_name, "r");
if (file)
{
if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
1, file) != 1)
{
if (ferror (file))
perror (_("Could not read stats file."));
else
fprintf (stderr, _("Bad stats file size.\n"));
}
if (fclose (file) != 0)
perror (_("Could not read stats file."));
}
bitset_stats_info_data.runs++;
}
/* Write bitset statistics file. */
void
bitset_stats_write (const char *file_name)
{
FILE *file;
if (!bitset_stats_info)
return;
if (!file_name)
file_name = BITSET_STATS_FILE;
file = fopen (file_name, "w");
if (file)
{
if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
1, file) != 1)
perror (_("Could not write stats file."));
if (fclose (file) != 0)
perror (_("Could not write stats file."));
}
else
perror (_("Could not open stats file for writing."));
}
/* Dump bitset statistics to FILE. */
void
bitset_stats_dump (FILE *file)
{
bitset_stats_print (file, false);
}
/* Function to be called from debugger to print bitset stats. */
void
debug_bitset_stats (void)
{
bitset_stats_print (stderr, true);
}
static void
bitset_stats_set (bitset dst, bitset_bindex bitno)
{
bitset bset = dst->s.bset;
bitset_windex wordno = bitno / BITSET_WORD_BITS;
bitset_windex offset = wordno - bset->b.cindex;
BITSET_STATS_SETS_INC (bset);
if (offset < bset->b.csize)
{
bset->b.cdata[offset] |= (bitset_word) 1 << (bitno % BITSET_WORD_BITS);
BITSET_STATS_CACHE_SETS_INC (bset);
}
else
BITSET_SET_ (bset, bitno);
}
static void
bitset_stats_reset (bitset dst, bitset_bindex bitno)
{
bitset bset = dst->s.bset;
bitset_windex wordno = bitno / BITSET_WORD_BITS;
bitset_windex offset = wordno - bset->b.cindex;
BITSET_STATS_RESETS_INC (bset);
if (offset < bset->b.csize)
{
bset->b.cdata[offset] &=
~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
BITSET_STATS_CACHE_RESETS_INC (bset);
}
else
BITSET_RESET_ (bset, bitno);
}
static bool
bitset_stats_toggle (bitset src, bitset_bindex bitno)
{
return BITSET_TOGGLE_ (src->s.bset, bitno);
}
static bool
bitset_stats_test (bitset src, bitset_bindex bitno)
{
bitset bset = src->s.bset;
bitset_windex wordno = bitno / BITSET_WORD_BITS;
bitset_windex offset = wordno - bset->b.cindex;
BITSET_STATS_TESTS_INC (bset);
if (offset < bset->b.csize)
{
BITSET_STATS_CACHE_TESTS_INC (bset);
return (bset->b.cdata[offset] >> (bitno % BITSET_WORD_BITS)) & 1;
}
else
return BITSET_TEST_ (bset, bitno);
}
static bitset_bindex
bitset_stats_resize (bitset src, bitset_bindex size)
{
return BITSET_RESIZE_ (src->s.bset, size);
}
static bitset_bindex
bitset_stats_size (bitset src)
{
return BITSET_SIZE_ (src->s.bset);
}
static bitset_bindex
bitset_stats_count (bitset src)
{
return BITSET_COUNT_ (src->s.bset);
}
static bool
bitset_stats_empty_p (bitset dst)
{
return BITSET_EMPTY_P_ (dst->s.bset);
}
static void
bitset_stats_ones (bitset dst)
{
BITSET_ONES_ (dst->s.bset);
}
static void
bitset_stats_zero (bitset dst)
{
BITSET_ZERO_ (dst->s.bset);
}
static void
bitset_stats_copy (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
BITSET_COPY_ (dst->s.bset, src->s.bset);
}
static bool
bitset_stats_disjoint_p (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
return BITSET_DISJOINT_P_ (dst->s.bset, src->s.bset);
}
static bool
bitset_stats_equal_p (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
return BITSET_EQUAL_P_ (dst->s.bset, src->s.bset);
}
static void
bitset_stats_not (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
BITSET_NOT_ (dst->s.bset, src->s.bset);
}
static bool
bitset_stats_subset_p (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
return BITSET_SUBSET_P_ (dst->s.bset, src->s.bset);
}
static void
bitset_stats_and (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_AND_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static bool
bitset_stats_and_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_AND_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static void
bitset_stats_andn (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_ANDN_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static bool
bitset_stats_andn_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_ANDN_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static void
bitset_stats_or (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_OR_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static bool
bitset_stats_or_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_OR_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static void
bitset_stats_xor (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_XOR_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static bool
bitset_stats_xor_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_XOR_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
}
static void
bitset_stats_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
BITSET_AND_OR_ (dst->s.bset, src1->s.bset, src2->s.bset, src3->s.bset);
}
static bool
bitset_stats_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
return BITSET_AND_OR_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset, src3->s.bset);
}
static void
bitset_stats_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
BITSET_ANDN_OR_ (dst->s.bset, src1->s.bset, src2->s.bset, src3->s.bset);
}
static bool
bitset_stats_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
return BITSET_ANDN_OR_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset, src3->s.bset);
}
static void
bitset_stats_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
BITSET_OR_AND_ (dst->s.bset, src1->s.bset, src2->s.bset, src3->s.bset);
}
static bool
bitset_stats_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
return BITSET_OR_AND_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset, src3->s.bset);
}
static bitset_bindex
bitset_stats_list (bitset bset, bitset_bindex *list,
bitset_bindex num, bitset_bindex *next)
{
bitset_bindex count;
bitset_bindex tmp;
bitset_bindex size;
bitset_bindex i;
enum bitset_type type;
count = BITSET_LIST_ (bset->s.bset, list, num, next);
type = BITSET_TYPE_ (bset->s.bset);
BITSET_STATS_LISTS_INC (bset->s.bset);
/* Log histogram of number of set bits. */
for (i = 0, tmp = count; tmp; tmp >>= 1, i++)
continue;
if (i >= BITSET_LOG_COUNT_BINS)
i = BITSET_LOG_COUNT_BINS - 1;
BITSET_STATS_LIST_COUNTS_INC (bset->s.bset, i);
/* Log histogram of number of bits in set. */
size = BITSET_SIZE_ (bset->s.bset);
for (i = 0, tmp = size; tmp; tmp >>= 1, i++)
continue;
if (i >= BITSET_LOG_SIZE_BINS)
i = BITSET_LOG_SIZE_BINS - 1;
BITSET_STATS_LIST_SIZES_INC (bset->s.bset, i);
/* Histogram of fraction of bits set. */
i = size ? (count * BITSET_DENSITY_BINS) / size : 0;
if (i >= BITSET_DENSITY_BINS)
i = BITSET_DENSITY_BINS - 1;
BITSET_STATS_LIST_DENSITY_INC (bset->s.bset, i);
return count;
}
static bitset_bindex
bitset_stats_list_reverse (bitset bset, bitset_bindex *list,
bitset_bindex num, bitset_bindex *next)
{
return BITSET_LIST_REVERSE_ (bset->s.bset, list, num, next);
}
static void
bitset_stats_free (bitset bset)
{
BITSET_STATS_FREES_INC (bset->s.bset);
BITSET_FREE_ (bset->s.bset);
}
struct bitset_vtable bitset_stats_vtable = {
bitset_stats_set,
bitset_stats_reset,
bitset_stats_toggle,
bitset_stats_test,
bitset_stats_resize,
bitset_stats_size,
bitset_stats_count,
bitset_stats_empty_p,
bitset_stats_ones,
bitset_stats_zero,
bitset_stats_copy,
bitset_stats_disjoint_p,
bitset_stats_equal_p,
bitset_stats_not,
bitset_stats_subset_p,
bitset_stats_and,
bitset_stats_and_cmp,
bitset_stats_andn,
bitset_stats_andn_cmp,
bitset_stats_or,
bitset_stats_or_cmp,
bitset_stats_xor,
bitset_stats_xor_cmp,
bitset_stats_and_or,
bitset_stats_and_or_cmp,
bitset_stats_andn_or,
bitset_stats_andn_or_cmp,
bitset_stats_or_and,
bitset_stats_or_and_cmp,
bitset_stats_list,
bitset_stats_list_reverse,
bitset_stats_free,
BITSET_STATS
};
/* Return enclosed bitset type. */
enum bitset_type
bitset_stats_type_get (bitset bset)
{
return BITSET_TYPE_ (bset->s.bset);
}
size_t
bitset_stats_bytes (void)
{
return sizeof (struct bitset_stats_struct);
}
bitset
bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
{
size_t bytes;
bitset sbset;
bset->b.vtable = &bitset_stats_vtable;
/* Disable cache. */
bset->b.cindex = 0;
bset->b.csize = 0;
bset->b.cdata = 0;
BITSET_NBITS_ (bset) = n_bits;
/* Set up the actual bitset implementation that
we are a wrapper over. */
switch (type)
{
default:
abort ();
case BITSET_ARRAY:
bytes = abitset_bytes (n_bits);
sbset = xcalloc (1, bytes);
abitset_init (sbset, n_bits);
break;
case BITSET_LIST:
bytes = lbitset_bytes (n_bits);
sbset = xcalloc (1, bytes);
lbitset_init (sbset, n_bits);
break;
case BITSET_TABLE:
bytes = ebitset_bytes (n_bits);
sbset = xcalloc (1, bytes);
ebitset_init (sbset, n_bits);
break;
case BITSET_VARRAY:
bytes = vbitset_bytes (n_bits);
sbset = xcalloc (1, bytes);
vbitset_init (sbset, n_bits);
break;
}
bset->s.bset = sbset;
BITSET_STATS_ALLOCS_INC (type);
return bset;
}

View File

@ -1,32 +0,0 @@
/* Functions to support bitset statistics.
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _BITSET_STATS_H
#define _BITSET_STATS_H
#include "bbitset.h"
extern bool bitset_stats_enabled;
extern enum bitset_type bitset_stats_type_get (bitset);
extern size_t bitset_stats_bytes (void);
extern bitset bitset_stats_init (bitset, bitset_bindex, enum bitset_type);
#endif

View File

@ -1,71 +0,0 @@
/* Bitset vectors.
Copyright (C) 2001, 2002, 2004, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include "bitsetv-print.h"
/*--------------------------------------------------------.
| Display the MATRIX array of SIZE bitsets of size SIZE. |
`--------------------------------------------------------*/
void
bitsetv_matrix_dump (FILE * out, const char *title, bitsetv bset)
{
bitset_bindex i, j;
bitset_bindex hsize = bitset_size (bset[0]);
/* Title. */
fprintf (out, "%s BEGIN\n", title);
/* Column numbers. */
fputs (" ", out);
for (i = 0; i < hsize; ++i)
putc (i / 10 ? '0' + i / 10 : ' ', out);
putc ('\n', out);
fputs (" ", out);
for (i = 0; i < hsize; ++i)
fprintf (out, "%d", (int) (i % 10));
putc ('\n', out);
/* Bar. */
fputs (" .", out);
for (i = 0; i < hsize; ++i)
putc ('-', out);
fputs (".\n", out);
/* Contents. */
for (i = 0; bset[i]; ++i)
{
fprintf (out, "%2lu|", (unsigned long int) i);
for (j = 0; j < hsize; ++j)
fputs (bitset_test (bset[i], j) ? "1" : " ", out);
fputs ("|\n", out);
}
/* Bar. */
fputs (" `", out);
for (i = 0; i < hsize; ++i)
putc ('-', out);
fputs ("'\n", out);
/* End title. */
fprintf (out, "%s END\n\n", title);
}

View File

@ -1,27 +0,0 @@
/* Bitset vectors.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
Contributed by Akim Demaille (akim@freefriends.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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _BITSETV_PRINT_H
#define _BITSETV_PRINT_H
#include "bitsetv.h"
/* Dump vector of bitsets as a matrix. */
extern void bitsetv_matrix_dump (FILE *, const char *, bitsetv);
#endif /* _BITSETV_H */

View File

@ -1,169 +0,0 @@
/* Bitset vectors.
Copyright (C) 2001, 2002, 2004, 2005, 2006 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include "bitsetv.h"
/* Create a vector of N_VECS bitsets, each of N_BITS, and of
type TYPE. */
bitset *
bitsetv_alloc (bitset_bindex n_vecs, bitset_bindex n_bits,
enum bitset_type type)
{
size_t vector_bytes;
size_t bytes;
bitset *bsetv;
bitset_bindex i;
/* Determine number of bytes for each set. */
bytes = bitset_bytes (type, n_bits);
/* If size calculation overflows, memory is exhausted. */
if (BITSET_SIZE_MAX / (sizeof (bitset) + bytes) <= n_vecs)
xalloc_die ();
/* Allocate vector table at head of bitset array. */
vector_bytes = (n_vecs + 1) * sizeof (bitset) + bytes - 1;
vector_bytes -= vector_bytes % bytes;
bsetv = xcalloc (1, vector_bytes + bytes * n_vecs);
for (i = 0; i < n_vecs; i++)
{
bsetv[i] = (bitset) (void *) ((char *) bsetv + vector_bytes + i * bytes);
bitset_init (bsetv[i], n_bits, type);
}
/* Null terminate table. */
bsetv[i] = 0;
return bsetv;
}
/* Create a vector of N_VECS bitsets, each of N_BITS, and with
attribute hints specified by ATTR. */
bitset *
bitsetv_create (bitset_bindex n_vecs, bitset_bindex n_bits, unsigned int attr)
{
enum bitset_type type;
type = bitset_type_choose (n_bits, attr);
return bitsetv_alloc (n_vecs, n_bits, type);
}
/* Free bitset vector BSETV. */
void
bitsetv_free (bitsetv bsetv)
{
bitset_bindex i;
for (i = 0; bsetv[i]; i++)
BITSET_FREE_ (bsetv[i]);
free (bsetv);
}
/* Zero a vector of bitsets. */
void
bitsetv_zero (bitsetv bsetv)
{
bitset_bindex i;
for (i = 0; bsetv[i]; i++)
bitset_zero (bsetv[i]);
}
/* Set a vector of bitsets to ones. */
void
bitsetv_ones (bitsetv bsetv)
{
bitset_bindex i;
for (i = 0; bsetv[i]; i++)
bitset_ones (bsetv[i]);
}
/* Given a vector BSETV of N bitsets of size N, modify its contents to
be the transitive closure of what was given. */
void
bitsetv_transitive_closure (bitsetv bsetv)
{
bitset_bindex i;
bitset_bindex j;
for (i = 0; bsetv[i]; i++)
for (j = 0; bsetv[j]; j++)
if (bitset_test (bsetv[j], i))
bitset_or (bsetv[j], bsetv[j], bsetv[i]);
}
/* Given a vector BSETV of N bitsets of size N, modify its contents to
be the reflexive transitive closure of what was given. This is
the same as transitive closure but with all bits on the diagonal
of the bit matrix set. */
void
bitsetv_reflexive_transitive_closure (bitsetv bsetv)
{
bitset_bindex i;
bitsetv_transitive_closure (bsetv);
for (i = 0; bsetv[i]; i++)
bitset_set (bsetv[i], i);
}
/* Dump the contents of a bitset vector BSETV with N_VECS elements to
FILE. */
void
bitsetv_dump (FILE *file, char const *title, char const *subtitle,
bitsetv bsetv)
{
bitset_windex i;
fprintf (file, "%s\n", title);
for (i = 0; bsetv[i]; i++)
{
fprintf (file, "%s %lu\n", subtitle, (unsigned long int) i);
bitset_dump (file, bsetv[i]);
}
fprintf (file, "\n");
}
void
debug_bitsetv (bitsetv bsetv)
{
bitset_windex i;
for (i = 0; bsetv[i]; i++)
{
fprintf (stderr, "%lu: ", (unsigned long int) i);
debug_bitset (bsetv[i]);
}
fprintf (stderr, "\n");
}

View File

@ -1,59 +0,0 @@
/* Bitset vectors.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _BITSETV_H
#define _BITSETV_H
#include "bitset.h"
typedef bitset * bitsetv;
/* Create a vector of N_VECS bitsets, each of N_BITS, and of
type TYPE. */
extern bitsetv bitsetv_alloc (bitset_bindex, bitset_bindex, enum bitset_type);
/* Create a vector of N_VECS bitsets, each of N_BITS, and with
attribute hints specified by ATTR. */
extern bitsetv bitsetv_create (bitset_bindex, bitset_bindex, unsigned int);
/* Free vector of bitsets. */
extern void bitsetv_free (bitsetv);
/* Zero vector of bitsets. */
extern void bitsetv_zero (bitsetv);
/* Set vector of bitsets. */
extern void bitsetv_ones (bitsetv);
/* Given a vector BSETV of N bitsets of size N, modify its contents to
be the transitive closure of what was given. */
extern void bitsetv_transitive_closure (bitsetv);
/* Given a vector BSETV of N bitsets of size N, modify its contents to
be the reflexive transitive closure of what was given. This is
the same as transitive closure but with all bits on the diagonal
of the bit matrix set. */
extern void bitsetv_reflexive_transitive_closure (bitsetv);
/* Dump vector of bitsets. */
extern void bitsetv_dump (FILE *, const char *, const char *, bitsetv);
/* Function to debug vector of bitsets from debugger. */
extern void debug_bitsetv (bitsetv);
#endif /* _BITSETV_H */

View File

@ -1,121 +0,0 @@
/* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000, 2001, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "dirname.h"
#include <string.h>
#include "xalloc.h"
/* Return the length of `dirname (FILE)', or zero if FILE is
in the working directory. Works properly even if
there are trailing slashes (by effectively ignoring them). */
size_t
dir_len (char const *file)
{
size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
size_t length;
/* Strip the basename and any redundant slashes before it. */
for (length = base_name (file) - file; prefix_length < length; length--)
if (! ISSLASH (file[length - 1]))
return length;
/* But don't strip the only slash from "/". */
return prefix_length + ISSLASH (file[prefix_length]);
}
/* Return the leading directories part of FILE,
allocated with xmalloc.
Works properly even if there are trailing slashes
(by effectively ignoring them). */
char *
dir_name (char const *file)
{
size_t length = dir_len (file);
bool append_dot = (length == FILE_SYSTEM_PREFIX_LEN (file));
char *dir = xmalloc (length + append_dot + 1);
memcpy (dir, file, length);
if (append_dot)
dir[length++] = '.';
dir[length] = 0;
return dir;
}
#ifdef TEST_DIRNAME
/*
Run the test like this (expect no output):
gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \
basename.c dirname.c xmalloc.c error.c
sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out
If it's been built on a DOS or Windows platforms, run another test like
this (again, expect no output):
sed -n '/^BEGIN-DOS-DATA$/,/^END-DOS-DATA$/p' dirname.c|grep -v DATA|./a.out
BEGIN-DATA
foo//// .
bar/foo//// bar
foo/ .
/ /
. .
a .
END-DATA
BEGIN-DOS-DATA
c:///// c:/
c:/ c:/
c:/. c:/
c:foo c:.
c:foo/bar c:foo
END-DOS-DATA
*/
# define MAX_BUFF_LEN 1024
# include <stdio.h>
char *program_name;
int
main (int argc, char *argv[])
{
char buff[MAX_BUFF_LEN + 1];
program_name = argv[0];
buff[MAX_BUFF_LEN] = 0;
while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
{
char file[MAX_BUFF_LEN];
char expected_result[MAX_BUFF_LEN];
char const *result;
sscanf (buff, "%s %s", file, expected_result);
result = dir_name (file);
if (strcmp (result, expected_result))
printf ("%s: got %s, expected %s\n", file, result, expected_result);
}
return 0;
}
#endif

View File

@ -1,47 +0,0 @@
/* Take file names apart into directory and base names.
Copyright (C) 1998, 2001, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef DIRNAME_H_
# define DIRNAME_H_ 1
# include <stdbool.h>
# include <stddef.h>
# ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
# endif
# ifndef ISSLASH
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
# endif
# ifndef FILE_SYSTEM_PREFIX_LEN
# define FILE_SYSTEM_PREFIX_LEN(File_name) 0
# endif
# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
# define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
char *base_name (char const *file);
char *dir_name (char const *file);
size_t base_len (char const *file);
size_t dir_len (char const *file);
bool strip_trailing_slashes (char *file);
#endif /* not DIRNAME_H_ */

View File

@ -1,46 +0,0 @@
/* Invoke dup, but avoid some glitches.
Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "unistd-safer.h"
#include <fcntl.h>
#include <unistd.h>
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
STDERR_FILENO. */
int
dup_safer (int fd)
{
#ifdef F_DUPFD
return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
#else
/* fd_safer calls us back, but eventually the recursion unwinds and
does the right thing. */
return fd_safer (dup (fd));
#endif
}

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +0,0 @@
/* Functions to support ebitsets.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _EBITSET_H
#define _EBITSET_H
#include "bitset.h"
extern size_t ebitset_bytes (bitset_bindex);
extern bitset ebitset_init (bitset, bitset_bindex);
extern void ebitset_release_memory (void);
#endif

View File

@ -1,304 +0,0 @@
/* Error handler for noninteractive utilities
Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "error.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if !_LIBC && ENABLE_NLS
# include "gettext.h"
#endif
#ifdef _LIBC
# include <wchar.h>
# define mbsrtowcs __mbsrtowcs
#endif
#if USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
#ifndef _
# define _(String) String
#endif
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
void (*error_print_progname) (void);
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
#ifdef _LIBC
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
# include <errno.h>
# include <libio/libioP.h>
/* In GNU libc we want do not want to use the common name `error' directly.
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_at_line __error_at_line
# include <libio/iolibio.h>
# define fflush(s) INTUSE(_IO_fflush) (s)
# undef putc
# define putc(c, fp) INTUSE(_IO_putc) (c, fp)
# include <bits/libc-lock.h>
#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
# ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
# endif
/* The calling program should define program_name and set it to the
name of the executing program. */
extern char *program_name;
# if HAVE_STRERROR_R || defined strerror_r
# define __strerror_r strerror_r
# endif
#endif /* not _LIBC */
static void
print_errno_message (int errnum)
{
char const *s = NULL;
#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;
# endif
#endif
#if !_LIBC
if (! s && ! (s = strerror (errnum)))
s = _("Unknown system error");
#endif
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
__fwprintf (stderr, L": %s", s);
return;
}
#endif
fprintf (stderr, ": %s", s);
}
static void
error_tail (int status, int errnum, const char *message, va_list args)
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
# define ALLOCA_LIMIT 2000
size_t len = strlen (message) + 1;
const wchar_t *wmessage = L"out of memory";
wchar_t *wbuf = (len < ALLOCA_LIMIT
? alloca (len * sizeof *wbuf)
: len <= SIZE_MAX / sizeof *wbuf
? malloc (len * sizeof *wbuf)
: NULL);
if (wbuf)
{
size_t res;
mbstate_t st;
const char *tmp = message;
memset (&st, '\0', sizeof (st));
res = mbsrtowcs (wbuf, &tmp, len, &st);
wmessage = res == (size_t) -1 ? L"???" : wbuf;
}
__vfwprintf (stderr, wmessage, args);
if (! (len < ALLOCA_LIMIT))
free (wbuf);
}
else
#endif
vfprintf (stderr, message, args);
va_end (args);
++error_message_count;
if (errnum)
print_errno_message (errnum);
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
putwc (L'\n', stderr);
else
#endif
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
}
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args.
If ERRNUM is nonzero, print its corresponding system error message.
Exit with status STATUS if it is nonzero. */
void
error (int status, int errnum, const char *message, ...)
{
va_list args;
#if defined _LIBC && defined __libc_ptf_call
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
__libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
fflush (stdout);
#ifdef _LIBC
_IO_flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
#endif
fprintf (stderr, "%s: ", program_name);
}
va_start (args, message);
error_tail (status, errnum, message, args);
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
int error_one_per_line;
void
error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message, ...)
{
va_list args;
if (error_one_per_line)
{
static const char *old_file_name;
static unsigned int old_line_number;
if (old_line_number == line_number
&& (file_name == old_file_name
|| strcmp (old_file_name, file_name) == 0))
/* Simply return and print nothing. */
return;
old_file_name = file_name;
old_line_number = line_number;
}
#if defined _LIBC && defined __libc_ptf_call
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
__libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
fflush (stdout);
#ifdef _LIBC
_IO_flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
#endif
fprintf (stderr, "%s:", program_name);
}
if (file_name != NULL)
{
#if _LIBC
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);
}
va_start (args, message);
error_tail (status, errnum, message, args);
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
#ifdef _LIBC
/* Make the weak alias. */
# undef error
# undef error_at_line
weak_alias (__error, error)
weak_alias (__error_at_line, error_at_line)
#endif

View File

@ -1,66 +0,0 @@
/* Declaration for error-reporting function
Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _ERROR_H
#define _ERROR_H 1
#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
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Print a message with `fprintf (stderr, FORMAT, ...)';
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
extern void error (int __status, int __errnum, const char *__format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern void error_at_line (int __status, int __errnum, const char *__fname,
unsigned int __lineno, const char *__format, ...)
__attribute__ ((__format__ (__printf__, 5, 6)));
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
extern void (*error_print_progname) (void);
/* This variable is incremented each time `error' is called. */
extern unsigned int error_message_count;
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
extern int error_one_per_line;
#ifdef __cplusplus
}
#endif
#endif /* error.h */

View File

@ -1,32 +0,0 @@
/* exit() function.
Copyright (C) 1995, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _EXIT_H
#define _EXIT_H
/* Get exit() declaration. */
#include <stdlib.h>
/* Some systems do not define EXIT_*, even with STDC_HEADERS. */
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#endif /* _EXIT_H */

View File

@ -1,27 +0,0 @@
/* Failure exit status
Copyright (C) 2002, 2003 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; see the file COPYING.
If not, write to the Free Software Foundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "exitfail.h"
#include "exit.h"
int volatile exit_failure = EXIT_FAILURE;

View File

@ -1,20 +0,0 @@
/* Failure exit status
Copyright (C) 2002 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; see the file COPYING.
If not, write to the Free Software Foundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
extern int volatile exit_failure;

View File

@ -1,59 +0,0 @@
/* Return a safer copy of a file descriptor.
Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "unistd-safer.h"
#include <errno.h>
#include <unistd.h>
#ifndef STDIN_FILENO
# define STDIN_FILENO 0
#endif
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
/* Return FD, unless FD would be a copy of standard input, output, or
error; in that case, return a duplicate of FD, closing FD. On
failure to duplicate, close FD, set errno, and return -1. Preserve
errno if FD is negative, so that the caller can always inspect
errno when the returned value is negative.
This function is usefully wrapped around functions that return file
descriptors, e.g., fd_safer (open ("file", O_RDONLY)). */
int
fd_safer (int fd)
{
if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
{
int f = dup_safer (fd);
int e = errno;
close (fd);
errno = e;
fd = f;
}
return fd;
}

View File

@ -1,69 +0,0 @@
/* Invoke fopen, but avoid some glitches.
Copyright (C) 2001, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "stdio-safer.h"
#include <errno.h>
#include <unistd.h>
#include "unistd-safer.h"
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
/* Like fopen, but do not return stdin, stdout, or stderr. */
FILE *
fopen_safer (char const *file, char const *mode)
{
FILE *fp = fopen (file, mode);
if (fp)
{
int fd = fileno (fp);
if (0 <= fd && fd <= STDERR_FILENO)
{
int f = dup_safer (fd);
if (f < 0)
{
int e = errno;
fclose (fp);
errno = e;
return NULL;
}
if (fclose (fp) != 0
|| ! (fp = fdopen (f, mode)))
{
int e = errno;
close (f);
errno = e;
return NULL;
}
}
}
return fp;
}

View File

@ -1,45 +0,0 @@
/* get-errno.c - get and set errno.
Copyright (C) 2002, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#include "get-errno.h"
/* Get and set errno. A source file that needs to set or get errno,
but doesn't need to test for specific errno values, can use these
functions to avoid namespace pollution. For example, a file that
defines EQUAL should not include <errno.h>, since <errno.h> might
define EQUAL; such a file can include <get-errno.h> instead. */
int
get_errno (void)
{
return errno;
}
void
set_errno (int e)
{
errno = e;
}

View File

@ -1,20 +0,0 @@
/* get-errno.h - get and set errno.
Copyright (C) 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
extern int get_errno (void);
extern void set_errno (int);

File diff suppressed because it is too large Load Diff

View File

@ -1,225 +0,0 @@
/* Declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_H
#ifndef __need_getopt
# define _GETOPT_H 1
#endif
/* Standalone applications should #define __GETOPT_PREFIX to an
identifier that prefixes the external functions and variables
defined in this header. When this happens, include the
headers that might declare getopt so that they will not cause
confusion if included after this file. Then systematically rename
identifiers so that they do not collide with the system functions
and variables. Renaming avoids problems with some compilers and
linkers. */
#if defined __GETOPT_PREFIX && !defined __need_getopt
# include <stdlib.h>
# include <stdio.h>
# include <unistd.h>
# undef __need_getopt
# undef getopt
# undef getopt_long
# undef getopt_long_only
# undef optarg
# undef opterr
# undef optind
# undef optopt
# define __GETOPT_CONCAT(x, y) x ## y
# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
# define getopt __GETOPT_ID (getopt)
# define getopt_long __GETOPT_ID (getopt_long)
# define getopt_long_only __GETOPT_ID (getopt_long_only)
# define optarg __GETOPT_ID (optarg)
# define opterr __GETOPT_ID (opterr)
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
#endif
/* Standalone applications get correct prototypes for getopt_long and
getopt_long_only; they declare "char **argv". libc uses prototypes
with "char *const *argv" that are incorrect because getopt_long and
getopt_long_only can permute argv; this is required for backward
compatibility (e.g., for LSB 2.0.1).
This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
but it caused redefinition warnings if both unistd.h and getopt.h were
included, since unistd.h includes getopt.h having previously defined
__need_getopt.
The only place where __getopt_argv_const is used is in definitions
of getopt_long and getopt_long_only below, but these are visible
only if __need_getopt is not defined, so it is quite safe to rewrite
the conditional as follows:
*/
#if !defined __need_getopt
# if defined __GETOPT_PREFIX
# define __getopt_argv_const /* empty */
# else
# define __getopt_argv_const const
# 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
#ifndef __THROW
# ifndef __GNUC_PREREQ
# define __GNUC_PREREQ(maj, min) (0)
# endif
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# else
# define __THROW
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
#ifndef __need_getopt
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
const char *name;
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
# define no_argument 0
# define required_argument 1
# define optional_argument 2
#endif /* need getopt */
/* Get definitions and prototypes for functions to process the
arguments in ARGV (ARGC of them, minus the program name) for
options given in OPTS.
Return the option character from OPTS just read. Return -1 when
there are no more options. For unrecognized options, or options
missing arguments, `optopt' is set to the option letter, and '?' is
returned.
The OPTS string is a list of characters which are recognized option
letters, optionally followed by colons, specifying that that letter
takes an argument, to be placed in `optarg'.
If a letter in OPTS is followed by two colons, its argument is
optional. This behavior is specific to the GNU `getopt'.
The argument `--' causes premature termination of argument
scanning, explicitly telling `getopt' that there are no more
options.
If OPTS begins with `--', then non-option arguments are treated as
arguments to the option '\0'. This behavior is specific to the GNU
`getopt'. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW;
#ifndef __need_getopt
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
#endif
#ifdef __cplusplus
}
#endif
/* Make sure we later can get all the definitions and declarations. */
#undef __need_getopt
#endif /* getopt.h */

View File

@ -1,174 +0,0 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef _LIBC
# include <getopt.h>
#else
# include "getopt.h"
#endif
#include "getopt_int.h"
#include <stdio.h>
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
opt_index, 0, 0);
}
int
_getopt_long_r (int argc, char **argv, const char *options,
const struct option *long_options, int *opt_index,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
0, 0, d);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only (int argc, char *__getopt_argv_const *argv,
const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
opt_index, 1, 0);
}
int
_getopt_long_only_r (int argc, char **argv, const char *options,
const struct option *long_options, int *opt_index,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
1, 0, d);
}
#ifdef TEST
#include <stdio.h>
int
main (int argc, char **argv)
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
static struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
{"delete", 1, 0, 0},
{"verbose", 0, 0, 0},
{"create", 0, 0, 0},
{"file", 1, 0, 0},
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
if (c == -1)
break;
switch (c)
{
case 0:
printf ("option %s", long_options[option_index].name);
if (optarg)
printf (" with arg %s", optarg);
printf ("\n");
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case 'd':
printf ("option d with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */

View File

@ -1,131 +0,0 @@
/* Internal declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_INT_H
#define _GETOPT_INT_H 1
extern int _getopt_internal (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct);
/* Reentrant versions which can handle parsing multiple argument
vectors at the same time. */
/* Data type for reentrant functions. */
struct _getopt_data
{
/* These have exactly the same meaning as the corresponding global
variables, except that they are used for the reentrant
versions of getopt. */
int optind;
int opterr;
int optopt;
char *optarg;
/* Internal members. */
/* True if the internal members have been initialized. */
int __initialized;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
char *__nextchar;
/* Describe how to deal with options that follow non-option ARGV-elements.
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters, or by calling getopt.
PERMUTE is the default. We permute the contents of ARGV as we
scan, so that eventually all the non-options are at the end.
This allows options to be given in any order, even with programs
that were not written to expect this.
RETURN_IN_ORDER is an option available to programs that were
written to expect options and other ARGV-elements in any order
and that care about the ordering of the two. We describe each
non-option ARGV-element as if it were the argument of an option
with character code 1. Using `-' as the first character of the
list of option characters selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} __ordering;
/* If the POSIXLY_CORRECT environment variable is set
or getopt was called. */
int __posixly_correct;
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first
of them; `last_nonopt' is the index after the last of them. */
int __first_nonopt;
int __last_nonopt;
#if defined _LIBC && defined USE_NONOPTION_FLAGS
int __nonoption_flags_max_len;
int __nonoption_flags_len;
# endif
};
/* The initializer is necessary to set OPTIND and OPTERR to their
default values and to clear the initialization flag. */
#define _GETOPT_DATA_INITIALIZER { 1, 1 }
extern int _getopt_internal_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct,
struct _getopt_data *__data);
extern int _getopt_long_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
struct _getopt_data *__data);
extern int _getopt_long_only_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts,
int *__longind,
struct _getopt_data *__data);
#endif /* getopt_int.h */

View File

@ -1,78 +0,0 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
chokes if dcgettext is defined as a macro. So include it now, to make
later inclusions of <locale.h> a NOP. We don't include <libintl.h>
as well because people using "gettext.h" will not include <libintl.h>,
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
is OK. */
#if defined(__sun)
# include <locale.h>
#endif
/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
<libintl.h>, which chokes if dcgettext is defined as a macro. So include
it now, to make later inclusions of <libintl.h> a NOP. */
#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
# include <cstdlib>
# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
# include <libintl.h>
# endif
#endif
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.
On pre-ANSI systems without 'const', the config.h file is supposed to
contain "#define const". */
# define gettext(Msgid) ((const char *) (Msgid))
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define textdomain(Domainname) ((const char *) (Domainname))
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
#endif
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
The argument, String, should be a literal string. Concatenated strings
and other string expressions won't work.
The macro's expansion is not parenthesized, so that it is suitable as
initializer for static 'char[]' or 'const char[]' variables. */
#define gettext_noop(String) String
#endif /* _LIBGETTEXT_H */

View File

@ -1,78 +0,0 @@
# This file is generated automatically by "bootstrap".
lib_SOURCES += argmatch.h argmatch.c
lib_SOURCES += basename.c stripslash.c
lib_SOURCES += exit.h
BUILT_SOURCES += $(GETOPT_H)
EXTRA_DIST += getopt_.h getopt_int.h
# We need the following in order to create <getopt.h> when the system
# doesn't have one that works with the given compiler.
getopt.h: getopt_.h
cp $(srcdir)/getopt_.h $@-t
mv $@-t $@
MOSTLYCLEANFILES += getopt.h getopt.h-t
# This is for those projects which use "gettextize --intl" to put a source-code
# copy of libintl into their package. In such projects, every Makefile.am needs
# -I$(top_builddir)/intl, so that <libintl.h> can be found in this directory.
# For the Makefile.ams in other directories it is the maintainer's
# responsibility; for the one from gnulib we do it here.
# This option has no effect when the user disables NLS (because then the intl
# directory contains no libintl.h file) or when the project does not use
# "gettextize --intl".
# (commented out by bootstrap) AM_CPPFLAGS += -I$(top_builddir)/intl
lib_SOURCES += gettext.h
lib_SOURCES += mbswidth.h mbswidth.c
BUILT_SOURCES += $(STDBOOL_H)
EXTRA_DIST += stdbool_.h
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool_.h
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t
mv $@-t $@
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
lib_SOURCES += stpcpy.h
BUILT_SOURCES += $(UNISTD_H)
# We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one.
unistd.h:
echo '/* Empty placeholder for $@. */' >$@
MOSTLYCLEANFILES += unistd.h
lib_SOURCES += verify.h
lib_SOURCES += xalloc-die.c
lib_SOURCES += xstrndup.h xstrndup.c

View File

@ -1,75 +0,0 @@
/* hard-locale.c -- Determine whether a locale is hard.
Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "hard-locale.h"
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include "strdup.h"
#ifdef __GLIBC__
# define GLIBC_VERSION __GLIBC__
#else
# define GLIBC_VERSION 0
#endif
/* Return true if the current CATEGORY locale is hard, i.e. if you
can't get away with assuming traditional C or POSIX behavior. */
bool
hard_locale (int category)
{
bool hard = true;
char const *p = setlocale (category, NULL);
if (p)
{
if (2 <= GLIBC_VERSION)
{
if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
hard = false;
}
else
{
char *locale = strdup (p);
if (locale)
{
/* Temporarily set the locale to the "C" and "POSIX" locales
to find their names, so that we can determine whether one
or the other is the caller's locale. */
if (((p = setlocale (category, "C"))
&& strcmp (p, locale) == 0)
|| ((p = setlocale (category, "POSIX"))
&& strcmp (p, locale) == 0))
hard = false;
/* Restore the caller's locale. */
setlocale (category, locale);
free (locale);
}
}
}
return hard;
}

View File

@ -1,26 +0,0 @@
/* Determine whether a locale is hard.
Copyright (C) 1999, 2003, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef HARD_LOCALE_H_
# define HARD_LOCALE_H_ 1
# include <stdbool.h>
bool hard_locale (int);
#endif /* HARD_LOCALE_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,88 +0,0 @@
/* hash - hashing table processing.
Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
Written by Jim Meyering <meyering@ascend.com>, 1998.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* A generic hash table package. */
/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
obstacks instead of malloc, and recompile `hash.c' with same setting. */
#ifndef HASH_H_
# define HASH_H_
# include <stdio.h>
# include <stdbool.h>
typedef size_t (*Hash_hasher) (const void *, size_t);
typedef bool (*Hash_comparator) (const void *, const void *);
typedef void (*Hash_data_freer) (void *);
typedef bool (*Hash_processor) (void *, void *);
struct hash_entry
{
void *data;
struct hash_entry *next;
};
struct hash_tuning
{
/* This structure is mainly used for `hash_initialize', see the block
documentation of `hash_reset_tuning' for more complete comments. */
float shrink_threshold; /* ratio of used buckets to trigger a shrink */
float shrink_factor; /* ratio of new smaller size to original size */
float growth_threshold; /* ratio of used buckets to trigger a growth */
float growth_factor; /* ratio of new bigger size to original size */
bool is_n_buckets; /* if CANDIDATE really means table size */
};
typedef struct hash_tuning Hash_tuning;
struct hash_table;
typedef struct hash_table Hash_table;
/* Information and lookup. */
size_t hash_get_n_buckets (const Hash_table *);
size_t hash_get_n_buckets_used (const Hash_table *);
size_t hash_get_n_entries (const Hash_table *);
size_t hash_get_max_bucket_length (const Hash_table *);
bool hash_table_ok (const Hash_table *);
void hash_print_statistics (const Hash_table *, FILE *);
void *hash_lookup (const Hash_table *, const void *);
/* Walking. */
void *hash_get_first (const Hash_table *);
void *hash_get_next (const Hash_table *, const void *);
size_t hash_get_entries (const Hash_table *, void **, size_t);
size_t hash_do_for_each (const Hash_table *, Hash_processor, void *);
/* Allocation and clean-up. */
size_t hash_string (const char *, size_t);
void hash_reset_tuning (Hash_tuning *);
Hash_table *hash_initialize (size_t, const Hash_tuning *,
Hash_hasher, Hash_comparator,
Hash_data_freer);
void hash_clear (Hash_table *);
void hash_free (Hash_table *);
/* Insertion and deletion. */
bool hash_rehash (Hash_table *, size_t);
void *hash_insert (Hash_table *, const void *);
void *hash_delete (Hash_table *, const void *);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +0,0 @@
/* Functions to support lbitsets.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _LBITSET_H
#define _LBITSET_H
#include "bitset.h"
extern size_t lbitset_bytes (bitset_bindex);
extern bitset lbitset_init (bitset, bitset_bindex);
extern void lbitset_release_memory (void);
#endif

View File

@ -1,36 +0,0 @@
/* Fake libiberty.h for Bison.
Copyright (C) 2002, 2003, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Bison depends on libiberty's implementation of bitsets, which
requires a `libiberty.h' file. This file provides the minimum
services. */
#ifndef BISON_LIBIBERTY_H_
# define BISON_LIBIBERTY_H_ 1
# ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
# define __attribute__(x)
# endif
# endif
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# include "xalloc.h"
#endif /* ! BISON_LIBIBERTY_H_ */

View File

@ -1,38 +0,0 @@
/* Yacc library main function.
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison 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.
Bison 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 Bison; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <config.h>
#if HAVE_LOCALE_H
# include <locale.h>
#endif
#if ! HAVE_SETLOCALE
# define setlocale(Category, Locale)
#endif
int yyparse (void);
int
main (void)
{
setlocale (LC_ALL, "");
return yyparse ();
}

View File

@ -1,36 +0,0 @@
/* malloc() function that is glibc compatible.
Copyright (C) 1997, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* written by Jim Meyering */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef malloc
#include <stdlib.h>
/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
void *
rpl_malloc (size_t n)
{
if (n == 0)
n = 1;
return malloc (n);
}

View File

@ -1,221 +0,0 @@
/* Determine the number of screen columns needed for a string.
Copyright (C) 2000-2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Bruno Haible <haible@clisp.cons.org>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "mbswidth.h"
/* Get MB_CUR_MAX. */
#include <stdlib.h>
#include <string.h>
/* Get isprint(). */
#include <ctype.h>
/* Get mbstate_t, mbrtowc(), mbsinit(), wcwidth(). */
#if HAVE_WCHAR_H
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
<wchar.h>. */
# include <stdio.h>
# include <time.h>
# include <wchar.h>
#endif
/* Get iswprint(), iswcntrl(). */
#if HAVE_WCTYPE_H
# include <wctype.h>
#endif
#if !defined iswprint && !HAVE_ISWPRINT
# define iswprint(wc) 1
#endif
#if !defined iswcntrl && !HAVE_ISWCNTRL
# define iswcntrl(wc) 0
#endif
#ifndef mbsinit
# if !HAVE_MBSINIT
# define mbsinit(ps) 1
# endif
#endif
#ifndef HAVE_DECL_WCWIDTH
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_WCWIDTH
int wcwidth ();
#endif
#ifndef wcwidth
# if !HAVE_WCWIDTH
/* wcwidth doesn't exist, so assume all printable characters have
width 1. */
# define wcwidth(wc) ((wc) == 0 ? 0 : iswprint (wc) ? 1 : -1)
# endif
#endif
/* Get ISPRINT. */
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
/* Undefine to protect against the definition in wctype.h of Solaris 2.6. */
#undef ISPRINT
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
#undef ISCNTRL
#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
/* Returns the number of columns needed to represent the multibyte
character string pointed to by STRING. If a non-printable character
occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned.
With flags = MBSW_REJECT_INVALID | MBSW_REJECT_UNPRINTABLE, this is
the multibyte analogue of the wcswidth function.
If STRING is not of length < INT_MAX / 2, integer overflow can occur. */
int
mbswidth (const char *string, int flags)
{
return mbsnwidth (string, strlen (string), flags);
}
/* Returns the number of columns needed to represent the multibyte
character string pointed to by STRING of length NBYTES. If a
non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is
specified, -1 is returned.
If NBYTES is not < INT_MAX / 2, integer overflow can occur. */
int
mbsnwidth (const char *string, size_t nbytes, int flags)
{
const char *p = string;
const char *plimit = p + nbytes;
int width;
width = 0;
#if HAVE_MBRTOWC
if (MB_CUR_MAX > 1)
{
while (p < plimit)
switch (*p)
{
case ' ': case '!': case '"': case '#': case '%':
case '&': case '\'': case '(': case ')': case '*':
case '+': case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case ':': case ';': case '<': case '=': case '>':
case '?':
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
case 'K': case 'L': case 'M': case 'N': case 'O':
case 'P': case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X': case 'Y':
case 'Z':
case '[': case '\\': case ']': case '^': case '_':
case 'a': case 'b': case 'c': case 'd': case 'e':
case 'f': case 'g': case 'h': case 'i': case 'j':
case 'k': case 'l': case 'm': case 'n': case 'o':
case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y':
case 'z': case '{': case '|': case '}': case '~':
/* These characters are printable ASCII characters. */
p++;
width++;
break;
default:
/* If we have a multibyte sequence, scan it up to its end. */
{
mbstate_t mbstate;
memset (&mbstate, 0, sizeof mbstate);
do
{
wchar_t wc;
size_t bytes;
int w;
bytes = mbrtowc (&wc, p, plimit - p, &mbstate);
if (bytes == (size_t) -1)
/* An invalid multibyte sequence was encountered. */
{
if (!(flags & MBSW_REJECT_INVALID))
{
p++;
width++;
break;
}
else
return -1;
}
if (bytes == (size_t) -2)
/* An incomplete multibyte character at the end. */
{
if (!(flags & MBSW_REJECT_INVALID))
{
p = plimit;
width++;
break;
}
else
return -1;
}
if (bytes == 0)
/* A null wide character was encountered. */
bytes = 1;
w = wcwidth (wc);
if (w >= 0)
/* A printable multibyte character. */
width += w;
else
/* An unprintable multibyte character. */
if (!(flags & MBSW_REJECT_UNPRINTABLE))
width += (iswcntrl (wc) ? 0 : 1);
else
return -1;
p += bytes;
}
while (! mbsinit (&mbstate));
}
break;
}
return width;
}
#endif
while (p < plimit)
{
unsigned char c = (unsigned char) *p++;
if (ISPRINT (c))
width++;
else if (!(flags & MBSW_REJECT_UNPRINTABLE))
width += (ISCNTRL (c) ? 0 : 1);
else
return -1;
}
return width;
}

View File

@ -1,61 +0,0 @@
/* Determine the number of screen columns needed for a string.
Copyright (C) 2000-2004 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stddef.h>
/* Avoid a clash of our mbswidth() with a function of the same name defined
in UnixWare 7.1.1 <wchar.h>. We need this #include before the #define
below.
However, we don't want to #include <wchar.h> on all platforms because
- Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
- BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
<wchar.h>. */
#if HAVE_DECL_MBSWIDTH_IN_WCHAR_H
# include <wchar.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Optional flags to influence mbswidth/mbsnwidth behavior. */
/* If this bit is set, return -1 upon finding an invalid or incomplete
character. Otherwise, assume invalid characters have width 1. */
#define MBSW_REJECT_INVALID 1
/* If this bit is set, return -1 upon finding a non-printable character.
Otherwise, assume unprintable characters have width 0 if they are
control characters and 1 otherwise. */
#define MBSW_REJECT_UNPRINTABLE 2
/* Returns the number of screen columns needed for STRING. */
#define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */
extern int mbswidth (const char *string, int flags);
/* Returns the number of screen columns needed for the NBYTES bytes
starting at BUF. */
extern int mbsnwidth (const char *buf, size_t nbytes, int flags);
#ifdef __cplusplus
}
#endif

View File

@ -1,440 +0,0 @@
/* obstack.c - subroutines used implicitly by object stack macros
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef _LIBC
# include <obstack.h>
# include <shlib-compat.h>
#else
# include "obstack.h"
#endif
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
incremented whenever callers compiled using an old obstack.h can no
longer properly call the functions in this obstack.c. */
#define OBSTACK_INTERFACE_VERSION 1
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself, and the installed library
supports the same library interface we do. This code is part of the GNU
C Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object
files, it is simpler to just do this in the source for each such file. */
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
# include <gnu-versions.h>
# if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
# define ELIDE_CODE
# endif
#endif
#include <stddef.h>
#ifndef ELIDE_CODE
# if HAVE_INTTYPES_H
# include <inttypes.h>
# endif
# if HAVE_STDINT_H || defined _LIBC
# include <stdint.h>
# endif
/* Determine default alignment. */
union fooround
{
uintmax_t i;
long double d;
void *p;
};
struct fooalign
{
char c;
union fooround u;
};
/* 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
DEFAULT_ROUNDING. So we prepare for it to do that. */
enum
{
DEFAULT_ALIGNMENT = offsetof (struct fooalign, u),
DEFAULT_ROUNDING = sizeof (union fooround)
};
/* 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;
in such a case, redefine COPYING_UNIT to `long' (if that works)
or `char' as a last resort. */
# ifndef COPYING_UNIT
# define COPYING_UNIT int
# endif
/* The functions allocating more room by calling `obstack_chunk_alloc'
jump to the handler pointed to by `obstack_alloc_failed_handler'.
This can be set to a user defined function which should either
abort gracefully or use longjump - but shouldn't return. This
variable by default points to the internal function
`print_and_abort'. */
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
/* Exit value used when `print_and_abort' is used. */
# include <stdlib.h>
# ifdef _LIBC
int obstack_exit_failure = EXIT_FAILURE;
# else
# include "exitfail.h"
# define obstack_exit_failure exit_failure
# endif
# ifdef _LIBC
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
/* A looong time ago (before 1994, anyway; we're not sure) this global variable
was used by non-GNU-C macros to avoid multiple evaluation. The GNU C
library still exports it because somebody might use it. */
struct obstack *_obstack_compat;
compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0);
# endif
# endif
/* Define a macro that either calls functions with the traditional malloc/free
calling interface, or calls functions with the mmalloc/mfree interface
(that adds an extra first argument), based on the state of use_extra_arg.
For free, do not use ?:, since some compilers, like the MIPS compilers,
do not allow (expr) ? void : void. */
# define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
# define CALL_FREEFUN(h, old_chunk) \
do { \
if ((h) -> use_extra_arg) \
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
else \
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
} while (0)
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
Objects start on multiples of ALIGNMENT (0 means use default).
CHUNKFUN is the function to use to allocate chunks,
and FREEFUN the function to free them.
Return nonzero if successful, calls obstack_alloc_failed_handler if
allocation fails. */
int
_obstack_begin (struct obstack *h,
int size, int alignment,
void *(*chunkfun) (long),
void (*freefun) (void *))
{
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = DEFAULT_ALIGNMENT;
if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */
{
/* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
Use the values for range checking, because if range checking is off,
the extra bytes won't be missed terribly, but if range checking is on
and we used a larger request, a whole extra 4096 bytes would be
allocated.
These number are irrelevant to the new GNU malloc. I suspect it is
less sensitive to the size of the request. */
int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
+ 4 + DEFAULT_ROUNDING - 1)
& ~(DEFAULT_ROUNDING - 1));
size = 4096 - extra;
}
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->use_extra_arg = 0;
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk)
(*obstack_alloc_failed_handler) ();
h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
alignment - 1);
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
chunk->prev = 0;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1;
}
int
_obstack_begin_1 (struct obstack *h, int size, int alignment,
void *(*chunkfun) (void *, long),
void (*freefun) (void *, void *),
void *arg)
{
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = DEFAULT_ALIGNMENT;
if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */
{
/* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
Use the values for range checking, because if range checking is off,
the extra bytes won't be missed terribly, but if range checking is on
and we used a larger request, a whole extra 4096 bytes would be
allocated.
These number are irrelevant to the new GNU malloc. I suspect it is
less sensitive to the size of the request. */
int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
+ 4 + DEFAULT_ROUNDING - 1)
& ~(DEFAULT_ROUNDING - 1));
size = 4096 - extra;
}
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->extra_arg = arg;
h->use_extra_arg = 1;
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk)
(*obstack_alloc_failed_handler) ();
h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
alignment - 1);
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
chunk->prev = 0;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1;
}
/* Allocate a new current chunk for the obstack *H
on the assumption that LENGTH bytes need to be added
to the current object, or a new object of length LENGTH allocated.
Copies any partial object from the end of the old chunk
to the beginning of the new one. */
void
_obstack_newchunk (struct obstack *h, int length)
{
register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk;
register long new_size;
register long obj_size = h->next_free - h->object_base;
register long i;
long already;
char *object_base;
/* Compute size for new chunk. */
new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100;
if (new_size < h->chunk_size)
new_size = h->chunk_size;
/* Allocate and initialize the new chunk. */
new_chunk = CALL_CHUNKFUN (h, new_size);
if (!new_chunk)
(*obstack_alloc_failed_handler) ();
h->chunk = new_chunk;
new_chunk->prev = old_chunk;
new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
/* Compute an aligned object_base in the new chunk */
object_base =
__PTR_ALIGN ((char *) new_chunk, new_chunk->contents, h->alignment_mask);
/* Move the existing object to the new chunk.
Word at a time is fast and is safe if the object
is sufficiently aligned. */
if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT)
{
for (i = obj_size / sizeof (COPYING_UNIT) - 1;
i >= 0; i--)
((COPYING_UNIT *)object_base)[i]
= ((COPYING_UNIT *)h->object_base)[i];
/* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,
but that can cross a page boundary on a machine
which does not do strict alignment for COPYING_UNITS. */
already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT);
}
else
already = 0;
/* Copy remaining bytes one by one. */
for (i = already; i < obj_size; i++)
object_base[i] = h->object_base[i];
/* If the object just copied was the only data in OLD_CHUNK,
free that chunk and remove it from the chain.
But not if that chunk might contain an empty object. */
if (! h->maybe_empty_object
&& (h->object_base
== __PTR_ALIGN ((char *) old_chunk, old_chunk->contents,
h->alignment_mask)))
{
new_chunk->prev = old_chunk->prev;
CALL_FREEFUN (h, old_chunk);
}
h->object_base = object_base;
h->next_free = h->object_base + obj_size;
/* The new chunk certainly contains no empty object yet. */
h->maybe_empty_object = 0;
}
# ifdef _LIBC
libc_hidden_def (_obstack_newchunk)
# endif
/* Return nonzero if object OBJ has been allocated from obstack H.
This is here for debugging.
If you use it in a program, you are probably losing. */
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
obstack.h because it is just for debugging. */
int _obstack_allocated_p (struct obstack *h, void *obj);
int
_obstack_allocated_p (struct obstack *h, void *obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = (h)->chunk;
/* We use >= rather than > since the object cannot be exactly at
the beginning of the chunk but might be an empty object exactly
at the end of an adjacent chunk. */
while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
{
plp = lp->prev;
lp = plp;
}
return lp != 0;
}
/* Free objects in obstack H, including OBJ and everything allocate
more recently than OBJ. If OBJ is zero, free everything in H. */
# undef obstack_free
void
obstack_free (struct obstack *h, void *obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = h->chunk;
/* We use >= because there cannot be an object at the beginning of a chunk.
But there can be an empty object at that address
at the end of another chunk. */
while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
{
plp = lp->prev;
CALL_FREEFUN (h, lp);
lp = plp;
/* If we switch chunks, we can't tell whether the new current
chunk contains an empty object, so assume that it may. */
h->maybe_empty_object = 1;
}
if (lp)
{
h->object_base = h->next_free = (char *) (obj);
h->chunk_limit = lp->limit;
h->chunk = lp;
}
else if (obj != 0)
/* obj is not in any of the chunks! */
abort ();
}
# ifdef _LIBC
/* Older versions of libc used a function _obstack_free intended to be
called by non-GCC compilers. */
strong_alias (obstack_free, _obstack_free)
# endif
int
_obstack_memory_used (struct obstack *h)
{
register struct _obstack_chunk* lp;
register int nbytes = 0;
for (lp = h->chunk; lp != 0; lp = lp->prev)
{
nbytes += lp->limit - (char *) lp;
}
return nbytes;
}
/* Define the error handler. */
# ifdef _LIBC
# include <libintl.h>
# else
# include "gettext.h"
# endif
# ifndef _
# define _(msgid) gettext (msgid)
# endif
# ifdef _LIBC
# include <libio/iolibio.h>
# 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
static void
__attribute__ ((noreturn))
print_and_abort (void)
{
/* Don't change any of these strings. Yes, it would be possible to add
the newline to the string and use fputs or so. But this must not
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. */
# ifdef _LIBC
(void) __fxprintf (NULL, "%s\n", _("memory exhausted"));
# else
fprintf (stderr, "%s\n", _("memory exhausted"));
# endif
exit (obstack_exit_failure);
}
#endif /* !ELIDE_CODE */

View File

@ -1,508 +0,0 @@
/* obstack.h - object stack macros
Copyright (C) 1988-1994,1996-1999,2003,2004,2005
Free Software Foundation, Inc.
This file is part of the GNU C Library.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Summary:
All the apparent functions defined here are macros. The idea
is that you would use these pre-tested macros to solve a
very specific set of problems, and they would run fast.
Caution: no side-effects in arguments please!! They may be
evaluated MANY times!!
These macros operate a stack of objects. Each object starts life
small, and may grow to maturity. (Consider building a word syllable
by syllable.) An object can move while it is growing. Once it has
been "finished" it never changes address again. So the "top of the
stack" is typically an immature growing object, while the rest of the
stack is of mature, fixed size and fixed address objects.
These routines grab large chunks of memory, using a function you
supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
by calling `obstack_chunk_free'. You must define them and declare
them before using any obstack macros.
Each independent stack is represented by a `struct obstack'.
Each of the obstack macros expects a pointer to such a structure
as the first argument.
One motivation for this package is the problem of growing char strings
in symbol tables. Unless you are "fascist pig with a read-only mind"
--Gosper's immortal quote from HAKMEM item 154, out of context--you
would not like to put any arbitrary upper limit on the length of your
symbols.
In practice this often means you will build many short symbols and a
few long symbols. At the time you are reading a symbol you don't know
how long it is. One traditional method is to read a symbol into a
buffer, realloc()ating the buffer every time you try to read a symbol
that is longer than the buffer. This is beaut, but you still will
want to copy the symbol from the buffer to a more permanent
symbol-table entry say about half the time.
With obstacks, you can work differently. Use one obstack for all symbol
names. As you read a symbol, grow the name in the obstack gradually.
When the name is complete, finalize it. Then, if the symbol exists already,
free the newly read name.
The way we do this is to take a large chunk, allocating memory from
low addresses. When you want to build a symbol in the chunk you just
add chars above the current "high water mark" in the chunk. When you
have finished adding chars, because you got to the end of the symbol,
you know how long the chars are, and you can create a new object.
Mostly the chars will not burst over the highest address of the chunk,
because you would typically expect a chunk to be (say) 100 times as
long as an average object.
In case that isn't clear, when we have enough chars to make up
the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
so we just point to it where it lies. No moving of chars is
needed and this is the second win: potentially long strings need
never be explicitly shuffled. Once an object is formed, it does not
change its address during its lifetime.
When the chars burst over a chunk boundary, we allocate a larger
chunk, and then copy the partly formed object from the end of the old
chunk to the beginning of the new larger chunk. We then carry on
accreting characters to the end of the object as we normally would.
A special macro is provided to add a single char at a time to a
growing object. This allows the use of register variables, which
break the ordinary 'growth' macro.
Summary:
We allocate large chunks.
We carve out one object at a time from the current chunk.
Once carved, an object never moves.
We are free to append data of any size to the currently
growing object.
Exactly one object is growing in an obstack at any one time.
You can run one obstack per control block.
You may have as many control blocks as you dare.
Because of the way we do it, you can `unwind' an obstack
back to a previous state. (You may remove objects much
as you would with a stack.)
*/
/* Don't do the contents of this file more than once. */
#ifndef _OBSTACK_H
#define _OBSTACK_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* We need the type of a pointer subtraction. If __PTRDIFF_TYPE__ is
defined, as with GNU C, use that; that way we don't pollute the
namespace with <stddef.h>'s symbols. Otherwise, include <stddef.h>
and use ptrdiff_t. */
#ifdef __PTRDIFF_TYPE__
# define PTR_INT_TYPE __PTRDIFF_TYPE__
#else
# include <stddef.h>
# define PTR_INT_TYPE ptrdiff_t
#endif
/* If B is the base of an object addressed by P, return the result of
aligning P to the next multiple of A + 1. B and P must be of type
char *. A + 1 must be a power of 2. */
#define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A)))
/* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case
where pointers can be converted to integers, aligned as integers,
and converted back again. If PTR_INT_TYPE is narrower than a
pointer (e.g., the AS/400), play it safe and compute the alignment
relative to B. Otherwise, use the faster strategy of computing the
alignment relative to 0. */
#define __PTR_ALIGN(B, P, A) \
__BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \
P, A)
#include <string.h>
struct _obstack_chunk /* Lives at front of each chunk. */
{
char *limit; /* 1 past end of this chunk */
struct _obstack_chunk *prev; /* address of prior chunk or NULL */
char contents[4]; /* objects begin here */
};
struct obstack /* control current object in current chunk */
{
long chunk_size; /* preferred size to allocate chunks in */
struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
char *object_base; /* address of object we are building */
char *next_free; /* where to add next char to current object */
char *chunk_limit; /* address of char after current chunk */
union
{
PTR_INT_TYPE tempint;
void *tempptr;
} temp; /* Temporary for some macros. */
int alignment_mask; /* Mask of alignment for each object. */
/* These prototypes vary based on `use_extra_arg', and we use
casts to the prototypeless function type in all assignments,
but having prototypes here quiets -Wstrict-prototypes. */
struct _obstack_chunk *(*chunkfun) (void *, long);
void (*freefun) (void *, struct _obstack_chunk *);
void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
unsigned maybe_empty_object:1;/* There is a possibility that the current
chunk contains a zero-length object. This
prevents freeing the chunk if we allocate
a bigger chunk to replace it. */
unsigned alloc_failed:1; /* No longer used, as we now call the failed
handler on error, but retained for binary
compatibility. */
};
/* Declare the external functions we use; they are in obstack.c. */
extern void _obstack_newchunk (struct obstack *, int);
extern int _obstack_begin (struct obstack *, int, int,
void *(*) (long), void (*) (void *));
extern int _obstack_begin_1 (struct obstack *, int, int,
void *(*) (void *, long),
void (*) (void *, void *), void *);
extern int _obstack_memory_used (struct obstack *);
void obstack_free (struct obstack *obstack, void *block);
/* Error handler called when `obstack_chunk_alloc' failed to allocate
more memory. This can be set to a user defined function which
should either abort gracefully or use longjump - but shouldn't
return. The default action is to print a message and abort. */
extern void (*obstack_alloc_failed_handler) (void);
/* Exit value used when `print_and_abort' is used. */
extern int obstack_exit_failure;
/* Pointer to beginning of object being allocated or to be allocated next.
Note that this might not be the final address of the object
because a new chunk might be needed to hold the final size. */
#define obstack_base(h) ((void *) (h)->object_base)
/* Size for allocating ordinary chunks. */
#define obstack_chunk_size(h) ((h)->chunk_size)
/* Pointer to next byte not yet allocated in current chunk. */
#define obstack_next_free(h) ((h)->next_free)
/* Mask specifying low bits that should be clear in address of an object. */
#define obstack_alignment_mask(h) ((h)->alignment_mask)
/* To prevent prototype warnings provide complete argument list. */
#define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) (long)) obstack_chunk_alloc, \
(void (*) (void *)) obstack_chunk_free)
#define obstack_begin(h, size) \
_obstack_begin ((h), (size), 0, \
(void *(*) (long)) obstack_chunk_alloc, \
(void (*) (void *)) obstack_chunk_free)
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
_obstack_begin ((h), (size), (alignment), \
(void *(*) (long)) (chunkfun), \
(void (*) (void *)) (freefun))
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
_obstack_begin_1 ((h), (size), (alignment), \
(void *(*) (void *, long)) (chunkfun), \
(void (*) (void *, void *)) (freefun), (arg))
#define obstack_chunkfun(h, newchunkfun) \
((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
#define obstack_freefun(h, newfreefun) \
((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))
#define obstack_blank_fast(h,n) ((h)->next_free += (n))
#define obstack_memory_used(h) _obstack_memory_used (h)
#if defined __GNUC__ && defined __STDC__ && __STDC__
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
does not implement __extension__. But that compiler doesn't define
__GNUC_MINOR__. */
# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
# define __extension__
# endif
/* For GNU C, if not -traditional,
we can define these macros to compute all args only once
without using a global variable.
Also, we can avoid using the `temp' slot, to make faster code. */
# define obstack_object_size(OBSTACK) \
__extension__ \
({ struct obstack const *__o = (OBSTACK); \
(unsigned) (__o->next_free - __o->object_base); })
# define obstack_room(OBSTACK) \
__extension__ \
({ struct obstack const *__o = (OBSTACK); \
(unsigned) (__o->chunk_limit - __o->next_free); })
# define obstack_make_room(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
(void) 0; })
# define obstack_empty_p(OBSTACK) \
__extension__ \
({ struct obstack const *__o = (OBSTACK); \
(__o->chunk->prev == 0 \
&& __o->next_free == __PTR_ALIGN ((char *) __o->chunk, \
__o->chunk->contents, \
__o->alignment_mask)); })
# define obstack_grow(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
memcpy (__o->next_free, where, __len); \
__o->next_free += __len; \
(void) 0; })
# define obstack_grow0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
memcpy (__o->next_free, where, __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
(void) 0; })
# define obstack_1grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, 1); \
obstack_1grow_fast (__o, datum); \
(void) 0; })
/* These assume that the obstack alignment is good enough for pointers
or ints, and that the data added so far to the current object
shares that much alignment. */
# define obstack_ptr_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (void *)); \
obstack_ptr_grow_fast (__o, datum); }) \
# define obstack_int_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (int)); \
obstack_int_grow_fast (__o, datum); })
# define obstack_ptr_grow_fast(OBSTACK,aptr) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
*(const void **) __o1->next_free = (aptr); \
__o1->next_free += sizeof (const void *); \
(void) 0; })
# define obstack_int_grow_fast(OBSTACK,aint) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
*(int *) __o1->next_free = (aint); \
__o1->next_free += sizeof (int); \
(void) 0; })
# define obstack_blank(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
obstack_blank_fast (__o, __len); \
(void) 0; })
# define obstack_alloc(OBSTACK,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_blank (__h, (length)); \
obstack_finish (__h); })
# define obstack_copy(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_grow (__h, (where), (length)); \
obstack_finish (__h); })
# define obstack_copy0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_grow0 (__h, (where), (length)); \
obstack_finish (__h); })
/* The local variable is named __o1 to avoid a name conflict
when obstack_blank is called. */
# define obstack_finish(OBSTACK) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
void *__value = (void *) __o1->object_base; \
if (__o1->next_free == __value) \
__o1->maybe_empty_object = 1; \
__o1->next_free \
= __PTR_ALIGN (__o1->object_base, __o1->next_free, \
__o1->alignment_mask); \
if (__o1->next_free - (char *)__o1->chunk \
> __o1->chunk_limit - (char *)__o1->chunk) \
__o1->next_free = __o1->chunk_limit; \
__o1->object_base = __o1->next_free; \
__value; })
# define obstack_free(OBSTACK, OBJ) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
void *__obj = (OBJ); \
if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
__o->next_free = __o->object_base = (char *)__obj; \
else (obstack_free) (__o, __obj); })
#else /* not __GNUC__ or not __STDC__ */
# define obstack_object_size(h) \
(unsigned) ((h)->next_free - (h)->object_base)
# define obstack_room(h) \
(unsigned) ((h)->chunk_limit - (h)->next_free)
# define obstack_empty_p(h) \
((h)->chunk->prev == 0 \
&& (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \
(h)->chunk->contents, \
(h)->alignment_mask))
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
so that we can avoid having void expressions
in the arms of the conditional expression.
Casting the third operand to void was tried before,
but some compilers won't accept it. */
# define obstack_make_room(h,length) \
( (h)->temp.tempint = (length), \
(((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0))
# define obstack_grow(h,where,length) \
( (h)->temp.tempint = (length), \
(((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \
memcpy ((h)->next_free, where, (h)->temp.tempint), \
(h)->next_free += (h)->temp.tempint)
# define obstack_grow0(h,where,length) \
( (h)->temp.tempint = (length), \
(((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \
memcpy ((h)->next_free, where, (h)->temp.tempint), \
(h)->next_free += (h)->temp.tempint, \
*((h)->next_free)++ = 0)
# define obstack_1grow(h,datum) \
( (((h)->next_free + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), 1), 0) : 0), \
obstack_1grow_fast (h, datum))
# define obstack_ptr_grow(h,datum) \
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
obstack_ptr_grow_fast (h, datum))
# define obstack_int_grow(h,datum) \
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
obstack_int_grow_fast (h, datum))
# define obstack_ptr_grow_fast(h,aptr) \
(((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr))
# define obstack_int_grow_fast(h,aint) \
(((int *) ((h)->next_free += sizeof (int)))[-1] = (aint))
# define obstack_blank(h,length) \
( (h)->temp.tempint = (length), \
(((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \
? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \
obstack_blank_fast (h, (h)->temp.tempint))
# define obstack_alloc(h,length) \
(obstack_blank ((h), (length)), obstack_finish ((h)))
# define obstack_copy(h,where,length) \
(obstack_grow ((h), (where), (length)), obstack_finish ((h)))
# define obstack_copy0(h,where,length) \
(obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
# define obstack_finish(h) \
( ((h)->next_free == (h)->object_base \
? (((h)->maybe_empty_object = 1), 0) \
: 0), \
(h)->temp.tempptr = (h)->object_base, \
(h)->next_free \
= __PTR_ALIGN ((h)->object_base, (h)->next_free, \
(h)->alignment_mask), \
(((h)->next_free - (char *) (h)->chunk \
> (h)->chunk_limit - (char *) (h)->chunk) \
? ((h)->next_free = (h)->chunk_limit) : 0), \
(h)->object_base = (h)->next_free, \
(h)->temp.tempptr)
# define obstack_free(h,obj) \
( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \
((((h)->temp.tempint > 0 \
&& (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \
? (int) ((h)->next_free = (h)->object_base \
= (h)->temp.tempint + (char *) (h)->chunk) \
: (((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0)))
#endif /* not __GNUC__ or not __STDC__ */
#ifdef __cplusplus
} /* C++ */
#endif
#endif /* obstack.h */

View File

@ -1,50 +0,0 @@
/* Invoke pipe, but avoid some glitches.
Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Jim Meyering. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "unistd-safer.h"
#include <unistd.h>
/* Like pipe, but ensure that neither of the file descriptors is
STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. */
int
pipe_safer (int fd[2])
{
int fail = pipe (fd);
if (fail)
return fail;
{
int i;
for (i = 0; i < 2; i++)
{
int f = fd_safer (fd[i]);
if (f < 0)
return -1;
fd[i] = f;
}
}
return 0;
}

View File

@ -1,41 +0,0 @@
/* quote.c - quote arguments for output
Copyright (C) 1998, 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert <eggert@twinsun.com> */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quotearg.h"
#include "quote.h"
/* Return an unambiguous printable representation of NAME,
allocated in slot N, suitable for diagnostics. */
char const *
quote_n (int n, char const *name)
{
return quotearg_n_style (n, locale_quoting_style, name);
}
/* Return an unambiguous printable representation of NAME,
suitable for diagnostics. */
char const *
quote (char const *name)
{
return quote_n (0, name);
}

View File

@ -1,22 +0,0 @@
/* quote.h - prototypes for quote.c
Copyright (C) 1998, 1999, 2000, 2001, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
char const *quote_n (int n, char const *name);
char const *quote (char const *name);

View File

@ -1,690 +0,0 @@
/* quotearg.c - quote arguments for output
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert <eggert@twinsun.com> */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "quotearg.h"
#include "xalloc.h"
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
#if HAVE_WCHAR_H
/* BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. */
# include <stdio.h>
# include <time.h>
# include <wchar.h>
#endif
#if !HAVE_MBRTOWC
/* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the
other macros are defined only for documentation and to satisfy C
syntax. */
# undef MB_CUR_MAX
# define MB_CUR_MAX 1
# define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0)
# define iswprint(wc) isprint ((unsigned char) (wc))
# undef HAVE_MBSINIT
#endif
#if !defined mbsinit && !HAVE_MBSINIT
# define mbsinit(ps) 1
#endif
#ifndef iswprint
# if HAVE_WCTYPE_H
# include <wctype.h>
# endif
# if !defined iswprint && !HAVE_ISWPRINT
# define iswprint(wc) 1
# endif
#endif
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#define INT_BITS (sizeof (int) * CHAR_BIT)
struct quoting_options
{
/* Basic quoting style. */
enum quoting_style style;
/* Quote the characters indicated by this bit vector even if the
quoting style would not normally require them to be quoted. */
unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1];
};
/* Names of quoting styles. */
char const *const quoting_style_args[] =
{
"literal",
"shell",
"shell-always",
"c",
"escape",
"locale",
"clocale",
0
};
/* Correspondences to quoting style names. */
enum quoting_style const quoting_style_vals[] =
{
literal_quoting_style,
shell_quoting_style,
shell_always_quoting_style,
c_quoting_style,
escape_quoting_style,
locale_quoting_style,
clocale_quoting_style
};
/* The default quoting options. */
static struct quoting_options default_quoting_options;
/* Allocate a new set of quoting options, with contents initially identical
to O if O is not null, or to the default if O is null.
It is the caller's responsibility to free the result. */
struct quoting_options *
clone_quoting_options (struct quoting_options *o)
{
int e = errno;
struct quoting_options *p = xmalloc (sizeof *p);
*p = *(o ? o : &default_quoting_options);
errno = e;
return p;
}
/* Get the value of O's quoting style. If O is null, use the default. */
enum quoting_style
get_quoting_style (struct quoting_options *o)
{
return (o ? o : &default_quoting_options)->style;
}
/* In O (or in the default if O is null),
set the value of the quoting style to S. */
void
set_quoting_style (struct quoting_options *o, enum quoting_style s)
{
(o ? o : &default_quoting_options)->style = s;
}
/* In O (or in the default if O is null),
set the value of the quoting options for character C to I.
Return the old value. Currently, the only values defined for I are
0 (the default) and 1 (which means to quote the character even if
it would not otherwise be quoted). */
int
set_char_quoting (struct quoting_options *o, char c, int i)
{
unsigned char uc = c;
unsigned int *p =
(o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS;
int shift = uc % INT_BITS;
int r = (*p >> shift) & 1;
*p ^= ((i & 1) ^ r) << shift;
return r;
}
/* MSGID approximates a quotation mark. Return its translation if it
has one; otherwise, return either it or "\"", depending on S. */
static char const *
gettext_quote (char const *msgid, enum quoting_style s)
{
char const *translation = _(msgid);
if (translation == msgid && s == clocale_quoting_style)
translation = "\"";
return translation;
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using QUOTING_STYLE and the
non-quoting-style part of O to control quoting.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is SIZE_MAX, use the string length of the argument for ARGSIZE.
This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG,
ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting
style specified by O, and O may not be null. */
static size_t
quotearg_buffer_restyled (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
enum quoting_style quoting_style,
struct quoting_options const *o)
{
size_t i;
size_t len = 0;
char const *quote_string = 0;
size_t quote_string_len = 0;
bool backslash_escapes = false;
bool unibyte_locale = MB_CUR_MAX == 1;
#define STORE(c) \
do \
{ \
if (len < buffersize) \
buffer[len] = (c); \
len++; \
} \
while (0)
switch (quoting_style)
{
case c_quoting_style:
STORE ('"');
backslash_escapes = true;
quote_string = "\"";
quote_string_len = 1;
break;
case escape_quoting_style:
backslash_escapes = true;
break;
case locale_quoting_style:
case clocale_quoting_style:
{
/* TRANSLATORS:
Get translations for open and closing quotation marks.
The message catalog should translate "`" to a left
quotation mark suitable for the locale, and similarly for
"'". If the catalog has no translation,
locale_quoting_style quotes `like this', and
clocale_quoting_style quotes "like this".
For example, an American English Unicode locale should
translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and
should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
MARK). A British English Unicode locale should instead
translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
If you don't know what to put here, please see
<http://en.wikipedia.org/wiki/Quotation_mark#Glyphs>
and use glyphs suitable for your language. */
char const *left = gettext_quote (N_("`"), quoting_style);
char const *right = gettext_quote (N_("'"), quoting_style);
for (quote_string = left; *quote_string; quote_string++)
STORE (*quote_string);
backslash_escapes = true;
quote_string = right;
quote_string_len = strlen (quote_string);
}
break;
case shell_always_quoting_style:
STORE ('\'');
quote_string = "'";
quote_string_len = 1;
break;
default:
break;
}
for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++)
{
unsigned char c;
unsigned char esc;
if (backslash_escapes
&& quote_string_len
&& i + quote_string_len <= argsize
&& memcmp (arg + i, quote_string, quote_string_len) == 0)
STORE ('\\');
c = arg[i];
switch (c)
{
case '\0':
if (backslash_escapes)
{
STORE ('\\');
STORE ('0');
STORE ('0');
c = '0';
}
break;
case '?':
switch (quoting_style)
{
case shell_quoting_style:
goto use_shell_always_quoting_style;
case c_quoting_style:
if (i + 2 < argsize && arg[i + 1] == '?')
switch (arg[i + 2])
{
case '!': case '\'':
case '(': case ')': case '-': case '/':
case '<': case '=': case '>':
/* Escape the second '?' in what would otherwise be
a trigraph. */
c = arg[i + 2];
i += 2;
STORE ('?');
STORE ('\\');
STORE ('?');
break;
default:
break;
}
break;
default:
break;
}
break;
case '\a': esc = 'a'; goto c_escape;
case '\b': esc = 'b'; goto c_escape;
case '\f': esc = 'f'; goto c_escape;
case '\n': esc = 'n'; goto c_and_shell_escape;
case '\r': esc = 'r'; goto c_and_shell_escape;
case '\t': esc = 't'; goto c_and_shell_escape;
case '\v': esc = 'v'; goto c_escape;
case '\\': esc = c; goto c_and_shell_escape;
c_and_shell_escape:
if (quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
c_escape:
if (backslash_escapes)
{
c = esc;
goto store_escape;
}
break;
case '{': case '}': /* sometimes special if isolated */
if (! (argsize == SIZE_MAX ? arg[1] == '\0' : argsize == 1))
break;
/* Fall through. */
case '#': case '~':
if (i != 0)
break;
/* Fall through. */
case ' ':
case '!': /* special in bash */
case '"': case '$': case '&':
case '(': case ')': case '*': case ';':
case '<':
case '=': /* sometimes special in 0th or (with "set -k") later args */
case '>': case '[':
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
case '`': case '|':
/* A shell special character. In theory, '$' and '`' could
be the first bytes of multibyte characters, which means
we should check them with mbrtowc, but in practice this
doesn't happen so it's not worth worrying about. */
if (quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
break;
case '\'':
switch (quoting_style)
{
case shell_quoting_style:
goto use_shell_always_quoting_style;
case shell_always_quoting_style:
STORE ('\'');
STORE ('\\');
STORE ('\'');
break;
default:
break;
}
break;
case '%': case '+': case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9': case ':':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
case 'Y': case 'Z': case ']': case '_': case 'a': case 'b':
case 'c': case 'd': case 'e': case 'f': case 'g': case 'h':
case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
case 'o': case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
/* These characters don't cause problems, no matter what the
quoting style is. They cannot start multibyte sequences. */
break;
default:
/* If we have a multibyte sequence, copy it until we reach
its end, find an error, or come back to the initial shift
state. For C-like styles, if the sequence has
unprintable characters, escape the whole sequence, since
we can't easily escape single characters within it. */
{
/* Length of multibyte sequence found so far. */
size_t m;
bool printable;
if (unibyte_locale)
{
m = 1;
printable = isprint (c) != 0;
}
else
{
mbstate_t mbstate;
memset (&mbstate, 0, sizeof mbstate);
m = 0;
printable = true;
if (argsize == SIZE_MAX)
argsize = strlen (arg);
do
{
wchar_t w;
size_t bytes = mbrtowc (&w, &arg[i + m],
argsize - (i + m), &mbstate);
if (bytes == 0)
break;
else if (bytes == (size_t) -1)
{
printable = false;
break;
}
else if (bytes == (size_t) -2)
{
printable = false;
while (i + m < argsize && arg[i + m])
m++;
break;
}
else
{
/* Work around a bug with older shells that "see" a '\'
that is really the 2nd byte of a multibyte character.
In practice the problem is limited to ASCII
chars >= '@' that are shell special chars. */
if ('[' == 0x5b && quoting_style == shell_quoting_style)
{
size_t j;
for (j = 1; j < bytes; j++)
switch (arg[i + m + j])
{
case '[': case '\\': case '^':
case '`': case '|':
goto use_shell_always_quoting_style;
default:
break;
}
}
if (! iswprint (w))
printable = false;
m += bytes;
}
}
while (! mbsinit (&mbstate));
}
if (1 < m || (backslash_escapes && ! printable))
{
/* Output a multibyte sequence, or an escaped
unprintable unibyte character. */
size_t ilim = i + m;
for (;;)
{
if (backslash_escapes && ! printable)
{
STORE ('\\');
STORE ('0' + (c >> 6));
STORE ('0' + ((c >> 3) & 7));
c = '0' + (c & 7);
}
if (ilim <= i + 1)
break;
STORE (c);
c = arg[++i];
}
goto store_c;
}
}
}
if (! (backslash_escapes
&& o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
goto store_c;
store_escape:
STORE ('\\');
store_c:
STORE (c);
}
if (i == 0 && quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
if (quote_string)
for (; *quote_string; quote_string++)
STORE (*quote_string);
if (len < buffersize)
buffer[len] = '\0';
return len;
use_shell_always_quoting_style:
return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
shell_always_quoting_style, o);
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is SIZE_MAX, use the string length of the argument for
ARGSIZE. */
size_t
quotearg_buffer (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o)
{
struct quoting_options const *p = o ? o : &default_quoting_options;
int e = errno;
size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
p->style, p);
errno = e;
return r;
}
/* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly
allocated storage containing the quoted string. */
char *
quotearg_alloc (char const *arg, size_t argsize,
struct quoting_options const *o)
{
int e = errno;
size_t bufsize = quotearg_buffer (0, 0, arg, argsize, o) + 1;
char *buf = xmalloc (bufsize);
quotearg_buffer (buf, bufsize, arg, argsize, o);
errno = e;
return buf;
}
/* Use storage slot N to return a quoted version of argument ARG.
ARG is of size ARGSIZE, but if that is SIZE_MAX, ARG is a
null-terminated string.
OPTIONS specifies the quoting options.
The returned value points to static storage that can be
reused by the next call to this function with the same value of N.
N must be nonnegative. N is deliberately declared with type "int"
to allow for future extensions (using negative values). */
static char *
quotearg_n_options (int n, char const *arg, size_t argsize,
struct quoting_options const *options)
{
int e = errno;
/* Preallocate a slot 0 buffer, so that the caller can always quote
one small component of a "memory exhausted" message in slot 0. */
static char slot0[256];
static unsigned int nslots = 1;
unsigned int n0 = n;
struct slotvec
{
size_t size;
char *val;
};
static struct slotvec slotvec0 = {sizeof slot0, slot0};
static struct slotvec *slotvec = &slotvec0;
if (n < 0)
abort ();
if (nslots <= n0)
{
/* FIXME: technically, the type of n1 should be `unsigned int',
but that evokes an unsuppressible warning from gcc-4.0.1 and
older. If gcc ever provides an option to suppress that warning,
revert to the original type, so that the test in xalloc_oversized
is once again performed only at compile time. */
size_t n1 = n0 + 1;
if (xalloc_oversized (n1, sizeof *slotvec))
xalloc_die ();
if (slotvec == &slotvec0)
{
slotvec = xmalloc (sizeof *slotvec);
*slotvec = slotvec0;
}
slotvec = xrealloc (slotvec, n1 * sizeof *slotvec);
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof *slotvec);
nslots = n1;
}
{
size_t size = slotvec[n].size;
char *val = slotvec[n].val;
size_t qsize = quotearg_buffer (val, size, arg, argsize, options);
if (size <= qsize)
{
slotvec[n].size = size = qsize + 1;
if (val != slot0)
free (val);
slotvec[n].val = val = xmalloc (size);
quotearg_buffer (val, size, arg, argsize, options);
}
errno = e;
return val;
}
}
char *
quotearg_n (int n, char const *arg)
{
return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options);
}
char *
quotearg (char const *arg)
{
return quotearg_n (0, arg);
}
/* Return quoting options for STYLE, with no extra quoting. */
static struct quoting_options
quoting_options_from_style (enum quoting_style style)
{
struct quoting_options o;
o.style = style;
memset (o.quote_these_too, 0, sizeof o.quote_these_too);
return o;
}
char *
quotearg_n_style (int n, enum quoting_style s, char const *arg)
{
struct quoting_options const o = quoting_options_from_style (s);
return quotearg_n_options (n, arg, SIZE_MAX, &o);
}
char *
quotearg_n_style_mem (int n, enum quoting_style s,
char const *arg, size_t argsize)
{
struct quoting_options const o = quoting_options_from_style (s);
return quotearg_n_options (n, arg, argsize, &o);
}
char *
quotearg_style (enum quoting_style s, char const *arg)
{
return quotearg_n_style (0, s, arg);
}
char *
quotearg_char (char const *arg, char ch)
{
struct quoting_options options;
options = default_quoting_options;
set_char_quoting (&options, ch, 1);
return quotearg_n_options (0, arg, SIZE_MAX, &options);
}
char *
quotearg_colon (char const *arg)
{
return quotearg_char (arg, ':');
}

View File

@ -1,137 +0,0 @@
/* quotearg.h - quote arguments for output
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert <eggert@twinsun.com> */
#ifndef QUOTEARG_H_
# define QUOTEARG_H_ 1
# include <stddef.h>
/* Basic quoting styles. */
enum quoting_style
{
/* Output names as-is (ls --quoting-style=literal). */
literal_quoting_style,
/* Quote names for the shell if they contain shell metacharacters
or would cause ambiguous output (ls --quoting-style=shell). */
shell_quoting_style,
/* Quote names for the shell, even if they would normally not
require quoting (ls --quoting-style=shell-always). */
shell_always_quoting_style,
/* Quote names as for a C language string (ls --quoting-style=c). */
c_quoting_style,
/* Like c_quoting_style except omit the surrounding double-quote
characters (ls --quoting-style=escape). */
escape_quoting_style,
/* Like clocale_quoting_style, but quote `like this' instead of
"like this" in the default C locale (ls --quoting-style=locale). */
locale_quoting_style,
/* Like c_quoting_style except use quotation marks appropriate for
the locale (ls --quoting-style=clocale). */
clocale_quoting_style
};
/* For now, --quoting-style=literal is the default, but this may change. */
# ifndef DEFAULT_QUOTING_STYLE
# define DEFAULT_QUOTING_STYLE literal_quoting_style
# endif
/* Names of quoting styles and their corresponding values. */
extern char const *const quoting_style_args[];
extern enum quoting_style const quoting_style_vals[];
struct quoting_options;
/* The functions listed below set and use a hidden variable
that contains the default quoting style options. */
/* Allocate a new set of quoting options, with contents initially identical
to O if O is not null, or to the default if O is null.
It is the caller's responsibility to free the result. */
struct quoting_options *clone_quoting_options (struct quoting_options *o);
/* Get the value of O's quoting style. If O is null, use the default. */
enum quoting_style get_quoting_style (struct quoting_options *o);
/* In O (or in the default if O is null),
set the value of the quoting style to S. */
void set_quoting_style (struct quoting_options *o, enum quoting_style s);
/* In O (or in the default if O is null),
set the value of the quoting options for character C to I.
Return the old value. Currently, the only values defined for I are
0 (the default) and 1 (which means to quote the character even if
it would not otherwise be quoted). */
int set_char_quoting (struct quoting_options *o, char c, int i);
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
size_t quotearg_buffer (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o);
/* Like quotearg_buffer, except return the result in a newly allocated
buffer. It is the caller's responsibility to free the result. */
char *quotearg_alloc (char const *arg, size_t argsize,
struct quoting_options const *o);
/* Use storage slot N to return a quoted version of the string ARG.
Use the default quoting options.
The returned value points to static storage that can be
reused by the next call to this function with the same value of N.
N must be nonnegative. */
char *quotearg_n (int n, char const *arg);
/* Equivalent to quotearg_n (0, ARG). */
char *quotearg (char const *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
options to specify the quoting method. */
char *quotearg_n_style (int n, enum quoting_style s, char const *arg);
/* Use style S and storage slot N to return a quoted version of the
argument ARG of size ARGSIZE. This is like quotearg_n_style
(N, S, ARG), except it can quote null bytes. */
char *quotearg_n_style_mem (int n, enum quoting_style s,
char const *arg, size_t argsize);
/* Equivalent to quotearg_n_style (0, S, ARG). */
char *quotearg_style (enum quoting_style s, char const *arg);
/* Like quotearg (ARG), except also quote any instances of CH. */
char *quotearg_char (char const *arg, char ch);
/* Equivalent to quotearg_char (ARG, ':'). */
char *quotearg_colon (char const *arg);
#endif /* !QUOTEARG_H_ */

Some files were not shown because too many files have changed in this diff Show More