diff --git a/src/apps/bin/grep-2.5/ABOUT-NLS b/src/apps/bin/grep-2.5/ABOUT-NLS new file mode 100644 index 0000000000..28d38c76fd --- /dev/null +++ b/src/apps/bin/grep-2.5/ABOUT-NLS @@ -0,0 +1,226 @@ +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. + +One advise in advance +===================== + + 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 or message inheritance) 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 provides +usable `catgets' (if using this is selected by the installer) or +`gettext' functions. If neither is available, 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 --with-catgets + ./configure --disable-nls + +will respectively bypass any pre-existing `catgets' or `gettext' to use +the internationalizing routines provided within this package, enable +the use of the `catgets' functions (if found on the locale system), 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. + + By default the configuration process will not test for the `catgets' +function and therefore they will not be used. The reasons are already +given above: the emulation on top of `catgets' cannot provide all the +extensions provided by the GNU `gettext' library. If you nevertheless +want to use the `catgets' functions use + + ./configure --with-catgets + +to enable the test for `catgets' (this causes no harm if `catgets' is +not available on your system). If you really select this option we +would like to hear about the reasons because we cannot think of any +good one ourself. + + 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 +ISO 639 `LL' two-letter code prior to using the programs in the +package. For example, let's suppose that you speak German. At the +shell prompt, merely execute `setenv LANG de' (in `csh'), +`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This +can be done from your `.login' or `.profile' file, once and for all. + + An operating system might already offer message localization for +many of its programs, while other programs have been installed locally +with the full capabilities of GNU `gettext'. Just using `gettext' +extended syntax for `LANG' would break proper localization of already +available operating system programs. In this case, users should set +both `LANGUAGE' and `LANG' variables in their environment, as programs +using GNU `gettext' give preference to `LANGUAGE'. For example, some +Swedish users would rather read translations in German than English for +when Swedish is not available. This is easily accomplished by setting +`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'. + +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, courtesy of Linux +International. You may reach your translation team at the address +`LL@li.org', replacing LL by the two-letter ISO 639 code for your +language. Language codes are *not* the same as the country codes given +in ISO 3166. The following translation teams exist, as of December +1997: + + Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en', + Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian + `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja', + Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish + `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es', + Swedish `sv', and Turkish `tr'. + +For example, you may reach the Chinese translation team by writing to +`zh@li.org'. + + 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 December +1997. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination. + + Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv + .----------------------------------------------------. + bash | [] [] [] | 3 + bison | [] [] [] | 3 + clisp | [] [] [] [] | 4 + cpio | [] [] [] [] [] [] | 6 + diffutils | [] [] [] [] [] | 5 + enscript | [] [] [] [] [] [] | 6 + fileutils | [] [] [] [] [] [] [] [] [] [] | 10 + findutils | [] [] [] [] [] [] [] [] [] | 9 + flex | [] [] [] [] | 4 + gcal | [] [] [] [] [] | 5 + gettext | [] [] [] [] [] [] [] [] [] [] [] | 12 + grep | [] [] [] [] [] [] [] [] [] [] | 10 + hello | [] [] [] [] [] [] [] [] [] [] [] | 11 + id-utils | [] [] [] | 3 + indent | [] [] [] [] [] | 5 + libc | [] [] [] [] [] [] [] | 7 + m4 | [] [] [] [] [] [] | 6 + make | [] [] [] [] [] [] | 6 + music | [] [] | 2 + ptx | [] [] [] [] [] [] [] [] | 8 + recode | [] [] [] [] [] [] [] [] [] | 9 + sh-utils | [] [] [] [] [] [] [] [] | 8 + sharutils | [] [] [] [] [] [] | 6 + tar | [] [] [] [] [] [] [] [] [] [] [] | 11 + texinfo | [] [] [] | 3 + textutils | [] [] [] [] [] [] [] [] [] | 9 + wdiff | [] [] [] [] [] [] [] [] | 8 + `----------------------------------------------------' + 17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv + 27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179 + + 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 December 1997 seems to be old, you may fetch a more recent copy +of this `ABOUT-NLS' file on most GNU archive sites. + diff --git a/src/apps/bin/grep-2.5/AUTHORS b/src/apps/bin/grep-2.5/AUTHORS new file mode 100644 index 0000000000..e08a38cf24 --- /dev/null +++ b/src/apps/bin/grep-2.5/AUTHORS @@ -0,0 +1,44 @@ +Mike Haertel wrote the main program and the dfa and kwset matchers. + +Arthur David Olson contributed the heuristics for finding fixed substrings +at the end of dfa.c. + +Richard Stallman and Karl Berry wrote the regex backtracking matcher. + +Henry Spencer wrote the original test suite from which grep's was derived. + +Scott Anderson invented the Khadafy test. + +David MacKenzie wrote the automatic configuration software use to +produce the configure script. + +Authors of the replacements for standard library routines are identified +in the corresponding source files. + +The idea of using Boyer-Moore type algorithms to quickly filter out +non-matching text before calling the regexp matcher was originally due +to James Woods. He also contributed some code to early versions of +GNU grep. + +Mike Haertel would like to thank Andrew Hume for many fascinating discussions +of string searching issues over the years. Hume & Sunday's excellent +paper on fast string searching (AT&T Bell Laboratories CSTR #156) +describes some of the history of the subject, as well as providing +exhaustive performance analysis of various implementation alternatives. +The inner loop of GNU grep is similar to Hume & Sunday's recommended +"Tuned Boyer Moore" inner loop. + +More work was done on regex.[ch] by Ulrich Drepper and Arnold +Robbins. Regex is now part of GNU C library, see this package +for complete details and credits. + +Arnold Robbins contributed to improve dfa.[ch]. In fact +it came straight from gawk-3.0.3 with small editing and fixes. + +Many folks contributed see THANKS, if I omited someone please +send me email. + +Alain Magloire maintained GNU grep until version 2.5e. + +Bernhard "Bero" Rosenkränzer is the current maintainer. + diff --git a/src/apps/bin/grep-2.5/COPYING b/src/apps/bin/grep-2.5/COPYING new file mode 100644 index 0000000000..60549be514 --- /dev/null +++ b/src/apps/bin/grep-2.5/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +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) 19yy 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. + + , 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. diff --git a/src/apps/bin/grep-2.5/ChangeLog b/src/apps/bin/grep-2.5/ChangeLog new file mode 100644 index 0000000000..a48292ad8b --- /dev/null +++ b/src/apps/bin/grep-2.5/ChangeLog @@ -0,0 +1,2458 @@ +2002-03-13 Bernhard Rosenkraenzer + * configure.in, m4/regex.m4, m4/malloc.m4, m4/realloc.m4: + Don't set LIBOBJS directly, autoconf 2.53 doesn't like it + * intl/*: Sync with gettext 0.11 + * po/*: Sync with translation project + * configure.in, src/Makefile.am: Don't duplicate code - make + egrep and fgrep links to grep and set matcher based on + application name, suggestion from + Guillaume Cottenceau + * src/grep.c: (prline) Add fix for -i --color from + Jim Meyering + * configure.in: Version 2.5; release + +2002-01-23 Bernhard Rosenkraenzer + * configure.in: Version 2.5g + * Makefile.cvs, grep.spec: Add packaging tools + Merge djgpp changes from Andrew Cottrell : + * src/grep.c: Added conditional compilation for DJGPP + * djgpp: remove directory as it is no longer required with DJGPP 2.03 + (or 2.04 when released) + * README.DOS: Moved djgpp/readme to readme.dos + * PATCHES.AC, PATCHES.AM: delete files - redundant + * configure.in, Makefile.am: remove djgpp directory from list + +2002-01-22 Bernhard Rosenkraenzer + * doc/grep.texi, doc/grep.1, NEWS: Document --label + * po/ru.po: Sync with translation project + * po/grep.pot: Sync with source + +2002-01-18 Bernhard Rosenkraenzer + * src/grep.c: Add --label, based on patch from Stepan Koltsov + +2001-11-20 Bernhard Rosenkraenzer + * autogen.sh: Don't hardcode aclocal dir + +2001-11-19 Bernhard Rosenkraenzer + * src/grep.c: Add --only-matching (-o) switch (see NEWS) + * doc/grep.texi, doc/grep.1, NEWS: Document changes + * configure.in, lib/Makefile.am: Don't use internal getopt if + we're on a system that provides a working getopt function + +2001-09-25 Bernhard Rosenkraenzer + * configure.in: Detect pcre correctly even when it's in + non-standard locations, using pcre-config + * src/grep.c: Add --color={always,never,tty} argument (like in ls) + * src/grep.c: Turn off blinking in the default colorization + * src/grep.c: Add --devices (-D) switch (analogous to --directories) + * src/dfa.c: Fix an i18n bug: echo "A" | grep '[A-Z0-9]' wouldn't work + in non-C-Locales on systems using current versions of glibc. + * AUTHORS: Change maintainer, credit Alain for his work until now + * configure.in, m4/decl.m4, m4/dosfile.m4, m4/gettext.m4, + m4/init.m4, m4/install.m4, m4/largefile.m4, m4/lcmessage.m4, + m4/header.m4, m4/isc-posix.m4, m4/missing.m4, m4/progtest.m4, + m4/sanity.m4: + Fix build with autoconf 2.5x, retain 2.1x compatibility for now + * autogen.sh: Add some crude hacks to make it possible to build with + both autoconf 2.5x and 2.1x + * acconfig.h: removed (no longer required) + * Makefile.am: add cvs-clean target + * doc/grep.texi, doc/grep.1, NEWS: Document changes + (--color, --devices, -D) + * src/dfa.c, src/grep.c: Add vim modelines + +2001-08-30 Alain Magloire + + * configure.in: Add gl in ALL_LINGUAS. + +2001-08-30 Kurt D Schwehr + + * doc/grep.1: Warn that grep insert a "--" between groups of matches, + when using the context options. + * doc/grep.texi: Likewised. + +2001-08-25 Heikki Korpela + + * doc/grep.texi: Point out that some Platforms do not support + reading of directories and silently ignore them. + +2001-08-21 Alain Magloire + + * lib/malloc.c: New file: + * lib/realloc.c: New file: + * lib/Makefile.am: Add malloc.c and realloc.c in EXTRA_DIST. + +2001-07-31 Alain Magloire + + * po/*.po: New files from the translation team: + grep-2.5e.de.po grep-2.5e.el.po grep-2.5e.eo.po grep-2.5e.es.po + grep-2.5e.et.po grep-2.5e.fr.po grep-2.5e.gl.po grep-2.5e.it.po + grep-2.5e.pl.po grep-2.5e.sl.po + +2001-07-31 Andreas Schwab + + * src/grep.c: Fix all uses of error to pass a proper format + string. + +2001-07-29 Alain Magloire + + * grep/src/grep.c (usage): Typos corrected. + Patches from Santiago Vila. + +2001-07-29 Alain Magloire + + David Clissold, wrote: + a small bug in the GNU grep 2.4.2, which may have gone unnoticed + because it only causes a failure if building on a system with large + files enabled (e.g. an "off_t" is a "long long" rather than a "long"). + savedir() takes on off_t argument, but in grepdir() the parameter + is cast to an (unsigned). Well, if an off_t is larger than an int, + the value gets truncated. This would not normally have an effect on a + little-endian platform (unless the file is >2GB), but on a big-endian + system it will always fail. The external effect is that + "grep -r foo dir_name" fails with ENOMEM (from malloc() within + savedir()). + + * grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling + savedir(). + Patch from David Clissold. + +2001-07-29 Alain Magloire + + * grep/doc/grep.texi: In Bugs report use {n,m} for consistency. + * grep/doc/grep.1: Likewised. + Noted by Steven Lucy. + +2001-04-27 Isamu Hasegawa + + * dfa.c (mblen_buf) : New variable contains the amount of remain + byte of corresponding multibyte character in the input string. + (SKIP_REMAIN_MB_IF_INITIAL_STATE) : Use mblen_buf. + (match_anychar) : Use mblen_buf. + (match_mb_charset) : Use mblen_buf. + (transit_state_consume_1char) : Use mblen_buf. + (transit_state) : Use inputwcs to get current (multibyte) character. + (dfaexec) : Add initialization of mblen_buf. + +2001-04-27 Isamu Hasegawa + + * dfa.c (addtok) : Set appropriate value to multibyte_prop. + (dfastate) : Add the initialization of the variable. + (dfaexec) : Call transit_state if d->fail may transit by + multibyte characters. + (transit_state_singlebyte) : Clean up unnecessary code. + (transit_state_consume_1char) : Likewise. + (transit_state) : Add checking for word and newline. + +2001-04-19 Isamu Hasegawa + + * search.c (check_multibyte_string) : Check the case when mbclen == 0. + +2001-04-11 Isamu Hasegawa + + * search.c (check_multibyte_string) : Check the head of multibyte + characters, and optimize a bit. + (EGexecute) : Optimize a bit. + (Fexecute) : Fix the index. + +2001-04-02 Alain Magloire + + * lib/regex.c: Update from GNU lib C, with the changes + provided by Paul Eggert. + * lib/posix/regex.h: Likewise. + +2001-02-17 Paul Eggert + + Stop trying to support hosts that have nonstandard declarations for + mbrtowc and/or mbstate_t. It's not worth the portability hassle. + + * lib/quotearg.c (mbrtowc, mbsinit): Remove workaround macros + for hosts that have mbrtowc but not mbstate_t, as we now + insist on proper declarations for both before using mbrtowc. + +2001-03-18 Alain Magloire + + * configure.in: Call AC_MBSTATE_T. + * Makefile.am: Add mbstate_t.m4 + * m4/Makefile.am: Add mbstate_t.m4 + * m4/mbstate_t.m4: New m4 macro. + * lib/strtol.c: Define CHAR_BITS. + Uwe H. Steinfeld, Ruslan Ermilov, Volkert Bochert, noted + that mbstate_t was not define for certain platforms. + +2001-03-18 Paul Eggert + + * src/grep.c (fillbuf): Fix storage allocation performance + bug: buffer was doubling in size in many cases where it didn't + have to. + +2001-03-17 Paul Eggert + + * src/grep.c (fillbuf): Avoid unnecessary division by 2. + Don't check xrealloc return value; it's guaranteed to be nonzero. + (fillbuf, grepdir): Use xalloc_die rather than error; it's shorter. + +2001-03-17 Alain Magloire + + * src/grep.c (context_length_arg): error () passing wrong format. + Spotted by Jim Meyering. + +2001-03-07 Alain Magloire + + * README-alpha: Removed reference to GNU tar, add the location + of the CVSROOT. + +2001-03-06 Alain Magloire + + Only the Regex patterns should be split in an array, patterns[]. + The dfa and KWset compiled patterns should remain global and the + patterns compiled all at once. + + * src/search.c: include "error.h" and "xalloc.h" to get prototyping + of x*alloc() and error(). + (kwsinit): Reverse to previous behaviour and takes no argument. + (kwsmusts): Likewised. + (Gcompile): For the regex pattern, split them and each pattern + is put in different compiled structure patterns[]. The patterns + are given to dfacomp() and kwsmusts() as is. + (Ecompile): Likewised. + (Fcompile): Reverse to the old behaviour of compiling the enire + patterns in one shot. + (EGexecute): If falling to GNU regex for the matching, loop in the + array of compile patterns[] to find a match. + (error): Many error () were call with arguments in the wrong order. + * tests/file.sh: Simple test to check for pattern in files. + + Reaction to bug report fired by Greg Louis + +2001-03-06 Isamu Hasegawa + + In multibyte environments, handle multibyte characters as single + characters in bracket expressions. + + * src/dfa.h (mb_char_classes) : new structure. + (mbcsets): new variable. + (nmbcsets): new variable. + (mbcsets_alloc) : new variable. + * src/dfa.c (prtok) : handle MBCSET. + (fetch_wc): new function to fetch a wide character. + (parse_bracket_exp_mb) : new function to handle multibyte character + in lex(). + (lex): invoke parse_bracket_exp_mb() for multibyte bracket expression. + (atom): handle MBCSET. + (epsclosure): likewise. + (dfaanalyze): likewise. + (dfastate): likewise. + (match_mb_charset): new function to judge whether a bracket match + with a multibyte character. + (check_matching_with_multibyte_ops) : handle MBCSET. + (dfainit): initialize new variables. + (dfafree): free new variables. + +2001-03-04 Alain Magloire + + To get more in sync with other GNU utilities like GNU tar and fetish + all the supporting functions are now under lib. + Thanks to Jim Meyering, Volkert Bochert and Paul Eggert for + the code and the reminders. + + * src/grep.c (fatal): Function removed, using error () from + lib/error.c instead. + (usage): Copyright updated. + (error): Function removed, using error () from lib/error.c instead, + adjust prototypes. + (prog): Global variable rename to program_name, to work with new + lib/error.c. + (xrealloc): Removed using lib/xmalloc.c. + (xmalloc): Removed using lib/xmalloc.c + (main): Register with atexit() to check for error on stdout. + * configure.in: Check for atexit(), call jm_MALLOC, jm_RELLOC and + jm_PREREQ_ERROR. + * tests/bre.awk: Removed the hack to drain the buffer since we + always fclose(stdout) atexit. + * tests/ere.awk: Likewise. + * tests/spencer1.awk: Likewise. + * bootstrap/Makefile.try: Update the Makefile to reflect the changes + in the new hierarchy. + + * README-alpha: New File. + * m4/realloc.m4: New File. + * m4/malloc.m4: New File. + * m4/error.m4: New File. + * m4/Makefile.am: Updated. + * lib: New directory. + * lib/Makefile.am: New file. + * lib/closeout.c: New file. + * lib/closeout.h: New file. + * lib/fnmatch.c: New file. + * lib/fnmatch.h: New file. + * lib/atexit.c: New file. + * lib/error.c: New file. + * lib/error.h: New file. + * lib/quotearg.h: New file. + * lib/quotearg.c: New file. + * lib/xmalloc.c: New file. + * lib/posix: New directory. + * lib/posix/Makefile.am: New file. + * src/getopt.c: Moved to lib. + * src/getopt1.c: Moved to lib. + * src/getopt.h: Moved to lib. + * src/alloca.c: Moved to lib. + * src/exclude.c: Moved to lib. + * src/exclude.h: Moved to lib. + * src/hard-locale.h: Moved to lib. + * src/hard-locale.c: Moved to lib. + * src/isdir.c: Moved to lib. + * src/mechr.c: Moved to lib. + * src/obstack.c: Moved to lib. + * src/obstack.h: Moved to lib. + * src/regex.c: Moved to lib. + * src/regex.h: Moved to lib. + * src/posix: Moved to lib. + * src/posix/regex.h: Moved to lib. + * src/savedir.h: Moved to lib. + * src/savedir.c: Moved to lib. + * src/stpcpy.c: Moved to lib. + * src/strtoul.c: Moved to lib. + * src/strtol.c: Moved to lib. + * src/strtoull.c: Moved to lib. + * src/strtoumax.c: Moved to lib. + * src/xstrtol.c: Moved to lib. + * src/xstrtol.h: Moved to lib. + * src/xstrtoumax.c: Moved to lib. + +2001-03-01 Isamu Hasegawa + + Implement the mechanism to match with multibyte characters, + and use it for `period' in multibyte environments. + + * dfa.h (mbps): new variable. + * dfa.c (prtok): handle ANYCHAR. + (lex): use ANYCHAR for `period' in multibyte environments. + (atom): handle ANYCHAR. + (state_index): initialize mbps in multibyte environments. + (epsclosure): handle ANYCHAR. + (dfaanalyze): handle ANYCHAR. + (dfastate): handle ANYCHAR. + (realloc_trans_if_necessary): new function. + (transit_state_singlebyte): new function. + (match_anychar): new function. + (check_matching_with_multibyte_ops): new function. + (transit_state_consume_1char): new function. + (transit_state): new function. + (dfaexec): invoke transit_state if expression can match with + a multibyte character in multibyte environments. + (dfamust): handle ANYCHAR. + +2001-03-01 Alain Magloire + + * src/exclude.c: New file. + * src/exclude.h: New file. + * src/grep.c (main): Took the GNU tar code to handle + the option --include, --exclude, --exclude-from. + Files are check for a match, with exlude_filename (). + New option --exclude-from. + * src/savedir.c: Call exclude_filename() to check for + file pattern exclusion or inclusion. + * configure.in: --disable-pcre rename to --disable-perl-regexp. + + +2001-02-25 Alain Magloire + + * src/dfa.c: Typo corrected. + Noted by Isamu Hasegawa. + * src/savedir.c: Typos corrected. + +2001-02-22 Alain Magloire + + * src/savedir.c (isdir1): New function, calling isdir with + the correct pathname. + +2001-02-19 Isamu Hasegawa + + Avoid incorrect state transition in multibyte environments. + + * dfa.h (nmultibyte_prop): new variable. + (multibyte_prop): new variable. + * dfa.c (addtok): set inputwcs. + (dfastate): avoid incorrect state transition in multibyte + environments. + (dfaexec): likewise. + (dfainit): init multibyte_prop. + (dfafree): free multibyte_prop. + (inputwcs): new variable. + +2001-02-19 Isamu Hasegawa + + Handle a multibyte character followed by '*', '+', and '{n,m}' + correctly. + + * dfa.c (update_mb_len_index): new function. + Support for multibyte string. + (FETCH): call update_mb_len_index. + (lex): check cur_mb_index not to misunderstand multibyte characters. + (atom): make a tree from a multibyte character. + (dfaparse): initialize new variables. + (mbs): new variable. + (cur_mb_len): new variable. + (cur_mb_index): new variable. + +2001-02-18 Jim Meyering + + * m4/dosfile.m4 (AC_DOSFILE): Move AC_DEFINEs out of AC_CACHE_CHECK. + +2001-02-17 Alain Malgoire + + * doc/grep.texi: Document the new options and the new behaviour + back-references are local. Use excerpt from Karl Berry regex + texinfo. + + * bootstrap/Makefile.try: Added xstrtoumax.o xstrtoul.o hard-local.o + +2001-02-17 Alain Magloire + + From Guglielmo 'bond' Bondioni : + The bug was that using a multi line file that contained REs (one per + line), backreferences in the REs were considered global (to the file) + and not local (to the line). + That is, \1 in line n refers to the first \(.\) in the whole file, + rather than in the line itself. + + From Tapani Tarvainen : + # Re: grep -e '\(a\)\1' -e '\(b\)\1' + That's not the way it should work: multiple -e arguments + should be treated as independent patterns and back references + should not refer to previous ones. + + From Paul Eggert : + GNU grep currently does not issue + diagnostics for the following two cases, both of which are erroneous: + grep -e '[' -e ']' + grep '[ + ]' + POSIX requires a diagnostic in both cases because '[' is not a valid + regular expression. + + To overcome those problems, grep no longer pass the concatenate + patterns to GNU regex but rather compile each patterns separately + and keep the result in an array. + + * src/search.c (patterns): New global variable; a structure array + holding the compiled patterns. + Declare function prototypes to minimize error. + (dfa, kswset, regexbuf, regs): Removed, no longer static globals, but + rather fields in patterns[] structure per motif. + (Fcompile): Alloc an entry in patterns[] to hold the regex. + (Ecompile): Alloc an entry per motif in the patterns[] array. + (Gcompile): Likewise. + (EGexecute): Loop through of array of patterns[] for a match. + +2001-02-17 Alain Magloire + + From Bernd Strieder : + # tail -f logfile | grep important | do_something_urgent + # tail -f logfile | grep important | do_something_taking_very_long + If grep does full buffering in these cases then the urgent operation + does not happen as it should in the first case, and in the second case + time is lost due to waiting for the buffer to be filled. + This is clearly spoken not grep's fault in the first place, but libc's. + There is a heuristic in libc that make a stream line-buffered only if a + terminal is on the other end. This doesn't take care of the cases where + this connection is somehow indirect. + + * src/grep.c (line_buffered): new option variable. + (prline): if line_buffered is set fflush() is call. + (usage): line_buffered new option. + Input from Paul Eggert, doing setvbuf() may not be portable + and breaks grep -z. + +2001-02-16 Alain Magloire + + Patch from Isamu Hasegawa, for multibyte support. + This patch prevent kwset_matcher from following problems. + For example, in SJIS encoding, one character has the codepoint 0x895c. + So the second byte of the character can match with '\' incorrectly. + And in eucJP encoding, there are the characters whose codepoints are + 0xa5b9, 0xa5c8. On the other hand, there is one character whose + codepoint is 0xb9a5. So 0xb9a5 can match with 2nd byte of 0xa5b9 + and 1st byte of 0xa5c8. + + * configure.in: Add check for mbrtowc. + * src/search.c (check_multibyte_string): new function. + Support for multibyte string. + (EGexecute): call check_multibyte_string when kwset is set. + (Fexecute): call to check_multibyte_string. + (MBS_SUPPORT): new macro. + (MB_CUR_MAX): new macro. + +2001-02-16 Alain Magloire + + * djgpp/config.bat: Fix for 4dos.com. + * m4/dosfile.m4 (HAVE_DOS_FILE_CONTENTS): Was not set. + Bugs noted and patched by Juan Manuel Guerrero. + +2001-02-16 Alain Magloire + + A much requested feature, the possibility to select + files when doing recurse : + # find . -name "*.c" | xargs grep main {} + # grep --include=*.c main . + # find . -not -name "*.c" | xargs grep main {} + # grep --exclude=*.c main . + + * src/grep.c (short_options): -R equivalent to -r. + (#ifdef) : Fix some inconsistencies in the use of #ifdefs, prefer + #if defined() wen possible. + (long_options): Add --color, --include and exclude. + (Usage): Description of new options. + (color): Rename color variable to color_option. + Removed 'always|never|auto' arguments, not necessary for grep. + (exclude_pattern): new variable, holder for the file pattern. + (include_pattern): new variable, hoder for the file pattern. + * src/savedir.c: Signature change, take two new argmuments. + * doc/grep.texi: Document, new options. + * doc/grep.man: Document, new options. + +2001-02-09 Alain Magloire + + * src/grep.c (long_options): Added equivalent to -r with -R. + * src/grep.c (usage): added --color and --colour. + Noted with patch from, H.Merijn Brand and Wichert Akkerman. + +2001-02-09 Alain Magloire + + Patch from Ulrich Drepper to provide hilighting. + + * src/grep.c: New option --color. + (color): New static var. + (COLOR_OPTION): new constant. + (grep_color): new static var. + (prline): Now when color is set prline() will call the current matcher + to find the offset of the matching string. + * src/savedir.c: Take advantage of _DIRENT_HAVE_TYPE if supported. + * src/search.c (EGexecute, Fexecute, Pexecute): Take a new argument + when doing exact match for the color hiligting. + +2000-09-01 Brian Youmans + + * doc/grep.texi: Typo fixes. + +2000-08-30 Paul Eggert + + * doc/grep.texi (Usage): Talk about what "grep -r hello *.c" + means. + +2000-08-20 Paul Eggert + + Handle range expressions correctly even when they match + strings with two or more characters. + + * src/dfa.h (CRANGE): New enum value. Comment fix. + + * src/dfa.c: Include if HAVE_SETLOCALE. + Include "hard-locale.h". + (prtok): Print CRANGE. + (hard_LC_COLLATE): New static var. + (lex): Return CRANGE when parsing a character range in a hard locale. + Don't use strcoll; it's no longer needed and wasn't correct anyway. + Use unsigned rather than token to hold unsigned chars. + (addtok): Comment fix. + (atom): Treat a CRANGE as if it were (.\1), approximately. + (dfaparse): Initialize hard_LC_COLLATE. + + * src/Makefile.am (base_sources): Add hard-locale.c, hard-locale.h. + + * src/hard-locale.c, src/hard-locale.h: New files, taken from + textutils. + +2000-08-20 Paul Eggert + + * tests/Makefile.am (TESTS_ENVIRONMENT): Add LC_ALL=C, since + some of the tests assume the C locale. + +2000-08-16 Paul Eggert + + * src/search.c (Gcompile, Ecompile): -x overrides -w, for + consistency with fgrep. Don't assume that sizes fit in 'int'. + Fix comments to match code. + +2000-06-06 Paul Eggert + + * src/grep.c (grepdir): Don't look at st_dev when testing for + Mingw32 bug. + +2000-06-05 Paul Eggert + + Port to Mingw32, based on suggestions from Christian Groessler + . + + * src/isdir.c: New file, taken from fileutils. + + * src/Makefile.am (base_sources): Add isdir.c. + + * src/grep.c (grepfile): Use isdir instead of doing it inline. + (grepdir): Suppress ancestor check if the directory's inode and device + are both zero, as that occurs only on Mingw32 which doesn't support + inode or device. + + * src/system.h (isdir): New decl. + (is_EISDIR): Depend on HAVE_DIR_EACCES_BUG, not D_OK. + Use isdir, not access. + +2000-06-02 Paul Eggert + + Problen noted by Gerald Stoller + + * src/grep.c (main): POSIX.2 says that -q overrides -l, which + in turn overrides the other output options. Fix grep to + behave that way. + +2000-05-27 Paul Eggert + + Simplify and tune the buffer allocation strategy. Do not reserve a + large save area: reserve only enough bytes to hold the residue, plus + page alignment. Put a newline sentinel before the buffer, for speed + when searching backwards for newline. + + * src/grep.c (ubuffer, bufsalloc, PREFERRED_SAVE_FACTOR, page_alloc): + Remove. All uses changed. + (INITIAL_BUFSIZE): New macro. + (reset, fillbuf): Use simpler buffer allocation strategy. + (reset): Check for preposterously large pagesize that would cause + later calculations to overflow. + (fillbuf): Do not resize buffer if there's room at the end for + at least one more page. This greatly increases performance when + reading from non-regular files that contain no newlines. + When growing the buffer, double its size instead of using a + more complicated algorithm. + (prtext, grep): Speed up by relying on the newline sentinel before the + start of the buffer. + (grep): When looking backwards for the last newline in a buffer, + stop when we hit the residue, since it can't contain a newline. + This avoids an O(N**2) algorithm when reading binary data from + a pipe. Use a sentinel to speed up the backward search for newline. + (nlscan): Undo previous change; it wasn't needed and just complicates + and slows down the code a tad. + +2000-05-24 Paul Eggert + + Handle very large input counts better. Bug noted by Jim Meyering. + + * src/grep.c (totalcc, totalnl): Use uintmax_t, not off_t. + (add_count): New function. + (nlscan, prline, grep): Use it to check line and byte count overflows. + (nlscan, grep): Don't keep track of counts when not asked to; this + avoids unnecessary overflow diagnostics. + (print_offset_sep): Now takes args of type uintmax_t and char, + not off_t and int. + +2000-05-16 Paul Eggert + + Problem reported by Bob Proulx , this patch + is base on his finding, with appropiate corrections. + + * src/grep.c (main): Fix bug: -x and -w matched even when no + patterns were specified. + * tests/empty.sh: Test for -x and -w bug in grep 2.4.2. + +2000-04-24 Paul Eggert + + POSIX.2 conformance fixes: grep -q now exits with status zero + if an input line is selected, even if an error also occurs. + grep -s no longer affects exit status. + + * src/grep.c (suppress_errors): Move definition earlier so + that suppressible_error can use it. + (suppressible_error): New function. + (exit_on_match): New var. + (grepbuf): If exit_on_match is nonzero, exit with status zero + immediately. + (grep, grepfile, grepdir): Invoke suppressible_error. + (main): -q sets exit_on_match. + + * doc/grep.1, doc/grep.texi, NEWS: + Document -q's behavior as required by POSIX.2. + + * tests/status.sh: + Test for -q and -s behavior as conforming to POSIX.2. + +2000-04-20 Paul Eggert + + * tests/Makefile.am (TESTS_ENVIRONMENT): + Set GREP_OPTIONS to the empty string. + +2000-04-20 Paul Eggert + + * tests/status.sh: Fix typo: test -b -> test -r. + +2000-04-20 Paul Eggert + + * src/dfa.c (lex): + Do not assume that [c] is equivalent to [c-c]; this isn't true + if LC_COLLATE specifies that some characters are equivalent. + (setbit_case_fold): New function. + (lex): Use it to simplify the code a bit. + +2000-04-17 Paul Eggert + + Do CRLF munging only if HAVE_DOS_FILE_CONTENTS, instead of + having it depend on O_BINARY (which leads to incorrect results + on BeOS, VMS, and MacOS). + + * bootstrap/Makefile.try (DEFS): Add -DHAVE_DOS_FILE_CONTENTS. + * src/system.h (SET_BINARY): Define only if HAVE_DOS_FILE_CONTENTS. + (O_BINARY): Do not define. + + * m4/dosfile.m4: Define HAVE_DOS_FILE_CONTENTS if it appears we're + using DOS. + + * src/grep.c (undossify_input, fillbuf, dosbuf.c, prline, main): + Depend on HAVE_DOS_FILE_CONTENTS, not O_BINARY, when handling CRLF + matters. + (grepfile, main): Depend on SET_BINARY, not O_BINARY, when + handling binary files on hosts that care about text versus binary. + +2000-04-17 Paul Eggert + + * lib/getpagesize.h (getpagesize): Define to B_PAGE_SIZE if + __BEOS__ is defined. Based on a fix by Bruno Haible + . + +2000-04-17 Bruno Haible + + * src/system.h [BeOS]: Ignore O_BINARY. + * src/getpagesize.h [BeOS]: Define getpagesize() as B_PAGE_SIZE. + +2000-04-10 Paul Eggert + + * doc/grep.1, doc/grep.texi, NEWS: -C now requires an operand. + * src/grep.c (short_options, long_options, main, usage): Likewise. + (context_length_arg): Renamed from ck_atoi. Now reports an error + and exits if the number is out of range for a context length. + (get_nondigit_option): New function, which checks for overflow + correctly, and which does not parse nonadjacent strings of digits + into a single number. + (main): Use get_nondigit_option instead of doing the code inline. + With -A, -B, and -C, optarg is now guaranteed to be nonzero. + +2000-04-08 Paul Eggert + + Now that we know that the input is always terminated by a + newline before the matching algorithms see it, clean up the + matching algorithms so that they no longer need to modify the + input by inserting a sentinel newline, and no longer worry + about running off the end of the buffer due to a missing sentinel. + + * src/grep.c (nlscan, prpending, prtext, grepbuf): Do not + worry about running off the end of the input buffer, since + it's now guaranteed to end in the sentinel newline. + * src/search.c (EGexecute, Pexecute): Likewise. + + * src/dfa.c (prtok, dfasyntax, dfaparse, copy, merge, state_index, + epsclosure, dfaexec, dfacomp): + Change many instances of "T *" to "T const *", to catch + any inadvertent programming errors made during this conversion. + * src/dfa.h (dfacomp, dfaexec, dfaparse): Likewise. + * src/grep.c (struct stats.parent, long_options, grepdir, + compile, execute, fillbuf, lastnl, lastout, nlscan, prline, + prpending, prtext, grepbuf, grep, grepfile, grepdir): Likewise. + * src/grep.h (struct matcher.compile, struct matcher.execute): + Likewise. + * src/kwset.c (struct kwset.trans, kwsalloc, kwsincr, treefails, + treedelta, hasevery, treenext, bmexec, cwexec, kwsexec): Likewise. + * src/kwset.h (kwsalloc, kwsincr, kwsexec): Likewise. + * src/search.c (kwsmusts, Gcompile, Ecompile, EGexecute, Pcompile, + Pexecute): Likewise. + + * src/dfa.c (dfaexec): + Use size_t, not char *, to avoid worrisome casts to convert + char const * to char *. + * src/dfa.h (dfaexec): Likewise. + * src/grep.c (execute): Likewise. + * src/grep.h (execute): Likewise. + * src/kwset.c (bmexec, cwexec, kwsexec): Likewise. + * src/kwset.h (struct kwsmatch.offset, kwsalloc, kwsincr, + kwsexec): Likewise. + * src/search.c (EGexecute, Fexecute, Pexecute): Likewise. + + * src/dfa.h (_PTR_T): Depend on defined __STDC__, not __STDC__. + (PARAMS): Depend on PROTOTYPES, not __STDC__. + + * src/dfa.c (dfasyntax): Last arg is unsigned char, not int. + * src/dfa.h (dfasyntax): Likewise. + + * src/dfa.h (struct dfa): Remove member newlines; no longer needed. + * src/dfa.c (build_state, dfaexec, dfafree): Do not worry + about special newline state. + + * src/search.c (matchers): Move definition to end of file, so + that we don't need forward decls. + (lastexact): Remove. + (kwset_exact_matches): New var; subsumes old lastexact var. + All uses changed. + + * src/dfa.c (index): Remove macro. + (REALLOC_IF_NECESSARY): Skip unnecessary test. + (tstbit, setbit, clrbit): Declare arg to be unsigned, to help compiler. + (copyset, zeroset, equal): Use C builtin primitives, to help compiler. + (dfaexec): Do not modify input string. + Remove newline parameter; no longer needed. + (comsubs): Use strchr, not index. + + * src/grep.h (matchers): Use fixed name size, not pointer (as + there's no need for the extra flexibility). All uses changed. + + * src/kwset.h (struct kwsmatch.offset): Renamed from beg, with + change of type to size_t. All uses changed. + + * src/grep.c (reset): No longer need kludge for dfaexec. Simplify. + (reset, grepbuf): Adjust to new interface for 'execute'. + (install_matcher): List is now terminated by null compile, + not null name. + Do not invoke setrlimit if that wouldn't change the limit. + + * src/dfa.c (xcalloc, xmalloc, xrealloc, prtok, tstbit, setbit, + clrbit, copyset, zeroset, notset, equal, charclass_index, + looking_at, lex, addtok, atom, nsubtoks, copytoks, closure, + branch, regexp, copy, insert, merge, delete, state_index, + build_state, build_state_zero, icatalloc, icpyalloc, istrstr, + ifree, freelist, enlist, comsubs, addlists, inboth): + Remove forward decls; no longer needed. + * src/grep.c (ck_atoi, usage, error, setmatcher, + install_matcher, prepend_args, prepend_default_options, + page_alloc, reset, fillbuf, grepbuf, prtext, prpending, prline, + print_offset_sep, nlscan, grep, grepfile): Likewise. + * src/kwset.c (enqueue, treefails, treedelta, hasevery, + treenext, bmexec, cwexec): Likewise. + * src/search.c (Gcompile, Ecompile, EGexecute, Fcompile, Fexecute, + Pcompile, Pexecute, kwsinit): Likewise. + + * src/search.c (Pcompile): Do not assume newly allocated + storage is zeroed. + +2000-04-06 Paul Eggert + + * doc/grep.1, doc/grep.texi, NEWS: Improve the explanation of + locale-dependent behavior of range expressions. Mention + LC_COLLATE, since this affects range expressions. + +2000-03-26 Paul Eggert + + * Makefile.am (ACINCLUDE_INPUTS): Add decl.m4, inttypes_h.m4, + uintmax_t.m4, ulonglong.m4, xstrtoumax.m4. + * m4/Makefile.am (EXTRA_DIST): Likewise. + + * src/Makefile.am (base_sources): + Add xstrtol.c, xstrtol.h, xstrtoumax.c. + (EXTRA_DIST): Add strtol.c. + + * configure.in (jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX, + HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): Add. + (AC_REPLACE_FUNCS): Add strtoul. + + * src/grep.c: Include xstrtol.h. + (ck_atio): Use xstrtoumax and do proper overflow checking. + (max_count, outleft): Now off_t, not int. + (main): Likewise. Use xstrtoumax to convert max_count from string. + + * acconfig.h (HAVE_DECL_STRTOUL, HAVE_DECL_STRTOULL): New #undefs. + (HAVE_STPCPY, ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, + HAVE_LC_MESSAGES): Remove. + + * m4/decl.m4, m4/inttypes_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4, + m4/xstrtoumax.m4, src/strtol.c, src/strtoul.c, src/strtoull.c, + src/strtoumax.c, src/xstrtol.c, src/xstrtol.h, src/xstrtoumax.c: + New files, taken unchanged from textutils, fileutils, sh-utils + and/or tar. + +2000-03-23 Paul Eggert + + * src/search.c (Pcompile): Add support for NUL bytes in + Perl regular expressions. + +2000-03-23 Paul Eggert + + * NEWS, doc/grep.1, doc/grep.texi: Change --pcre to --perl-regexp. + * src/grep.c (long_options, usage): Likewise. + + * doc/grep.1, doc/grep.texi: Remove pgrep program. + * src/Makefile.am (bin_PROGRAMS): Likewise. + (pgrep_SOURCES): Remove. + + * src/grep.c (main): Rename matcher from "pgrep" to "perl". + * src/search.c (matchers): Likewise. + + * src/search.c: Do not include stdio.h; no longer needed. + (NILP): Remove. + (sub): No longer static. + (n_pcre): Remove. + (cre): No longer an array. Present only if HAVE_LIBPCRE. + (extra): New variable. + (Pcompile): Use fatal to report errors. + This also removes a possible core dump. + Add checks (marked FIXME) for restrictions in pcre. + Use pcre_maketables for proper localized behavior. + (Pcompile, Pexecute): Use GNU coding style. + The argument is a single pattern, not a list of patterns separated + by newlines; this is for consistency with grep and egrep. + Use pcre_study for speed. + (Pexecute): Abort if we lack pcre. + Abort if pcre_exec reports an impossible error. + Use code similar to the rest of search.c + to narrow down to the line we've found. + +2000-03-21 Alain Magloire + + * configure.in: added AC_CHECK_LIB(pcre, pcre_exec) + * ChangeLog: Typos corrected. + * src/search.c: new MACRO HAVE_LIBPCRE + +2000-03-21 H.Merijn Brand + + * src/Makefile.am(bin_PROGRAMS): added pgrep and new macro + pgrep_SOURCES. + * src/search.c: new functions Pcompile() and Pexecute() + to support PCRE. Update matcher[] array for pgrep. + * src/grep.c: new short and long option --pcre and -P. + usage() updated. + +2000-03-21 Bastiaan Stougie + + Improvement of the -m or --max-count option. Now works for NUM > 1 and + prints trailing context for the last matching line. + + * src/grep.c + (after_last_match): Is a new off_t variable that replaces inputhwm + to retain the correct input offset even after a call to fillbuf. Note + that after_last_match has a different meaning than inputhwm: + it always points to the offset in the input of the first byte after + the last matching line, and is 0 if no matching line has been found + yet. + (grep): Print trailing context after the NUMth match when the -m NUM + option is used. + (grep): Added comment. Should have been commented already. + (grepbuf): Now updates outleft correctly. This fixes the bug that the + -m NUM option did not stop after NUM lines for NUM greater than 1. + (grepbuf, prtext): Now update after_last_match instead of inputhwm. + (fillbuf): No longer updates inputhwm. + (prpending): When outputting trailing context of the max_count-th + matching line, stop at the first matching line. + (grepfile): Seek to after_last_match or eof, depending on the values + of outleft and bufmapped. + (usage): added the -m or --max-count option to the help message. + * doc/grep.texi, doc/grep.1: Document the change of the -m option. + +2000-03-17 Paul Eggert + + Add new -m or --max-count option, based on a suggestion by + Bastiaan Stougie. + + * doc/grep.texi, doc/grep.1: Document it. + * src/grep.c (short_options, long_options, main): Add it. + (inputhwm): New variable. + (fillbuf, prtext, grepbuf): Set it. + (bufmapped): Now a macro (defined to zero) if HAVE_MMAP is not defined. + (max_count, outleft): New variables. + (prtext, grepbuf, grep): Don't output more than outleft lines. + (grepfile): If grepping standard input, seek to the limit of what + we've read before exiting. This fixes a bug with mmapped input, + and is needed for proper -m support. + (main): Exit immediately if -m 0 is specified. + +2000-03-08 Alain Magloire + + * configure.in: version 2.4.2 + +2000-03-07 Paul Eggert + + * Make intl subdirectory match fileutils, tar, etc.; + see intl/ChangeLog for details. + + * src/getpagesize.h: Reformat to match latest fileutils. + + * src/savedir.c (savedir): Work even if directory size is + negative; this can happen with some NFS screwups. + +2000-03-03 Jim Meyering + + * regex.m4: Make sure re_compile_pattern accepts patterns like `{1'. + +2000-03-02 Alain Magloire + + * 2.4.1 Release + +2000-02-25 Paul Eggert + + * configure.in (LIBOBJS): Work around automake 1.4 bug: + regex.c wasn't being passed through ansi2knr on pre-ANSI hosts. + (ac_use_included_regex): Fix typo in warning. + * src/Makefile.am (EXTRA_DIST): Remove regex.c, as the LIBOBJS + workaround means that automake now puts regex.c into DIST_COMMON. + +2000-02-25 Alain Magloire + + * po/*.po: update of the PO files. + +2000-02-22 Eli Zaretskii + + * doc/grep.1: Two small glitches(typos). + +2000-02-18 Eli Zaretskii + + * djgpp/config.site (prefix, INSTALL): Use /dev/env/DJDIR instead + of ${DJDIR}, so that the produced Makefile's work on any DJGPP + installation. + +2000-01-30 Alain Magloire + + * doc/grep.1: corrected typo. + Noted by Ruslan Ermilov. + +2000-01-30 Alain Magloire + + * vms/Makefile.am: added config_vms.h to EXTRA_DIST. + * vms/config_vms.h: New File, contains macros specific to VMS and + avoid namespace collision with operating system supplied C library. + * vms/make.com: Better compiler auto-detection; information for builds + on pre-OpenVMS 7.x systems; general overhaul. + * src/getpagesize.h: Reinstate support for different pagesizes on + VAX and Alpha. Work around problem with DEC C compiler. + * src/vms_fab.c: Cast to some assigments; fixed typo argcp vs. argp. + * src/vms_fab.h: Added new include files to avoid warnings about + undefined function prototypes. + Those patches were provided by Martin P.J. Zinser (zinser@decus.de). + +2000-01-30 Paul Eggert + + * src/grep.c (main): Update copyright notice. + +2000-01-28 Alain Magloire + + * src/grep.c (usage): The example "%s -i 'hello.*world' could + lead to confusion when progname is 'fgrep. + Noted by Akim Demaille. + + * configure.in: Reenable, jm_INCLUDE_REGEX() since we now + track GNU lib C. + * src/Makefile.am: EXTRA_DIST new macros with regex.c regex.h. + Requested By Ulrich Drepper. + +2000-01-25 Paul Eggert + + * src/grep.c (grep): If the final byte of an input file is not + a newline, grep now silently supplies one. + * doc/grep.texi, NEWS: Likewise. + +2000-01-25 Paul Eggert + + * NEWS, doc/grep.1, doc/grep.texi: Add -I option. + * src/grep.c (short_options, usage, main): Likewise. + + * doc/grep.texi: Fix some incorrect references to ASCII. + +2000-01-25 Paul Eggert + + * doc/grep.1: Simplify synopsis; sort options; mention + environment variables; clean up some minor gaffes. + +2000-01-25 Paul Eggert + + * doc/grep.texi: + Fix some errors in description of [:print:] and the like. + +2000-01-23 Paul Eggert + + * src/dfa.c (FETCH, lex): Put brackets around if-body to avoid + GCC warning about ambiguous if-then-else. + +2000-01-23 Paul Eggert + + * src/regex.c (GET_UNSIGNED_NUMBER): Allow only ASCII digits. + * src/dfa.c (ISASCIIDIGIT): New macro. + (lex): Use it instead of ISDIGIT. + +2000-01-23 Paul Eggert + + The bug is that regular expression ranges like [a-z] compare raw + byte codes to the range boundaries, whereas POSIX says that they + should use the current collating sequence instead. For example, + in Solaris 7 with LC_ALL=en_US, the command + echo x | grep '[ -~]' + outputs 'x', but it shouldn't output anything since ' ' and '~' + sort before all letters in that locale. + + * src/regex.c (compile_range): When matching a character + range, use the current collating sequence, as POSIX requires. + * src/dfa.c (lex): Likewise. + +2000-01-20 Alain Magloire + + * tests/Makefile.am (dist-hook): Added new rule to make sure + that the shell scripts have the right permissions. + * src/posix/Makefile.am (EXTRA_DIST): added regex.h in the + distribution. + * THANKS: updated. + +2000-01-18 Alain Magloire + + * Rectification the initial patch to add --binary-file option + was done by Ruslan Ermilov. + +2000-01-17 Paul Eggert + + Sync with sources of fileutils 4.0n, tar 1.13.17, glibc 2.1.3a1. + Convert to ANSI C prototypes (using ansi2knr for backwards + compatibility), as this makes it easier to sync. + + * configure.in (AC_OBJEXT): Spell in a funny way, to work around + a bug in automake 1.4 with ansi2knr. + (LIBOBJS): Add assignment so that .o files in LIBOBJS are also built + via the ANSI2KNR-filtering rules. + (AC_OUTPUT): Add src/posix/Makefile. + * src/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr. + (SUBDIRS): New macro. + * src/ansi2knr.1, src/ansi2knr.c, src/posix/Makefile.am: New files. + * src/dfa.c, src/dosbuf.c, src/grep.c, src/kwset.c, src/search.c, + src/vms_fab.c: + Use prototypes for function definitions. + * src/grep.c (main): Use int counter for default context, + fixing an ANSI portability bug uncovered by the above changes. + + * config.guess, config.sub, install-sh, missing, src/alloca.c, + src/getpagesize.h, src/memchr.c, src/savedir.c, src/savedir.h, + src/stpcpy.c: + Upgrade to latest version from fileutils 4.0n. + + * src/getopt.c, src/getopt.h, src/getopt1.c: Upgrade to latest + version from tar 1.13.17. + + * src/obstack.c, src/obstack.h, src/regex.c, src/regex.h: + Upgrade to glibc 2.1.3 alpha 1, with K&R C portability fix. + * src/posix/regex.h: New file, from glibc 2.1.3 alpha 1. + +2000-01-04 Paul Eggert + + Initial patch by Ruslan Ermilov. + + Add --binary-files option. + * NEWS, doc/grep.1, doc/grep.texi: Document it. + * src/grep.c (BINARY_FILES_OPTION): New constant. + (long_options, grep, usage, main): New --binary-files option. + (binary_files): New var. + * src/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, CHAR_MAX): + New macros. + (INT_MAX, UCHAR_MAX): Define in terms of TYPE_MAXIMUM. + +2000-01-04 Paul Eggert + + * savedir.c (savedir): Don't store past the end of an array if + name_size is zero and the directory is empty. + Reported by Dima Barsky . + +1999-12-03 Alain Magloire + + * 2.4 Release. + +1999-11-18 Paul Eggert + + * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a + problem with the QNX 4.25 shell, which doesn't propagate exit + status of failed commands inside shell assignments. + +1999-11-13 Eli Zaretskii + + * doc/grep.texi: Minor markup and spelling corrections. Use + @noindent where appropriate. + + * PATCHES-{AM,AC}: rename to PATCHES.{AM,AC} + +1999-11-12 Eli Zaretskii + + doc/grep.texi: Minor fixes and typos corrected. + djgpp/README: Updated version. + +1999-11-07 Paul Eggert + + * src/grep.c (usage): Fix misspelling. + +1999-11-07 Paul Eggert + + Don't assume that the C library has re_set_syntax and friends. + * src/Makefile.am (base_sources): Add regex.c, regex.h. + (EXTRA_DIST): Remove regex.c, regex.h. + + * src/grep.c (prtext): Use out_quiet, not not_text, to decide + whether to set pending to zero at the end. + (not_text): Remove static variable, undoing latest change. + (grep): Likewise. + + * doc/grep.texi: Tighten up the text, and fix some minor + spelling and usage errors. Use @enumerate rather than @table + @samp, since it's better for Q&A format. Add cross + references. + +1999-11-01 Alain Magloire + + * src/search.c: Use the more portable [[:alnum:]] + to define a word instead of Ascii dependent [0-9A-Za-z] + * src/grep.c: make not_text global to not display text when + the context switches -A/-B/-C are use on binary files. + * make grep-2.3g available for testing. + * configure.in: drop support for --without-included-regex. + This was generating bogus bug reports, since many GNU/Linux + users have different version of glibc. And glibc maintainers + decided to drop k&r support. + +1999-11-01 Arnold D. Robbins + + * regex.c (init_syntax_once): move below definition of + ISALNUM etc., then use ISALNUM to init the table, so that + the word ops will work if i18n'ed. + (SYNTAX): And subscript with 0xFF for Latin-1 characters. + +1999-10-26 Alain Magloire + + * src/regex.c: Merge changes from GNU lib C. + * Updated the *.po files + +1999-10-26 Paul Eggert + + * src/grep.c (fillbuf): Don't report buffer size overflow if + newalloc == save and maxalloc == save. This can happen + e.g. when reading a large page-aligned file that contains + no newlines. + +1999-10-21 Paul Eggert + + * src/grep.c (usage): Give example. Clarify -F. + Explain exit status more clearly. + +1999-10-12 Paul Eggert + + * doc/grep.texi: Shorten the commentary about egrep and {. + "BSD grep" -> "traditional grep". + * doc/grep.1: Match recent changes to grep.texi. + +1999-10-11 Paul Eggert + + * NEWS, doc/grep.1, doc/grep.texi: New option --mmap. + * src/grep.c (mmap_option): New variable. + (long_options, reset, usage): Add --mmap. + Default is now read, not mmap. + + * doc/grep.1: Document -Z or --null. + +1999-10-11 Paul Eggert + + * doc/grep.texi: Fix texinfo glitches. POSIX -> POSIX.2 where + appropriate. + +1999-10-11 Paul Eggert + + * acconfig.h (ssize_t): New #undef. + + * configure.in (AC_CHECK_TYPE): Add ssize_t. + + * src/grep.c (PREFERRED_SAVE_FACTOR): New macro. + (reset): If the buffer has already been allocated, set bufsalloc to + be bufalloc / PREFERRED_SAVE_FACTOR. This avoids problems when + bufsalloc == bufalloc (possible after reading a large binary file). + (reset): Use PREFERRED_SAVE_FACTOR instead of magic constant. + Do not set bufbeg; nobody uses it. + Always set buflim. + Check for lseek error. + Use SEEK_CUR, not a magic constant. + (fillbuf): Return an error indication, not a count. + All callers changed. + Do not assume ssize_t fits in int. + Use PREFERRED_SAVE_FACTOR instead of magic constant. + Clean up mmap code. + Do not attempt to mmap zero bytes. + Check for lseek error. + Use SEEK_SET, not a magic constant. + Work correctly if read is interrupted. + (grepfile): Work correctly if open or close is interrupted. + + * src/system.h (SEEK_SET, SEEK_CUR): New macros. + +1999-10-02 Alain Magloire + + * src/regex.[ch]: upgrade from GNU lib C source tree. + + * make beta 2.3f available. + +1999-10-02 Paul Eggert + + * NEWS: egrep is now equivalent to `grep -E'. + The lower bound of an interval is not optional. + You can specify a matcher multiple types without error. + -u and -U are now allowed on non-DOS hosts, and have no effect. + * doc/grep.texi: Likewise. + * doc/grep.1: Likewise. + Fix some troff bugs that prevented `groff' from rendering the page. + + * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c (default_matcher): + Remove. + (matcher): Add. + * src/grep.h (default_matcher): Remove. + (matcher): Now exported from ?grepmat.c, not grep.c. + + * src/dfa.c (lex): If { would start an invalid interval specification, + treat it as a normal character. + Remove (broken) support for {,M} meaning {0,M}. + Diagnose bogus intervals like {1,0}. + (closure): maxrep is now -1 to indicate no limit, not zero; + zero is a valid value for maxrep, meaning an upper bound of zero. + + * src/grep.c (short_options): New constant. + (long_options, main): -u and -U are now supported on Unix, + with no effect. + (matcher): Removed; now defined by ?grepmat.c. + (install_matcher): Renamed from setmatcher. + (setmatcher): New function. + (usage): Report new, more uniform option scheme. + (main): Do not initialize matcher; ?grepmat.c now does this. + Rely on setmatcher to catch matcher conflicts. + Default matcher is "grep". + + * src/search.c (matchers): + Remove "posix-egrep" matcher; no longer needed. + (Ecompile): Likewise. + The egrep matcher now has POSIX behavior. + + * tests/bre.tests: grep '\{' is no longer an error. + Fix test for interval too large, and enable it. + * tests/ere.tests: grep -E {1 is no longer an error + Likewise for a{1, a{1a, a{1a}, a{1,x}. + +1999-09-22 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around GCC + 2.95.1 bug with HP-UX 10.20. + +1999-09-12 Paul Eggert + + * src/grep.c (fillbuf): Fix typo: we sometimes reported + arithmetic overflow even when there wasn't any. + +1999-09-12 Paul Eggert + + * configure.in (AC_CHECK_FUNCS): Add memmove. + + * src/system.h (S_ISREG): New macro. + (memmove): Define if ! defined HAVE_MEMMOVE && ! defined memmove, + not if !defined STDC_HEADERS. This is needed for SunOS 4.1.4, + which defines STDC_HEADERS but lacks memmove. + + * src/grep.c (bufoffset): Needed even if !defined HAVE_MMAP. + (reset): Always fstat the file, since we always need its size if it is + regular. + Similarly, get the buffer offset of every regular file. + Set bufmapped to 0 if the file's initial offset is not a multiple + of the page size. + (fillbuf): Calculate an upper bound on how much memory we should + allocate only for regular files, since we don't know the sizes of + other files. + Don't bother to check whether the file offset is a multiple of the page + size, since we now do that just once in `reset'. + When an mmapped area would fall past the end of the file, trim it to + just before instead of giving up immediately and doing a `read'; + that avoids a worst-case behavior that could read half an mmapped file. + Fix bug when computing offsets on hosts that don't have mmap. + +1999-08-27 Paul Eggert + + * src/system.h (memmove): New macro. + + * src/grep.c (page_alloc): Reallocate the old buffer instead + of having both old and new buffers active simultaneously. + Remove valloc debugging variant, which no longer applies. + + (fillbuf): Rejigger the buffer allocation mechanism. The old + mechanism could allocate more than 10*N bytes for an N-byte + file, which was excessive. Check for arithmetic overflow a + bit more carefully. + +1999-08-25 Paul Eggert + + * src/grep.c (grepdir): + Don't assume that st_ino and st_dev must be integers; + POSIX.1 allows them to be floating-point (!). + + * src/vms_fab.h (arr_ptr): `:' -> `;' to fix typo. + +1999-08-18 Alain Magloire + + * 2.3e snapshot. + +1999-08-18 Alain Magloire + + * src/search.c: On a CRAY J90 system running UNICOS 8.0. + Compilation of ./src/search.c failed because the declaration of + the variable "regex": + static struct re_pattern_buffer regex; + conflicted with a previous declaration search.c #includes "system.h", + which #includes , which declares : + extern char *regex __((char *_Re, char *_Subject, ...)); + The declaration in search.c is local to that one source file. + I just changed its name to something less likely to conflict. + (I called it "regexbuf", but you could pick any name you want.) + Excerpt email from Dean Kopesky. + +1999-08-16 Paul Eggert + + Upgrade large-file support to the version used in tar and + textutils. + + * Makefile.am (ACLOCAL_AMFLAGS): Define to be empty. + (M4DIR, ACINCLUDE_INPUTS): New macros. + ($(srcdir)/acinclude.m4): New rule. + + * configure.in (AC_CANONICAL_HOST, AM_C_PROTOTYPES): Add. + (AC_SYS_LARGEFILE): Renamed from AC_LFS, for compatibility + with what should appear in the next autoconf release. + + * m4/largefile.m4: Renamed from m4/lfs.m4. + + * src/ansi2knr.1, src/ansi2knr.c, config.guess, config.sub: + New files. config.guess and config.sub ar needed by the new + AC_SYS_LARGEFILE. ansi2knr is needed by AM_C_PROTOTYPES, + which in turn is needed by the new AC_SYS_LARGEFILE. + +1999-08-16 Alain Magloire + + * 2.3d snapshot on ftp server. + +1999-07-26 Paul Eggert + +Several GNU tools have options to process arbitrary file names, even +file names that contain newline characters. These include `find +-print0', `perl -0', `sort -z', and `xargs -0'. It'd be handy if GNU +grep also processed such file names. Here's a proposed patch to do +this, relative to grep 2.3c. This patch introduces two options, one +for the data, and one for the file names. (Sometimes one wants +null-terminated file names in the output, and sometimes one wants to +process lists of null-terminated strings, and these are orthogonal +axes.) + + * NEWS, doc/grep.texi: New -z or --null-data and -Z or --null options. + * src/grep.c (long_options, usage, main): Likewise. + + * src/dfa.h (dfasyntax): New eol parameter. + * src/dfa.c (eolbyte): New var. + (dfasyntax): Set it from new parameter. + (lex, dfastat, build_state, dfaexec): Use it instead of '\n'. + + * src/grep.h (eolbyte): New decl. + * src/grep.c (eolbyte): New var. + (nlscan, prpending, prtext, grepbuf, grep): Use it instead of '\n'. + (filename_mask): New var. + (prline, grepfile): Output NUL separator if filename_mask is zero. + (grep): Look for '\200' as the hallmark of a binary file, not '\0', + if -z or --null-data is specified, since it implies that '\0' is + expected as text. + + * src/search.c (Gcompile, Ecompile): Pass eolbyte to dfasyntax. + (EGexecute, Fexecute): Use eolbyte instead of '\n'. + +1999-06-15 Alain Magloire + + * src/grep.c, doc/grep{1,texi} : + --revert-match should be --invert-match. + Correction proposed by Karl Berry. + +1999-06-12 Alain Magloire + + * doc/grep.{1,texi}: add description for --with-filename. + Noted missing by UEBAYASHI Masao. + +1999-03-17 Paul Eggert + + * NEWS: Add GREP_OPTIONS. + + * doc/grep.texi: Document GREP_OPTIONS, and the other + environment variables. Fix doc for [:blank:], [:cntrl:], [:punct:]. + + * src/grep.c (prepend_args, prepend_default_options): New functions. + (main): Use them to implement GREP_OPTIONS. + * src/system.h (getenv): New decl. + +1999-03-16 Volker Borchert + + * configure.in: Use case case ... esac for checking Visual C++. + When ${CC} contains options it was not recognize. + +1999-03-07 Paul Eggert + + * src/grep.c (usage): Don't report -E, -F, and -G unless we're grep. + (main): Don't match options -E, -F, and -G unless we're grep. + Remove after-the-fact check for options -E, -F, and -G, since + they're no longer needed. + +1999-03-05 Eli Zaretskii + + * src/grep.c (main): Print the name of the default matcher instead + of just "grep". + +1999-02-06 Alain Magloire + + * tests/*.awk : Linux users are seeing "Broken Pipe" on make check. + The problem is that grep does not drain its stdin, thus the previous + process in the pipeline receives a SIGPIPE. Other shells are silent + about this. There is actually no failure, since the broken pipe is + expected. You can work around it by changing the pipeline, so that + the input is drained, like this: + status=`echo 'check' | { ${GREP} -E -e pattern >/dev/null 2>&1; + echo $?; cat >/dev/null; }`; if test $status -ne $errnu then ... fi + Excerpt email from Andreas Schwab. + +1999-02-23 Alain Magloire + + * src/grep.c : Restrict the use of -E, -F, -G + to only grep driver, Posix behaviour. {f,e}grep + the matcher is already set. This change may brake + scripts, warn in NEWS. + + * doc/grep.{1,texi} : -C takes arguments, upgrade manual. + + * beta 2.3a + +1999-02-23 Alain Magloire + + * configure.in : Change the configure VC test from + 'test x$ac_cv_prog_CC = xcl;' to 'test x"$ac_cv_prog_CC" = xcl;' + Email from Joshua R. Poulson. + +1999-02-23 Paul Eggert + + Fix porting bug reported by Amakawa Shuhei for SunOS 4.1.4-JL. + The btowc.c shipped with grep 2.3 is incorrect for Solaris + 2.5.1 and earlier, as it assumes UTF8, which these OSes do not + support. Solaris 7 supports btowc, so there's no need to ship + a substitute for it. The only questionable case is Solaris + 2.6, which lacks btowc but does support UTF8. However, 2.6 + supports UTF8 but only as a demonstration (for an English + locale!); Japanese Solaris 2.6 users typically use EUC, or + sometimes shift-JIS, but they cannot use UTF8 since Japanese + UTF8 is not supported. Hence there's no point to having grep + substitute a btowc that uses UTF8, as it is either redundant, + or it will almost invariably have incorrect behavior. + + * configure.in (AC_CHECK_HEADERS): Don't set USE_WCHAR. + (AC_CHECK_FUNCS): Add btowc, wctype. + (AC_REPLACE_FUNCS): Don't replace btowc; our replacement is + invariably doing the wrong thing anyway, at least on SunOS/Solaris. + Don't bother to check for wctype in -lw, as we don't support + wide characters on Solaris 2.5.1 or earlier anyway. + + * bootstrap/Makefile.try (OBJS): Remove btowc.$(OBJEXT). + + * src/btowc.c: Removed; no longer needed. + +1999-02-19 Paul Eggert + + * NEWS: Fix typo when talking about the old behavior of + silently skipping directories; it was grep 2.1, not grep 2.2. + +1999-02-15 Alain Magloire + + * bootstrap/Makefile.try : add DJGPP DEFS. + Done by Elie Zaretsckii. + +1999-02-14 Alain Magloire + + * m4/gettext.m4 : Guard [] with changequote. + From Elie Zaretskii. + + * djgpp/config.bat : Makefile.in.in --> Makefile.in-in + From Elie Zaretskii. + + * src/dosbuf: k&r function parameter. + + * release of 2.3. + +1999-02-10 Alain Magloire + + * bootstrap/{Makefile{try,am},REAMDE} : skeleton + provided for system lacking the tools to autoconfigure. + + * src/{e,f,}grepmat.c: added guard [HAVE_CONFIG_H] + +1999-02-10 Alain Magloire + + * PATCHES-AC, PATCHES-AM: updated. + + * m4/regex.m4 : updated. + +1999-02-05 Eli Zaretskii + + * m4/gettext.m4 : Support DOS-style D:/foo/bar absolute file + names. + + * aclocal.m4 (DJGPP) : Use $DJ_GPP instead, since changing the + latter prevents GCC from finding headers and libraries. + + * djgpp/config.bat: Make building from another directory work + + * djgpp/config.sed: Remove redundant command wich edited path + separator: now done by configure. + + * src/grep.c [O_BINARY]: Add prototype for undossify_input. + + * doc/grep.texi (Introduction): Typo fixed. + +1999-02-03 Alain Magloire + + * grep-2.2f beta release. + +1999-02-02 Alain Magloire + + * m4/{djgpp,envsep,glibc,regex,dosfile,isc-posix}.m4 : + New files to aid configuration and unload configure.in. + * m4/Makefile.am : updated. + * src/btowc.c : protect for wchar.h + +1999-01-28 Alain Magloire + + * intl/Makefile.in: Replace .o with .${ac_objext} where necessary. + Work around a limitation of Visual C++ on Cygwin32. + * acconfig.h configure.in: Define `alloca' as `_alloca' when CC=cl. + This little hack was suggested by Ian Roxborough . + Patch forwarded by Ben Elliston. + +1999-01-28 Alain Magloire + + * PATCHES-AM: New file. A small patch for automake-1.4, use $(sep) + as the path separator base on @SEP@. + * PATCHES-AC configure.in : updated for autoconf-13. + +1999-01-27 Volker Borchert + + * grep.c: fgrep -NUM not working correctly. + add the argument number to digit_args_val. + +1999-01-22 Paul Eggert + + Prevent grep -r from recursing infinitely through directory loops via + symbolic links. + + * grep.c (struct stats): New type. + (stats_base): New var. + (bufstat): Remove; subsumed by stats->stat. + (reset, fillbuf, grep, grepdir, grepfile): Pass struct stats * arg, + for directory loop checking; use this instead of the bufstat global. + All callers changed. + (grepfile): Stat the file before invoking grepdir. + (grepdir): Assume that the argument has already been statted. + No longer a need for a directory size argument, since it + can be gotten from the struct stats * argument. + Check for directory loops. + Create linked list of directories currently being visited, + to detect loops. + +1998-12-29 Kaveh R. Ghazi + + intl/localealias.c: When building grep-2.2e using cc on Irix4, + I needed the following patch to intl/localealias.c. + (Its the same patch used by fileutils-4.0.) The patch resolves + conflicts between char* and unsigned char* in the i18n code. + +1998-12-10 Alain Magloire + + * src/grep.c : Typo in contex -->context + Noted by Vladimir Michl. + +1998-12-01 Alain Magloire + + * doc/Makefile.am djgpp/Makefile.am m4/Makefile.am vms/Makefile.am: + New files. + + * m4/progtest.m4: proctect '[]' from m4. + Noted by Eli Z. + + * PATCHES-AC: New file, add the patch for autoconf in the dist. + + * acconfig.h: (HAVE_DOS_FILENAME) + + * TODO: updated. + + * src/search.c: remove obsolete 'gegrep,ggrep,gnugrep' + matchers. grep no longer depend on argv[0]. + + * grep-2.2e beta to test DJGPP port. + +1998-11-28 Paul Eggert + + Various portability enhancements: + - Don't assume that O_BINARY implies DOS. Use separate + macros D_OK (for DOS-like directory access) and + HAVE_DOS_FILE_NAMES (for DOS-like file names). + - Don't assume that off_t fits into long; it doesn't on Solaris 2.6. + - Have is_EISDIR set errno properly on hosts with screwed-up EISDIR. + - Treat ':' specially in DOS file names only if it's the end of a + drive specifier. + - Protect against errno < 0. + + * src/grep.c (is_EISDIR): Move defn to system.h. + (print_offset_sep): New function. + (fillbuf): Remove redundant test of O_BINARY. + (totalcc, totalnl): Now of type off_t. + (prline): Use print_offset_sep to print file offsets. + (grepfile): Don't set e to EISDIR; that's is_EISDIR's responsibility + on machines that don't work properly with EISDIR. + (grepdir): Don't assume ':' means slash on all DOS filenames; + it means it only in the file prefix. + + * src/system.h (strerror): Check for negative error numbers. + (is_EISDIR): Depend on D_OK, not O_BINARY. + (SET_BINARY): Depend on HAVE_SETMODE, not __DJGPP__. + (IS_SLASH, FILESYSTEM_PREFIX_LEN): Depend on HAVE_DOS_FILE_NAMES, + not O_BINARY. + (CHAR_BIT): New macro. + + * src/dosbuf.c (struct dos_map): + pos and add members are now of type off_t. + (dos_stripped_crs): Now of type off_t. + (dossified_pos): Now accepts arg and returns value of type off_t. + + * configure.in (AC_CHECK_FUNCS): Add setmode. + (HAVE_DOS_FILENAMES): New macro + +1998-11-27 Eli Zaretskii + + * djgpp/config.sed: New file, a Sed script to edit configure + script before running it on DOS/Windows. + * djgpp/config.bat: Updated to handle po2tbl.sed.in and + po/Makefile.in.in on DOS filesystems, and to run config.sed. + +1998-11-24 Jim Meyering + + * src/grep.c : Typo s/infalid/invalid/ + Also noted by Stanislav Brabec. + +1998-11-24 Eli Zaretskii + + * doc/grep.texi: I found and corrected several typos. + I believe the GNU standards require the section that describes the + options to the programs to be called ``Invoking'' or ``Invoking + ''. This is so users and programs can easily find + that node in any Info file. So I changed the name of the + `Options' chapter to `Invoking', and corrected the + cross-references accordingly. + I added some markup to things like file names and options. + I added some additional index entries where that seemed useful. + I also corrected some index entries, such as "@cindex [:alnum:]", + which used a colon in them (the colons confuse Info readers). + +1998-11-24 Alain Magloire + + * grep/doc/grep.texi : -h is not use for help. + Nit spotted by Jim Meyering. + +1998-11-23 Alain Magloire + + * doc: New directory, grep.1, {e,f}grep.man move here + * doc/grep.texi: New info manual + * doc/version.texi: New + * doc/Makefile.am: New + * tests/{ere,bre}.*: New files. The spencer2 test is split + in two ere/bre. + * config.hin: New, config.h.in rename to config.hin for OS + with limited file system aka DOS. + + * grep-2.2d release for beta. + +1998-11-18 Alain Magloire + + * src/regex.[ch] : Updated from GLibc, previous patches were + integrate by Ulrich Drepper and some added ones. + +1998-11-16 Paul Eggert + + * grep.h (__attribute__): New macro, if not GCC. + (fatal): Add __attribute__((noreturn)). + * grep.c (usage): Add __attribute__((noreturn)). + +1998-11-16 Paul Eggert + + Remove memory leak with valloced buffers, by invoking malloc instead. + + * configure.in (AC_CHECK_FUNCS), src/system.h (valloc): Remove. + * src/grep.c (page_alloc): New function. + (ubuffer, pagesize): New vars. + (ALIGN_TO): New macro. + (reset): Initialize new vars. Check for overflow in buffer size calc. + Use page_alloc instead of valloc. + (fillbuf): Likewise. Use memcpy to copy saved area. + +1998-11-15 Paul Eggert + + * dfa.c (dfacomp), search.c (EGexecute): Don't assume char is unsigned. + +1998-11-14 Paul Eggert + + * src/grep.c (grepdir): Fix bug: memory freed twice. + + * src/search.c (Gcompile, Ecompile): Don't invoke dfainit, + since dfacomp does it for us, and if we also do it then we + leak memory. + +1998-11-13 Eli Zaretskii + + * djgpp/config.bat: Rewrite to run the configure script via Bash. + * djgpp/config.site, djgpp/getconf: New files. + * djgpp/config.h, djgpp/*.mak, djgpp/po2tbl.sed: Remove. + * djgpp/README: Update instructions. + + * Makefile.am (EXTRA_DIST): Update the list of DJGPP files. + + * src/system.h (IS_SLASH): New macro. + (is_EISDIR): Define it here for DOS and Windows. + + * src/grep.c (main) [O_BINARY]: Set stdout to binary mode, so the + EOL formats of the input and output files match, unless stdout is + the console device. + (is_EISDIR): Don't define if already defined. Accept a second + argument, the file name; all callers changed. + (grepdir): Don't free `file', inside the loop. Use IS_SLASH to + check whether `dir' needs a slash. + (grepfile): If file is a directory, set e to EISDIR. + +1998-11-10 Alain Magloire + + * src/vms_fab.{c,h}: New file for VMS wildcard expansion + Written by Phillip C. Brisco. + + * vms/make.com : add line to compile vms_fab.c and + {e,f,}grepmat.c with link for each grep/fgrep/egrep. + Base on patch send by Phillib C. Brisco. + +1998-11-09 Alain Magloire + + * grep-2.2c on alpha for testing. + +1998-11-09 Paul Eggert + + * src/grep.1: Fix `Last Change' of output by generating the date + from the RCS Id. + + * src/grep.c (is_EISDIR): New macro. + (grep): If -s, suppress errors from trying to read directories. + (grepfile): Use is_EISDIR to simplify code. + (grepdir): If -s, suppress errors from trying to read directories. + + * src/grep.1: Fix -q -r -s problems; describe BSD grep better. + + * src/grep.c (main): Update copyright. + + Specify default matcher with default_matcher extern var, not + DEFAULT_MATCHER macro. This is more straightforward and means + we need to compile grep.c just once. + + * src/egrepmat.c, src/fgrepmat.c, src/grepmat.c: New files. + + * src/Makefile.am (base_sources): New macro. + (egrep_SOURCES, fgrep_SOURCES, grep_SOURCES): Now consist of + $(base_sources) plus the single tailoring file. + (grep_LDADD, egrep_LDADD, fgrep_LDADD): Remove. + (EXTRA_DIST): Remove grep.c, regex.c. + (fgrep.o, egrep.o): Remove. + + * src/grep.h (matcher): Now char const *. + (default_matcher): New decl. + + * src/grep.c (matcher): Now char const *. + (setmatcher): Now accepts char const *. + (main): Default the matcher from default_matcher (linked externally) + rather than DEFAULT_MATCHER (a macro). + +1998-11-08 Alain Magloire + + * src/grep.1: `prep.ai.mit.edu' should be replaced with `gnu.org'. + Nit from Paul Eggert. + +1998-11-06 Alain Magloire + + * src/grep.c: The Matcher is not set to argv[0] but + explicitly by a #define MATCHER at compile time default is "grep". + + * aclocal/: NEW dir. provides our own *.m4 + + * configure.in: Move Paul's Large Files to AC_LFS.(aclocal/lfs.m4) + Taken from Jim Meyering fileutils. + +1998-11-05 Alain Magloire + + * src/grep.1: update the man pages according to the + changes make by Miles. + + * po/*.po: updated. + + * first beta release for 2.3 (2.2a). + +1998-11-04 Miles Bader + + * src/grep.c (main): Rationalize interaction of -C/-NUM/-A/-B + options, and allow -C to have an optional argument. -NUM can + now be mixed with -C, and -A, -B always take precedence over + -C/-NUM, regardless of order. + (long_options): Let -C/--context take an optional argument. + +1998-11-03 Alain Magloire + + * src/dfa.c: HP-UX define clrbit/setbit as macros in + #undef if defined. + Fixed by Andreas Ley and Philippe Defert. + + * src/grep.1 : mention that -s follows POSIX.2 behavior. + Noted by Paul Eggert and others. + + * tests/khadafy.sh: a typo in failure(s). + Spotted By Sotiris Vassilopoulos. + +1998-11-01 Paul Eggert + + * src/system.h (IN_CTYPE_DOMAIN): New macro. + (ISALPHA, ISUPPER, ISLOWER, ISDIGIT, ISXDIGIT, ISSPACE, + ISPUNCT, ISALNUM, ISPRINT, ISGRAPH, ISCNTRL): Use + IN_CTYPE_DOMAIN instead of isascii. + +1998-08-18 Paul Eggert + + Add support for new -r or --recursive (or -d recurse or + --directories=recurse) option. + + * src/Makefile.am (grep_SOURCES): Add savedir.c, savedir.h, stpcpy.c. + + * src/grep.1: Describe new options. + + * src/grep.c: Include "savedir.h". + (long_options): Add -r or --recursive. + (RECURSE_DIRECTORIES): New enum value. + (IS_DIRECTORY_ERRNO): Remove. + (reset, grep): Add file name arg. + (grepdir, grepfile): New functions. + (initial_bufoffset): New var. + (reset): Initialize it. + (fillbuf): Use it. + (count_matches, list_files, no_filenames, suppress_errors): New static + vars; formerly were local to `main'. + (grep): Recurse through directories if the user asks for this. + (usage, main): Add new options. + (main): Change some local vars to be static, as described above. + Move most of the guts into grepfile function. + so that it can be recursed through. + + * configure.in (AC_HEADER_DIRENT, AC_FUNC_CLOSEDIR_VOID): Add. + (AC_REPLACE_FUNCS): Add stpcpy. + + * src/savedir.c, src/savedir.h, src/stpcpy.c: New files; + taken from fileutils 3.16u. + +1998-08-11 Paul Eggert + + * src/system.h (initialize_main): New macro. + * src/grep.c (main): Invoke initialize_main first thing. + +1998-04-29 Paul Eggert + + * NEWS, src/grep.1: Describe new -a and -d options. + + * src/grep.c (long_options, usage, main): + New options -d or --directories and -a or --text. + (directories, always_text): New variables. + (IS_DIRECTORY_ERRNO): New macro. + (reset): Now returns value specifying whether to skip this file. + Stat the file if either mmap or directory-skipping is possible. + Skip the file if it's a directory and we're skipping directories. + (grep): Skip the file if `reset' tells us to. + (main): If open fails because the file is a directory, and if we're + skipping directories, don't report an error. + Remove special case for DOS and Windows. + + * src/dosbuf.c (guess_type): Use the same method for guessing whether a + file is binary as grep.c's grep does. + There's no longer any need to declare `bp' to be unsigned. + +1998-04-26 Alain Magloire + + * grep-2.2 release. + + * src/dfa.c: Wrong revision was pulled out + for beta 2.1.1d. + * src/search.c: Wrong revision was pulled out + for beta 2.1.1d. + + * src/grep.c: ck_atoi () added instead of atoi (). + Suggestion from Jim Meyering. + ck_atoi () pulled from diffutils-2.7, maintained by Paul Eggert. + + * AUTHORS: Rephrase of some sentences. + * README: Rewording. + Noted and patched by Joel N. Weber II. + +1998-04-17 Kaveh R. Ghazi + + * src/dfa.h: Don't define `const', trust autoconf to handle it. + +1998-04-16 Alain Magloire + + * tests/{status,empty}.sh: wrong return status. + + * src/grep.c: Remove the REGEX part in usage (), it was + consider overkill by most. + +1998-04-14 Eli Zaretskii + + * djgpp/config.bat: Support file names with multiple dots on all + platforms. + + * djgpp/README: Add instructions about file names illegal on + MS-DOS. + +1998-04-13 Alain Magloire + + * src/dfa.c: by "popular" demand reverse + back to '_' not word-constituent. + + * grep-2.1.1c available for testing. + +1998-04-13 Karl Heuer + + * src/grep.c: (a) The directory check is done too early: + logically, if the argument is "-", then it refers to standard + input, regardless of whether there's something in the file + system answering to "-". + (b) The sh command "grep -l root /etc/passwd /etc/group 0<&-" + prints "(standard input)" instead of "/etc/passwd", because it + mistakenly believes that a named file will never be opened on fd + 0. The string "(standard input)" should be based on the file + having been originally specified as "-", rather than making + assumptions about the fd. + (c) the code that calls close(fd) is being done outside of the + test for a bad fd. Thus, if the open failed, this code will + attempt to close(-1). It should be done inside the "fd != -1" + branch. + This patch addresses all three of these problems. + +1998-04-13 Alain Magloire + + * configure.in: remove the deprecated AC_ISC_POSIX macro. + Spotted by Karl Heuer. + +1998-04-03 Eli Zaretskii + + * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated from the + relevant Makefile.in files. + + * djgpp/config.bat: Create files in intl directory like the + configure script does. + +1998-03-28 Eli Zaretskii + + * djgpp/main.mak, djgpp/src.mak, djgpp/tests.mak: Updated to track + changes in respective Makefile.in files. + + * src/dosbuf.c (guess_type): Avoid running off the end of the + buffer. Spotted by Paul Eggert. + +1998-03-27 Alain Magloire + + * grep-2.1.1b.tar.gz available. + + * src/regex.c: CLASS_CHAR_MAX set to 256 instead of 6 + when WCTYPE and WCHAR are not defined. When class names + where bigger then 6, it will not detect an error. + example '[[:alphabet:]]'. + + * Updated the copyright of the files with emacs. + With emacs Jim :). + +1998-03-26 Jim Meyering + + * src/dfa.c (IS_WORD_CONSTITUENT): Define. + (lex): Use IS_WORD_CONSTITUENT, not ISALNUM. + Don't special-case '_'. + (dfastate): Use IS_WORD_CONSTITUENT, not ISALNUM. + (dfaexec): Likewise. + +1998-03-25 Alain Magloire + + * tests/warning.sh: typos and replace the echos with + a simple cat. + Noted By Jim Meyering. + + * src/regex.c: #undef ISASCII and ISPRINT before defining + them(On Solaris it was define). + Pattern 'a[[:]:]]b' is an invalid char class and the error + from regex was 1(REG_NOMATCH) instead of 2 (REG_ECTYPE). + Fix with help from Ulrich Drepper. + + * src/grep.c (usage): Ulrich wrote: "A single printf should + not have more than 900 bytes. For translation reasons the + text shouldn't be split in too many pieces since this is + tiresome and also does not help to generate a consistent picture." + Noted by Ulrich Drepper. + * src/grep.c (usage): Dig out and old patch from + Franc,ois to explain the regex in usage(). + Ideas from Franc,ois Pinard. + +1998-03-23 Alain Magloire + + * testing: grep-2.1.1a for testing. + + * configure.in: Solaris needs '-lw' if we use wchar/wctype + functions. + * src/btowc.c: New file from GNU libc. Solaris 2.5 don't + have it define. + * configure.in : check for btowc (). + + * regex.c: Include before , to work around + a Solaris 2.5 bug. + Patch provided by Paul Eggert. + + * tests/status.sh: new file to check return status code. + * tests/empty.sh: new file to check for empty pattern. + * tests/warning.sh: new file to tell where to report errors. + + * configure.in: If available, prefer support for large files + unless the user specified one of the CPPFLAGS, LDFLAGS, or LIBS + variables. + Done by Paul Eggert. + + * src/grep.c (usage): change prep.ai.mit.edu for gnu.org. + +1998-03-18 Alain Magloire + + * src/grep.c (usage): Formating the --help message a bit off. + Noted by William Bader. + + * src/grep.c (main): When checking conflicting matcher for option -E the + matcher was to "egrep" instead of "posix-egrep". + Reported by kwzh@gnu.org. + + * src/grep.c: Typos and rewording the --help message. + Reported by Karl Heuer. + + * src/grep.1: The man page wording : + A regular expression matching a single character may be + followed by one of several repetition operators: + is unclear since 'x(yz)*z' is a valid regex. + Remove the "matching a single character". + Suggested by Harald Hanche-Olsen. + + * src/grep.c (main): `-f /dev/null' now specifies no patterns + and therfore matches nothing. + Reported by Jorge Stolfi. + Patched by Paul Eggert. + +1998-03-10 Alain Magloire + + * Ice storm 98(el nino). Lost grep repository disk, + and my $HOME directory, etc .. + Trying to get the emails/patch from dejanews.com + and start from grep-2.1. + sigh .... + +1997-11-01 Alain Magloire + + * src/grep.c: For the long options, the problems are: + --file appears in the option table as 'no_argument' + instead of 'required_argument'. + --files-with-matches is missing from the option table. + The help lists '--fixed-strings' as the long option for -F, + the table has '--fixed-regexp'. + --regexp appears in the option table as 'no_argument' + instead of 'required_argument'. + --with-filename is missing from the option table. + Reported by Grant McDorman and Krishna Sethuraman. + +1997-10-19 Alain Magloire + + * src/grep.c: the option "with-filename was not in the arg table. + Corrected by Jim Hand. + + * GNU gettext library from gettext-0.10.32. + + * src/grep.c: reverse back to greping directories, + One could skip the error message by defining + SKIP_DIR_ERROR. There is no clear way of doing + things, I hope to setle this on the next majore release + Thanks Paul Eggert, Eli Zaretskii and gnits for the + exchange. + + * tests/status.sh: add this check to make sure + That the return status code is ok. + +1997-10-10 Andreas Schwab + + * src/grep.1: Fix formatting. + + * configure.in: Check for wctype.h, wchar.h, libintl.h and + isascii, which are needed for regex.c. + +1997-10-01 Paul Eggert + + * src/grep.c (fillbuf): Don't warn about mmap failures. + +1997-09-7 Alain Magloire + + * src/grep.c: added code for -H --with-filename. + + * djgpp/*: patch wrongly apply + duplication of text in djgpp/{README,config.h}. + Filter djgpp/config.bat with unix2dos. + + * djgpp/make.mak: beautify + From Eli Zaretskii. + + * grep-2.1 release. + +1997-09-01 Alain Magloire + + * grep-2.0f out for testing. + + * update to GNU gettext library from gettext-0.10.31 + + * grep.c : have a nicer format for --version. + Noted by Ulrich Drepper. + + * obstack.[ch]: updated from GNU C library + * configure.in: look for stdlib.h [HAVE_STDLIB_H] + Comments from Ulrich Drepper. + +1997-08-25 Philippe De Muyter + + * src/dfa.c (sys/types.h): File included unconditionnaly. + +1997-08-16 Eli Zaretskii + + * grep.c (long_options) [O_BINARY]: Add DOS-specific options. + (fillbuf) [O_BINARY]: For DOS-style text files, strip CR + characters at end of line. + (prline) [O_BINARY]: Report correct byte offsets, even though CR + characters were stripped when reading the file. + (usage) [O_BINARY]: Add DOS-specific options. + (setmatcher) [HAVE_SETRLIMIT]: Set re_max_failures so that the + matcher won't ever overflow the stack. + (main) [__MSDOS__, _WIN32]: Handle backslashes and drive letters + in argv[0], remove the .exe suffix, and downcase the prgram name. + [O_BINARY]: Pass additional DOS-specific options to getopt_long + and handle them. Call stat before attempting to open the file, in + case it is a directory (DOS will fail the open call for + directories). Switch the input descriptor to binary mode, unless + it is a terminal device. + + * system.h [O_BINARY]: Define macros to switch a handle to binary + mode, so binary files could be grep'ed on MS-DOS and MS-Windows. + [HAVE_SETLOCALE]: Test for HAVE_SETLOCALE instead of + HAVE_LC_MESSAGES, to prevent compilation error in grep.c on + systems which don't define HAVE_LC_MESSAGES, but have setlocale. + + * dosbuf.c: New file, functions specific for MS-DOS/MS-Windows. + (guess_type, undossify_input, dossified_pos): New functions. + + * djgpp/config.h, djgpp/config.bat, djgpp/main.mak, djgpp/src.mak, + djgpp/po.mak, djgpp/intl.mak, djgpp/tests.mak, djgpp/po2tbl.sed: + New files, for building Grep with DJGPP tools for MS-DOS and + MS-Windows. + + * grep.1: Document DOS-specific switches. + +1997-08-08 Alain Magloire + + * grep-2.0e: available for testing + + * grep.c: change LC_MESSAGE to LC_ALL for (LC_CTYPE). + Suggested by Jochen Hein. + + * ABOUT-NLS: updated. + * grep.c: --version: more verbosity (COPYRIGHT). + * grep.c: --help: PATTERN, FILE instead of , . + * INSTALL.grep: not necessary removed. + * configure.in: --disable-regex rename --without-include-regex. + * THANKS: format: first row name, second email. + * ChangeLog: format ISO 8601. + Reported by Franc,ois Pinard. + + * grep.c: move dcl of struct stat st into "else" where it's used. + Reported by Jim Meyering. + + * grep.c: totalnl should be %u in printf. + Reported by Michael Aichlmay + Corrected with guidance from Ulrich Drepper + +1997-07-24 Alain Magloire + + * Makefile.am: corrected an error when installing {f,e}grep.1. + From Kaveh R. Ghazi . + From Ulrich Drepper . + + * Many files: use PARAMS instead of __STDC__ for prototypes. + From Jim Meyering . + Patch provided by Kaveh R. Ghazi . + + * dfa.[ch]: uses the one in gawk-3.0.3 with the patch from + Arnold (see Changelog: July 12 1997) + + * grep.1: a note to say -l, -L, -q stop on first match. + Noted by Andrew Beattie . + + * grep.c: refuse to scan if the file is a directory. + This was causing problems on SUNs. If the directory contains + a file that could match the pattern, garbage was display. + + * tests directory: added new set of tests from Henry Spencer + regex package. Change the way the tests were done to be more + conformant to automake. + + * configure.in: added --disable-regex for folks with their own fuctions. + + * grep-20d : available for testing + +1997-07-18 Alain Magloire + + * grep-2.0c: available for testing + +1997-07-17 Alain Magloire + + * src/grep.c: Cause grep to fail if `fclose (stdout)' fails. + From Jim Meyering . + + * grep.c:usage() more consistency in the --help. + + * egrep, fgrep were links This is in violation of GNU standards: + "Please don't make the behavior of a utility depend on the name used + to invoke it. It is useful sometimes to make a link to a utility with + a different name, and that should not change what it does." + For now egrep and fgrep will be copies of grep. A better scheme + should be found later. + After discussion with Tom Tromey . + + * fgrep.man and egrep.man included: They are stubs that call grep.1. + * Makefile.am: modified to install {f,e,}grep[,.1]. + + * speed hack for -l, -L: bail out on first match. + From Scott Weikart . + + * *.[ch]: provided prototypes for strict argument checking + With the help of Stewart Levin . + +1997-07-16 Alain Magloire + + * configure.in: typo in the creation of po/Makefile + Noted by Volker Borchert bt@teknon.de. + + * grep-2.0b: make it available for testing. + +1997-07-15 Alain Magloire + + * src/grep.c usage(): cut the --help in smaller printf()'s + Noted by Ulrich Drepper . + +1997-07-14 Alain Magloire + + * grep-2.0a: make an alpha available for testing. + +1997-07-12 Alain Magloire + + * run gettextize: added the po directory filled with *.po files. + + * check.sh, scriptgen.awk: fix grep paths. + + * change the directory strucure: grep is now in src to comply with + gettext.m4. + + * grep.c version.c [VERSION]: got rid of version.c, + it is now define via config.h. + + * dfa.c: patch to speed up initialization. + Arnold Robbins (arnold@gnu.ai.mit.edu). + +1997-07-09 Alain Magloire + + * *.c [HAVE_CONFIG_H]: Macro defined. + + * support for I18N in Makefile.am and configure.in. + + * update all the string to use gettext(I18N). + Help from Franc,ois Pinard previous patch . + +1997-07-04 Alain Magloire + + * obstack.[ch]: updated from glibc. + Work of Ulrich Drepper . + + * regex.[ch]: updated from glibc. + Work of Ulrich Drepper . + + * grep.c: for option -e not counting '\n' for new keys. + From Mark Waite . + + * grep.c: for option -f allocating the right count. + From Andreas Schwab . + Mike Heartel (mike@cs.uoregon.edu). + + * kwset.c (bmexec): Cast tp[-2] to unsigned char before comparing. + From Jim Meyering . + + * grep.1: various typos. + From Keith Bostic . + Mike Heartel (mike@cs.uoregon.edu). + +1997-06-17 Alain Magloire + + * grep.c: support for long options. + patch done by Franc,ois Pinard . + + * add getopt1.c in Makefile.am. + Noted by Franc,ois Pinard + + * replace getopt.[ch] and add getopt1.c. + + * kwset.c: undef malloc before define it. + Franc,ois Pinard . + +1997-06-07 Alain Magloire + + * grep.c: format incorrect in + fprintf("%s: warning: %s: %s...", filename, strerror(errno)). + Mike Heartel (mike@cs.uoregon.edu). + +1996-11-19 David J MacKenzie + + * make.com: Set the logical SYS. From rdb@cocamrd.oz.au (Rodney Brown). + + * grep.c (S_ISREG): Define if not defined already, for e.g. + SunOS 4.0.3. + + * dfa.c (test_bit, set_bit, clear_bit): Renamed from tstbit, + setbit, clrbit to avoid conflict with HP-UX sys/param.h macros. + + * memchr.c: New file, from GNU libc. + * grep.c (memchr): Remove definition. + * configure.in: Use AC_REPLACE_FUNCS for memchr. + + * configure.in: Remove unused checks for memalign and unsigned char. + * grep.c: HAVE_WORKING_MMAP -> HAVE_MMAP. + + * system.h: New file. + * dfa.c, kwset.c, grep.c, search.c: Use it instead of duplicating + portability boilerplate. + + * grep.c: Include sys/types.h once, instead of three times + conditionally. + * dfa.c, kwset.c, search.c: Include sys/types.h unconditionally, + to always try to get size_t (needed on some old SysV's). + + * dfa.c: Define strchr in terms of index, not the other way around. + * search.c: Use memcpy instead of bcopy. + +1996-11-15 David J MacKenzie + + * Many files: Update FSF address. + Update configuration to use autoconf v2 and automake. + +1993-05-22 Mike Haertel + + * Version 2.0 released. diff --git a/src/apps/bin/grep-2.5/INSTALL b/src/apps/bin/grep-2.5/INSTALL new file mode 100644 index 0000000000..b42a17ac46 --- /dev/null +++ b/src/apps/bin/grep-2.5/INSTALL @@ -0,0 +1,182 @@ +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, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + 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 at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' 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. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +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 supports 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' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' 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' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +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 host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +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. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--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. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/src/apps/bin/grep-2.5/Jamfile b/src/apps/bin/grep-2.5/Jamfile new file mode 100644 index 0000000000..e393acdf0b --- /dev/null +++ b/src/apps/bin/grep-2.5/Jamfile @@ -0,0 +1,4 @@ +SubDir OBOS_TOP src apps bin grep-2.5 ; + +SubInclude OBOS_TOP src apps bin grep-2.5 lib ; +SubInclude OBOS_TOP src apps bin grep-2.5 src ; diff --git a/src/apps/bin/grep-2.5/Makefile b/src/apps/bin/grep-2.5/Makefile new file mode 100644 index 0000000000..ea77663d19 --- /dev/null +++ b/src/apps/bin/grep-2.5/Makefile @@ -0,0 +1,476 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = . + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/grep +pkglibdir = $(libdir)/grep +pkgincludedir = $(includedir)/grep +top_builddir = . + +ACLOCAL = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal +AUTOCONF = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf +AUTOMAKE = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake +AUTOHEADER = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader + +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i586-pc-beos +AMTAR = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar +AWK = gawk +BUILD_INCLUDED_LIBINTL = yes +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +CC = gcc +CPP = gcc -E +DATADIRNAME = share +DEPDIR = .deps +EXEEXT = +GENCAT = gencat +GETCONF = +GLIBC21 = no +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +GMSGFMT = : +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INSTOBJEXT = .mo +INTLBISON = bison +INTLLIBS = $(top_builddir)/intl/libintl.a +INTLOBJS = $(GETTOBJS) +INTL_LIBTOOL_SUFFIX_PREFIX = +LIBICONV = +MKINSTALLDIRS = ./mkinstalldirs +MSGFMT = : +OBJEXT = o +PACKAGE = grep +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +POSUB = po +RANLIB = ranlib +SEP = : +SYMLINK = ln -s +SYMLINKFROM = grep +U = +USE_INCLUDED_LIBINTL = yes +USE_NLS = yes +VERSION = 2.5 +am__include = include +am__quote = +install_sh = /boot/home/Development/current/src/apps/bin/grep-2.5/install-sh + +AUTOMAKE_OPTIONS = no-dependencies + +SUBDIRS = intl po lib doc src tests m4 vms bootstrap + +EXTRA_DIST = TODO README README-alpha PATCHES.AC PATCHES.AM + +# We should be able to just define `ACLOCAL_AMFLAGS = --acdir=m4', +# but this runs afoul of a bug in automake 1. +# The following hack works around this bug by creating acinclude.m4 manually. +ACLOCAL_AMFLAGS = +M4DIR = $(srcdir)/m4 +ACINCLUDE_INPUTS = $(M4DIR)/decl.m4 $(M4DIR)/djgpp.m4 $(M4DIR)/dosfile.m4 \ + $(M4DIR)/envsep.m4 $(M4DIR)/error.m4 $(M4DIR)/gettext.m4 $(M4DIR)/glibc.m4 \ + $(M4DIR)/header.m4 $(M4DIR)/init.m4 $(M4DIR)/install.m4 \ + $(M4DIR)/inttypes_h.m4 $(M4DIR)/isc-posix.m4 $(M4DIR)/largefile.m4 \ + $(M4DIR)/lcmessage.m4 $(M4DIR)/malloc.m4 $(M4DIR)/mbstate_t.m4 \ + $(M4DIR)/missing.m4 $(M4DIR)/progtest.m4 $(M4DIR)/realloc.m4 \ + $(M4DIR)/regex.m4 $(M4DIR)/sanity.m4 $(M4DIR)/strerror_r.m4 \ + $(M4DIR)/uintmax_t.m4 $(M4DIR)/ulonglong.m4 $(M4DIR)/xstrtoumax.m4 + +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = intl/Makefile +depcomp = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ + INSTALL Makefile.am Makefile.in NEWS THANKS TODO aclocal.m4 \ + config.guess config.hin config.sub configure configure.in \ + install-sh missing mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$@ $(SHELL) ./config.status + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/config.hin $(top_builddir)/config.status + @rm -f stamp-h stamp-hT + @echo timestamp > stamp-hT 2> /dev/null + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h:config.hin \ + $(SHELL) ./config.status + @mv stamp-hT stamp-h +$(srcdir)/config.hin: $(srcdir)/./stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/./stamp-h.in; \ + $(MAKE) $(srcdir)/./stamp-h.in; \ + else :; fi +$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) + @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT + @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null + cd $(top_srcdir) && $(AUTOHEADER) + @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in + +distclean-hdr: + -rm -f config.h +intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(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 $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.hin$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags config.hin $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +# Avoid unsightly `./'. +distdir = $(PACKAGE)-$(VERSION) + +GZIP_ENV = --best + +distdir: $(DISTFILES) + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/intl $(distdir)/po + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(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 + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + --with-included-gettext \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || (echo "Error: files left after uninstall" 1>&2; \ + exit 1) ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && $(MAKE) $(AM_MAKEFLAGS) distclean \ + && rm -f $(distdir).tar.gz \ + && (test `find . -type f -print | wc -l` -eq 0 \ + || (echo "Error: files left after distclean" 1>&2; \ + exit 1) ) + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) +distclean: distclean-recursive + -rm -f config.status config.cache config.log +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive dist dist-all distcheck distclean \ + distclean-generic distclean-hdr distclean-recursive \ + distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ + info-recursive install install-am install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-generic mostlyclean-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +$(srcdir)/acinclude.m4 : $(ACINCLUDE_INPUTS) + cat $(ACINCLUDE_INPUTS) >$(srcdir)/acinclude.m4 + +# make cvs-clean blatantly stolen from KDE CVS ;) +cvs-clean: + @if test ! -d CVS; then \ + echo "You don't have a toplevel CVS directory."; \ + echo "You most certainly didn't use cvs to get these sources."; \ + echo "But this function depends on cvs's information."; \ + exit 1 ;\ + fi;\ + pwd=`pwd` ;\ + dirs=`find . -type d | grep -v CVS | sed -e "s#^./##"` ;\ + for i in $$dirs; do \ + if test ! -d "$$pwd/$$i/CVS"; then \ + echo "D $$i" ;\ + rm -rf "$$pwd/$$i"; \ + continue; \ + fi ;\ + cd $$pwd/$$i ;\ + for f in * .*; do \ + if test ! -d "$$f"; then \ + if grep "^/$$f/" CVS/Entries > /dev/null; then \ + a="b"; \ + else \ + echo "F $$i/$$f"; \ + rm -f "$$pwd/$$i/$$f"; \ + fi; \ + fi ; \ + done; \ + done +# 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: diff --git a/src/apps/bin/grep-2.5/Makefile.am b/src/apps/bin/grep-2.5/Makefile.am new file mode 100644 index 0000000000..e4b58c478a --- /dev/null +++ b/src/apps/bin/grep-2.5/Makefile.am @@ -0,0 +1,51 @@ +## Process this file with automake to create Makefile.in +AUTOMAKE_OPTIONS = no-dependencies + +SUBDIRS = intl po lib doc src tests m4 vms bootstrap + +EXTRA_DIST = TODO README README-alpha PATCHES.AC PATCHES.AM + +# We should be able to just define `ACLOCAL_AMFLAGS = --acdir=m4', +# but this runs afoul of a bug in automake 1. +# The following hack works around this bug by creating acinclude.m4 manually. +ACLOCAL_AMFLAGS = +M4DIR = $(srcdir)/m4 +ACINCLUDE_INPUTS = $(M4DIR)/decl.m4 $(M4DIR)/djgpp.m4 $(M4DIR)/dosfile.m4 \ + $(M4DIR)/envsep.m4 $(M4DIR)/error.m4 $(M4DIR)/gettext.m4 $(M4DIR)/glibc.m4 \ + $(M4DIR)/header.m4 $(M4DIR)/init.m4 $(M4DIR)/install.m4 \ + $(M4DIR)/inttypes_h.m4 $(M4DIR)/isc-posix.m4 $(M4DIR)/largefile.m4 \ + $(M4DIR)/lcmessage.m4 $(M4DIR)/malloc.m4 $(M4DIR)/mbstate_t.m4 \ + $(M4DIR)/missing.m4 $(M4DIR)/progtest.m4 $(M4DIR)/realloc.m4 \ + $(M4DIR)/regex.m4 $(M4DIR)/sanity.m4 $(M4DIR)/strerror_r.m4 \ + $(M4DIR)/uintmax_t.m4 $(M4DIR)/ulonglong.m4 $(M4DIR)/xstrtoumax.m4 +$(srcdir)/acinclude.m4 : $(ACINCLUDE_INPUTS) + cat $(ACINCLUDE_INPUTS) >$(srcdir)/acinclude.m4 + +# make cvs-clean blatantly stolen from KDE CVS ;) +cvs-clean: + @if test ! -d CVS; then \ + echo "You don't have a toplevel CVS directory."; \ + echo "You most certainly didn't use cvs to get these sources."; \ + echo "But this function depends on cvs's information."; \ + exit 1 ;\ + fi;\ + pwd=`pwd` ;\ + dirs=`find . -type d | grep -v CVS | sed -e "s#^./##"` ;\ + for i in $$dirs; do \ + if test ! -d "$$pwd/$$i/CVS"; then \ + echo "D $$i" ;\ + rm -rf "$$pwd/$$i"; \ + continue; \ + fi ;\ + cd $$pwd/$$i ;\ + for f in * .*; do \ + if test ! -d "$$f"; then \ + if grep "^/$$f/" CVS/Entries > /dev/null; then \ + a="b"; \ + else \ + echo "F $$i/$$f"; \ + rm -f "$$pwd/$$i/$$f"; \ + fi; \ + fi ; \ + done; \ + done diff --git a/src/apps/bin/grep-2.5/Makefile.cvs b/src/apps/bin/grep-2.5/Makefile.cvs new file mode 100644 index 0000000000..910a25943b --- /dev/null +++ b/src/apps/bin/grep-2.5/Makefile.cvs @@ -0,0 +1,47 @@ +VERSION = $(shell cat configure.in |grep INIT_AUTOMAKE |sed -e 's/.*,//;s/^ //;s/.$$//' ) +SRCDIR = $(shell pwd) + +all: autogen.sh configure.in + ./autogen.sh + +grep-$(VERSION).tar: + [ -e configure.in ] || ( echo Must be run from grep source dir ; exit 1 ) + rm -rf /tmp/grep-$(VERSION) && cp -aR $(SRCDIR) /tmp/grep-$(VERSION) && cd /tmp/grep-$(VERSION) && make -f Makefile.cvs cvs-clean && make -f Makefile.cvs && rm -rf autom4te.cache && (find . -type d -name CVS |xargs rm -rf) && cd .. && tar chf $(SRCDIR)/grep-$(VERSION).tar grep-$(VERSION) + +grep-$(VERSION).tar.bz2: grep-$(VERSION).tar + bzip2 -9f grep-$(VERSION).tar + +grep-$(VERSION).tar.gz: grep-$(VERSION).tar + gzip -9f grep-$(VERSION).tar + +rpm: grep-$(VERSION).tar.bz2 + rpm -ts --define '_srcrpmdir $(SRCDIR)' grep-$(VERSION).tar.bz2 + +# make cvs-clean blatantly stolen from KDE CVS ;) +cvs-clean: + @if test ! -d CVS; then \ + echo "You don't have a toplevel CVS directory."; \ + echo "You most certainly didn't use cvs to get these sources."; \ + echo "But this function depends on cvs's information."; \ + exit 1 ;\ + fi;\ + pwd=`pwd` ;\ + dirs=`find . -type d | grep -v CVS | sed -e "s#^./##"` ;\ + for i in $$dirs; do \ + if test ! -d "$$pwd/$$i/CVS"; then \ + echo "D $$i" ;\ + rm -rf "$$pwd/$$i"; \ + continue; \ + fi ;\ + cd $$pwd/$$i ;\ + for f in * .*; do \ + if test ! -d "$$f"; then \ + if grep "^/$$f/" CVS/Entries > /dev/null; then \ + a="b"; \ + else \ + echo "F $$i/$$f"; \ + rm -f "$$pwd/$$i/$$f"; \ + fi; \ + fi ; \ + done; \ + done diff --git a/src/apps/bin/grep-2.5/Makefile.in b/src/apps/bin/grep-2.5/Makefile.in new file mode 100644 index 0000000000..6394e7db0a --- /dev/null +++ b/src/apps/bin/grep-2.5/Makefile.in @@ -0,0 +1,476 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GETCONF = @GETCONF@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SEP = @SEP@ +SYMLINK = @SYMLINK@ +SYMLINKFROM = @SYMLINKFROM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AUTOMAKE_OPTIONS = no-dependencies + +SUBDIRS = intl po lib doc src tests m4 vms bootstrap + +EXTRA_DIST = TODO README README-alpha PATCHES.AC PATCHES.AM + +# We should be able to just define `ACLOCAL_AMFLAGS = --acdir=m4', +# but this runs afoul of a bug in automake 1. +# The following hack works around this bug by creating acinclude.m4 manually. +ACLOCAL_AMFLAGS = +M4DIR = $(srcdir)/m4 +ACINCLUDE_INPUTS = $(M4DIR)/decl.m4 $(M4DIR)/djgpp.m4 $(M4DIR)/dosfile.m4 \ + $(M4DIR)/envsep.m4 $(M4DIR)/error.m4 $(M4DIR)/gettext.m4 $(M4DIR)/glibc.m4 \ + $(M4DIR)/header.m4 $(M4DIR)/init.m4 $(M4DIR)/install.m4 \ + $(M4DIR)/inttypes_h.m4 $(M4DIR)/isc-posix.m4 $(M4DIR)/largefile.m4 \ + $(M4DIR)/lcmessage.m4 $(M4DIR)/malloc.m4 $(M4DIR)/mbstate_t.m4 \ + $(M4DIR)/missing.m4 $(M4DIR)/progtest.m4 $(M4DIR)/realloc.m4 \ + $(M4DIR)/regex.m4 $(M4DIR)/sanity.m4 $(M4DIR)/strerror_r.m4 \ + $(M4DIR)/uintmax_t.m4 $(M4DIR)/ulonglong.m4 $(M4DIR)/xstrtoumax.m4 + +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = intl/Makefile +depcomp = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ + INSTALL Makefile.am Makefile.in NEWS THANKS TODO aclocal.m4 \ + config.guess config.hin config.sub configure configure.in \ + install-sh missing mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$@ $(SHELL) ./config.status + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/config.hin $(top_builddir)/config.status + @rm -f stamp-h stamp-hT + @echo timestamp > stamp-hT 2> /dev/null + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h:config.hin \ + $(SHELL) ./config.status + @mv stamp-hT stamp-h +$(srcdir)/config.hin: $(srcdir)/./stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/./stamp-h.in; \ + $(MAKE) $(srcdir)/./stamp-h.in; \ + else :; fi +$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) + @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT + @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null + cd $(top_srcdir) && $(AUTOHEADER) + @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in + +distclean-hdr: + -rm -f config.h +intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(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 $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.hin$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags config.hin $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +# Avoid unsightly `./'. +distdir = $(PACKAGE)-$(VERSION) + +GZIP_ENV = --best + +distdir: $(DISTFILES) + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/intl $(distdir)/po + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(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 + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + --with-included-gettext \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || (echo "Error: files left after uninstall" 1>&2; \ + exit 1) ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && $(MAKE) $(AM_MAKEFLAGS) distclean \ + && rm -f $(distdir).tar.gz \ + && (test `find . -type f -print | wc -l` -eq 0 \ + || (echo "Error: files left after distclean" 1>&2; \ + exit 1) ) + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) +distclean: distclean-recursive + -rm -f config.status config.cache config.log +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive dist dist-all distcheck distclean \ + distclean-generic distclean-hdr distclean-recursive \ + distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ + info-recursive install install-am install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-generic mostlyclean-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +$(srcdir)/acinclude.m4 : $(ACINCLUDE_INPUTS) + cat $(ACINCLUDE_INPUTS) >$(srcdir)/acinclude.m4 + +# make cvs-clean blatantly stolen from KDE CVS ;) +cvs-clean: + @if test ! -d CVS; then \ + echo "You don't have a toplevel CVS directory."; \ + echo "You most certainly didn't use cvs to get these sources."; \ + echo "But this function depends on cvs's information."; \ + exit 1 ;\ + fi;\ + pwd=`pwd` ;\ + dirs=`find . -type d | grep -v CVS | sed -e "s#^./##"` ;\ + for i in $$dirs; do \ + if test ! -d "$$pwd/$$i/CVS"; then \ + echo "D $$i" ;\ + rm -rf "$$pwd/$$i"; \ + continue; \ + fi ;\ + cd $$pwd/$$i ;\ + for f in * .*; do \ + if test ! -d "$$f"; then \ + if grep "^/$$f/" CVS/Entries > /dev/null; then \ + a="b"; \ + else \ + echo "F $$i/$$f"; \ + rm -f "$$pwd/$$i/$$f"; \ + fi; \ + fi ; \ + done; \ + done +# 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: diff --git a/src/apps/bin/grep-2.5/NEWS b/src/apps/bin/grep-2.5/NEWS new file mode 100644 index 0000000000..d02b350371 --- /dev/null +++ b/src/apps/bin/grep-2.5/NEWS @@ -0,0 +1,235 @@ +Version 2.5 + - The new option --label allows to specify a different name for input + from stdin. See the man or info pages for details. + + - The internal lib/getopt* files are no longer used on systems providing + getopt functionality in their libc (e.g. glibc 2.2.x). + If you need the old getopt files, use --with-included-getopt. + + - The new option --only-matching (-o) will print only the part of matching + lines that matches the pattern. This is useful, for example, to extract + IP addresses from log files. + + - i18n bug fixed ([A-Z0-9] wouldn't match A in locales other than C on + systems using recent glibc builds + + - GNU grep can now be built with autoconf 2.52. + + - The new option --devices controls how grep handles device files. Its usage + is analogous to --directories. + + - The new option --line-buffered fflush on everyline. There is a noticeable + slow down when forcing line buffering. + + - Back references are now local to the regex. + grep -e '\(a\)\1' -e '\(b\)\1' + The last backref \1 in the second expression refer to \(b\) + + - The new option --include=PATTERN will only search matching files + when recursing in directories + + - The new option --exclude=PATTERN will skip matching files when + recursing in directories. + + - The new option --color will use the environment variable GREP_COLOR + (default is red) to highlight the matching string. + --color takes an optional argument specifying when to colorize a line: + --color=always, --color=tty, --color=never + + - The following changes are for POSIX.2 conformance: + + . The -q or --quiet or --silent option now causes grep to exit + with zero status when a input line is selected, even if an error + also occurs. + + . The -s or --no-messages option no longer affects the exit status. + + . Bracket regular expressions like [a-z] are now locale-dependent. + For example, many locales sort characters in dictionary order, + and in these locales the regular expression [a-d] is not + equivalent to [abcd]; it might be equivalent to [aBbCcDd], for + example. To obtain the traditional interpretation of bracket + expressions, you can use the C locale by setting the LC_ALL + environment variable to the value "C". + + - The -C or --context option now requires an argument, partly for + consistency, and partly because POSIX.2 recommends against + optional arguments. + + - The new -P or --perl-regexp option tells grep to interpert the pattern as + a Perl regular expression. + + - The new option --max-count=num makes grep stop reading a file after num + matching lines. + New option -m; equivalent to --max-count. + + - Translations for bg, ca, da, nb and tr have been added. + +Version 2.4.2 + + - Added more check in configure to default the grep-${version}/src/regex.c + instead of the one in GNU Lib C. + +Version 2.4.1 + + - If the final byte of an input file is not a newline, grep now silently + supplies one. + + - The new option --binary-files=TYPE makes grep assume that a binary input + file is of type TYPE. + --binary-files='binary' (the default) outputs a 1-line summary of matches. + --binary-files='without-match' assumes binary files do not match. + --binary-files='text' treats binary files as text + (equivalent to the -a or --text option). + + - New option -I; equivalent to --binary-files='without-match'. + +Version 2.4: + + - egrep is now equivalent to `grep -E' as required by POSIX, + removing a longstanding source of confusion and incompatibility. + `grep' is now more forgiving about stray `{'s, for backward + compatibility with traditional egrep. + + - The lower bound of an interval is not optional. + You must use an explicit zero, e.g. `x{0,10}' instead of `x{,10}'. + (The old documentation incorrectly claimed that it was optional.) + + - The --revert-match option has been renamed to --invert-match. + + - The --fixed-regexp option has been renamed to --fixed-string. + + - New option -H or --with-filename. + + - New option --mmap. By default, GNU grep now uses read instead of mmap. + This is faster on some hosts, and is safer on all. + + - The new option -z or --null-data causes `grep' to treat a zero byte + (the ASCII NUL character) as a line terminator in input data, and + to treat newlines as ordinary data. + + - The new option -Z or --null causes `grep' to output a zero byte + instead of the normal separator after a file name. + + - These two options can be used with commands like `find -print0', + `perl -0', `sort -z', and `xargs -0' to process arbitrary file names, + even those that contain newlines. + + - The environment variable GREP_OPTIONS specifies default options; + e.g. GREP_OPTIONS='--directories=skip' reestablishes grep 2.1's + behavior of silently skipping directories. + + - You can specify a matcher multiple times without error, e.g. + `grep -E -E' or `fgrep -F'. It is still an error to specify + conflicting matchers. + + - -u and -U are now allowed on non-DOS hosts, and have no effect. + + - Modifications of the tests scripts to go around the "Broken Pipe" + errors from bash. See Bash FAQ. + + - New option -r or --recursive or --directories=recurse. + (This option was also in grep 2.3, but wasn't announced here.) + + - --without-included-regex disable, was causing bogus reports .i.e + doing more harm then good. + +Version 2.3: + + - When searching a binary file FOO, grep now just reports + `Binary file FOO matches' instead of outputting binary data. + This is typically more useful than the old behavior, + and it is also more consistent with other utilities like `diff'. + A file is considered to be binary if it contains a NUL (i.e. zero) byte. + + The new -a or --text option causes `grep' to assume that all + input is text. (This option has the same meaning as with `diff'.) + Use it if you want binary data in your output. + + - `grep' now searches directories just like ordinary files; it no longer + silently skips directories. This is the traditional behavior of + Unix text utilities (in particular, of traditional `grep'). + Hence `grep PATTERN DIRECTORY' should report + `grep: DIRECTORY: Is a directory' on hosts where the operating system + does not permit programs to read directories directly, and + `grep: DIRECTORY: Binary file matches' (or nothing) otherwise. + + The new -d ACTION or --directories=ACTION option affects directory handling. + `-d skip' causes `grep' to silently skip directories, as in grep 2.1; + `-d read' (the default) causes `grep' to read directories if possible, + as in earlier versions of grep. + + - The MS-DOS and Microsoft Windows ports now behave identically to the + GNU and Unix ports with respect to binary files and directories. + +Version 2.2: + +Bug fix release. + + - Status error number fix. + - Skipping directories removed. + - Many typos fix. + - -f /dev/null fix(not to consider as an empty pattern). + - Checks for wctype/wchar. + - -E was using the wrong matcher fix. + - bug in regex char class fix + - Fixes for DJGPP + +Version 2.1: + +This is a bug fix release(see Changelog) i.e. no new features. + + - More compliance to GNU standard. + - Long options. + - Internationalisation. + - Use automake/autoconf. + - Directory hierarchy change. + - Sigvec with -e on Linux corrected. + - Sigvec with -f on Linux corrected. + - Sigvec with the mmap() corrected. + - Bug in kwset corrected. + - -q, -L and -l stop on first match. + - New and improve regex.[ch] from Ulrich Drepper. + - New and improve dfa.[ch] from Arnold Robbins. + - Prototypes for over zealous C compiler. + - Not scanning a file, if it's a directory + (cause problems on Sun). + - Ported to MS-DOS/MS-Windows with DJGPP tools. + +See Changelog for the full story and proper credits. + +Version 2.0: + +The most important user visible change is that egrep and fgrep have +disappeared as separate programs into the single grep program mandated +by POSIX 1003.2. New options -G, -E, and -F have been added, +selecting grep, egrep, and fgrep behavior respectively. For +compatibility with historical practice, hard links named egrep and +fgrep are also provided. See the manual page for details. + +In addition, the regular expression facilities described in Posix +draft 11.2 are now supported, except for internationalization features +related to locale-dependent collating sequence information. + +There is a new option, -L, which is like -l except it lists +files which don't contain matches. The reason this option was +added is because '-l -v' doesn't do what you expect. + +Performance has been improved; the amount of improvement is platform +dependent, but (for example) grep 2.0 typically runs at least 30% faster +than grep 1.6 on a DECstation using the MIPS compiler. Where possible, +grep now uses mmap() for file input; on a Sun 4 running SunOS 4.1 this +may cut system time by as much as half, for a total reduction in running +time by nearly 50%. On machines that don't use mmap(), the buffering +code has been rewritten to choose more favorable alignments and buffer +sizes for read(). + +Portability has been substantially cleaned up, and an automatic +configure script is now provided. + +The internals have changed in ways too numerous to mention. +People brave enough to reuse the DFA matcher in other programs +will now have their bravery amply "rewarded", for the interface +to that file has been completely changed. Some changes were +necessary to track the evolution of the regex package, and since +I was changing it anyway I decided to do a general cleanup. diff --git a/src/apps/bin/grep-2.5/README b/src/apps/bin/grep-2.5/README new file mode 100644 index 0000000000..66c1bb2ba7 --- /dev/null +++ b/src/apps/bin/grep-2.5/README @@ -0,0 +1,26 @@ +This is GNU grep, the "fastest grep in the west" (we hope). All +bugs reported in previous releases have been fixed. Many exciting new +bugs have probably been introduced in this revision. + +GNU grep is provided "as is" with no warranty. The exact terms +under which you may use and (re)distribute this program are detailed +in the GNU General Public License, in the file COPYING. + +GNU grep is based on a fast lazy-state deterministic matcher (about +twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper +search for a fixed string that eliminates impossible text from being +considered by the full regexp matcher without necessarily having to +look at every character. The result is typically many times faster +than Unix grep or egrep. (Regular expressions containing backreferencing +will run more slowly, however.) + +See the files AUTHORS and THANKS for a list of authors and other contributors. + +See the file INSTALL for compilation and installation instructions. + +See the file NEWS for a description of major changes in this release. + +See the file TODO for ideas on how you could help us improve grep. + +Send bug reports to bug-gnu-utils@gnu.org. Be sure to +include the word "grep" in your Subject: header field. diff --git a/src/apps/bin/grep-2.5/README-alpha b/src/apps/bin/grep-2.5/README-alpha new file mode 100644 index 0000000000..a7ddd055a6 --- /dev/null +++ b/src/apps/bin/grep-2.5/README-alpha @@ -0,0 +1,10 @@ +Newer ALPHA versions of this code are available through +anonymous CVS: + +$ cvs -d :pserver:anoncvs@subversions.gnu.org:/cvs checkout grep + +If you are using an old version of cvs, you might have to run +$ cvs -d :pserver:anoncvs@subversions.gnu.org:/cvs login +first (and just press enter at the password prompt). + +Please send comments and problem reports to . diff --git a/src/apps/bin/grep-2.5/README.DOS b/src/apps/bin/grep-2.5/README.DOS new file mode 100644 index 0000000000..3f005325a0 --- /dev/null +++ b/src/apps/bin/grep-2.5/README.DOS @@ -0,0 +1,76 @@ +GREP DJGPP README +================= + +To compile the Grep package with DJGPP tools, you will need the +following tools (the names of the archives on DJGPP ftp sites where +these tools are available are in parentheses): + + - The basic DJGPP development environment, including the + GCC compiler and the libraries (v2gnu/gccNNNb.zip, + v2gnu/bnuNNNb.zip, v2/djdevNNN.zip). + + - GNU Make revision 3.75 or later (v2gnu/makNNNb.zip). + + - GNU Bash (v2gnu/bshNNNb.zip). + + - GNU Sed (v2gnu/sedNNNb.zip). + + - GNU M4 (v2gnu/m4-NNNb.zip). + + - GNU Fileutils (v2gnu/filNNNb.zip), Textutils + (v2gnu/txtNNNb.zip) and Diffutils (v2gnu/difNNNb.zip). + + - A (previous version of) GNU Grep (v2gnu/grepNNb.zip). + +Running the tests ("make check" in the top-level directory) +additionally requires Gawk (v2gnu/gwkNNNb.zip). TAGS and ID targets +require `etags' (from the Emacs distribution) and `mkid' (from +ID-utils, v2gnu/iduNNb.zip), respectively. + +All of these tools are available from the DJGPP archive sites. + +To build Grep: + sh autogen.sh + sh configure + make + + +Source distributions on DJGPP sites usually come pre-configured, so +all you need to do in order to build the programs is to say "make". +However, source distributions on GNU ftp sites, like ftp.gnu.org, +need to be configured by running sh configure. You will also need +to run it if you need to configure Grep differently than for the +default configuration, for example if you want to install the programs +in a directory other than the bin subdirectory of your DJGPP +installation. + +To test that the package works, say "make check". If you don't have a +file named sh.exe somewhere on your PATH, "make check" will refuse to +run, as it needs a Unix-like shell. + +To install, either copy the executables and man pages to the +appropriate directories, or say "make install". To clean up, say +"make clean" or "make distclean". + +Please note the -u and -U options that specifically target MS-DOS and +MS-Windows environments. They are described in the Grep man page in +this distribution. + +National Language Support doesn't work in this port, so don't expect +the programs to talk to you in any language but English. + +Please post any problems in the DOS version to the comp.os.msdos.djgpp +news group first, especially if they have something to do with the +DOS-specific aspects. + +To create the files required for the documentation package +perform the following in the docs directory: + make grep.dvi + make grep.ps + makeinfo --html grep.texi -o grep.html + + +2.5f ported by Andrew Cottrell + +Enjoy, + Eli Zaretskii diff --git a/src/apps/bin/grep-2.5/THANKS b/src/apps/bin/grep-2.5/THANKS new file mode 100644 index 0000000000..93dd31c1b0 --- /dev/null +++ b/src/apps/bin/grep-2.5/THANKS @@ -0,0 +1,72 @@ +Aharon Robbins +Akim Demaille +Alain Magloire +Andreas Schwab +Andreas Ley +Bastiaan "Darquan" Stougie +Ben Elliston +Bernd Strieder +Bernhard Rosenkraenzer +Bob Proulx +Brian Youmans <3diff@gnu.org> +Bruno Haible +Christian Groessler +David Clissold +David J MacKenzie +David O'Brien +Eli Zaretskii +Florian La Roche +Franc,ois Pinard +Gerald Stoller +Grant McDorman +Greg Louis +Guglielmo 'bond' Bondioni +H. Merijn Brand +Harald Hanche-Olsen +Hans-Bernhard Broeker +Heikki Korpela +Isamu Hasegawa +Jeff Bailey +Jim Hand +Jim Meyering +Jochen Hein +Joel N. Weber II +John Hughes +Jorge Stolfi +Juan Manuel Guerrero +Karl Berry +Karl Heuer +Kaveh R. Ghazi +Kazuro Furukawa +Keith Bostic +Krishna Sethuraman +Kurt D Schwehr +Mark Waite +Martin P.J. Zinser +Martin Rex +Michael Aichlmayr +Miles Bader +Olaf Kirch +Paul Eggert +Paul Kimoto +Phillip C. Brisco +Philippe Defert +Philippe De Muyter +Philip Hazel +Roland Roberts +Ruslan Ermilov +Santiago Vila +Shannon Hill +Sotiris Vassilopoulos +Stewart Levin +Sydoruk Stepan +Tapani Tarvainen +Tom 'moof' Spindler +Tom Tromey +Ulrich Drepper +UEBAYASHI Masao +Uwe H. Steinfeld +Volker Borchert +Wichert Akkerman +William Bader +Wolfgang Schludi diff --git a/src/apps/bin/grep-2.5/TODO b/src/apps/bin/grep-2.5/TODO new file mode 100644 index 0000000000..7a622a771b --- /dev/null +++ b/src/apps/bin/grep-2.5/TODO @@ -0,0 +1,42 @@ +Write Texinfo documentation for grep. The manual page would be a good +place to start, but Info documents are also supposed to contain a +tutorial and examples. + +Fix the DFA matcher to never use exponential space. (Fortunately, these +cases are rare.) + +Improve the performance of the regex backtracking matcher. This matcher +is agonizingly slow, and is responsible for grep sometimes being slower +than Unix grep when backreferences are used. + +Provide support for the Posix [= =] and [. .] constructs. This is +difficult because it requires locale-dependent details of the character +set and collating sequence, but Posix does not standardize any method +for accessing this information! + +## + +Some test in tests/spencer2.tests should have failed !!! +Need to filter out some bugs in dfa.[ch]/regex.[ch]. + +Threads for grep ? + +Grep does 32 bits arithmetic, it needs to move to 64. + +Clean up, to many #ifdef's !! + +Check some new Algorithms for matching, talk to Karl Berry and Nelson. +Sunday's "Quick Search" Algorithm (CACM 33, 8 August 1990 pp. 132-142) +claim that his algo. is faster then Boyer-More ???? +Worth Checking. + +Take a look at cgrep (Context grep) seems like nice work. +Take a look at sgrep (Struct grep). +Take a look at agrep (Approximate grep), from glimpse. +Can we merge ? + +POSIX Compliance see p10003.x + +Moving away from GNU regex API for POSIX regex API. + +Better and faster !! diff --git a/src/apps/bin/grep-2.5/aclocal.m4 b/src/apps/bin/grep-2.5/aclocal.m4 new file mode 100644 index 0000000000..4e05847b87 --- /dev/null +++ b/src/apps/bin/grep-2.5/aclocal.m4 @@ -0,0 +1,1829 @@ +# aclocal.m4 generated automatically by aclocal 1.5 + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + +# Do all the work for Automake. 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. + +# serial 5 + +# 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... + + +# We require 2.13 because we rely on SHELL being computed by configure. +AC_PREREQ([2.13]) + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. +# The purpose of this macro is to provide the user with a means to +# check macros which are provided without letting her know how the +# information is coded. +# If this macro is not defined by Autoconf, define it here. +ifdef([AC_PROVIDE_IFELSE], + [], + [define([AC_PROVIDE_IFELSE], + [ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) +# ---------------------------------------------- +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first]) +fi + +# Define the identity of the package. +PACKAGE=$1 +AC_SUBST(PACKAGE)dnl +VERSION=$2 +AC_SUBST(VERSION)dnl +ifelse([$3],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +ifdef([m4_pattern_allow], + [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl + +# Autoconf 2.50 always computes EXEEXT. However we need to be +# compatible with 2.13, for now. So we always define EXEEXT, but we +# don't compute it. +AC_SUBST(EXEEXT) +# Similar for OBJEXT -- only we only use OBJEXT if the user actually +# requests that it be used. This is a bit dumb. +: ${OBJEXT=o} +AC_SUBST(OBJEXT) + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# 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_DEP_TRACK])dnl +AC_REQUIRE([AM_SET_DEPDIR])dnl +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 +]) + +# +# Check to make sure that the build environment is sane. +# + +# serial 3 + +# 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)]) + + +# serial 2 + +# 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= + am_backtick='`' + AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# 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], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` +]) + +# 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)]) + +# 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 +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + + + +# 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" 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 + + 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 + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type" +AC_SUBST([$1DEPMODE]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST(DEPDIR) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --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]) +pushdef([subst], defn([AC_SUBST])) +subst(AMDEPBACKSLASH) +popdef([subst]) +]) + +# Generate code to set up dependency tracking. +# This macro should only be invoked once -- use via AC_REQUIRE. +# Usage: +# AM_OUTPUT_DEPENDENCY_COMMANDS + +# +# 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_OUTPUT_COMMANDS([ +test x"$AMDEP_TRUE" != x"" || +for mf in $CONFIG_FILES; do + case "$mf" in + Makefile) dirpart=.;; + */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; + *) continue;; + esac + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # 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 -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //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=`echo "$file" | sed -e 's|/[^/]*$||'` + $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +], [AMDEP_TRUE="$AMDEP_TRUE" +ac_aux_dir="$ac_aux_dir"])]) + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +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 | fgrep -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 +]) + +# serial 3 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +# +# FIXME: Once using 2.50, use this: +# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], + [errprint(__file__:__line__: [$0: invalid condition: $1 +])dnl +m4exit(1)])dnl +ifelse([$1], [FALSE], + [errprint(__file__:__line__: [$0: invalid condition: $1 +])dnl +m4exit(1)])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +# serial 3 + +# 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. We must strip everything past the first ":", +# and everything past the last "/". + +AC_PREREQ([2.12]) + +AC_DEFUN([AM_CONFIG_HEADER], +[ifdef([AC_FOREACH],dnl + [dnl init our file count if it isn't already + m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0])) + dnl prepare to store our destination file list for use in config.status + AC_FOREACH([_AM_File], [$1], + [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*])) + m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index)) + dnl and add it to the list of files AC keeps track of, along + dnl with our hook + AC_CONFIG_HEADERS(_AM_File, +dnl COMMANDS, [, INIT-CMDS] +[# update the timestamp +echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" +][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS + m4_popdef([_AM_Dest])])],dnl +[AC_CONFIG_HEADER([$1]) + AC_OUTPUT_COMMANDS( + ifelse(patsubst([$1], [[^ ]], []), + [], + [test -z "$CONFIG_HEADERS" || echo timestamp >dnl + patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl +[am_indx=1 +for am_file in $1; do + case " \$CONFIG_HEADERS " in + *" \$am_file "*) + am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\` + if test -n "\$am_dir"; then + am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\` + for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do + am_tmpdir=\$am_tmpdir\$am_subdir/ + if test ! -d \$am_tmpdir; then + mkdir \$am_tmpdir + fi + done + fi + echo timestamp > "\$am_dir"stamp-h\$am_indx + ;; + esac + am_indx=\`expr \$am_indx + 1\` +done]) +])]) # AM_CONFIG_HEADER + +# _AM_DIRNAME(PATH) +# ----------------- +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(m4_regexp([$1], [^/.*]), -1, + [.], + m4_patsubst([$1], [^\(/\).*], [\1])), + m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +]) # _AM_DIRNAME + +#serial 6 + +dnl By default, many hosts won't let programs access large files; +dnl one must use special compiler options to get large-file access to work. +dnl For more details about this brain damage please see: +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html + +dnl Written by Paul Eggert . + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME) +AC_DEFUN([AC_SYS_LARGEFILE_FLAGS], + [AC_CACHE_CHECK([for $1 value to request large file support], + ac_cv_sys_largefile_$1, + [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2 + then + ac_cv_sys_largefile_$1=`cat conftest.1` + else + ac_cv_sys_largefile_$1=no + ifelse($1, CFLAGS, + [case "$host_os" in + # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1. +changequote(, )dnl + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) +changequote([, ])dnl + if test "$GCC" = yes; then + ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ + fi + ;; + # IRIX 6.2 and later require cc -n32. +changequote(, )dnl + irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) +changequote([, ])dnl + if test "$GCC" != yes; then + ac_cv_sys_largefile_CFLAGS=-n32 + fi + esac + if test "$ac_cv_sys_largefile_CFLAGS" != no; then + ac_save_CC="$CC" + CC="$CC $ac_cv_sys_largefile_CFLAGS" + AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) + CC="$ac_save_CC" + fi]) + fi + rm -f conftest*])]) + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL) +AC_DEFUN([AC_SYS_LARGEFILE_SPACE_APPEND], + [case $2 in + no) ;; + ?*) + case "[$]$1" in + '') $1=$2 ;; + *) $1=[$]$1' '$2 ;; + esac ;; + esac]) + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) +AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE], + [AC_CACHE_CHECK([for $1], $2, + [$2=no +changequote(, )dnl + $4 + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + -D$1) + $2=1 ;; + -D$1=*) + $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; + esac + done +changequote([, ])dnl + ]) + if test "[$]$2" != no; then + AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) + fi]) + +AC_DEFUN([AC_SYS_LARGEFILE], + [AC_REQUIRE([AC_CANONICAL_HOST]) + AC_ARG_ENABLE(largefile, + [ --disable-largefile omit support for large files]) + if test "$enable_largefile" != no; then + AC_CHECK_TOOL(GETCONF, getconf) + AC_SYS_LARGEFILE_FLAGS(CFLAGS) + AC_SYS_LARGEFILE_FLAGS(LDFLAGS) + AC_SYS_LARGEFILE_FLAGS(LIBS) + + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + no) ;; + -D_FILE_OFFSET_BITS=*) ;; + -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; + -D_LARGE_FILES | -D_LARGE_FILES=*) ;; + -D?* | -I?*) + AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; + *) + AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; + esac + done + AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") + AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") + AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + [case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_file_offset_bits=64 ;; + esac]) + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, + ac_cv_sys_largefile_source, + [Define to make fseeko etc. visible, on some hosts.], + [case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_largefile_source=1 ;; + esac]) + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + [case "$host_os" in + # AIX 4.2 and later + aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) + ac_cv_sys_large_files=1 ;; + esac]) + fi + ]) + + +# serial 1 + +AC_DEFUN([AM_C_PROTOTYPES], +[AC_REQUIRE([AM_PROG_CC_STDC]) +AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([for function prototypes]) +if test "$am_cv_prog_cc_stdc" != no; then + AC_MSG_RESULT(yes) + AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes]) + U= ANSI2KNR= +else + AC_MSG_RESULT(no) + U=_ ANSI2KNR=./ansi2knr +fi +# Ensure some checks needed by ansi2knr itself. +AC_HEADER_STDC +AC_CHECK_HEADERS(string.h) +AC_SUBST(U)dnl +AC_SUBST(ANSI2KNR)dnl +]) + + +# serial 1 + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +AC_DEFUN([AM_PROG_CC_STDC], +[AC_REQUIRE([AC_PROG_CC]) +AC_BEFORE([$0], [AC_C_INLINE]) +AC_BEFORE([$0], [AC_C_CONST]) +dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require +dnl a magic option to avoid problems with ANSI preprocessor commands +dnl like #elif. +dnl FIXME: can't do this because then AC_AIX won't work due to a +dnl circular dependency. +dnl AC_BEFORE([$0], [AC_PROG_CPP]) +AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C]) +AC_CACHE_VAL(am_cv_prog_cc_stdc, +[am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( +[#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], +[am_cv_prog_cc_stdc="$ac_arg"; break]) +done +CC="$ac_save_CC" +]) +if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) +else + AC_MSG_RESULT([$am_cv_prog_cc_stdc]) +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac +]) + +#serial 5 + +dnl From Paul Eggert. + +AC_PREREQ(2.13) + +# Define uintmax_t to `unsigned long' or `unsigned long long' +# if does not exist. + +AC_DEFUN(jm_AC_TYPE_UINTMAX_T, +[ + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + if test $jm_ac_cv_header_inttypes_h = no; then + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, +[ Define to unsigned long or unsigned long long + if doesn't define.]) + fi +]) + +#serial 3 + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN(jm_AC_HEADER_INTTYPES_H, +[ + AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1;], + jm_ac_cv_header_inttypes_h=yes, + jm_ac_cv_header_inttypes_h=no)]) + if test $jm_ac_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, +[Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) + +#serial 2 + +dnl From Paul Eggert. + +AC_DEFUN(jm_AC_TYPE_UNSIGNED_LONG_LONG, +[ + AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, + [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], + [unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull;], + ac_cv_type_unsigned_long_long=yes, + ac_cv_type_unsigned_long_long=no)]) + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, + [Define if you have the unsigned long long type.]) + fi +]) + +# serial 8 + +# From Paul Eggert. + +# BeOS 5 has but does not define mbstate_t, +# so you can't declare an object of that type. +# Check for this incompatibility with Standard C. + +# Include stdlib.h first, because otherwise this test would fail on Linux +# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits +# a syntax error in wchar.h due to the use of undefined __int32_t. + +AC_DEFUN(AC_MBSTATE_T, + [ + AC_CHECK_HEADERS(stdlib.h) + + AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, + [AC_TRY_COMPILE([ +#if HAVE_STDLIB_H +# include +#endif +#include ], + [mbstate_t x; return sizeof x;], + ac_cv_type_mbstate_t=yes, + ac_cv_type_mbstate_t=no)]) + if test $ac_cv_type_mbstate_t = no; then + AC_DEFINE(mbstate_t, int, + [Define to a type if does not define.]) + fi]) + +#serial 2 + +# autoconf tests required for use of xstrtoumax.c + +AC_DEFUN(jm_AC_PREREQ_XSTRTOUMAX, +[ + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + AC_CHECK_HEADERS(stdlib.h) + + AC_CACHE_CHECK([whether defines strtoumax as a macro], + jm_cv_func_strtoumax_macro, + AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include +#ifdef strtoumax + inttypes_h_defines_strtoumax +#endif], + jm_cv_func_strtoumax_macro=yes, + jm_cv_func_strtoumax_macro=no)) + + if test "$jm_cv_func_strtoumax_macro" != yes; then + AC_REPLACE_FUNCS(strtoumax) + fi + + dnl We don't need (and can't compile) the replacement strtoull + dnl unless the type `unsigned long long' exists. + dnl Also, only the replacement strtoumax invokes strtoull, + dnl so we need the replacement strtoull only if strtoumax does not exist. + case "$ac_cv_type_unsigned_long_long,$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in + yes,no,no) + AC_REPLACE_FUNCS(strtoull) + ;; + esac + +]) + +#serial 5 + +AC_DEFUN(jm_CHECK_DECLARATION, +[ + AC_MSG_CHECKING([whether $1 is declared]) + AC_CACHE_VAL(jm_cv_func_decl_$1, + [AC_TRY_COMPILE([$2], + [ +#ifndef $1 +char *(*pfn) = (char *(*)) $1 +#endif + ], + eval "jm_cv_func_decl_$1=yes", + eval "jm_cv_func_decl_$1=no")]) + + if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$3], , :, [$3]) + else + AC_MSG_RESULT(no) + ifelse([$4], , , [$4 +])dnl + fi +])dnl + +dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED +dnl [, ACTION-IF-NOT-DECLARED]]) +AC_DEFUN(jm_CHECK_DECLARATIONS, +[ + for jm_func in $2 + do + jm_CHECK_DECLARATION($jm_func, [$1], + [ + jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + AC_DEFINE_UNQUOTED($jm_tr_func, 1, [Define if your system declares $1]) $3], [$4])dnl + done +]) + +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 10 + +dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]). +dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). Otherwise, a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. +dnl LIBDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_WITH_NLS], + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + INTLLIBS= + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + CATOBJEXT=NONE + + dnl Add a version number to the cache macros. + define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc]) + define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl]) + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_TRY_LINK([#include +extern int _nl_msg_cat_cntr;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], + gt_cv_func_gnugettext_libc=yes, + gt_cv_func_gnugettext_libc=no)]) + + if test "$gt_cv_func_gnugettext_libc" != "yes"; then + AC_CACHE_CHECK([for GNU gettext in libintl], + gt_cv_func_gnugettext_libintl, + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $LIBICONV" + AC_TRY_LINK([#include +extern int _nl_msg_cat_cntr;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], + gt_cv_func_gnugettext_libintl=yes, + gt_cv_func_gnugettext_libintl=no) + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if test "$gt_cv_func_gnugettext_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + dnl If iconv() is in a separate libiconv library, then anyone + dnl linking with libintl{.a,.so} also needs to link with + dnl libiconv. + INTLLIBS="-lintl $LIBICONV" + fi + + gt_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + LIBS="$gt_save_LIBS" + + dnl Search for GNU msgfmt in the PATH. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext in the PATH. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + + CATOBJEXT=.gmo + fi + ]) + + if test "$CATOBJEXT" = "NONE"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + AC_SUBST(MSGFMT) + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU msgfmt. + if test "$GMSGFMT" != ":"; then + dnl If it is no GNU msgfmt we define it as : so that the + dnl Makefiles still can work. + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then + : ; + else + AC_MSG_RESULT( + [found msgfmt program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + AC_OUTPUT_COMMANDS( + [for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done]) + + + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl intl/plural.c is generated from intl/plural.y. It requires bison, + dnl because plural.y uses bison specific features. It requires at least + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) +changequote(<<,>>)dnl + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) +changequote([,])dnl + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(GMOFILES) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + ]) + +dnl Usage: Just like AM_WITH_NLS, which see. +AC_DEFUN([AM_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([jm_GLIBC21])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h]) + AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \ +getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ +strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) + + AM_ICONV + AM_LANGINFO_CODESET + AM_LC_MESSAGES + AM_WITH_NLS([$1],[$2],[$3]) + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but $(top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], []) + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + +# Search path for a program which passes the given test. +# Ulrich Drepper , 1996. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 2 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + +#serial 2 + +# Test for the GNU C Library, version 2.1 or newer. +# From Bruno Haible. + +AC_DEFUN([jm_GLIBC21], + [ + AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, + ac_cv_gnu_library_2_1, + [AC_EGREP_CPP([Lucky GNU user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + ], + ac_cv_gnu_library_2_1=yes, + ac_cv_gnu_library_2_1=no) + ] + ) + AC_SUBST(GLIBC21) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) + +#serial AM2 + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + AC_ARG_WITH([libiconv-prefix], +[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + ]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi + LIBICONV= + if test "$am_cv_lib_iconv" = yes; then + LIBICONV="-liconv" + fi + AC_SUBST(LIBICONV) +]) + +#serial AM1 + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi +]) + +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 2 + +AC_DEFUN([AM_LC_MESSAGES], + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# Check to see if we use dir\file name conventtion +# If so, set macro HAVE_DOS_FILE_NAMES +# Also set the macro HAVE_DOS_FILE_CONTENTS for now, +# since don't know of a good way to independently check this. +dnl AC_DOSFILE() +AC_DEFUN(AC_DOSFILE, +[ + AC_CACHE_CHECK([for dos file convention], ac_cv_dosfile, + [if test -d ".\."; then + ac_cv_dosfile=yes + else + ac_cv_dosfile=no + fi + ]) + + if test $ac_cv_dosfile = yes; then + AC_DEFINE(HAVE_DOS_FILE_NAMES, 1, [Define if your OS uses backslashes as directory separators]) + AC_DEFINE(HAVE_DOS_FILE_CONTENTS, 1, + [Define if text file lines end in CRLF.]) + fi +]) + +# Check to see the separator for the environment variables +# and set SEP to ";" or default ":" + +dnl AM_SEP() +dnl SEP +AC_DEFUN(AM_SEP, +[AC_REQUIRE([AC_CYGWIN]) +AC_REQUIRE([AC_MINGW32]) +AC_REQUIRE([AC_DJGPP]) +AC_MSG_CHECKING([for environ variable separator]) +AC_CACHE_VAL(ac_cv_sep, +[if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$DJ_GPP" = yes ; then + ac_cv_sep=yes +else + ac_cv_sep=no +fi]) +SEP=":" +test x"$ac_cv_sep" = xyes && SEP=";" +AC_MSG_RESULT(${SEP}) +AC_SUBST(SEP)]) + +dnl Check for DJGPP. we use DJ_GPP as the variable +dnl EXEEXXT +AC_DEFUN(AC_DJGPP, +[AC_CACHE_CHECK(for DJGPP environment, ac_cv_djgpp, +[AC_TRY_COMPILE(,[ return __DJGPP__;], +ac_cv_djgpp=yes, ac_cv_djgpp=no) +rm -f conftest*]) +DJ_GPP= +test "$ac_cv_djgpp" = yes && DJ_GPP=yes]) + +#serial 5001 + +dnl Initially derived from code in GNU grep. +dnl Mostly written by Jim Meyering. + +dnl Usage: jm_INCLUDED_REGEX([lib/regex.c]) +dnl +AC_DEFUN(jm_INCLUDED_REGEX, + [ + dnl Even packages that don't use regex.c can use this macro. + dnl Of course, for them it doesn't do anything. + + # Assume we'll default to using the included regex.c. + ac_use_included_regex=yes + + # However, if the system regex support is good enough that it passes the + # the following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. The first failing regular expression is from `Spencer ere + # test #75' in grep-2.3. + AC_CACHE_CHECK([for working re_compile_pattern], + jm_cv_func_working_re_compile_pattern, + AC_TRY_RUN( + changequote(<<, >>)dnl + << +#include +#include + int + main () + { + static struct re_pattern_buffer regex; + const char *s; + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + /* Add this third left square bracket, [, to balance the + three right ones below. Otherwise autoconf-2.14 chokes. */ + s = re_compile_pattern ("a[[:]:]]b\n", 9, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + exit (1); + + /* This should succeed, but doesn't for e.g. glibc-2.1.3. */ + s = re_compile_pattern ("{1", 2, ®ex); + + exit (s ? 1 : 0); + } + >>, + changequote([, ])dnl + + jm_cv_func_working_re_compile_pattern=yes, + jm_cv_func_working_re_compile_pattern=no, + dnl When crosscompiling, assume it's broken. + jm_cv_func_working_re_compile_pattern=no)) + if test $jm_cv_func_working_re_compile_pattern = yes; then + ac_use_included_regex=no + fi + + test -n "$1" || AC_MSG_ERROR([missing argument]) + syscmd([test -f $1]) + ifelse(sysval, 0, + [ + + AC_ARG_WITH(included-regex, + [ --without-included-regex don't compile regex; this is the default on + systems with version 2 of the GNU C library + (use with caution on other system)], + jm_with_regex=$withval, + jm_with_regex=$ac_use_included_regex) + if test "$jm_with_regex" = yes; then + AC_LIBOBJ(regex) + fi + ], + ) + ] +) + +#serial 1002, but ported to autoconf 2.13 by eggert +# Experimental replacement for the function in the latest CVS autoconf. +# If the compile-test says strerror_r doesn't work, then resort to a +# `run'-test that works on BeOS and segfaults on DEC Unix. +# Use with the error.c file in ../lib. + +undefine([AC_FUNC_STRERROR_R]) + +# AC_FUNC_STRERROR_R +# ------------------ +AC_DEFUN([AC_FUNC_STRERROR_R], +[jm_CHECK_DECLARATION(strerror_r, [#include ]) +test $jm_cv_func_decl_strerror_r != yes +AC_DEFINE_UNQUOTED(HAVE_DECL_STRERROR_R, $?, + [Define to 1 if strerror_r is declared.]) +AC_CHECK_FUNCS([strerror_r]) +if test $ac_cv_func_strerror_r = yes; then + AC_CHECK_HEADERS(string.h) + AC_CACHE_CHECK([for working strerror_r], + ac_cv_func_strerror_r_works, + [ + AC_TRY_COMPILE( + [ +# include +# if HAVE_STRING_H +# include +# endif + ], + [ + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + ], + ac_cv_func_strerror_r_works=yes, + ac_cv_func_strerror_r_works=no + ) + if test $ac_cv_func_strerror_r_works = no; then + # strerror_r seems not to work, but now we have to choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns int. + # This test should segfault on the DEC system. + AC_TRY_RUN( + [ +# include +# include +# include + + extern char *strerror_r (); + + int + main () + { + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + exit (!isalpha (x)); + } + ], + ac_cv_func_strerror_r_works=yes, + ac_cv_func_strerror_r_works=no, + ac_cv_func_strerror_r_works=no) + fi + ]) + if test $ac_cv_func_strerror_r_works = yes; then + AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1, + [Define to 1 if strerror_r returns a string.]) + fi +fi +])# AC_FUNC_STRERROR_R + +#serial 1 + +dnl FIXME: put these prerequisite-only *.m4 files in a separate +dnl directory -- otherwise, they'll conflict with existing files. + +dnl These are the prerequisite macros for GNU's error.c file. +AC_DEFUN(jm_PREREQ_ERROR, +[ + AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt) + AC_HEADER_STDC +]) + +#serial 3 + +dnl From Jim Meyering. +dnl Determine whether malloc accepts 0 as its argument. +dnl If it doesn't, arrange to use the replacement function. +dnl + +AC_DEFUN(jm_FUNC_MALLOC, +[ + dnl xmalloc.c requires that this symbol be defined so it doesn't + dnl mistakenly use a broken malloc -- as it might if this test were omitted. + AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1, + [Define if the malloc check has been performed. ]) + + AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc, + [AC_TRY_RUN([ + char *malloc (); + int + main () + { + exit (malloc (0) ? 0 : 1); + } + ], + jm_cv_func_working_malloc=yes, + jm_cv_func_working_malloc=no, + dnl When crosscompiling, assume malloc is broken. + jm_cv_func_working_malloc=no) + ]) + if test $jm_cv_func_working_malloc = no; then + AC_LIBOBJ(malloc) + AC_DEFINE_UNQUOTED(malloc, rpl_malloc, + [Define to rpl_malloc if the replacement function should be used.]) + fi +]) + +#serial 3 + +dnl From Jim Meyering. +dnl Determine whether realloc works when both arguments are 0. +dnl If it doesn't, arrange to use the replacement function. +dnl + +AC_DEFUN(jm_FUNC_REALLOC, +[ + dnl xmalloc.c requires that this symbol be defined so it doesn't + dnl mistakenly use a broken realloc -- as it might if this test were omitted. + AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1, + [Define if the realloc check has been performed. ]) + + AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc, + [AC_TRY_RUN([ + char *realloc (); + int + main () + { + exit (realloc (0, 0) ? 0 : 1); + } + ], + jm_cv_func_working_realloc=yes, + jm_cv_func_working_realloc=no, + dnl When crosscompiling, assume realloc is broken. + jm_cv_func_working_realloc=no) + ]) + if test $jm_cv_func_working_realloc = no; then + AC_LIBOBJ(realloc) + AC_DEFINE_UNQUOTED(realloc, rpl_realloc, + [Define to rpl_realloc if the replacement function should be used.]) + fi +]) + diff --git a/src/apps/bin/grep-2.5/autogen.sh b/src/apps/bin/grep-2.5/autogen.sh new file mode 100755 index 0000000000..389d3a080e --- /dev/null +++ b/src/apps/bin/grep-2.5/autogen.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# We want to support both legacy and current autoconf - this is a bit ugly... +AC_VERSION=`autoconf --version 2>&1 |head -n1 |sed -e "s/.* //;s/\.//;s/[a-z]//"` +if test -z "$AC_VERSION"; then + echo "Warning: Couldn't determine autoconf version. Assuming a current version." + AC_VERSION=252 +fi +if test "$AC_VERSION" -lt 250; then + rm -f acinclude.m4 + echo "#undef ssize_t" >acconfig.h + for i in m4/*.m4; do + if cat $i |grep -q "jm_"; then + cat $i >>acinclude.m4 + elif test ! -e `aclocal --print-ac-dir`/`basename $i`; then + cat $i >>acinclude.m4 + fi + done + aclocal +else + aclocal -I m4 +fi +autoheader +automake -a +if test "$AC_VERSION" -lt 250; then + # Workaround for a bug in ancient versions of autoheader + sed -e 's,#undef $,/* your autoheader is buggy */,g' config.hin >config.hin.new + rm config.hin + mv config.hin.new config.hin + # Make sure config.hin doesn't get rebuilt after the workaround + sed -e 's,@AUTOHEADER@,true,' Makefile.in >Makefile.in.new + rm Makefile.in + mv Makefile.in.new Makefile.in +fi +autoconf diff --git a/src/apps/bin/grep-2.5/bootstrap/Makefile b/src/apps/bin/grep-2.5/bootstrap/Makefile new file mode 100644 index 0000000000..0dc27b7081 --- /dev/null +++ b/src/apps/bin/grep-2.5/bootstrap/Makefile @@ -0,0 +1,221 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/grep +pkglibdir = $(libdir)/grep +pkgincludedir = $(includedir)/grep +top_builddir = .. + +ACLOCAL = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal +AUTOCONF = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf +AUTOMAKE = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake +AUTOHEADER = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader + +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i586-pc-beos +AMTAR = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar +AWK = gawk +BUILD_INCLUDED_LIBINTL = yes +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +CC = gcc +CPP = gcc -E +DATADIRNAME = share +DEPDIR = .deps +EXEEXT = +GENCAT = gencat +GETCONF = +GLIBC21 = no +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +GMSGFMT = : +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INSTOBJEXT = .mo +INTLBISON = bison +INTLLIBS = $(top_builddir)/intl/libintl.a +INTLOBJS = $(GETTOBJS) +INTL_LIBTOOL_SUFFIX_PREFIX = +LIBICONV = +MKINSTALLDIRS = ./mkinstalldirs +MSGFMT = : +OBJEXT = o +PACKAGE = grep +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +POSUB = po +RANLIB = ranlib +SEP = : +SYMLINK = ln -s +SYMLINKFROM = grep +U = +USE_INCLUDED_LIBINTL = yes +USE_NLS = yes +VERSION = 2.5 +am__include = include +am__quote = +install_sh = /boot/home/Development/current/src/apps/bin/grep-2.5/install-sh + +AUTOMAKE_OPTIONS = no-dependencies + +EXTRA_DIST = Makefile.try README +subdir = bootstrap +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +DIST_SOURCES = +DIST_COMMON = README Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu bootstrap/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/bootstrap/Makefile.am b/src/apps/bin/grep-2.5/bootstrap/Makefile.am new file mode 100644 index 0000000000..a54af3ba5d --- /dev/null +++ b/src/apps/bin/grep-2.5/bootstrap/Makefile.am @@ -0,0 +1,4 @@ +## Process this file with automake to create Makefile.in +AUTOMAKE_OPTIONS = no-dependencies + +EXTRA_DIST = Makefile.try README diff --git a/src/apps/bin/grep-2.5/bootstrap/Makefile.in b/src/apps/bin/grep-2.5/bootstrap/Makefile.in new file mode 100644 index 0000000000..0a8b07e241 --- /dev/null +++ b/src/apps/bin/grep-2.5/bootstrap/Makefile.in @@ -0,0 +1,221 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GETCONF = @GETCONF@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SEP = @SEP@ +SYMLINK = @SYMLINK@ +SYMLINKFROM = @SYMLINKFROM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AUTOMAKE_OPTIONS = no-dependencies + +EXTRA_DIST = Makefile.try README +subdir = bootstrap +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +DIST_SOURCES = +DIST_COMMON = README Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu bootstrap/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/bootstrap/Makefile.try b/src/apps/bin/grep-2.5/bootstrap/Makefile.try new file mode 100644 index 0000000000..f1d1acabd8 --- /dev/null +++ b/src/apps/bin/grep-2.5/bootstrap/Makefile.try @@ -0,0 +1,135 @@ +# + +# Define for DOS/WIN (not including DJGPP): +#OBJEXT = obj +#EXEEXT = .exe +EXEEXT = +OBJEXT = o + +# Source of grep. +OBJS = \ + dfa.$(OBJEXT) \ + grep.$(OBJEXT) \ + kwset.$(OBJEXT) \ + search.$(OBJEXT) + +# Supporting routines. +LIB_OBJS_core = \ + $(libdir)/closeout.$(OBJEXT) \ + $(libdir)/error.$(OBJEXT) \ + $(libdir)/exclude.$(OBJEXT) \ + $(libdir)/hard-locale.$(OBJEXT) \ + $(libdir)/isdir.$(OBJEXT) \ + $(libdir)/quotearg.$(OBJEXT) \ + $(libdir)/regex.$(OBJEXT) \ + $(libdir)/savedir.$(OBJEXT) \ + $(libdir)/strtoumax.$(OBJEXT) \ + $(libdir)/xmalloc.$(OBJEXT) \ + $(libdir)/xstrtol.$(OBJEXT) \ + $(libdir)/xstrtoumax.$(OBJEXT) + +# Comment out functions already supported as needed. +#LIB_OBJ_atexit = $(libdir)/atexit.$(OBJEXT) +#LIB_OBJ_alloca = $(libdir)/alloca.$(OBJEXT) +#LIB_OBJ_fnmatch = $(libdir)/fnmatch.$(OBJEXT) +LIB_OBJ_getopt = $(libdir)/getopt.$(OBJEXT) $(libdir)/getopt1.$(OBJEXT) +#LIB_OBJ_memchr = $(libdir)/memchr.$(OBJEXT) +LIB_OBJ_obstack = $(libdir)/obstack.$(OBJEXT) +#LIB_OBJ_strtoul = $(libdir)/strtoul.$(OBJEXT) +LIB_OBJ_stpcpy = $(libdir)/stpcpy.$(OBJEXT) +LIB_OBJ_strtoull = $(libdir)/strtoull.$(OBJEXT) + +LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_atexit) $(LIB_OBJ_alloca) \ + $(LIB_OBJ_fnmatch) $(LIB_OBJ_getopt) $(LIB_OBJ_memchr) \ + $(LIB_OBJ_obstack) $(LIB_OBJ_strtoul) $(LIB_OBJ_stpcpy) \ + $(LIB_OBJ_strtoull) + +# For Linux +#LIB_OBJS = $(LIB_OBJS_core) + +# For QNX/Neutrino +#LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_getopt) $(LIB_OBJ_obstack) \ +# $(LIB_OBJ_stpcpy) $(LIB_OBJ_strtoull) + +# Where is DIR and opendir/readdir defined. +# or -DHAVE_DIRENT_H +# or -DHAVE_SYS_NDIR_H +# or -DHAVE_SYS_DIR_H +# or -DHAVE_NDIR_H +# +# undef HAVE_STRERROR if lacking strerror() +# undef HAVE_MEMCHR if lacking memchr() +# + +# default dry run +DEFS_core = \ + -DSTDC_HEADERS \ + -DHAVE_MEMCHR \ + -DHAVE_DIRENT_H \ + -DHAVE_STRERROR \ + -Dconst= \ + -Dsize_t=unsigned \ + -Duintmax_t=long + +# SunOS-4.1.x k&r cc +#DEFS_sunos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -Dconst= + +# Solaris +#DEFS_solaris = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -DHAVE_STRERROR + +# DOS/WIN (change also OBJEXT/EXEEXT, see above) +# DOS/DJGPP +DEFS_dos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_STRERROR -DHAVE_DIRENT_H \ + -DHAVE_DOS_FILE_CONTENTS \ + -DHAVE_DOS_FILE_NAMES -DHAVE_UNISTD_H -DHAVE_SETMODE + +# If support ANSI C prototypes +DEFS_ansi_c = -DPROTOTYPES + +# No wchar support +# DEFS_wchar = -DUSE_WIDE_CHAR -DHAVE_WCHAR_H +DEFS_wchar = -Dwchar_t=int -Dmbstate_t=int + +# Is strtol() and strtoul() declarared ? +#DEFS_strtol = -DHAVE_DECL_STRTOULL=0 -DHAVE_DECL_STRTOUL=0 +DEFS_strtol = -DHAVE_DECL_STRTOULL=1 -DHAVE_DECL_STRTOUL=1 + +# Define if malloc(0)/realloc(0) works +#DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=0 \ +# -DHAVE_DONE_WORKING_REALLOC_CHECK=0 +DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=1 \ + -DHAVE_DONE_WORKING_REALLOC_CHECK=1 + +DEFS = $(DEFS_core) $(DEFS_ansi_c) $(DEFS_wchar) $(DEFS_strtol) $(DEFS_alloc) \ + -DHAVE_DECL_STRERROR_R=0 -DHAVE_VPRINTF -DCHAR_BIT=8 + + +#### + +CFLAGS = $(DEFS) -I. -I.. -I$(libdir) -DVERSION=\"bootstrap\" -DPACKAGE=\"grep\" + +libdir = ../lib + +PROGS = grep$(EXEEXT) egrep$(EXEEXT) fgrep$(EXEEXT) + +libgreputils_a = $(libdir)/libgreputils.a + +all : $(libgreputils_a) $(PROGS) + +grep$(EXEEXT) : $(OBJS) grepmat.$(OBJEXT) $(libgreputils_a) + $(CC) $(OBJS) grepmat.$(OBJEXT) -o grep $(libgreputils_a) + +egrep$(EXEEXT) : $(OBJS) egrepmat.$(OBJEXT) $(libgreputils_a) + $(CC) $(OBJS) egrepmat.$(OBJEXT) -o egrep $(libgreputils_a) + +fgrep$(EXEEXT) : $(OBJS) fgrepmat.$(OBJEXT) $(libgreputils_a) + $(CC) $(OBJS) fgrepmat.$(OBJEXT) -o fgrep $(libgreputils_a) + +$(libgreputils_a) : $(LIB_OBJS) + $(AR) $(ARFLAGS) $(libgreputils_a) $(LIB_OBJS) + +clean : + $(RM) grepmat.$(OBJEXT) egrepmat.$(OBJEXT) fgrepmat.$(OBJEXT) + $(RM) $(OBJS) + $(RM) $(PROGS) + $(RM) $(libgreputils_a) $(LIB_OBJS) diff --git a/src/apps/bin/grep-2.5/bootstrap/README b/src/apps/bin/grep-2.5/bootstrap/README new file mode 100644 index 0000000000..cd7f402c43 --- /dev/null +++ b/src/apps/bin/grep-2.5/bootstrap/README @@ -0,0 +1,8 @@ +# + +If your system is lacking the necessary tools to build the configuration, +Makefile.try is provided for bootstraping. Move Makefile.try to +../src/Makefile, edit the Makefile and type make. Good luck ! + +cp Makefile.try ../src/Makefile +make diff --git a/src/apps/bin/grep-2.5/config.guess b/src/apps/bin/grep-2.5/config.guess new file mode 100755 index 0000000000..cd430f6d1f --- /dev/null +++ b/src/apps/bin/grep-2.5/config.guess @@ -0,0 +1,1314 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-08-21' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# Please send patches to . +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + sparc*:NetBSD:*) + echo `uname -p`-unknown-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + eval $set_cc_for_build + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-pc-linux-gnu\n", argv[1]); +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-pc-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +eval $set_cc_for_build +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/src/apps/bin/grep-2.5/config.h b/src/apps/bin/grep-2.5/config.h new file mode 100644 index 0000000000..64fb5420aa --- /dev/null +++ b/src/apps/bin/grep-2.5/config.h @@ -0,0 +1,341 @@ +/* config.h. Generated by configure. */ +/* config.hin. Generated from configure.in by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +//#define ENABLE_NLS 1 + +/* We are building grep */ +#define GREP 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARGZ_H */ + +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Define to 1 if you have the `btowc' function. */ +#define HAVE_BTOWC 1 + +/* Define to 1 if you have the `dcgettext' function. */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if strerror_r is declared. */ +#define HAVE_DECL_STRERROR_R 1 + +/* Define if declares strtoul. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define if declares strtoull. */ +#define HAVE_DECL_STRTOULL 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define if the malloc check has been performed. */ +#define HAVE_DONE_WORKING_MALLOC_CHECK 1 + +/* Define if the realloc check has been performed. */ +#define HAVE_DONE_WORKING_REALLOC_CHECK 1 + +/* Define to 1 if you have the `doprnt' function. */ +/* #undef HAVE_DOPRNT */ + +/* Define if text file lines end in CRLF. */ +/* #undef HAVE_DOS_FILE_CONTENTS */ + +/* Define if your OS uses backslashes as directory separators */ +/* #undef HAVE_DOS_FILE_NAMES */ + +/* Define to 1 if you have the `feof_unlocked' function. */ +#define HAVE_FEOF_UNLOCKED 1 + +/* Define to 1 if you have the `fgets_unlocked' function. */ +#define HAVE_FGETS_UNLOCKED 1 + +/* Define to 1 if you have the `fnmatch' function. */ +#define HAVE_FNMATCH 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getegid' function. */ +#define HAVE_GETEGID 1 + +/* Define to 1 if you have the `geteuid' function. */ +#define HAVE_GETEUID 1 + +/* Define to 1 if you have the `getgid' function. */ +#define HAVE_GETGID 1 + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define if you have and nl_langinfo(CODESET). */ +/* #undef HAVE_LANGINFO_CODESET */ + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBINTL_H */ + +/* Define to 1 if you have the `pcre' library (-lpcre). */ +/* #undef HAVE_LIBPCRE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `mbrtowc' function. */ +#define HAVE_MBRTOWC 1 + +/* Define to 1 if you have the `memchr' function. */ +#define HAVE_MEMCHR 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mempcpy' function. */ +/* #undef HAVE_MEMPCPY */ + +/* Define to 1 if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the `munmap' function. */ +/* #undef HAVE_MUNMAP */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NL_TYPES_H */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `setenv' function. */ +/* #undef HAVE_SETENV */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setmode' function. */ +/* #undef HAVE_SETMODE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the 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 `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the `strtoull' function. */ +/* #undef HAVE_STRTOULL */ + +/* Define to 1 if you have the `strtoumax' function. */ +#define HAVE_STRTOUMAX 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tsearch' function. */ +/* #undef HAVE_TSEARCH */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the unsigned long long type. */ +#define HAVE_UNSIGNED_LONG_LONG 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wctype' function. */ +#define HAVE_WCTYPE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WCTYPE_H */ + +/* Define to 1 if strerror_r returns a string. */ +#define HAVE_WORKING_STRERROR_R 1 + +/* Define to 1 if you have the `__argz_count' function. */ +/* #undef HAVE___ARGZ_COUNT */ + +/* Define to 1 if you have the `__argz_next' function. */ +/* #undef HAVE___ARGZ_NEXT */ + +/* Define to 1 if you have the `__argz_stringify' function. */ +/* #undef HAVE___ARGZ_STRINGIFY */ + +/* Define as const if the declaration of iconv() needs const. */ +/* #undef ICONV_CONST */ + +/* Name of package */ +#define PACKAGE "grep" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define if compiler has function prototypes */ +#define PROTOTYPES 1 + +/* 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 the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.5" + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to make fseeko etc. visible, on some hosts. */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define if your compiler is broken */ +/* #undef alloca */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +/* #undef inline */ + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to a type if does not define. */ +#define mbstate_t int + +/* Define to `long' if does not define. */ +/* #undef off_t */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +/* Define to unsigned long or unsigned long long if doesn't + define. */ +/* #undef uintmax_t */ diff --git a/src/apps/bin/grep-2.5/config.hin b/src/apps/bin/grep-2.5/config.hin new file mode 100644 index 0000000000..9526803b1c --- /dev/null +++ b/src/apps/bin/grep-2.5/config.hin @@ -0,0 +1,340 @@ +/* config.hin. Generated from configure.in by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* We are building grep */ +#undef GREP + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARGZ_H + +/* Define to 1 if you have the `atexit' function. */ +#undef HAVE_ATEXIT + +/* Define to 1 if you have the `btowc' function. */ +#undef HAVE_BTOWC + +/* Define to 1 if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if strerror_r is declared. */ +#undef HAVE_DECL_STRERROR_R + +/* Define if declares strtoul. */ +#undef HAVE_DECL_STRTOUL + +/* Define if declares strtoull. */ +#undef HAVE_DECL_STRTOULL + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define if the malloc check has been performed. */ +#undef HAVE_DONE_WORKING_MALLOC_CHECK + +/* Define if the realloc check has been performed. */ +#undef HAVE_DONE_WORKING_REALLOC_CHECK + +/* Define to 1 if you have the `doprnt' function. */ +#undef HAVE_DOPRNT + +/* Define if text file lines end in CRLF. */ +#undef HAVE_DOS_FILE_CONTENTS + +/* Define if your OS uses backslashes as directory separators */ +#undef HAVE_DOS_FILE_NAMES + +/* Define to 1 if you have the `feof_unlocked' function. */ +#undef HAVE_FEOF_UNLOCKED + +/* Define to 1 if you have the `fgets_unlocked' function. */ +#undef HAVE_FGETS_UNLOCKED + +/* Define to 1 if you have the `fnmatch' function. */ +#undef HAVE_FNMATCH + +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the `getegid' function. */ +#undef HAVE_GETEGID + +/* Define to 1 if you have the `geteuid' function. */ +#undef HAVE_GETEUID + +/* Define to 1 if you have the `getgid' function. */ +#undef HAVE_GETGID + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the `getuid' function. */ +#undef HAVE_GETUID + +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII + +/* Define if you have and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + +/* Define to 1 if you have the `pcre' library (-lpcre). */ +#undef HAVE_LIBPCRE + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `mbrtowc' function. */ +#undef HAVE_MBRTOWC + +/* Define to 1 if you have the `memchr' function. */ +#undef HAVE_MEMCHR + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `setmode' function. */ +#undef HAVE_SETMODE + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `stpcpy' function. */ +#undef HAVE_STPCPY + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the `strerror_r' function. */ +#undef HAVE_STRERROR_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if you have the `strtoull' function. */ +#undef HAVE_STRTOULL + +/* Define to 1 if you have the `strtoumax' function. */ +#undef HAVE_STRTOUMAX + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the `tsearch' function. */ +#undef HAVE_TSEARCH + +/* Define to 1 if you have the 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 `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define to 1 if you have the `wctype' function. */ +#undef HAVE_WCTYPE + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if strerror_r returns a string. */ +#undef HAVE_WORKING_STRERROR_R + +/* Define to 1 if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT + +/* Define to 1 if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT + +/* Define to 1 if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if compiler has function prototypes */ +#undef PROTOTYPES + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if the `S_IS*' macros in do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define to make fseeko etc. visible, on some hosts. */ +#undef _LARGEFILE_SOURCE + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define if your compiler is broken */ +#undef alloca + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#undef inline + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to a type if does not define. */ +#undef mbstate_t + +/* Define to `long' if does not define. */ +#undef off_t + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc + +/* Define to `unsigned' if does not define. */ +#undef size_t + +/* Define to `int' if does not define. */ +#undef ssize_t + +/* Define to unsigned long or unsigned long long if doesn't + define. */ +#undef uintmax_t diff --git a/src/apps/bin/grep-2.5/config.log b/src/apps/bin/grep-2.5/config.log new file mode 100644 index 0000000000..9e2ca20388 --- /dev/null +++ b/src/apps/bin/grep-2.5/config.log @@ -0,0 +1,2015 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.53. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = +uname -m = BePC +uname -r = 5.0 +uname -s = BeOS +uname -v = 1000009 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: . +PATH: /boot/home/config/bin +PATH: /bin +PATH: /boot/apps +PATH: /boot/preferences +PATH: /boot/beos/apps +PATH: /boot/beos/preferences +PATH: /boot/develop/tools/gnupro/bin +PATH: /boot/apps/X11R6.4/bin +PATH: /boot/apps/GeekGadgets/bin +PATH: /boot/home/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1251: checking for a BSD-compatible install +configure:1305: result: /bin/install -c +configure:1316: checking whether build environment is sane +configure:1359: result: yes +configure:1393: checking for gawk +configure:1409: found /bin/gawk +configure:1419: result: gawk +configure:1429: checking whether make sets ${MAKE} +configure:1449: result: yes +configure:1577: checking build system type +configure:1595: result: i586-pc-beos +configure:1603: checking host system type +configure:1617: result: i586-pc-beos +configure:1629: checking for gawk +configure:1655: result: gawk +configure:1711: checking for gcc +configure:1727: found /boot/develop/tools/gnupro/bin/gcc +configure:1737: result: gcc +configure:1981: checking for C compiler version +configure:1984: gcc --version &5 +2.9-beos-991026 +configure:1987: $? = 0 +configure:1989: gcc -v &5 +Reading specs from /boot/develop/tools/gnupro/lib/gcc-lib/i586-beos/2.9-beos-991026/specs +gcc version 2.9-beos-991026 +configure:1992: $? = 0 +configure:1994: gcc -V &5 +gcc: argument to `-V' is missing +configure:1997: $? = 1 +configure:2023: checking for C compiler default output +configure:2026: gcc conftest.c >&5 +configure:2029: $? = 0 +configure:2062: result: conftest +configure:2067: checking whether the C compiler works +configure:2073: ./conftest +configure:2076: $? = 0 +configure:2091: result: yes +configure:2098: checking whether we are cross compiling +configure:2100: result: no +configure:2103: checking for suffix of executables +configure:2105: gcc -o conftest conftest.c >&5 +configure:2108: $? = 0 +configure:2130: result: +configure:2136: checking for suffix of object files +configure:2160: gcc -c conftest.c >&5 +configure:2163: $? = 0 +configure:2182: result: o +configure:2186: checking whether we are using the GNU C compiler +configure:2213: gcc -c conftest.c >&5 +configure:2216: $? = 0 +configure:2219: test -s conftest.o +configure:2222: $? = 0 +configure:2234: result: yes +configure:2240: checking whether gcc accepts -g +configure:2264: gcc -c -g conftest.c >&5 +configure:2267: $? = 0 +configure:2270: test -s conftest.o +configure:2273: $? = 0 +configure:2283: result: yes +configure:2310: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/conftest.c:2: parse error before `me' +configure:2313: $? = 1 +configure: failed program was: +#ifndef __cplusplus + choke me +#endif +configure:2431: checking for style of include used by make +configure:2459: result: GNU +configure:2466: checking dependency style of gcc +configure:2528: result: gcc +configure:2545: checking for a BSD-compatible install +configure:2599: result: /bin/install -c +configure:2651: checking for ranlib +configure:2667: found /boot/develop/tools/gnupro/bin/ranlib +configure:2678: result: ranlib +configure:2740: checking for getconf +configure:2769: result: no +configure:2778: checking for CFLAGS value to request large file support +configure:2846: result: no +configure:2848: checking for LDFLAGS value to request large file support +configure:2862: result: no +configure:2864: checking for LIBS value to request large file support +configure:2878: result: no +configure:2923: checking for _FILE_OFFSET_BITS +configure:2944: result: no +configure:2953: checking for _LARGEFILE_SOURCE +configure:2974: result: no +configure:2983: checking for _LARGE_FILES +configure:3004: result: no +configure:3018: checking for gcc option to accept ANSI C +configure:3084: gcc -c -g -O2 conftest.c >&5 +configure:3087: $? = 0 +configure:3090: test -s conftest.o +configure:3093: $? = 0 +configure:3107: result: none needed +configure:3123: checking how to run the C preprocessor +configure:3149: gcc -E conftest.c +configure:3155: $? = 0 +configure:3182: gcc -E conftest.c +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:3178: ac_nonexistent.h: No such file or directory +configure:3188: $? = 1 +configure: failed program was: +#line 3177 "configure" +#include "confdefs.h" +#include +configure:3225: result: gcc -E +configure:3240: gcc -E conftest.c +configure:3246: $? = 0 +configure:3273: gcc -E conftest.c +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:3269: ac_nonexistent.h: No such file or directory +configure:3279: $? = 1 +configure: failed program was: +#line 3268 "configure" +#include "confdefs.h" +#include +configure:3333: checking for sys/types.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3333: checking for sys/stat.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3333: checking for stdlib.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3333: checking for string.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3333: checking for memory.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3333: checking for strings.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3333: checking for inttypes.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3333: checking for stdint.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:3374: stdint.h: No such file or directory +configure:3349: $? = 1 +configure: failed program was: +#line 3338 "configure" +#include "confdefs.h" +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif + +#include +configure:3365: result: no +configure:3333: checking for unistd.h +configure:3346: gcc -c -g -O2 conftest.c >&5 +configure:3349: $? = 0 +configure:3352: test -s conftest.o +configure:3355: $? = 0 +configure:3365: result: yes +configure:3379: checking for function prototypes +configure:3382: result: yes +configure:3396: checking for ANSI C header files +configure:3410: gcc -E conftest.c +configure:3416: $? = 0 +configure:3501: gcc -o conftest -g -O2 conftest.c >&5 +configure:3504: $? = 0 +configure:3506: ./conftest +configure:3509: $? = 0 +configure:3523: result: yes +configure:3538: checking for string.h +configure:3543: result: yes +configure:3648: checking for size_t +configure:3675: gcc -c -g -O2 conftest.c >&5 +configure:3678: $? = 0 +configure:3681: test -s conftest.o +configure:3684: $? = 0 +configure:3694: result: yes +configure:3706: checking for ssize_t +configure:3733: gcc -c -g -O2 conftest.c >&5 +configure:3736: $? = 0 +configure:3739: test -s conftest.o +configure:3742: $? = 0 +configure:3752: result: yes +configure:3764: checking for gcc option to accept ANSI C +configure:3827: gcc -c -g -O2 conftest.c >&5 +configure:3830: $? = 0 +configure:3833: test -s conftest.o +configure:3836: $? = 0 +configure:3853: result: none needed +configure:3861: checking for an ANSI C-conforming const +configure:3931: gcc -c -g -O2 conftest.c >&5 +configure:3934: $? = 0 +configure:3937: test -s conftest.o +configure:3940: $? = 0 +configure:3950: result: yes +configure:3961: checking for inttypes.h +configure:3986: gcc -c -g -O2 conftest.c >&5 +configure:3989: $? = 0 +configure:3992: test -s conftest.o +configure:3995: $? = 0 +configure:4005: result: yes +configure:4016: checking for unsigned long long +configure:4041: gcc -o conftest -g -O2 conftest.c >&5 +configure:4044: $? = 0 +configure:4047: test -s conftest +configure:4050: $? = 0 +configure:4060: result: yes +configure:4085: checking for ANSI C header files +configure:4212: result: yes +configure:4232: checking for string.h +configure:4237: result: yes +configure:4232: checking for stdlib.h +configure:4237: result: yes +configure:4241: checking sys/param.h usability +configure:4250: gcc -c -g -O2 conftest.c >&5 +configure:4253: $? = 0 +configure:4256: test -s conftest.o +configure:4259: $? = 0 +configure:4268: result: yes +configure:4272: checking sys/param.h presence +configure:4279: gcc -E conftest.c +configure:4285: $? = 0 +configure:4303: result: yes +configure:4321: checking for sys/param.h +configure:4328: result: yes +configure:4232: checking for memory.h +configure:4237: result: yes +configure:4232: checking for unistd.h +configure:4237: result: yes +configure:4241: checking libintl.h usability +configure:4250: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4278: libintl.h: No such file or directory +configure:4253: $? = 1 +configure: failed program was: +#line 4243 "configure" +#include "confdefs.h" +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif +#include +configure:4268: result: no +configure:4272: checking libintl.h presence +configure:4279: gcc -E conftest.c +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4275: libintl.h: No such file or directory +configure:4285: $? = 1 +configure: failed program was: +#line 4274 "configure" +#include "confdefs.h" +#include +configure:4303: result: no +configure:4321: checking for libintl.h +configure:4328: result: no +configure:4356: checking wctype.h usability +configure:4365: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4393: wctype.h: No such file or directory +configure:4368: $? = 1 +configure: failed program was: +#line 4358 "configure" +#include "confdefs.h" +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif +#include +configure:4383: result: no +configure:4387: checking wctype.h presence +configure:4394: gcc -E conftest.c +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4390: wctype.h: No such file or directory +configure:4400: $? = 1 +configure: failed program was: +#line 4389 "configure" +#include "confdefs.h" +#include +configure:4418: result: no +configure:4436: checking for wctype.h +configure:4443: result: no +configure:4356: checking wchar.h usability +configure:4365: gcc -c -g -O2 conftest.c >&5 +configure:4368: $? = 0 +configure:4371: test -s conftest.o +configure:4374: $? = 0 +configure:4383: result: yes +configure:4387: checking wchar.h presence +configure:4394: gcc -E conftest.c +configure:4400: $? = 0 +configure:4418: result: yes +configure:4436: checking for wchar.h +configure:4443: result: yes +configure:4464: checking for dirent.h that defines DIR +configure:4491: gcc -c -g -O2 conftest.c >&5 +configure:4494: $? = 0 +configure:4497: test -s conftest.o +configure:4500: $? = 0 +configure:4510: result: yes +configure:4523: checking for library containing opendir +configure:4556: gcc -o conftest -g -O2 conftest.c >&5 +configure:4559: $? = 0 +configure:4562: test -s conftest +configure:4565: $? = 0 +configure:4624: result: none required +configure:4742: checking whether stat file-mode macros are broken +configure:4787: result: no +configure:4803: checking for stdlib.h +configure:4808: result: yes +configure:4913: checking for mbstate_t +configure:4941: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4933: `mbstate_t' undeclared (first use in this function) +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4933: (Each undeclared identifier is reported only once +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4933: for each function it appears in.) +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4933: parse error before `x' +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:4933: `x' undeclared (first use in this function) +configure:4944: $? = 1 +configure: failed program was: +#line 4918 "configure" +#include "confdefs.h" + +#if HAVE_STDLIB_H +# include +#endif +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +configure:4960: result: no +configure:4972: checking for working alloca.h +configure:4996: gcc -o conftest -g -O2 conftest.c >&5 +configure:4999: $? = 0 +configure:5002: test -s conftest +configure:5005: $? = 0 +configure:5015: result: yes +configure:5025: checking for alloca +configure:5069: gcc -o conftest -g -O2 conftest.c >&5 +configure:5072: $? = 0 +configure:5075: test -s conftest +configure:5078: $? = 0 +configure:5088: result: yes +configure:5278: checking whether closedir returns void +configure:5310: gcc -o conftest -g -O2 conftest.c >&5 +configure:5313: $? = 0 +configure:5315: ./conftest +configure:5318: $? = 0 +configure:5331: result: no +configure:5347: checking for stdlib.h +configure:5352: result: yes +configure:5347: checking for unistd.h +configure:5352: result: yes +configure:5460: checking for getpagesize +configure:5503: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccgY7UQv.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:5493: undefined reference to `getpagesize' +collect2: ld returned 1 exit status +configure:5506: $? = 1 +configure: failed program was: +#line 5465 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getpagesize (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getpagesize (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_getpagesize) || defined (__stub___getpagesize) +choke me +#else +f = getpagesize; +#endif + + ; + return 0; +} +configure:5522: result: no +configure:5532: checking for working mmap +configure:5671: gcc -o conftest -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:5601: sys/mman.h: No such file or directory +configure:5674: $? = 1 +configure: program exited with status 1 +configure: failed program was: +#line 5540 "configure" +#include "confdefs.h" +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !STDC_HEADERS && !HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#if !HAVE_GETPAGESIZE +/* Assume that all systems that can run configure have sys/param.h. */ +# if !HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# if HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + exit (1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + exit (1); + if (write (fd, data, pagesize) != pagesize) + exit (1); + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + exit (1); + data2 = (char *) malloc (2 * pagesize); + if (!data2) + exit (1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit (1); + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + exit (1); + if (read (fd, data3, pagesize) != pagesize) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit (1); + close (fd); + exit (0); +} +configure:5692: result: no +configure:5714: checking for btowc +configure:5757: gcc -o conftest -g -O2 conftest.c >&5 +configure:5760: $? = 0 +configure:5763: test -s conftest +configure:5766: $? = 0 +configure:5776: result: yes +configure:5714: checking for isascii +configure:5757: gcc -o conftest -g -O2 conftest.c >&5 +configure:5760: $? = 0 +configure:5763: test -s conftest +configure:5766: $? = 0 +configure:5776: result: yes +configure:5714: checking for memmove +configure:5757: gcc -o conftest -g -O2 conftest.c >&5 +configure:5760: $? = 0 +configure:5763: test -s conftest +configure:5766: $? = 0 +configure:5776: result: yes +configure:5714: checking for setmode +configure:5757: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccoKaXdt.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:5747: undefined reference to `setmode' +collect2: ld returned 1 exit status +configure:5760: $? = 1 +configure: failed program was: +#line 5719 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setmode (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setmode (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setmode) || defined (__stub___setmode) +choke me +#else +f = setmode; +#endif + + ; + return 0; +} +configure:5776: result: no +configure:5714: checking for strerror +configure:5757: gcc -o conftest -g -O2 conftest.c >&5 +configure:5760: $? = 0 +configure:5763: test -s conftest +configure:5766: $? = 0 +configure:5776: result: yes +configure:5714: checking for wctype +configure:5757: gcc -o conftest -g -O2 conftest.c >&5 +configure:5760: $? = 0 +configure:5763: test -s conftest +configure:5766: $? = 0 +configure:5776: result: yes +configure:5714: checking for mbrtowc +configure:5757: gcc -o conftest -g -O2 conftest.c >&5 +configure:5760: $? = 0 +configure:5763: test -s conftest +configure:5766: $? = 0 +configure:5776: result: yes +configure:5794: checking for memchr +configure:5837: gcc -o conftest -g -O2 conftest.c >&5 +configure:5840: $? = 0 +configure:5843: test -s conftest +configure:5846: $? = 0 +configure:5856: result: yes +configure:5794: checking for stpcpy +configure:5837: gcc -o conftest -g -O2 conftest.c >&5 +configure:5840: $? = 0 +configure:5843: test -s conftest +configure:5846: $? = 0 +configure:5856: result: yes +configure:5794: checking for strtoul +configure:5837: gcc -o conftest -g -O2 conftest.c >&5 +configure:5840: $? = 0 +configure:5843: test -s conftest +configure:5846: $? = 0 +configure:5856: result: yes +configure:5794: checking for atexit +configure:5837: gcc -o conftest -g -O2 conftest.c >&5 +configure:5840: $? = 0 +configure:5843: test -s conftest +configure:5846: $? = 0 +configure:5856: result: yes +configure:5794: checking for fnmatch +configure:5837: gcc -o conftest -g -O2 conftest.c >&5 +configure:5840: $? = 0 +configure:5843: test -s conftest +configure:5846: $? = 0 +configure:5856: result: yes +configure:5877: checking for stdlib.h +configure:5882: result: yes +configure:5987: checking whether defines strtoumax as a macro +configure:6009: result: no +configure:6017: checking for strtoumax +configure:6060: gcc -o conftest -g -O2 conftest.c >&5 +configure:6063: $? = 0 +configure:6066: test -s conftest +configure:6069: $? = 0 +configure:6079: result: yes +configure:6184: checking whether strtoul is declared +configure:6212: gcc -c -g -O2 conftest.c >&5 +configure:6215: $? = 0 +configure:6218: test -s conftest.o +configure:6221: $? = 0 +configure:6234: result: yes +configure:6184: checking whether strtoull is declared +configure:6212: gcc -c -g -O2 conftest.c >&5 +configure:6215: $? = 0 +configure:6218: test -s conftest.o +configure:6221: $? = 0 +configure:6234: result: yes +configure:6273: checking for strerror in -lcposix +configure:6306: gcc -o conftest -g -O2 conftest.c -lcposix >&5 +/boot/develop/tools/gnupro/bin/ld: cannot open -lcposix: No such file or directory +collect2: ld returned 1 exit status +configure:6309: $? = 1 +configure: failed program was: +#line 6280 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +strerror (); + ; + return 0; +} +configure:6326: result: no +configure:6334: checking for inline +configure:6351: gcc -c -g -O2 conftest.c >&5 +configure:6354: $? = 0 +configure:6357: test -s conftest.o +configure:6360: $? = 0 +configure:6371: result: inline +configure:6386: checking for off_t +configure:6413: gcc -c -g -O2 conftest.c >&5 +configure:6416: $? = 0 +configure:6419: test -s conftest.o +configure:6422: $? = 0 +configure:6432: result: yes +configure:6445: checking whether we are using the GNU C Library 2.1 or newer +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6452: features.h: No such file or directory +configure:6473: result: no +configure:6504: checking argz.h usability +configure:6513: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6541: argz.h: No such file or directory +configure:6516: $? = 1 +configure: failed program was: +#line 6506 "configure" +#include "confdefs.h" +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif +#include +configure:6531: result: no +configure:6535: checking argz.h presence +configure:6542: gcc -E conftest.c +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6538: argz.h: No such file or directory +configure:6548: $? = 1 +configure: failed program was: +#line 6537 "configure" +#include "confdefs.h" +#include +configure:6566: result: no +configure:6584: checking for argz.h +configure:6591: result: no +configure:6504: checking limits.h usability +configure:6513: gcc -c -g -O2 conftest.c >&5 +configure:6516: $? = 0 +configure:6519: test -s conftest.o +configure:6522: $? = 0 +configure:6531: result: yes +configure:6535: checking limits.h presence +configure:6542: gcc -E conftest.c +configure:6548: $? = 0 +configure:6566: result: yes +configure:6584: checking for limits.h +configure:6591: result: yes +configure:6504: checking locale.h usability +configure:6513: gcc -c -g -O2 conftest.c >&5 +configure:6516: $? = 0 +configure:6519: test -s conftest.o +configure:6522: $? = 0 +configure:6531: result: yes +configure:6535: checking locale.h presence +configure:6542: gcc -E conftest.c +configure:6548: $? = 0 +configure:6566: result: yes +configure:6584: checking for locale.h +configure:6591: result: yes +configure:6504: checking nl_types.h usability +configure:6513: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6541: nl_types.h: No such file or directory +configure:6516: $? = 1 +configure: failed program was: +#line 6506 "configure" +#include "confdefs.h" +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif +#include +configure:6531: result: no +configure:6535: checking nl_types.h presence +configure:6542: gcc -E conftest.c +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6538: nl_types.h: No such file or directory +configure:6548: $? = 1 +configure: failed program was: +#line 6537 "configure" +#include "confdefs.h" +#include +configure:6566: result: no +configure:6584: checking for nl_types.h +configure:6591: result: no +configure:6504: checking malloc.h usability +configure:6513: gcc -c -g -O2 conftest.c >&5 +configure:6516: $? = 0 +configure:6519: test -s conftest.o +configure:6522: $? = 0 +configure:6531: result: yes +configure:6535: checking malloc.h presence +configure:6542: gcc -E conftest.c +configure:6548: $? = 0 +configure:6566: result: yes +configure:6584: checking for malloc.h +configure:6591: result: yes +configure:6504: checking stddef.h usability +configure:6513: gcc -c -g -O2 conftest.c >&5 +configure:6516: $? = 0 +configure:6519: test -s conftest.o +configure:6522: $? = 0 +configure:6531: result: yes +configure:6535: checking stddef.h presence +configure:6542: gcc -E conftest.c +configure:6548: $? = 0 +configure:6566: result: yes +configure:6584: checking for stddef.h +configure:6591: result: yes +configure:6495: checking for stdlib.h +configure:6500: result: yes +configure:6495: checking for string.h +configure:6500: result: yes +configure:6495: checking for unistd.h +configure:6500: result: yes +configure:6495: checking for sys/param.h +configure:6500: result: yes +configure:6630: checking for feof_unlocked +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for fgets_unlocked +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for getcwd +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for getegid +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for geteuid +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for getgid +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for getuid +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for mempcpy +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccUC78WE.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6663: undefined reference to `mempcpy' +collect2: ld returned 1 exit status +configure:6676: $? = 1 +configure: failed program was: +#line 6635 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mempcpy (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mempcpy (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mempcpy) || defined (__stub___mempcpy) +choke me +#else +f = mempcpy; +#endif + + ; + return 0; +} +configure:6692: result: no +configure:6630: checking for munmap +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/cchpQLlR.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6663: undefined reference to `munmap' +collect2: ld returned 1 exit status +configure:6676: $? = 1 +configure: failed program was: +#line 6635 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char munmap (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char munmap (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_munmap) || defined (__stub___munmap) +choke me +#else +f = munmap; +#endif + + ; + return 0; +} +configure:6692: result: no +configure:6630: checking for putenv +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for setenv +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/cc8QWCEL.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6663: undefined reference to `setenv' +collect2: ld returned 1 exit status +configure:6676: $? = 1 +configure: failed program was: +#line 6635 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setenv (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setenv (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setenv) || defined (__stub___setenv) +choke me +#else +f = setenv; +#endif + + ; + return 0; +} +configure:6692: result: no +configure:6630: checking for setlocale +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for stpcpy +configure:6692: result: yes +configure:6630: checking for strchr +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for strcasecmp +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for strdup +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +configure:6676: $? = 0 +configure:6679: test -s conftest +configure:6682: $? = 0 +configure:6692: result: yes +configure:6630: checking for strtoul +configure:6692: result: yes +configure:6630: checking for tsearch +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccwrLnCl.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6663: undefined reference to `tsearch' +collect2: ld returned 1 exit status +configure:6676: $? = 1 +configure: failed program was: +#line 6635 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char tsearch (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char tsearch (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_tsearch) || defined (__stub___tsearch) +choke me +#else +f = tsearch; +#endif + + ; + return 0; +} +configure:6692: result: no +configure:6630: checking for __argz_count +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccXyhCTo.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6663: undefined reference to `__argz_count' +collect2: ld returned 1 exit status +configure:6676: $? = 1 +configure: failed program was: +#line 6635 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char __argz_count (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char __argz_count (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub___argz_count) || defined (__stub_____argz_count) +choke me +#else +f = __argz_count; +#endif + + ; + return 0; +} +configure:6692: result: no +configure:6630: checking for __argz_stringify +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccI2kpnC.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6663: undefined reference to `__argz_stringify' +collect2: ld returned 1 exit status +configure:6676: $? = 1 +configure: failed program was: +#line 6635 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char __argz_stringify (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char __argz_stringify (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub___argz_stringify) || defined (__stub_____argz_stringify) +choke me +#else +f = __argz_stringify; +#endif + + ; + return 0; +} +configure:6692: result: no +configure:6630: checking for __argz_next +configure:6673: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccVqFrMK.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6663: undefined reference to `__argz_next' +collect2: ld returned 1 exit status +configure:6676: $? = 1 +configure: failed program was: +#line 6635 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char __argz_next (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char __argz_next (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub___argz_next) || defined (__stub_____argz_next) +choke me +#else +f = __argz_next; +#endif + + ; + return 0; +} +configure:6692: result: no +configure:6717: checking for iconv +configure:6747: gcc -o conftest -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6727: iconv.h: No such file or directory +configure:6750: $? = 1 +configure: failed program was: +#line 6725 "configure" +#include "confdefs.h" +#include +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +configure:6789: gcc -o conftest -g -O2 conftest.c -liconv >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6769: iconv.h: No such file or directory +configure:6792: $? = 1 +configure: failed program was: +#line 6767 "configure" +#include "confdefs.h" +#include +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +configure:6811: result: no, consider installing GNU libiconv +configure:6895: checking for nl_langinfo and CODESET +configure:6919: gcc -o conftest -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:6901: langinfo.h: No such file or directory +configure:6922: $? = 1 +configure: failed program was: +#line 6900 "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +char* cs = nl_langinfo(CODESET); + ; + return 0; +} +configure:6939: result: no +configure:6950: checking for LC_MESSAGES +configure:6974: gcc -o conftest -g -O2 conftest.c >&5 +configure:6977: $? = 0 +configure:6980: test -s conftest +configure:6983: $? = 0 +configure:6993: result: yes +configure:7003: checking whether NLS is requested +configure:7012: result: yes +configure:7026: checking whether included gettext is requested +configure:7036: result: no +configure:7047: checking for libintl.h +configure:7052: result: no +configure:7472: checking for msgfmt +configure:7502: result: no +configure:7508: checking for gmsgfmt +configure:7539: result: : +configure:7548: checking for xgettext +configure:7578: result: no +configure:7624: checking for bison +configure:7640: found /bin/bison +configure:7650: result: bison +configure:7663: checking version of bison +configure:7672: result: 1.28, ok +configure:7711: checking for catalogs to be installed +configure:7731: result: cs de el eo es et fr gl hr id it ja ko nl no pl pt_BR ru sl sv +configure:7754: checking for dos file convention +configure:7766: result: no +configure:7793: checking for DJGPP environment +configure:7817: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:7809: `__DJGPP__' undeclared (first use in this function) +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:7809: (Each undeclared identifier is reported only once +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:7809: for each function it appears in.) +configure:7820: $? = 1 +configure: failed program was: +#line 7798 "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + return __DJGPP__; + ; + return 0; +} +configure:7837: result: no +configure:7844: checking for environ variable separator +configure:7858: result: : +configure:7876: checking for working re_compile_pattern +configure:7911: gcc -o conftest -g -O2 conftest.c >&5 +configure:7914: $? = 0 +configure:7916: ./conftest +configure:7919: $? = 0 +configure:7933: result: yes +configure:7960: checking for getopt_long +configure:8003: gcc -o conftest -g -O2 conftest.c >&5 +configure:8006: $? = 0 +configure:8009: test -s conftest +configure:8012: $? = 0 +configure:8022: result: yes +configure:8048: WARNING: Included lib/regex.c not used +configure:8053: checking whether strerror_r is declared +configure:8081: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:8074: `strerror_r' undeclared (first use in this function) +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:8074: (Each undeclared identifier is reported only once +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:8074: for each function it appears in.) +configure:8084: $? = 1 +configure: failed program was: +#line 8058 "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + +#ifndef strerror_r +char *(*pfn) = (char *(*)) strerror_r +#endif + + ; + return 0; +} +configure:8107: result: no +configure:8121: checking for strerror_r +configure:8164: gcc -o conftest -g -O2 conftest.c >&5 +configure:8167: $? = 0 +configure:8170: test -s conftest +configure:8173: $? = 0 +configure:8183: result: yes +configure:8199: checking for string.h +configure:8204: result: yes +configure:8308: checking for working strerror_r +configure:8341: gcc -c -g -O2 conftest.c >&5 +/boot/home/Development/current/src/apps/bin/grep-2.5/configure: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:8332: invalid type argument of `unary *' +configure:8344: $? = 1 +configure: failed program was: +#line 8314 "configure" +#include "confdefs.h" + +# include +# if HAVE_STRING_H +# include +# endif + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + + ; + return 0; +} +configure:8390: gcc -o conftest -g -O2 conftest.c >&5 +configure:8393: $? = 0 +configure:8395: ./conftest +configure:8398: $? = 0 +configure:8413: result: yes +configure:8432: checking for strerror +configure:8494: result: yes +configure:8432: checking for strerror_r +configure:8494: result: yes +configure:8432: checking for vprintf +configure:8475: gcc -o conftest -g -O2 conftest.c >&5 +configure:8478: $? = 0 +configure:8481: test -s conftest +configure:8484: $? = 0 +configure:8494: result: yes +configure:8432: checking for doprnt +configure:8475: gcc -o conftest -g -O2 conftest.c >&5 +/tmp/ccj8KdcV.o: In function `main': +/boot/home/Development/current/src/apps/bin/grep-2.5/configure:8465: undefined reference to `doprnt' +collect2: ld returned 1 exit status +configure:8478: $? = 1 +configure: failed program was: +#line 8437 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char doprnt (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char doprnt (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_doprnt) || defined (__stub___doprnt) +choke me +#else +f = doprnt; +#endif + + ; + return 0; +} +configure:8494: result: no +configure:8504: checking for ANSI C header files +configure:8631: result: yes +configure:8650: checking for working malloc +configure:8671: gcc -o conftest -g -O2 conftest.c >&5 +configure:8674: $? = 0 +configure:8676: ./conftest +configure:8679: $? = 0 +configure:8693: result: yes +configure:8711: checking for working realloc +configure:8732: gcc -o conftest -g -O2 conftest.c >&5 +configure:8735: $? = 0 +configure:8737: ./conftest +configure:8740: $? = 0 +configure:8754: result: yes +configure:8773: checking for pcre_exec in -lpcre +configure:8806: gcc -o conftest -g -O2 conftest.c -lpcre >&5 +/boot/develop/tools/gnupro/bin/ld: cannot open -lpcre: No such file or directory +collect2: ld returned 1 exit status +configure:8809: $? = 1 +configure: failed program was: +#line 8780 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pcre_exec (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +pcre_exec (); + ; + return 0; +} +configure:8826: result: no +configure:8839: checking How to create links +configure:8858: result: ln -s +configure:8946: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by config.status, which was +generated by GNU Autoconf 2.53. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on + +config.status:651: creating Makefile +config.status:651: creating lib/Makefile +config.status:651: creating lib/posix/Makefile +config.status:651: creating src/Makefile +config.status:651: creating tests/Makefile +config.status:651: creating po/Makefile.in +config.status:651: creating intl/Makefile +config.status:651: creating doc/Makefile +config.status:651: creating m4/Makefile +config.status:651: creating vms/Makefile +config.status:651: creating bootstrap/Makefile +config.status:755: creating config.h +config.status:1135: executing default-1 commands +config.status:1135: executing default-2 commands +config.status:1135: executing default commands + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=i586-pc-beos +ac_cv_build_alias=i586-pc-beos +ac_cv_c_compiler_gnu=yes +ac_cv_c_const=yes +ac_cv_c_inline=inline +ac_cv_djgpp=no +ac_cv_dosfile=no +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext= +ac_cv_func___argz_count=no +ac_cv_func___argz_next=no +ac_cv_func___argz_stringify=no +ac_cv_func_alloca_works=yes +ac_cv_func_atexit=yes +ac_cv_func_btowc=yes +ac_cv_func_closedir_void=no +ac_cv_func_doprnt=no +ac_cv_func_feof_unlocked=yes +ac_cv_func_fgets_unlocked=yes +ac_cv_func_fnmatch=yes +ac_cv_func_getcwd=yes +ac_cv_func_getegid=yes +ac_cv_func_geteuid=yes +ac_cv_func_getgid=yes +ac_cv_func_getopt_long=yes +ac_cv_func_getpagesize=no +ac_cv_func_getuid=yes +ac_cv_func_isascii=yes +ac_cv_func_mbrtowc=yes +ac_cv_func_memchr=yes +ac_cv_func_memmove=yes +ac_cv_func_mempcpy=no +ac_cv_func_mmap_fixed_mapped=no +ac_cv_func_munmap=no +ac_cv_func_putenv=yes +ac_cv_func_setenv=no +ac_cv_func_setlocale=yes +ac_cv_func_setmode=no +ac_cv_func_stpcpy=yes +ac_cv_func_strcasecmp=yes +ac_cv_func_strchr=yes +ac_cv_func_strdup=yes +ac_cv_func_strerror=yes +ac_cv_func_strerror_r=yes +ac_cv_func_strerror_r_works=yes +ac_cv_func_strtoul=yes +ac_cv_func_strtoumax=yes +ac_cv_func_tsearch=no +ac_cv_func_vprintf=yes +ac_cv_func_wctype=yes +ac_cv_gnu_library_2_1=no +ac_cv_header_argz_h=no +ac_cv_header_dirent_dirent_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_libintl_h=no +ac_cv_header_limits_h=yes +ac_cv_header_locale_h=yes +ac_cv_header_malloc_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_nl_types_h=no +ac_cv_header_stat_broken=no +ac_cv_header_stdc=yes +ac_cv_header_stddef_h=yes +ac_cv_header_stdint_h=no +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_param_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_header_wchar_h=yes +ac_cv_header_wctype_h=no +ac_cv_host=i586-pc-beos +ac_cv_host_alias=i586-pc-beos +ac_cv_lib_cposix_strerror=no +ac_cv_lib_pcre_pcre_exec=no +ac_cv_objext=o +ac_cv_path_GMSGFMT=: +ac_cv_path_MSGFMT=: +ac_cv_path_XGETTEXT=: +ac_cv_path_install='/bin/install -c' +ac_cv_prog_AWK=gawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_INTLBISON=bison +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_stdc= +ac_cv_prog_make_make_set=yes +ac_cv_search_opendir='none required' +ac_cv_sep=no +ac_cv_sys_file_offset_bits=no +ac_cv_sys_large_files=no +ac_cv_sys_largefile_CFLAGS=no +ac_cv_sys_largefile_LDFLAGS=no +ac_cv_sys_largefile_LIBS=no +ac_cv_sys_largefile_source=no +ac_cv_type_mbstate_t=no +ac_cv_type_off_t=yes +ac_cv_type_size_t=yes +ac_cv_type_ssize_t=yes +ac_cv_type_unsigned_long_long=yes +ac_cv_working_alloca_h=yes +am_cv_CC_dependencies_compiler_type=gcc +am_cv_func_iconv='no, consider installing GNU libiconv' +am_cv_langinfo_codeset=no +am_cv_lib_iconv=no +am_cv_prog_cc_stdc= +am_cv_val_LC_MESSAGES=yes +jm_ac_cv_header_inttypes_h=yes +jm_cv_func_decl_strerror_r=no +jm_cv_func_decl_strtoul=yes +jm_cv_func_decl_strtoull=yes +jm_cv_func_strtoumax_macro=no +jm_cv_func_working_malloc=yes +jm_cv_func_working_re_compile_pattern=yes +jm_cv_func_working_realloc=yes +nls_cv_force_use_gnu_gettext=no +nls_cv_header_intl= +nls_cv_header_libgt= +nls_cv_use_gnu_gettext=yes + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define PACKAGE_NAME "" +#define PACKAGE_TARNAME "" +#define PACKAGE_VERSION "" +#define PACKAGE_STRING "" +#define PACKAGE_BUGREPORT "" +#define GREP 1 +#define PACKAGE "grep" +#define VERSION "2.5" +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_UNISTD_H 1 +#define PROTOTYPES 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_UNSIGNED_LONG_LONG 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_WCHAR_H 1 +#define HAVE_DIRENT_H 1 +#define HAVE_STDLIB_H 1 +#define mbstate_t int +#define HAVE_ALLOCA_H 1 +#define HAVE_ALLOCA 1 +#define HAVE_STDLIB_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_BTOWC 1 +#define HAVE_ISASCII 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRERROR 1 +#define HAVE_WCTYPE 1 +#define HAVE_MBRTOWC 1 +#define HAVE_MEMCHR 1 +#define HAVE_STPCPY 1 +#define HAVE_STRTOUL 1 +#define HAVE_ATEXIT 1 +#define HAVE_FNMATCH 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRTOUMAX 1 +#define HAVE_DECL_STRTOUL 1 +#define HAVE_DECL_STRTOULL 1 +#define HAVE_DECL_STRTOUL 1 +#define HAVE_DECL_STRTOULL 1 +#define HAVE_LIMITS_H 1 +#define HAVE_LOCALE_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_FEOF_UNLOCKED 1 +#define HAVE_FGETS_UNLOCKED 1 +#define HAVE_GETCWD 1 +#define HAVE_GETEGID 1 +#define HAVE_GETEUID 1 +#define HAVE_GETGID 1 +#define HAVE_GETUID 1 +#define HAVE_PUTENV 1 +#define HAVE_SETLOCALE 1 +#define HAVE_STPCPY 1 +#define HAVE_STRCHR 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRDUP 1 +#define HAVE_STRTOUL 1 +#define HAVE_LC_MESSAGES 1 +#define ENABLE_NLS 1 +#define HAVE_DECL_STRERROR_R 0 +#define HAVE_STRERROR_R 1 +#define HAVE_STRING_H 1 +#define HAVE_WORKING_STRERROR_R 1 +#define HAVE_STRERROR 1 +#define HAVE_STRERROR_R 1 +#define HAVE_VPRINTF 1 +#define STDC_HEADERS 1 +#define HAVE_DONE_WORKING_MALLOC_CHECK 1 +#define HAVE_DONE_WORKING_REALLOC_CHECK 1 + +configure: exit 0 diff --git a/src/apps/bin/grep-2.5/config.status b/src/apps/bin/grep-2.5/config.status new file mode 100755 index 0000000000..976065a854 --- /dev/null +++ b/src/apps/bin/grep-2.5/config.status @@ -0,0 +1,1210 @@ +#! /bin/sh +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=${CONFIG_SHELL-/bin/sh} + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.53. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +config_files=" Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile" +config_headers=" config.h:config.hin" +config_commands=" default-1 default-2 default" + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +ac_cs_version="\ +config.status +configured by ./configure, generated by GNU Autoconf 2.53, + with options \"\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=. +INSTALL="/bin/install -c" +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running /bin/sh ./configure " " --no-create --no-recursion" + exec /bin/sh ./configure --no-create --no-recursion ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="" +ac_aux_dir="." + + +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "lib/posix/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/posix/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "intl/Makefile" ) CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; + "vms/Makefile" ) CONFIG_FILES="$CONFIG_FILES vms/Makefile" ;; + "bootstrap/Makefile" ) CONFIG_FILES="$CONFIG_FILES bootstrap/Makefile" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "default-2" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-2" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t$/@;t t/; /@;t t$/s/[\\&,]/\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t$/,;t t/' >$tmp/subs.sed <<\CEOF +s,@SHELL@,/bin/sh,;t t +s,@PATH_SEPARATOR@,:,;t t +s,@PACKAGE_NAME@,,;t t +s,@PACKAGE_TARNAME@,,;t t +s,@PACKAGE_VERSION@,,;t t +s,@PACKAGE_STRING@,,;t t +s,@PACKAGE_BUGREPORT@,,;t t +s,@exec_prefix@,${prefix},;t t +s,@prefix@,/usr/local,;t t +s,@program_transform_name@,s,x,x,,;t t +s,@bindir@,${exec_prefix}/bin,;t t +s,@sbindir@,${exec_prefix}/sbin,;t t +s,@libexecdir@,${exec_prefix}/libexec,;t t +s,@datadir@,${prefix}/share,;t t +s,@sysconfdir@,${prefix}/etc,;t t +s,@sharedstatedir@,${prefix}/com,;t t +s,@localstatedir@,${prefix}/var,;t t +s,@libdir@,${exec_prefix}/lib,;t t +s,@includedir@,${prefix}/include,;t t +s,@oldincludedir@,/usr/include,;t t +s,@infodir@,${prefix}/info,;t t +s,@mandir@,${prefix}/man,;t t +s,@build_alias@,,;t t +s,@host_alias@,,;t t +s,@target_alias@,,;t t +s,@DEFS@,-DHAVE_CONFIG_H,;t t +s,@ECHO_C@,,;t t +s,@ECHO_N@,-n,;t t +s,@ECHO_T@,,;t t +s,@LIBS@,,;t t +s,@INSTALL_PROGRAM@,${INSTALL},;t t +s,@INSTALL_SCRIPT@,${INSTALL},;t t +s,@INSTALL_DATA@,${INSTALL} -m 644,;t t +s,@PACKAGE@,grep,;t t +s,@VERSION@,2.5,;t t +s,@EXEEXT@,,;t t +s,@OBJEXT@,o,;t t +s,@ACLOCAL@,${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal,;t t +s,@AUTOCONF@,${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf,;t t +s,@AUTOMAKE@,${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake,;t t +s,@AUTOHEADER@,${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader,;t t +s,@MAKEINFO@,${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run makeinfo,;t t +s,@AMTAR@,${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar,;t t +s,@install_sh@,/boot/home/Development/current/src/apps/bin/grep-2.5/install-sh,;t t +s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t +s,@AWK@,gawk,;t t +s,@SET_MAKE@,,;t t +s,@AMDEP_TRUE@,,;t t +s,@AMDEP_FALSE@,#,;t t +s,@AMDEPBACKSLASH@,\,;t t +s,@DEPDIR@,.deps,;t t +s,@build@,i586-pc-beos,;t t +s,@build_cpu@,i586,;t t +s,@build_vendor@,pc,;t t +s,@build_os@,beos,;t t +s,@host@,i586-pc-beos,;t t +s,@host_cpu@,i586,;t t +s,@host_vendor@,pc,;t t +s,@host_os@,beos,;t t +s,@CC@,gcc,;t t +s,@CFLAGS@,-g -O2,;t t +s,@LDFLAGS@,,;t t +s,@CPPFLAGS@,,;t t +s,@ac_ct_CC@,gcc,;t t +s,@am__include@,include,;t t +s,@am__quote@,,;t t +s,@CCDEPMODE@,depmode=gcc,;t t +s,@RANLIB@,ranlib,;t t +s,@ac_ct_RANLIB@,ranlib,;t t +s,@GETCONF@,,;t t +s,@ac_ct_GETCONF@,,;t t +s,@CPP@,gcc -E,;t t +s,@U@,,;t t +s,@ANSI2KNR@,,;t t +s,@ALLOCA@,,;t t +s,@LIBOBJS@,,;t t +s,@GLIBC21@,no,;t t +s,@LIBICONV@,,;t t +s,@USE_NLS@,yes,;t t +s,@MSGFMT@,:,;t t +s,@GMSGFMT@,:,;t t +s,@XGETTEXT@,:,;t t +s,@INTLBISON@,bison,;t t +s,@BUILD_INCLUDED_LIBINTL@,yes,;t t +s,@USE_INCLUDED_LIBINTL@,yes,;t t +s,@CATALOGS@, cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo,;t t +s,@CATOBJEXT@,.gmo,;t t +s,@GMOFILES@, cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo,;t t +s,@INTLLIBS@,$(top_builddir)/intl/libintl.a ,;t t +s,@INTLOBJS@,$(GETTOBJS),;t t +s,@POFILES@, cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po,;t t +s,@POSUB@,po,;t t +s,@DATADIRNAME@,share,;t t +s,@INSTOBJEXT@,.mo,;t t +s,@GENCAT@,gencat,;t t +s,@MKINSTALLDIRS@,./mkinstalldirs,;t t +s,@INTL_LIBTOOL_SUFFIX_PREFIX@,,;t t +s,@SEP@,:,;t t +s,@SYMLINK@,ln -s,;t t +s,@SYMLINKFROM@,grep,;t t +CEOF + + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + sed "/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + + # Handle all the #define templates only if necessary. + if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then + # If there are no defines, we may have an empty if/fi + : + cat >$tmp/defines.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + cat >$tmp/defines.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + cat >$tmp/defines.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + fi # egrep + + # Handle all the #undef templates + cat >$tmp/undefs.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + cat >$tmp/undefs.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + cat >$tmp/undefs.sed <$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi + # Run the commands associated with the file. + case $ac_file in + config.h ) # update the timestamp +echo timestamp >"./stamp-h1" + ;; + esac +done + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + default-1 ) +test x"$AMDEP_TRUE" != x"" || +for mf in $CONFIG_FILES; do + case "$mf" in + Makefile) dirpart=.;; + */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; + *) continue;; + esac + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # 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 -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //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=`echo "$file" | sed -e 's|/[^/]*$||'` + $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + default-2 ) for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done ;; + default ) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h ;; + esac +done + +{ (exit 0); exit 0; } diff --git a/src/apps/bin/grep-2.5/config.sub b/src/apps/bin/grep-2.5/config.sub new file mode 100755 index 0000000000..12ebc7875a --- /dev/null +++ b/src/apps/bin/grep-2.5/config.sub @@ -0,0 +1,1410 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-08-13' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 \ + | we32k \ + | x86 | xscale \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alphapca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \ + | mipsle-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [cjt]90) + basic_machine=${basic_machine}-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb) + basic_machine=sh-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/src/apps/bin/grep-2.5/configure b/src/apps/bin/grep-2.5/configure new file mode 100755 index 0000000000..06fc05df21 --- /dev/null +++ b/src/apps/bin/grep-2.5/configure @@ -0,0 +1,10099 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.53. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="src/grep.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + --disable-perl-regexp disable perl-regexp + --disable-largefile omit support for large files + --disable-nls do not use Native Language Support + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib + --with-included-gettext use the GNU gettext library included here + --without-included-regex don't compile regex; this is the default on + systems with version 2 of the GNU C library + (use with caution on other system) + --with-included-getopt Use the included getopt rather than glibc's + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.53. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell meta-characters. +ac_configure_args= +ac_sep= +for ac_arg +do + case $ac_arg in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n ) continue ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + +cat >>confdefs.h <<\_ACEOF +#define GREP 1 +_ACEOF + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# 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". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` + +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= + am_backtick='`' + { echo "$as_me:$LINENO: WARNING: ${am_backtick}missing' script is too old or missing" >&5 +echo "$as_me: WARNING: ${am_backtick}missing' script is too old or missing" >&2;} +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="${MAKE}"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + + +# test to see if srcdir already configured +if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# Define the identity of the package. +PACKAGE=grep +VERSION=2.5 + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. + +# Autoconf 2.50 always computes EXEEXT. However we need to be +# compatible with 2.13, for now. So we always define EXEEXT, but we +# don't compute it. + +# Similar for OBJEXT -- only we only use OBJEXT if the user actually +# requests that it be used. This is a bit dumb. +: ${OBJEXT=o} + + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + + + ac_config_headers="$ac_config_headers config.h:config.hin" + + +# Check whether --enable-perl-regexp or --disable-perl-regexp was given. +if test "${enable_perl_regexp+set}" = set; then + enableval="$enable_perl_regexp" + case "${enableval}" in + yes) testpcre=yes ;; + no) testpcre=no ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-perl-regexp" >&5 +echo "$as_me: error: bad value ${enableval} for --disable-perl-regexp" >&2;} + { (exit 1); exit 1; }; } ;; + esac +else + testpcre=yes +fi; + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$as_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_config_commands="$ac_config_commands default-1" + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +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 | fgrep -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 + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 + + am_cv_CC_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 + # 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. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + + + # Check whether --enable-largefile or --disable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval="$enable_largefile" + +fi; + if test "$enable_largefile" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}getconf", so it can be a program name with args. +set dummy ${ac_tool_prefix}getconf; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_GETCONF+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$GETCONF"; then + ac_cv_prog_GETCONF="$GETCONF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GETCONF="${ac_tool_prefix}getconf" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +GETCONF=$ac_cv_prog_GETCONF +if test -n "$GETCONF"; then + echo "$as_me:$LINENO: result: $GETCONF" >&5 +echo "${ECHO_T}$GETCONF" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_GETCONF"; then + ac_ct_GETCONF=$GETCONF + # Extract the first word of "getconf", so it can be a program name with args. +set dummy getconf; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_GETCONF+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_GETCONF"; then + ac_cv_prog_ac_ct_GETCONF="$ac_ct_GETCONF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GETCONF="getconf" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_GETCONF=$ac_cv_prog_ac_ct_GETCONF +if test -n "$ac_ct_GETCONF"; then + echo "$as_me:$LINENO: result: $ac_ct_GETCONF" >&5 +echo "${ECHO_T}$ac_ct_GETCONF" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + GETCONF=$ac_ct_GETCONF +else + GETCONF="$ac_cv_prog_GETCONF" +fi + + echo "$as_me:$LINENO: checking for CFLAGS value to request large file support" >&5 +echo $ECHO_N "checking for CFLAGS value to request large file support... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_CFLAGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if ($GETCONF LFS_CFLAGS) >conftest.1 2>conftest.2 && test ! -s conftest.2 + then + ac_cv_sys_largefile_CFLAGS=`cat conftest.1` + else + ac_cv_sys_largefile_CFLAGS=no + case "$host_os" in + # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1. + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + if test "$GCC" = yes; then + ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ + fi + ;; + # IRIX 6.2 and later require cc -n32. + irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) + if test "$GCC" != yes; then + ac_cv_sys_largefile_CFLAGS=-n32 + fi + esac + if test "$ac_cv_sys_largefile_CFLAGS" != no; then + ac_save_CC="$CC" + CC="$CC $ac_cv_sys_largefile_CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_sys_largefile_CFLAGS=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + CC="$ac_save_CC" + fi + fi + rm -f conftest* +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CFLAGS" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CFLAGS" >&6 + echo "$as_me:$LINENO: checking for LDFLAGS value to request large file support" >&5 +echo $ECHO_N "checking for LDFLAGS value to request large file support... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_LDFLAGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if ($GETCONF LFS_LDFLAGS) >conftest.1 2>conftest.2 && test ! -s conftest.2 + then + ac_cv_sys_largefile_LDFLAGS=`cat conftest.1` + else + ac_cv_sys_largefile_LDFLAGS=no + + fi + rm -f conftest* +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_LDFLAGS" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_LDFLAGS" >&6 + echo "$as_me:$LINENO: checking for LIBS value to request large file support" >&5 +echo $ECHO_N "checking for LIBS value to request large file support... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_LIBS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if ($GETCONF LFS_LIBS) >conftest.1 2>conftest.2 && test ! -s conftest.2 + then + ac_cv_sys_largefile_LIBS=`cat conftest.1` + else + ac_cv_sys_largefile_LIBS=no + + fi + rm -f conftest* +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_LIBS" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_LIBS" >&6 + + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + no) ;; + -D_FILE_OFFSET_BITS=*) ;; + -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; + -D_LARGE_FILES | -D_LARGE_FILES=*) ;; + -D?* | -I?*) + case "$ac_flag" in + no) ;; + ?*) + case "$CPPFLAGS" in + '') CPPFLAGS="$ac_flag" ;; + *) CPPFLAGS=$CPPFLAGS' '"$ac_flag" ;; + esac ;; + esac ;; + *) + case "$ac_flag" in + no) ;; + ?*) + case "$CFLAGS" in + '') CFLAGS="$ac_flag" ;; + *) CFLAGS=$CFLAGS' '"$ac_flag" ;; + esac ;; + esac ;; + esac + done + case "$ac_cv_sys_largefile_LDFLAGS" in + no) ;; + ?*) + case "$LDFLAGS" in + '') LDFLAGS="$ac_cv_sys_largefile_LDFLAGS" ;; + *) LDFLAGS=$LDFLAGS' '"$ac_cv_sys_largefile_LDFLAGS" ;; + esac ;; + esac + case "$ac_cv_sys_largefile_LIBS" in + no) ;; + ?*) + case "$LIBS" in + '') LIBS="$ac_cv_sys_largefile_LIBS" ;; + *) LIBS=$LIBS' '"$ac_cv_sys_largefile_LIBS" ;; + esac ;; + esac + echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS... $ECHO_C" >&6 +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_file_offset_bits=no + case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_file_offset_bits=64 ;; + esac + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + -D_FILE_OFFSET_BITS) + ac_cv_sys_file_offset_bits=1 ;; + -D_FILE_OFFSET_BITS=*) + ac_cv_sys_file_offset_bits=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; + esac + done + +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 + if test "$ac_cv_sys_file_offset_bits" != no; then + +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF + + fi + echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE" >&5 +echo $ECHO_N "checking for _LARGEFILE_SOURCE... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_source=no + case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_largefile_source=1 ;; + esac + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + -D_LARGEFILE_SOURCE) + ac_cv_sys_largefile_source=1 ;; + -D_LARGEFILE_SOURCE=*) + ac_cv_sys_largefile_source=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; + esac + done + +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 + if test "$ac_cv_sys_largefile_source" != no; then + +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF + + fi + echo "$as_me:$LINENO: checking for _LARGE_FILES" >&5 +echo $ECHO_N "checking for _LARGE_FILES... $ECHO_C" >&6 +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_large_files=no + case "$host_os" in + # AIX 4.2 and later + aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) + ac_cv_sys_large_files=1 ;; + esac + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + -D_LARGE_FILES) + ac_cv_sys_large_files=1 ;; + -D_LARGE_FILES=*) + ac_cv_sys_large_files=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; + esac + done + +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 + if test "$ac_cv_sys_large_files" != no; then + +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF + + fi + fi + + + + +echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 +if test "${am_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_prog_cc_stdc="$ac_arg"; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +CC="$ac_save_CC" + +fi + +if test -z "$am_cv_prog_cc_stdc"; then + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 +else + echo "$as_me:$LINENO: result: $am_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$am_cv_prog_cc_stdc" >&6 +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + +echo "$as_me:$LINENO: checking for function prototypes" >&5 +echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6 +if test "$am_cv_prog_cc_stdc" != no; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define PROTOTYPES 1 +_ACEOF + + U= ANSI2KNR= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + U=_ ANSI2KNR=./ansi2knr +fi +# Ensure some checks needed by ansi2knr itself. +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + +for ac_header in string.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_size_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 +if test "${ac_cv_type_ssize_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((ssize_t *) 0) + return 0; +if (sizeof (ssize_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_ssize_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_ssize_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 +if test $ac_cv_type_ssize_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t int +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_const=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + + + echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 +if test "${jm_ac_cv_header_inttypes_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +uintmax_t i = (uintmax_t) -1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + jm_ac_cv_header_inttypes_h=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +jm_ac_cv_header_inttypes_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $jm_ac_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$jm_ac_cv_header_inttypes_h" >&6 + if test $jm_ac_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H 1 +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +unsigned long long ull = 1; int i = 63; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_long_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_unsigned_long_long=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 + if test $ac_cv_type_unsigned_long_long = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UNSIGNED_LONG_LONG 1 +_ACEOF + + fi + + + + if test $jm_ac_cv_header_inttypes_h = no; then + + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + +cat >>confdefs.h <<_ACEOF +#define uintmax_t $ac_type +_ACEOF + + fi + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + + +for ac_header in string.h stdlib.h sys/param.h memory.h unistd.h libintl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in wctype.h wchar.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include <$ac_hdr> + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in dir; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +else + echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_opendir=no +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="none required" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_opendir" = no; then + for ac_lib in x; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char opendir (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_opendir="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6 +if test "$ac_cv_search_opendir" != no; then + test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" + +fi + +fi + +echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 +echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 +if test "${ac_cv_header_stat_broken+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include + +#if defined(S_ISBLK) && defined(S_IFDIR) +# if S_ISBLK (S_IFDIR) +You lose. +# endif +#endif + +#if defined(S_ISBLK) && defined(S_IFCHR) +# if S_ISBLK (S_IFCHR) +You lose. +# endif +#endif + +#if defined(S_ISLNK) && defined(S_IFREG) +# if S_ISLNK (S_IFREG) +You lose. +# endif +#endif + +#if defined(S_ISSOCK) && defined(S_IFREG) +# if S_ISSOCK (S_IFREG) +You lose. +# endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "You lose" >/dev/null 2>&1; then + ac_cv_header_stat_broken=yes +else + ac_cv_header_stat_broken=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 +echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 +if test $ac_cv_header_stat_broken = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STAT_MACROS_BROKEN 1 +_ACEOF + +fi + + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + echo "$as_me:$LINENO: checking for mbstate_t" >&5 +echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6 +if test "${ac_cv_type_mbstate_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_STDLIB_H +# include +#endif +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +mbstate_t x; return sizeof x; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_mbstate_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_mbstate_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 +echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6 + if test $ac_cv_type_mbstate_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define mbstate_t int +_ACEOF + + fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_working_alloca_h=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA_H 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_alloca_works=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_alloca_works=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 + +if test $ac_cv_func_alloca_works = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF +#define C_ALLOCA 1 +_ACEOF + + +echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#if defined(CRAY) && ! defined(CRAY2) +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "webecray" >/dev/null 2>&1; then + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6 +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +main () +{ + exit (find_stack_direction () < 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_stack_direction=1 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_c_stack_direction=-1 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 + +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 +if test "${ac_cv_func_closedir_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (closedir (opendir (".")) != 0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_closedir_void=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_func_closedir_void=yes +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 +if test $ac_cv_func_closedir_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define CLOSEDIR_VOID 1 +_ACEOF + +fi + + + +for ac_header in stdlib.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in getpagesize +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_mmap_fixed_mapped=no +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !STDC_HEADERS && !HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#if !HAVE_GETPAGESIZE +/* Assume that all systems that can run configure have sys/param.h. */ +# if !HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# if HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + exit (1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + exit (1); + if (write (fd, data, pagesize) != pagesize) + exit (1); + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + exit (1); + data2 = (char *) malloc (2 * pagesize); + if (!data2) + exit (1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit (1); + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + exit (1); + if (read (fd, data3, pagesize) != pagesize) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit (1); + close (fd); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mmap_fixed_mapped=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MMAP 1 +_ACEOF + +fi +rm -f conftest.mmap + + + + + + + + + +for ac_func in btowc isascii memmove setmode strerror wctype mbrtowc +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + +for ac_func in memchr stpcpy strtoul atexit fnmatch +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + LIBOBJS="$LIBOBJS $ac_func.$ac_objext" +fi +done + + + + + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + echo "$as_me:$LINENO: checking whether defines strtoumax as a macro" >&5 +echo $ECHO_N "checking whether defines strtoumax as a macro... $ECHO_C" >&6 +if test "${jm_cv_func_strtoumax_macro+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef strtoumax + inttypes_h_defines_strtoumax +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "inttypes_h_defines_strtoumax" >/dev/null 2>&1; then + jm_cv_func_strtoumax_macro=yes +else + jm_cv_func_strtoumax_macro=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $jm_cv_func_strtoumax_macro" >&5 +echo "${ECHO_T}$jm_cv_func_strtoumax_macro" >&6 + + if test "$jm_cv_func_strtoumax_macro" != yes; then + +for ac_func in strtoumax +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + LIBOBJS="$LIBOBJS $ac_func.$ac_objext" +fi +done + + + fi + + case "$ac_cv_type_unsigned_long_long,$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in + yes,no,no) + +for ac_func in strtoull +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + LIBOBJS="$LIBOBJS $ac_func.$ac_objext" +fi +done + + + ;; + esac + + + + + for jm_func in strtoul strtoull + do + + echo "$as_me:$LINENO: checking whether $jm_func is declared" >&5 +echo $ECHO_N "checking whether $jm_func is declared... $ECHO_C" >&6 + if eval "test \"\${jm_cv_func_decl_$jm_func+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + +#ifndef $jm_func +char *(*pfn) = (char *(*)) $jm_func +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "jm_cv_func_decl_$jm_func=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "jm_cv_func_decl_$jm_func=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi + + + if eval "test \"`echo '$jm_cv_func_decl_'$jm_func`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + + jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + +cat >>confdefs.h <<_ACEOF +#define $jm_tr_func 1 +_ACEOF + + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + done + +test $jm_cv_func_decl_strtoul != yes + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOUL $? +_ACEOF + +test $jm_cv_func_decl_strtoull != yes + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOULL $? +_ACEOF + + +case "$ac_cv_prog_CC" in + cl*) +cat >>confdefs.h <<\_ACEOF +#define alloca _alloca +_ACEOF + ;; + *) ;; +esac + +ALL_LINGUAS="cs de el eo es et fr gl hr id it ja ko nl no pl pt_BR ru sl sv" + + echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 +echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 +if test "${ac_cv_lib_cposix_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cposix_strerror=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_cposix_strerror=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 +echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 +if test $ac_cv_lib_cposix_strerror = yes; then + LIBS="$LIBS -lcposix" +fi + + + +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#ifndef __cplusplus +static $ac_kw int static_foo () {return 0; } +$ac_kw int foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 +case $ac_cv_c_inline in + inline | yes) ;; + no) +cat >>confdefs.h <<\_ACEOF +#define inline +_ACEOF + ;; + *) cat >>confdefs.h <<_ACEOF +#define inline $ac_cv_c_inline +_ACEOF + ;; +esac + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_off_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_off_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long +_ACEOF + +fi + + + echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 +echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6 +if test "${ac_cv_gnu_library_2_1+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "Lucky GNU user" >/dev/null 2>&1; then + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* + + + +fi +echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 +echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6 + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + + + + + + + + + + +for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + + + + + + + + + + + +for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \ +getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ +strdup strtoul tsearch __argz_count __argz_stringify __argz_next +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + +fi; + + echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6 +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6 + if test "$am_cv_func_iconv" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + if test "${am_cv_proto_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_proto_iconv_arg1="" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +am_cv_proto_iconv_arg1="const" +fi +rm -f conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + echo "$as_me:$LINENO: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +echo "${ECHO_T}${ac_t:- + }$am_cv_proto_iconv" >&6 + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + LIBICONV= + if test "$am_cv_lib_iconv" = yes; then + LIBICONV="-liconv" + fi + + + + echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 +if test "${am_cv_langinfo_codeset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +char* cs = nl_langinfo(CODESET); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_langinfo_codeset=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +am_cv_langinfo_codeset=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 + if test $am_cv_langinfo_codeset = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LANGINFO_CODESET 1 +_ACEOF + + fi + + if test $ac_cv_header_locale_h = yes; then + echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 +if test "${am_cv_val_LC_MESSAGES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_val_LC_MESSAGES=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +am_cv_val_LC_MESSAGES=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 +echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 + if test $am_cv_val_LC_MESSAGES = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LC_MESSAGES 1 +_ACEOF + + fi + fi + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 + + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + INTLLIBS= + + if test "$USE_NLS" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 +echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 + +# Check whether --with-included-gettext or --without-included-gettext was given. +if test "${with_included_gettext+set}" = set; then + withval="$with_included_gettext" + nls_cv_force_use_gnu_gettext=$withval +else + nls_cv_force_use_gnu_gettext=no +fi; + echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 +echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + CATOBJEXT=NONE + + + + + if test "${ac_cv_header_libintl_h+set}" = set; then + echo "$as_me:$LINENO: checking for libintl.h" >&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking libintl.h usability" >&5 +echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking libintl.h presence" >&5 +echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for libintl.h" >&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_libintl_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 + +fi +if test $ac_cv_header_libintl_h = yes; then + echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 +echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 +if test "${gt_cv_func_gnugettext1_libc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +extern int _nl_msg_cat_cntr; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_func_gnugettext1_libc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +gt_cv_func_gnugettext1_libc=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 + + if test "$gt_cv_func_gnugettext1_libc" != "yes"; then + echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 +echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 +if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +extern int _nl_msg_cat_cntr; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gt_cv_func_gnugettext1_libintl=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +gt_cv_func_gnugettext1_libintl=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 + fi + + if test "$gt_cv_func_gnugettext1_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETTEXT 1 +_ACEOF + + + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + INTLLIBS="-lintl $LIBICONV" + fi + + gt_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + +for ac_func in dcgettext +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + LIBS="$gt_save_LIBS" + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT + +if test -n "$GMSGFMT"; then + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + CATOBJEXT=.gmo + fi + +fi + + + + if test "$CATOBJEXT" = "NONE"; then + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + INTLOBJS="\$(GETTOBJS)" + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT + +if test -n "$GMSGFMT"; then + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then + : ; + else + echo "$as_me:$LINENO: result: found msgfmt program is not GNU msgfmt; ignore it" >&5 +echo "${ECHO_T}found msgfmt program is not GNU msgfmt; ignore it" >&6 + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then + : ; + else + echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT=":" + fi + fi + + POSUB=po + fi + ac_config_commands="$ac_config_commands default-2" + + + + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi + + for ac_prog in bison +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_INTLBISON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$INTLBISON"; then + ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_INTLBISON="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +INTLBISON=$ac_cv_prog_INTLBISON +if test -n "$INTLBISON"; then + echo "$as_me:$LINENO: result: $INTLBISON" >&5 +echo "${ECHO_T}$INTLBISON" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$INTLBISON" && break +done + + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + echo "$as_me:$LINENO: checking version of bison" >&5 +echo $ECHO_N "checking version of bison... $ECHO_C" >&6 + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + echo "$as_me:$LINENO: result: $ac_prog_version" >&5 +echo "${ECHO_T}$ac_prog_version" >&6 + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + + + + + + + + + + + nls_cv_header_intl= + nls_cv_header_libgt= + + DATADIRNAME=share + + + INSTOBJEXT=.mo + + + GENCAT=gencat + + + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + INTL_LIBTOOL_SUFFIX_PREFIX= + + + + + echo "$as_me:$LINENO: checking for dos file convention" >&5 +echo $ECHO_N "checking for dos file convention... $ECHO_C" >&6 +if test "${ac_cv_dosfile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -d ".\."; then + ac_cv_dosfile=yes + else + ac_cv_dosfile=no + fi + +fi +echo "$as_me:$LINENO: result: $ac_cv_dosfile" >&5 +echo "${ECHO_T}$ac_cv_dosfile" >&6 + + if test $ac_cv_dosfile = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOS_FILE_NAMES 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOS_FILE_CONTENTS 1 +_ACEOF + + fi + + +case $host_os in + *cygwin* ) CYGWIN=yes;; + * ) CYGWIN=no;; +esac + +case $host_os in + *mingw32* ) MINGW32=yes;; + * ) MINGW32=no;; +esac + +echo "$as_me:$LINENO: checking for DJGPP environment" >&5 +echo $ECHO_N "checking for DJGPP environment... $ECHO_C" >&6 +if test "${ac_cv_djgpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + return __DJGPP__; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_djgpp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_djgpp=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest* +fi +echo "$as_me:$LINENO: result: $ac_cv_djgpp" >&5 +echo "${ECHO_T}$ac_cv_djgpp" >&6 +DJ_GPP= +test "$ac_cv_djgpp" = yes && DJ_GPP=yes + + + +echo "$as_me:$LINENO: checking for environ variable separator" >&5 +echo $ECHO_N "checking for environ variable separator... $ECHO_C" >&6 +if test "${ac_cv_sep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$DJ_GPP" = yes ; then + ac_cv_sep=yes +else + ac_cv_sep=no +fi +fi + +SEP=":" +test x"$ac_cv_sep" = xyes && SEP=";" +echo "$as_me:$LINENO: result: ${SEP}" >&5 +echo "${ECHO_T}${SEP}" >&6 + + + + + + + + + # Assume we'll default to using the included regex.c. + ac_use_included_regex=yes + + # However, if the system regex support is good enough that it passes the + # the following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. The first failing regular expression is from `Spencer ere + # test #75' in grep-2.3. + echo "$as_me:$LINENO: checking for working re_compile_pattern" >&5 +echo $ECHO_N "checking for working re_compile_pattern... $ECHO_C" >&6 +if test "${jm_cv_func_working_re_compile_pattern+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + jm_cv_func_working_re_compile_pattern=no +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#include +#include + int + main () + { + static struct re_pattern_buffer regex; + const char *s; + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + /* Add this third left square bracket, , to balance the + three right ones below. Otherwise autoconf-2.14 chokes. */ + s = re_compile_pattern ("a[[:]:]b\n", 9, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + exit (1); + + /* This should succeed, but doesn't for e.g. glibc-2.1.3. */ + s = re_compile_pattern ("{1", 2, ®ex); + + exit (s ? 1 : 0); + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + jm_cv_func_working_re_compile_pattern=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +jm_cv_func_working_re_compile_pattern=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $jm_cv_func_working_re_compile_pattern" >&5 +echo "${ECHO_T}$jm_cv_func_working_re_compile_pattern" >&6 + if test $jm_cv_func_working_re_compile_pattern = yes; then + ac_use_included_regex=no + fi + + test -n "lib/regex.c" || { { echo "$as_me:$LINENO: error: missing argument" >&5 +echo "$as_me: error: missing argument" >&2;} + { (exit 1); exit 1; }; } + + + + +# Check whether --with-included-regex or --without-included-regex was given. +if test "${with_included_regex+set}" = set; then + withval="$with_included_regex" + jm_with_regex=$withval +else + jm_with_regex=$ac_use_included_regex +fi; + if test "$jm_with_regex" = yes; then + LIBOBJS="$LIBOBJS regex.$ac_objext" + fi + + + + +echo "$as_me:$LINENO: checking for getopt_long" >&5 +echo $ECHO_N "checking for getopt_long... $ECHO_C" >&6 +if test "${ac_cv_func_getopt_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getopt_long (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getopt_long (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_getopt_long) || defined (__stub___getopt_long) +choke me +#else +f = getopt_long; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_getopt_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_getopt_long=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_getopt_long" >&5 +echo "${ECHO_T}$ac_cv_func_getopt_long" >&6 +if test $ac_cv_func_getopt_long = yes; then + + +# Check whether --with-included-getopt or --without-included-getopt was given. +if test "${with_included_getopt+set}" = set; then + withval="$with_included_getopt" + with_getopt=$withval +else + with_getopt=$no +fi; + if test "x$with_getopt" = xyes; then + LIBOBJS="$LIBOBJS getopt.$ac_objext" + LIBOBJS="$LIBOBJS getopt1.$ac_objext" + fi + +else + + LIBOBJS="$LIBOBJS getopt.$ac_objext" + LIBOBJS="$LIBOBJS getopt1.$ac_objext" + +fi + + +if test "$jm_with_regex" = no; then + { echo "$as_me:$LINENO: WARNING: Included lib/regex.c not used" >&5 +echo "$as_me: WARNING: Included lib/regex.c not used" >&2;} +fi + + + echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 +echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 + if test "${jm_cv_func_decl_strerror_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + +#ifndef strerror_r +char *(*pfn) = (char *(*)) strerror_r +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "jm_cv_func_decl_strerror_r=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "jm_cv_func_decl_strerror_r=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi + + + if eval "test \"`echo '$jm_cv_func_decl_'strerror_r`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + +test $jm_cv_func_decl_strerror_r != yes + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R $? +_ACEOF + + +for ac_func in strerror_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test $ac_cv_func_strerror_r = yes; then + +for ac_header in string.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + echo "$as_me:$LINENO: checking for working strerror_r" >&5 +echo $ECHO_N "checking for working strerror_r... $ECHO_C" >&6 +if test "${ac_cv_func_strerror_r_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +# include +# if HAVE_STRING_H +# include +# endif + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_works=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_strerror_r_works=no + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_func_strerror_r_works = no; then + # strerror_r seems not to work, but now we have to choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns int. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then + ac_cv_func_strerror_r_works=no +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +# include +# include +# include + + extern char *strerror_r (); + + int + main () + { + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + exit (!isalpha (x)); + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_func_strerror_r_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + fi + +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_works" >&5 +echo "${ECHO_T}$ac_cv_func_strerror_r_works" >&6 + if test $ac_cv_func_strerror_r_works = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_STRERROR_R 1 +_ACEOF + + fi +fi + + + + + + +for ac_func in strerror strerror_r vprintf doprnt +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + +cat >>confdefs.h <<_ACEOF +#define HAVE_DONE_WORKING_MALLOC_CHECK 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for working malloc" >&5 +echo $ECHO_N "checking for working malloc... $ECHO_C" >&6 +if test "${jm_cv_func_working_malloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + jm_cv_func_working_malloc=no +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + + char *malloc (); + int + main () + { + exit (malloc (0) ? 0 : 1); + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + jm_cv_func_working_malloc=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +jm_cv_func_working_malloc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:$LINENO: result: $jm_cv_func_working_malloc" >&5 +echo "${ECHO_T}$jm_cv_func_working_malloc" >&6 + if test $jm_cv_func_working_malloc = no; then + LIBOBJS="$LIBOBJS malloc.$ac_objext" + +cat >>confdefs.h <<_ACEOF +#define malloc rpl_malloc +_ACEOF + + fi + + + +cat >>confdefs.h <<_ACEOF +#define HAVE_DONE_WORKING_REALLOC_CHECK 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for working realloc" >&5 +echo $ECHO_N "checking for working realloc... $ECHO_C" >&6 +if test "${jm_cv_func_working_realloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + jm_cv_func_working_realloc=no +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + + char *realloc (); + int + main () + { + exit (realloc (0, 0) ? 0 : 1); + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + jm_cv_func_working_realloc=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +jm_cv_func_working_realloc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:$LINENO: result: $jm_cv_func_working_realloc" >&5 +echo "${ECHO_T}$jm_cv_func_working_realloc" >&6 + if test $jm_cv_func_working_realloc = no; then + LIBOBJS="$LIBOBJS realloc.$ac_objext" + +cat >>confdefs.h <<_ACEOF +#define realloc rpl_realloc +_ACEOF + + fi + + +# support for pcre +if test x"$testpcre" = x"yes"; then + if pcre-config --cflags >/dev/null 2>&1; then + CFLAGS="$CFLAGS `pcre-config --cflags`" + LIBS="$LIBS `pcre-config --libs`" + fi + +echo "$as_me:$LINENO: checking for pcre_exec in -lpcre" >&5 +echo $ECHO_N "checking for pcre_exec in -lpcre... $ECHO_C" >&6 +if test "${ac_cv_lib_pcre_pcre_exec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcre $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pcre_exec (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +pcre_exec (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pcre_pcre_exec=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_pcre_pcre_exec=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pcre_pcre_exec" >&5 +echo "${ECHO_T}$ac_cv_lib_pcre_pcre_exec" >&6 +if test $ac_cv_lib_pcre_pcre_exec = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCRE 1 +_ACEOF + + LIBS="-lpcre $LIBS" + +fi + +fi + +echo "$as_me:$LINENO: checking How to create links" >&5 +echo $ECHO_N "checking How to create links... $ECHO_C" >&6 +rm -f test00 test01 +touch test00 +ln -s test00 test01 || : +SYMLINK="" +SYMLINKFROM="grep" +if test -L test01; then + SYMLINK="ln -s" +else + SYMLINKFROM="${bindir}/grep" + rm -f test01 + ln test00 test01 || : + if test -e test01; then + SYMLINK="ln" + else + SYMLINK="cp" + fi +fi +echo "$as_me:$LINENO: result: $SYMLINK" >&5 +echo "${ECHO_T}$SYMLINK" >&6 + + +rm -f test00 test01 + +ac_config_files="$ac_config_files Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile" +ac_config_commands="$ac_config_commands default" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.53. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.53, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" + exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" +ac_aux_dir="$ac_aux_dir" + + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "lib/posix/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/posix/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "intl/Makefile" ) CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; + "vms/Makefile" ) CONFIG_FILES="$CONFIG_FILES vms/Makefile" ;; + "bootstrap/Makefile" ) CONFIG_FILES="$CONFIG_FILES bootstrap/Makefile" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "default-2" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-2" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@GETCONF@,$GETCONF,;t t +s,@ac_ct_GETCONF@,$ac_ct_GETCONF,;t t +s,@CPP@,$CPP,;t t +s,@U@,$U,;t t +s,@ANSI2KNR@,$ANSI2KNR,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@GLIBC21@,$GLIBC21,;t t +s,@LIBICONV@,$LIBICONV,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@INTLBISON@,$INTLBISON,;t t +s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t +s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t +s,@GMOFILES@,$GMOFILES,;t t +s,@INTLLIBS@,$INTLLIBS,;t t +s,@INTLOBJS@,$INTLOBJS,;t t +s,@POFILES@,$POFILES,;t t +s,@POSUB@,$POSUB,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@GENCAT@,$GENCAT,;t t +s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t +s,@SEP@,$SEP,;t t +s,@SYMLINK@,$SYMLINK,;t t +s,@SYMLINKFROM@,$SYMLINKFROM,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi + # Run the commands associated with the file. + case $ac_file in + config.h ) # update the timestamp +echo timestamp >"./stamp-h1" + ;; + esac +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + default-1 ) +test x"$AMDEP_TRUE" != x"" || +for mf in $CONFIG_FILES; do + case "$mf" in + Makefile) dirpart=.;; + */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; + *) continue;; + esac + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # 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 -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //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=`echo "$file" | sed -e 's|/[^/]*$||'` + $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + default-2 ) for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done ;; + default ) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/src/apps/bin/grep-2.5/configure.in b/src/apps/bin/grep-2.5/configure.in new file mode 100644 index 0000000000..6f2a0a3020 --- /dev/null +++ b/src/apps/bin/grep-2.5/configure.in @@ -0,0 +1,168 @@ +# Configuration for grep +# +# Alain Magloire +# Bernhard Rosenkraenzer +# +dnl Process this file with autoconf to produce a configure script +AC_INIT(src/grep.c) +AC_DEFINE(GREP, 1, [We are building grep]) +AC_PREREQ(2.13) + +dnl Automake stuff. +AM_INIT_AUTOMAKE(grep, 2.5) +AM_CONFIG_HEADER(config.h:config.hin) + +dnl Check for arguments +AC_ARG_ENABLE(perl-regexp, + [ --disable-perl-regexp disable perl-regexp], + [case "${enableval}" in + yes) testpcre=yes ;; + no) testpcre=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-perl-regexp) ;; + esac],[testpcre=yes]) + +dnl Checks for programs. +AC_CANONICAL_HOST +AC_PROG_AWK +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_RANLIB + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_SYS_LARGEFILE +AM_C_PROTOTYPES +AC_TYPE_SIZE_T +AC_CHECK_TYPE(ssize_t, int) +AC_C_CONST +jm_AC_TYPE_UINTMAX_T + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(string.h stdlib.h sys/param.h memory.h unistd.h libintl.h) +AC_CHECK_HEADERS(wctype.h wchar.h) +AC_HEADER_DIRENT +AC_HEADER_STAT +AC_MBSTATE_T + +dnl Checks for functions. +AC_FUNC_ALLOCA +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_MMAP + +dnl getpagesize is checked for by AC_FUNC_MMAP. +AC_CHECK_FUNCS(btowc isascii memmove setmode strerror wctype mbrtowc) +AC_REPLACE_FUNCS(memchr stpcpy strtoul atexit fnmatch) +jm_AC_PREREQ_XSTRTOUMAX + +dnl Replace this with jm_CHECK_DECLS once autoconf 2.15 is out. +jm_CHECK_DECLARATIONS([#include ], [strtoul strtoull]) +test $jm_cv_func_decl_strtoul != yes +AC_DEFINE_UNQUOTED([HAVE_DECL_STRTOUL], $?, + [Define if declares strtoul.]) +test $jm_cv_func_decl_strtoull != yes +AC_DEFINE_UNQUOTED([HAVE_DECL_STRTOULL], $?, + [Define if declares strtoull.]) + +dnl for VC++ +case "$ac_cv_prog_CC" in + cl*) AC_DEFINE([alloca], _alloca, [Define if your compiler is broken]) ;; + *) ;; +esac + +dnl I18N feature +ALL_LINGUAS="cs de el eo es et fr gl hr id it ja ko nl no pl pt_BR ru sl sv" +AM_GNU_GETTEXT + +dnl DOS file name convention +dnl sets HAVE_DOS_FILE_NAMES +AC_DOSFILE + +dnl check for the environ separator +dnl sets SEP +AM_SEP + +dnl OS specifics +dnl sets {EXE,OBJ}EXT +AC_EXEEXT +dnl Invoke the (capitalized) ac_objext macro without spelling its name. +dnl This works around a bug in automake 1.4 with ansi2knr. +dnl Automake looks for (capitalized) ac_objext by grepping for it, +dnl so it won't find it in this file. +ifelse(,, [AC][_OBJEXT]) + +dnl some folks ask for this, that's fine by me +dnl hope they know what they're doing ... +dnl if glibc2 regex is not included + +dnl Many GNU/Linux people have different +dnl glibc versions with buggy regex. +jm_INCLUDED_REGEX(lib/regex.c) + +dnl Many people on non-GNU/Linux systems don't have getopt +AC_CHECK_FUNC(getopt_long, + [ + AC_ARG_WITH(included-getopt, + [ --with-included-getopt Use the included getopt rather than glibc's], + with_getopt=$withval, + with_getopt=$no) + if test "x$with_getopt" = xyes; then + AC_LIBOBJ(getopt) + AC_LIBOBJ(getopt1) + fi + ], + [ + AC_LIBOBJ(getopt) + AC_LIBOBJ(getopt1) + ]) + +dnl Some installers want to be informed if we do not use our regex. +dnl For example, if the host platform uses dynamic linking and the installer +dnl knows that the grep may be invoked on other hosts with buggy libraries, +dnl then the installer should configure --with-included-regex. +if test "$jm_with_regex" = no; then + AC_MSG_WARN(Included lib/regex.c not used) +fi + +dnl These are the prerequisite macros for GNU's error.c file. +AC_FUNC_STRERROR_R +jm_PREREQ_ERROR + +dnl Determine whether malloc accepts 0 as its argument. +dnl If it doesn't, arrange to use the replacement function. +jm_FUNC_MALLOC +jm_FUNC_REALLOC + +# support for pcre +if test x"$testpcre" = x"yes"; then + if pcre-config --cflags >/dev/null 2>&1; then + CFLAGS="$CFLAGS `pcre-config --cflags`" + LIBS="$LIBS `pcre-config --libs`" + fi + AC_CHECK_LIB(pcre, pcre_exec) +fi + +dnl Check how to create the {e,f}grep links +AC_MSG_CHECKING([How to create links]) +rm -f test00 test01 +touch test00 +ln -s test00 test01 || : +SYMLINK="" +SYMLINKFROM="grep" +if test -L test01; then + SYMLINK="ln -s" +else + SYMLINKFROM="${bindir}/grep" + rm -f test01 + ln test00 test01 || : + if test -e test01; then + SYMLINK="ln" + else + SYMLINK="cp" + fi +fi +AC_MSG_RESULT($SYMLINK) +AC_SUBST(SYMLINK) +AC_SUBST(SYMLINKFROM) +rm -f test00 test01 + +AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h]) diff --git a/src/apps/bin/grep-2.5/depcomp b/src/apps/bin/grep-2.5/depcomp new file mode 100755 index 0000000000..65899658ee --- /dev/null +++ b/src/apps/bin/grep-2.5/depcomp @@ -0,0 +1,411 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 AIX compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + + tmpdepfile1="$object.d" + tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` + if test "$libtool" = yes; then + "$@" -Wc,-MD + else + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + test -z "$dashmflag" && dashmflag=-M + ( IFS=" " + case " $* " in + *" --mode=compile "*) # this is libtool, let us make it quiet + for arg + do # cycle over the arguments + case "$arg" in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + # X makedepend + ( + shift + cleared=no + for arg in "$@"; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tail +3 "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/src/apps/bin/grep-2.5/doc/Makefile b/src/apps/bin/grep-2.5/doc/Makefile new file mode 100644 index 0000000000..7759612d3f --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/Makefile @@ -0,0 +1,402 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/grep +pkglibdir = $(libdir)/grep +pkgincludedir = $(includedir)/grep +top_builddir = .. + +ACLOCAL = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal +AUTOCONF = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf +AUTOMAKE = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake +AUTOHEADER = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader + +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i586-pc-beos +AMTAR = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar +AWK = gawk +BUILD_INCLUDED_LIBINTL = yes +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +CC = gcc +CPP = gcc -E +DATADIRNAME = share +DEPDIR = .deps +EXEEXT = +GENCAT = gencat +GETCONF = +GLIBC21 = no +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +GMSGFMT = : +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INSTOBJEXT = .mo +INTLBISON = bison +INTLLIBS = $(top_builddir)/intl/libintl.a +INTLOBJS = $(GETTOBJS) +INTL_LIBTOOL_SUFFIX_PREFIX = +LIBICONV = +MKINSTALLDIRS = ./mkinstalldirs +MSGFMT = : +OBJEXT = o +PACKAGE = grep +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +POSUB = po +RANLIB = ranlib +SEP = : +SYMLINK = ln -s +SYMLINKFROM = grep +U = +USE_INCLUDED_LIBINTL = yes +USE_NLS = yes +VERSION = 2.5 +am__include = include +am__quote = +install_sh = /boot/home/Development/current/src/apps/bin/grep-2.5/install-sh + +AUTOMAKE_OPTIONS = no-dependencies + +info_TEXINFOS = grep.texi + +man_MANS = grep.1 fgrep.1 egrep.1 + +EXTRA_DIST = grep.1 egrep.man fgrep.man + +CLEANFILES = egrep.1 fgrep.1 +subdir = doc +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +DIST_SOURCES = +INFO_DEPS = grep.info +DVIS = grep.dvi +TEXINFOS = grep.texi + +NROFF = nroff +MANS = $(man_MANS) +DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \ + version.texi +all: all-am + +.SUFFIXES: +.SUFFIXES: .dvi .info .ps .texi +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +$(srcdir)/version.texi: $(srcdir)/stamp-vti + @: +$(srcdir)/stamp-vti: grep.texi $(top_srcdir)/configure.in + @(set `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/grep.texi`; \ + 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 + +grep.info: grep.texi $(srcdir)/version.texi +grep.dvi: grep.texi $(srcdir)/version.texi + +.texi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ + `echo $< | sed 's,.*/,,'` + +.texi.dvi: + TEXINPUTS=$(srcdir):$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $< + +.texi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ + `echo $< | sed 's,.*/,,'` + +MAKEINFO = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run makeinfo +TEXI2DVI = texi2dvi +DVIPS = dvips +.dvi.ps: + $(DVIPS) $< -o $@ + +uninstall-info-am: + $(PRE_UNINSTALL) + @if (install-info --version && \ + install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \ + install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (if cd $(DESTDIR)$(infodir); then \ + echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \ + rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \ + else :; fi); \ + done + +dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + d=$(srcdir); \ + for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done; \ + done + +mostlyclean-aminfo: + -rm -f grep.aux grep.cp grep.cps grep.dvi grep.fn grep.fns grep.ky grep.log \ + grep.op grep.pg grep.ps grep.toc grep.tp grep.vr + +maintainer-clean-aminfo: + cd $(srcdir) && \ + for i in $(INFO_DEPS); do \ + rm -f $$i; \ + if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ + rm -f $$i-[0-9]*; \ + fi; \ + done + +man1dir = $(mandir)/man1 +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(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/^.*\\.//'`; \ + 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/^.*\\.//'`; \ + 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: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || 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: + $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir) + +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)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: $(DVIS) + +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) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + d=$(srcdir); \ + for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + done; \ + else : ; fi +install-man: install-man1 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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 + +uninstall-am: uninstall-info-am uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: all all-am check check-am clean clean-generic dist-info \ + distclean distclean-generic distdir dvi dvi-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-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 \ + uninstall uninstall-am uninstall-info-am uninstall-man \ + uninstall-man1 + + +fgrep.1: fgrep.man + inst=`echo "grep" | sed '$(transform)'`.1; \ +sed -e "s%@grep@%$$inst%g" $(srcdir)/fgrep.man > $@ + +egrep.1: egrep.man + inst=`echo "grep" | sed '$(transform)'`.1; \ +sed -e "s%@grep@%$$inst%g" $(srcdir)/egrep.man > $@ +# 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: diff --git a/src/apps/bin/grep-2.5/doc/Makefile.am b/src/apps/bin/grep-2.5/doc/Makefile.am new file mode 100644 index 0000000000..b93d96c35a --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/Makefile.am @@ -0,0 +1,18 @@ +## Process this file with automake to create Makefile.in +AUTOMAKE_OPTIONS=no-dependencies + +info_TEXINFOS = grep.texi + +man_MANS = grep.1 fgrep.1 egrep.1 + +EXTRA_DIST = grep.1 egrep.man fgrep.man + +CLEANFILES = egrep.1 fgrep.1 + +fgrep.1: fgrep.man + inst=`echo "grep" | sed '$(transform)'`.1; \ +sed -e "s%@grep@%$$inst%g" $(srcdir)/fgrep.man > $@ + +egrep.1: egrep.man + inst=`echo "grep" | sed '$(transform)'`.1; \ +sed -e "s%@grep@%$$inst%g" $(srcdir)/egrep.man > $@ diff --git a/src/apps/bin/grep-2.5/doc/Makefile.in b/src/apps/bin/grep-2.5/doc/Makefile.in new file mode 100644 index 0000000000..fc69dce238 --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/Makefile.in @@ -0,0 +1,402 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GETCONF = @GETCONF@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SEP = @SEP@ +SYMLINK = @SYMLINK@ +SYMLINKFROM = @SYMLINKFROM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AUTOMAKE_OPTIONS = no-dependencies + +info_TEXINFOS = grep.texi + +man_MANS = grep.1 fgrep.1 egrep.1 + +EXTRA_DIST = grep.1 egrep.man fgrep.man + +CLEANFILES = egrep.1 fgrep.1 +subdir = doc +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +DIST_SOURCES = +INFO_DEPS = grep.info +DVIS = grep.dvi +TEXINFOS = grep.texi + +NROFF = nroff +MANS = $(man_MANS) +DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \ + version.texi +all: all-am + +.SUFFIXES: +.SUFFIXES: .dvi .info .ps .texi +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +$(srcdir)/version.texi: $(srcdir)/stamp-vti + @: +$(srcdir)/stamp-vti: grep.texi $(top_srcdir)/configure.in + @(set `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/grep.texi`; \ + 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 + +grep.info: grep.texi $(srcdir)/version.texi +grep.dvi: grep.texi $(srcdir)/version.texi + +.texi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ + `echo $< | sed 's,.*/,,'` + +.texi.dvi: + TEXINPUTS=$(srcdir):$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $< + +.texi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ + `echo $< | sed 's,.*/,,'` + +MAKEINFO = @MAKEINFO@ +TEXI2DVI = texi2dvi +DVIPS = dvips +.dvi.ps: + $(DVIPS) $< -o $@ + +uninstall-info-am: + $(PRE_UNINSTALL) + @if (install-info --version && \ + install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \ + install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (if cd $(DESTDIR)$(infodir); then \ + echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \ + rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \ + else :; fi); \ + done + +dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + d=$(srcdir); \ + for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done; \ + done + +mostlyclean-aminfo: + -rm -f grep.aux grep.cp grep.cps grep.dvi grep.fn grep.fns grep.ky grep.log \ + grep.op grep.pg grep.ps grep.toc grep.tp grep.vr + +maintainer-clean-aminfo: + cd $(srcdir) && \ + for i in $(INFO_DEPS); do \ + rm -f $$i; \ + if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ + rm -f $$i-[0-9]*; \ + fi; \ + done + +man1dir = $(mandir)/man1 +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(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/^.*\\.//'`; \ + 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/^.*\\.//'`; \ + 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: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || 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: + $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir) + +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)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: $(DVIS) + +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) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + d=$(srcdir); \ + for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + done; \ + else : ; fi +install-man: install-man1 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +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 + +uninstall-am: uninstall-info-am uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: all all-am check check-am clean clean-generic dist-info \ + distclean distclean-generic distdir dvi dvi-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-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 \ + uninstall uninstall-am uninstall-info-am uninstall-man \ + uninstall-man1 + + +fgrep.1: fgrep.man + inst=`echo "grep" | sed '$(transform)'`.1; \ +sed -e "s%@grep@%$$inst%g" $(srcdir)/fgrep.man > $@ + +egrep.1: egrep.man + inst=`echo "grep" | sed '$(transform)'`.1; \ +sed -e "s%@grep@%$$inst%g" $(srcdir)/egrep.man > $@ +# 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: diff --git a/src/apps/bin/grep-2.5/doc/egrep.1 b/src/apps/bin/grep-2.5/doc/egrep.1 new file mode 100644 index 0000000000..6a74c5d10b --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/egrep.1 @@ -0,0 +1 @@ +.so man1/grep.1 diff --git a/src/apps/bin/grep-2.5/doc/egrep.man b/src/apps/bin/grep-2.5/doc/egrep.man new file mode 100644 index 0000000000..877a8a89d7 --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/egrep.man @@ -0,0 +1 @@ +.so man1/@grep@ diff --git a/src/apps/bin/grep-2.5/doc/fgrep.1 b/src/apps/bin/grep-2.5/doc/fgrep.1 new file mode 100644 index 0000000000..6a74c5d10b --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/fgrep.1 @@ -0,0 +1 @@ +.so man1/grep.1 diff --git a/src/apps/bin/grep-2.5/doc/fgrep.man b/src/apps/bin/grep-2.5/doc/fgrep.man new file mode 100644 index 0000000000..877a8a89d7 --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/fgrep.man @@ -0,0 +1 @@ +.so man1/@grep@ diff --git a/src/apps/bin/grep-2.5/doc/grep.1 b/src/apps/bin/grep-2.5/doc/grep.1 new file mode 100644 index 0000000000..cbcf458cab --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/grep.1 @@ -0,0 +1,782 @@ +.\" grep man page +.if !\n(.g \{\ +. if !\w|\*(lq| \{\ +. ds lq `` +. if \w'\(lq' .ds lq "\(lq +. \} +. if !\w|\*(rq| \{\ +. ds rq '' +. if \w'\(rq' .ds rq "\(rq +. \} +.\} +.de Id +.ds Dt \\$4 +.. +.Id $Id: grep.1,v 1.1 2004/03/02 02:37:05 michaelphipps Exp $ +.TH GREP 1 \*(Dt "GNU Project" +.SH NAME +grep, egrep, fgrep \- print lines matching a pattern +.SH SYNOPSIS +.B grep +.RI [ options ] +.I PATTERN +.RI [ FILE .\|.\|.] +.br +.B grep +.RI [ options ] +.RB [ \-e +.I PATTERN +| +.B \-f +.IR FILE ] +.RI [ FILE .\|.\|.] +.SH DESCRIPTION +.PP +.B Grep +searches the named input +.IR FILE s +(or standard input if no files are named, or +the file name +.B \- +is given) +for lines containing a match to the given +.IR PATTERN . +By default, +.B grep +prints the matching lines. +.PP +In addition, two variant programs +.B egrep +and +.B fgrep +are available. +.B Egrep +is the same as +.BR "grep\ \-E" . +.B Fgrep +is the same as +.BR "grep\ \-F" . +.SH OPTIONS +.TP +.BI \-A " NUM" "\fR,\fP \-\^\-after-context=" NUM +Print +.I NUM +lines of trailing context after matching lines. +Places a line containing +.B \-\^\- +between contiguous groups of matches. +.TP +.BR \-a ", " \-\^\-text +Process a binary file as if it were text; this is equivalent to the +.B \-\^\-binary-files=text +option. +.TP +.BI \-B " NUM" "\fR,\fP \-\^\-before-context=" NUM +Print +.I NUM +lines of leading context before matching lines. +Places a line containing +.B \-\^\- +between contiguous groups of matches. +.TP +.BI \-C " NUM" "\fR,\fP \-\^\-context=" NUM +Print +.I NUM +lines of output context. +Places a line containing +.B \-\^\- +between contiguous groups of matches. +.TP +.BR \-b ", " \-\^\-byte-offset +Print the byte offset within the input file before +each line of output. +.TP +.BI \-\^\-binary-files= TYPE +If the first few bytes of a file indicate that the file contains binary +data, assume that the file is of type +.IR TYPE . +By default, +.I TYPE +is +.BR binary , +and +.B grep +normally outputs either +a one-line message saying that a binary file matches, or no message if +there is no match. +If +.I TYPE +is +.BR without-match , +.B grep +assumes that a binary file does not match; this is equivalent to the +.B \-I +option. +If +.I TYPE +is +.BR text , +.B grep +processes a binary file as if it were text; this is equivalent to the +.B \-a +option. +.I Warning: +.B "grep \-\^\-binary-files=text" +might output binary garbage, +which can have nasty side effects if the output is a terminal and if the +terminal driver interprets some of it as commands. +.TP +.BI \-\^\-colour[=\fIWHEN\fR] ", " \-\^\-color[=\fIWHEN\fR] +Surround the matching string with the marker find in +.B GREP_COLOR +environment variable. WHEN may be `never', `always', or `auto' +.TP +.BR \-c ", " \-\^\-count +Suppress normal output; instead print a count of +matching lines for each input file. +With the +.BR \-v ", " \-\^\-invert-match +option (see below), count non-matching lines. +.TP +.BI \-D " ACTION" "\fR,\fP \-\^\-devices=" ACTION +If an input file is a device, FIFO or socket, use +.I ACTION +to process it. By default, +.I ACTION +is +.BR read , +which means that devices are read just as if they were ordinary files. +If +.I ACTION +is +.BR skip , +devices are silently skipped. +.TP +.BI \-d " ACTION" "\fR,\fP \-\^\-directories=" ACTION +If an input file is a directory, use +.I ACTION +to process it. By default, +.I ACTION +is +.BR read , +which means that directories are read just as if they were ordinary files. +If +.I ACTION +is +.BR skip , +directories are silently skipped. +If +.I ACTION +is +.BR recurse , +.B grep +reads all files under each directory, recursively; +this is equivalent to the +.B \-r +option. +.TP +.BR \-E ", " \-\^\-extended-regexp +Interpret +.I PATTERN +as an extended regular expression (see below). +.TP +.BI \-e " PATTERN" "\fR,\fP \-\^\-regexp=" PATTERN +Use +.I PATTERN +as the pattern; useful to protect patterns beginning with +.BR \- . +.TP +.BR \-F ", " \-\^\-fixed-strings +Interpret +.I PATTERN +as a list of fixed strings, separated by newlines, +any of which is to be matched. +.BR \-P ", " \-\^\-perl-regexp +Interpret +.I PATTERN +as a Perl regular expression. +.TP +.BI \-f " FILE" "\fR,\fP \-\^\-file=" FILE +Obtain patterns from +.IR FILE , +one per line. +The empty file contains zero patterns, and therefore matches nothing. +.TP +.BR \-G ", " \-\^\-basic-regexp +Interpret +.I PATTERN +as a basic regular expression (see below). This is the default. +.TP +.BR \-H ", " \-\^\-with-filename +Print the filename for each match. +.TP +.BR \-h ", " \-\^\-no-filename +Suppress the prefixing of filenames on output +when multiple files are searched. +.TP +.B \-\^\-help +Output a brief help message. +.TP +.BR \-I +Process a binary file as if it did not contain matching data; this is +equivalent to the +.B \-\^\-binary-files=without-match +option. +.TP +.BR \-i ", " \-\^\-ignore-case +Ignore case distinctions in both the +.I PATTERN +and the input files. +.TP +.BR \-L ", " \-\^\-files-without-match +Suppress normal output; instead print the name +of each input file from which no output would +normally have been printed. The scanning will stop +on the first match. +.TP +.BR \-l ", " \-\^\-files-with-matches +Suppress normal output; instead print +the name of each input file from which output +would normally have been printed. The scanning will +stop on the first match. +.TP +.BI \-m " NUM" "\fR,\fP \-\^\-max-count=" NUM +Stop reading a file after +.I NUM +matching lines. If the input is standard input from a regular file, +and +.I NUM +matching lines are output, +.B grep +ensures that the standard input is positioned to just after the last +matching line before exiting, regardless of the presence of trailing +context lines. This enables a calling process to resume a search. +When +.B grep +stops after +.I NUM +matching lines, it outputs any trailing context lines. When the +.B \-c +or +.B \-\^\-count +option is also used, +.B grep +does not output a count greater than +.IR NUM . +When the +.B \-v +or +.B \-\^\-invert-match +option is also used, +.B grep +stops after outputting +.I NUM +non-matching lines. +.TP +.B \-\^\-mmap +If possible, use the +.BR mmap (2) +system call to read input, instead of +the default +.BR read (2) +system call. In some situations, +.B \-\^\-mmap +yields better performance. However, +.B \-\^\-mmap +can cause undefined behavior (including core dumps) +if an input file shrinks while +.B grep +is operating, or if an I/O error occurs. +.TP +.BR \-n ", " \-\^\-line-number +Prefix each line of output with the line number +within its input file. +.TP +.BR \-o ", " \-\^\-only-matching +Show only the part of a matching line that matches +.I PATTERN. +.TP +.BI \-\^\-label= LABEL +Displays input actually coming from standard input as input coming from file +.I LABEL. +This is especially useful for tools like zgrep, e.g. +.B "gzip -cd foo.gz |grep --label=foo something" +.TP +.BR \-\^\-line-buffering +Use line buffering, it can be a performance penality. +.TP +.BR \-q ", " \-\^\-quiet ", " \-\^\-silent +Quiet; do not write anything to standard output. +Exit immediately with zero status if any match is found, +even if an error was detected. +Also see the +.B \-s +or +.B \-\^\-no-messages +option. +.TP +.BR \-R ", " \-r ", " \-\^\-recursive +Read all files under each directory, recursively; +this is equivalent to the +.B "\-d recurse" +option. +.TP +.BR "\fR \fP \-\^\-include=" PATTERN +Recurse in directories only searching file matching +.I PATTERN. +.TP +.BR "\fR \fP \-\^\-exclude=" PATTERN +Recurse in directories skip file matching +.I PATTERN. +.TP +.BR \-s ", " \-\^\-no-messages +Suppress error messages about nonexistent or unreadable files. +Portability note: unlike \s-1GNU\s0 +.BR grep , +traditional +.B grep +did not conform to \s-1POSIX.2\s0, because traditional +.B grep +lacked a +.B \-q +option and its +.B \-s +option behaved like \s-1GNU\s0 +.BR grep 's +.B \-q +option. +Shell scripts intended to be portable to traditional +.B grep +should avoid both +.B \-q +and +.B \-s +and should redirect output to /dev/null instead. +.TP +.BR \-U ", " \-\^\-binary +Treat the file(s) as binary. By default, under MS-DOS and MS-Windows, +.BR grep +guesses the file type by looking at the contents of the first 32KB +read from the file. If +.BR grep +decides the file is a text file, it strips the CR characters from the +original file contents (to make regular expressions with +.B ^ +and +.B $ +work correctly). Specifying +.B \-U +overrules this guesswork, causing all files to be read and passed to the +matching mechanism verbatim; if the file is a text file with CR/LF +pairs at the end of each line, this will cause some regular +expressions to fail. +This option has no effect on platforms other than MS-DOS and +MS-Windows. +.TP +.BR \-u ", " \-\^\-unix-byte-offsets +Report Unix-style byte offsets. This switch causes +.B grep +to report byte offsets as if the file were Unix-style text file, i.e. with +CR characters stripped off. This will produce results identical to running +.B grep +on a Unix machine. This option has no effect unless +.B \-b +option is also used; +it has no effect on platforms other than MS-DOS and MS-Windows. +.TP +.BR \-V ", " \-\^\-version +Print the version number of +.B grep +to standard error. This version number should +be included in all bug reports (see below). +.TP +.BR \-v ", " \-\^\-invert-match +Invert the sense of matching, to select non-matching lines. +.TP +.BR \-w ", " \-\^\-word-regexp +Select only those lines containing matches that form whole words. +The test is that the matching substring must either be at the +beginning of the line, or preceded by a non-word constituent +character. Similarly, it must be either at the end of the line +or followed by a non-word constituent character. Word-constituent +characters are letters, digits, and the underscore. +.TP +.BR \-x ", " \-\^\-line-regexp +Select only those matches that exactly match the whole line. +.TP +.B \-y +Obsolete synonym for +.BR \-i . +.TP +.BR \-Z ", " \-\^\-null +Output a zero byte (the \s-1ASCII\s0 +.B NUL +character) instead of the character that normally follows a file name. +For example, +.B "grep \-lZ" +outputs a zero byte after each file name instead of the usual newline. +This option makes the output unambiguous, even in the presence of file +names containing unusual characters like newlines. This option can be +used with commands like +.BR "find \-print0" , +.BR "perl \-0" , +.BR "sort \-z" , +and +.B "xargs \-0" +to process arbitrary file names, +even those that contain newline characters. +.SH "REGULAR EXPRESSIONS" +.PP +A regular expression is a pattern that describes a set of strings. +Regular expressions are constructed analogously to arithmetic +expressions, by using various operators to combine smaller expressions. +.PP +.B Grep +understands two different versions of regular expression syntax: +\*(lqbasic\*(rq and \*(lqextended.\*(rq In +.RB "\s-1GNU\s0\ " grep , +there is no difference in available functionality using either syntax. +In other implementations, basic regular expressions are less powerful. +The following description applies to extended regular expressions; +differences for basic regular expressions are summarized afterwards. +.PP +The fundamental building blocks are the regular expressions that match +a single character. Most characters, including all letters and digits, +are regular expressions that match themselves. Any metacharacter with +special meaning may be quoted by preceding it with a backslash. +.PP +A +.I "bracket expression" +is a list of characters enclosed by +.B [ +and +.BR ] . +It matches any single +character in that list; if the first character of the list +is the caret +.B ^ +then it matches any character +.I not +in the list. +For example, the regular expression +.B [0123456789] +matches any single digit. +.PP +Within a bracket expression, a +.I "range expression" +consists of two characters separated by a hyphen. +It matches any single character that sorts between the two characters, +inclusive, using the locale's collating sequence and character set. +For example, in the default C locale, +.B [a\-d] +is equivalent to +.BR [abcd] . +Many locales sort characters in dictionary order, and in these locales +.B [a\-d] +is typically not equivalent to +.BR [abcd] ; +it might be equivalent to +.BR [aBbCcDd] , +for example. +To obtain the traditional interpretation of bracket expressions, +you can use the C locale by setting the +.B LC_ALL +environment variable to the value +.BR C . +.PP +Finally, certain named classes of characters are predefined within +bracket expressions, as follows. +Their names are self explanatory, and they are +.BR [:alnum:] , +.BR [:alpha:] , +.BR [:cntrl:] , +.BR [:digit:] , +.BR [:graph:] , +.BR [:lower:] , +.BR [:print:] , +.BR [:punct:] , +.BR [:space:] , +.BR [:upper:] , +and +.BR [:xdigit:]. +For example, +.B [[:alnum:]] +means +.BR [0\-9A\-Za\-z] , +except the latter form depends upon the C locale and the +\s-1ASCII\s0 character encoding, whereas the former is independent +of locale and character set. +(Note that the brackets in these class names are part of the symbolic +names, and must be included in addition to the brackets delimiting +the bracket list.) Most metacharacters lose their special meaning +inside lists. To include a literal +.B ] +place it first in the list. Similarly, to include a literal +.B ^ +place it anywhere but first. Finally, to include a literal +.B \- +place it last. +.PP +The period +.B . +matches any single character. +The symbol +.B \ew +is a synonym for +.B [[:alnum:]] +and +.B \eW +is a synonym for +.BR [^[:alnum]] . +.PP +The caret +.B ^ +and the dollar sign +.B $ +are metacharacters that respectively match the empty string at the +beginning and end of a line. +The symbols +.B \e< +and +.B \e> +respectively match the empty string at the beginning and end of a word. +The symbol +.B \eb +matches the empty string at the edge of a word, +and +.B \eB +matches the empty string provided it's +.I not +at the edge of a word. +.PP +A regular expression may be followed by one of several repetition operators: +.PD 0 +.TP +.B ? +The preceding item is optional and matched at most once. +.TP +.B * +The preceding item will be matched zero or more times. +.TP +.B + +The preceding item will be matched one or more times. +.TP +.BI { n } +The preceding item is matched exactly +.I n +times. +.TP +.BI { n ,} +The preceding item is matched +.I n +or more times. +.TP +.BI { n , m } +The preceding item is matched at least +.I n +times, but not more than +.I m +times. +.PD +.PP +Two regular expressions may be concatenated; the resulting +regular expression matches any string formed by concatenating +two substrings that respectively match the concatenated +subexpressions. +.PP +Two regular expressions may be joined by the infix operator +.BR | ; +the resulting regular expression matches any string matching +either subexpression. +.PP +Repetition takes precedence over concatenation, which in turn +takes precedence over alternation. A whole subexpression may be +enclosed in parentheses to override these precedence rules. +.PP +The backreference +.BI \e n\c +\&, where +.I n +is a single digit, matches the substring +previously matched by the +.IR n th +parenthesized subexpression of the regular expression. +.PP +In basic regular expressions the metacharacters +.BR ? , +.BR + , +.BR { , +.BR | , +.BR ( , +and +.BR ) +lose their special meaning; instead use the backslashed +versions +.BR \e? , +.BR \e+ , +.BR \e{ , +.BR \e| , +.BR \e( , +and +.BR \e) . +.PP +Traditional +.B egrep +did not support the +.B { +metacharacter, and some +.B egrep +implementations support +.B \e{ +instead, so portable scripts should avoid +.B { +in +.B egrep +patterns and should use +.B [{] +to match a literal +.BR { . +.PP +\s-1GNU\s0 +.B egrep +attempts to support traditional usage by assuming that +.B { +is not special if it would be the start of an invalid interval +specification. For example, the shell command +.B "egrep '{1'" +searches for the two-character string +.B {1 +instead of reporting a syntax error in the regular expression. +\s-1POSIX.2\s0 allows this behavior as an extension, but portable scripts +should avoid it. +.SH "ENVIRONMENT VARIABLES" +Grep's behavior is affected by the following environment variables. +.PP +A locale +.BI LC_ foo +is specified by examining the three environment variables +.BR LC_ALL , +.BR LC_\fIfoo\fP , +.BR LANG , +in that order. +The first of these variables that is set specifies the locale. +For example, if +.B LC_ALL +is not set, but +.B LC_MESSAGES +is set to +.BR pt_BR , +then Brazilian Portuguese is used for the +.B LC_MESSAGES +locale. +The C locale is used if none of these environment variables are set, +or if the locale catalog is not installed, or if +.B grep +was not compiled with national language support (\s-1NLS\s0). +.TP +.B GREP_OPTIONS +This variable specifies default options to be placed in front of any +explicit options. For example, if +.B GREP_OPTIONS +is +.BR "'\-\^\-binary-files=without-match \-\^\-directories=skip'" , +.B grep +behaves as if the two options +.B \-\^\-binary-files=without-match +and +.B \-\^\-directories=skip +had been specified before any explicit options. +Option specifications are separated by whitespace. +A backslash escapes the next character, +so it can be used to specify an option containing whitespace or a backslash. +.TP +.B GREP_COLOR +Specifies the marker for highlighting. +.TP +\fBLC_ALL\fP, \fBLC_COLLATE\fP, \fBLANG\fP +These variables specify the +.B LC_COLLATE +locale, which determines the collating sequence used to interpret +range expressions like +.BR [a\-z] . +.TP +\fBLC_ALL\fP, \fBLC_CTYPE\fP, \fBLANG\fP +These variables specify the +.B LC_CTYPE +locale, which determines the type of characters, e.g., which +characters are whitespace. +.TP +\fBLC_ALL\fP, \fBLC_MESSAGES\fP, \fBLANG\fP +These variables specify the +.B LC_MESSAGES +locale, which determines the language that +.B grep +uses for messages. +The default C locale uses American English messages. +.TP +.B POSIXLY_CORRECT +If set, +.B grep +behaves as \s-1POSIX.2\s0 requires; otherwise, +.B grep +behaves more like other \s-1GNU\s0 programs. +\s-1POSIX.2\s0 requires that options that follow file names must be +treated as file names; by default, such options are permuted to the +front of the operand list and are treated as options. +Also, \s-1POSIX.2\s0 requires that unrecognized options be diagnosed as +\*(lqillegal\*(rq, but since they are not really against the law the default +is to diagnose them as \*(lqinvalid\*(rq. +.B POSIXLY_CORRECT +also disables \fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP, +described below. +.TP +\fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP +(Here +.I N +is +.BR grep 's +numeric process ID.) If the +.IR i th +character of this environment variable's value is +.BR 1 , +do not consider the +.IR i th +operand of +.B grep +to be an option, even if it appears to be one. +A shell can put this variable in the environment for each command it runs, +specifying which operands are the results of file name wildcard +expansion and therefore should not be treated as options. +This behavior is available only with the \s-1GNU\s0 C library, and only +when +.B POSIXLY_CORRECT +is not set. +.SH DIAGNOSTICS +.PP +Normally, exit status is 0 if selected lines are found and 1 otherwise. +But the exit status is 2 if an error occurred, unless the +.B \-q +or +.B \-\^\-quiet +or +.B \-\^\-silent +option is used and a selected line is found. +.SH BUGS +.PP +Email bug reports to +.BR bug-gnu-utils@gnu.org . +Be sure to include the word \*(lqgrep\*(rq somewhere in the +\*(lqSubject:\*(rq field. +.PP +Large repetition counts in the +.BI { n , m } +construct may cause grep to use lots of memory. +In addition, +certain other obscure regular expressions require exponential time +and space, and may cause +.B grep +to run out of memory. +.PP +Backreferences are very slow, and may require exponential time. +.\" Work around problems with some troff -man implementations. +.br diff --git a/src/apps/bin/grep-2.5/doc/grep.info b/src/apps/bin/grep-2.5/doc/grep.info new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/apps/bin/grep-2.5/doc/grep.texi b/src/apps/bin/grep-2.5/doc/grep.texi new file mode 100644 index 0000000000..32b27c4199 --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/grep.texi @@ -0,0 +1,2090 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename grep.info +@settitle grep, print lines matching a pattern +@c %**end of header + +@c This file has the new style title page commands. +@c Run `makeinfo' rather than `texinfo-format-buffer'. + +@c smallbook + +@c tex +@c \overfullrule=0pt +@c end tex + +@include version.texi + +@c Combine indices. +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp + +@defcodeindex op +@syncodeindex op fn +@syncodeindex vr fn + +@ifinfo +@direntry +* grep: (grep). print lines matching a pattern. +@end direntry +This file documents @command{grep}, a pattern matching engine. + + +Published by the Free Software Foundation, +59 Temple Place - Suite 330 +Boston, MA 02111-1307, USA + +@c man begin COPYRIGHT +Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries a copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). + +@end ignore +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Sections being ``GNU General Public License'' and ``GNU Free +Documentation License'', with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the section +entitled ``GNU Free Documentation License'' (@pxref{Copying}). +@c man end +@end ifinfo + +@setchapternewpage off + +@titlepage +@title grep, searching for a pattern +@subtitle version @value{VERSION}, @value{UPDATED} +@author Alain Magloire et al. + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc. + +@sp 2 +Published by the Free Software Foundation, @* +59 Temple Place - Suite 330, @* +Boston, MA 02111-1307, USA + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Sections being ``GNU General Public License'' and ``GNU Free +Documentation License'', with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the section +entitled ``GNU Free Documentation License''. +@end titlepage + + +@ifnottex +@node Top +@top Grep + +@command{grep} searches for lines matching a pattern. + +This document was produced for version @value{VERSION} of @sc{gnu} +@command{grep}. +@end ifnottex + +@menu +* Introduction:: Introduction. +* Invoking:: Invoking @command{grep}; description of options. +* Diagnostics:: Exit status returned by @command{grep}. +* Grep Programs:: @command{grep} programs. +* Regular Expressions:: Regular Expressions. +* Usage:: Examples. +* Reporting Bugs:: Reporting Bugs. +* Copying:: License terms. +* Concept Index:: A menu with all the topics in this manual. +* Index:: A menu with all @command{grep} commands + and command-line options. +@end menu + + +@node Introduction, Invoking, Top, Top +@chapter Introduction + +@cindex Searching for a pattern. + +@command{grep} searches the input files +for lines containing a match to a given +pattern list. When it finds a match in a line, it copies the line to standard +output (by default), or does whatever other sort of output you have requested +with options. + +Though @command{grep} expects to do the matching on text, +it has no limits on input line length other than available memory, +and it can match arbitrary characters within a line. +If the final byte of an input file is not a newline, +@command{grep} silently supplies one. +Since newline is also a separator for the list of patterns, there +is no way to match newline characters in a text. + +@node Invoking +@chapter Invoking @command{grep} + +@command{grep} comes with a rich set of options from @sc{posix.2} and @sc{gnu} +extensions. + +@table @samp + +@item -c +@itemx --count +@opindex -c +@opindex --count +@cindex counting lines +Suppress normal output; instead print a count of matching +lines for each input file. With the @samp{-v}, @samp{--invert-match} option, +count non-matching lines. + +@item -e @var{pattern} +@itemx --regexp=@var{pattern} +@opindex -e +@opindex --regexp=@var{pattern} +@cindex pattern list +Use @var{pattern} as the pattern; useful to protect patterns +beginning with a @samp{-}. + +@item -f @var{file} +@itemx --file=@var{file} +@opindex -f +@opindex --file +@cindex pattern from file +Obtain patterns from @var{file}, one per line. The empty +file contains zero patterns, and therefore matches nothing. + +@item -i +@itemx --ignore-case +@opindex -i +@opindex --ignore-case +@cindex case insensitive search +Ignore case distinctions in both the pattern and the input files. + +@item -l +@itemx --files-with-matches +@opindex -l +@opindex --files-with-matches +@cindex names of matching files +Suppress normal output; instead print the name of each input +file from which output would normally have been printed. +The scanning of every file will stop on the first match. + +@item -n +@itemx --line-number +@opindex -n +@opindex --line-number +@cindex line numbering +Prefix each line of output with the line number within its input file. + +@item -o +@itemx --only-matching +@opindex -o +@opindex --only-matching +@cindex only matching +Print only the part of matching lines that actually matches @var{pattern}. + +@item -q +@itemx --quiet +@itemx --silent +@opindex -q +@opindex --quiet +@opindex --silent +@cindex quiet, silent +Quiet; do not write anything to standard output. Exit immediately with +zero status if any match is found, even if an error was detected. Also +see the @samp{-s} or @samp{--no-messages} option. + +@item -s +@itemx --no-messages +@opindex -s +@opindex --no-messages +@cindex suppress error messages +Suppress error messages about nonexistent or unreadable files. +Portability note: unlike @sc{gnu} @command{grep}, traditional +@command{grep} did not conform to @sc{posix.2}, because traditional +@command{grep} lacked a @samp{-q} option and its @samp{-s} option behaved +like @sc{gnu} @command{grep}'s @samp{-q} option. Shell scripts intended +to be portable to traditional @command{grep} should avoid both +@samp{-q} and @samp{-s} and should redirect +output to @file{/dev/null} instead. + +@item -v +@itemx --invert-match +@opindex -v +@opindex --invert-match +@cindex invert matching +@cindex print non-matching lines +Invert the sense of matching, to select non-matching lines. + +@item -x +@itemx --line-regexp +@opindex -x +@opindex --line-regexp +@cindex match the whole line +Select only those matches that exactly match the whole line. + +@end table + +@section @sc{gnu} Extensions + +@table @samp + +@item -A @var{num} +@itemx --after-context=@var{num} +@opindex -A +@opindex --after-context +@cindex after context +@cindex context lines, after match +Print @var{num} lines of trailing context after matching lines. + +@item -B @var{num} +@itemx --before-context=@var{num} +@opindex -B +@opindex --before-context +@cindex before context +@cindex context lines, before match +Print @var{num} lines of leading context before matching lines. + +@item -C @var{num} +@itemx --context=@var{num} +@opindex -C +@opindex --context +@cindex context +Print @var{num} lines of output context. + +@item --colour[=@var{WHEN}] +@itemx --color[=@var{WHEN}] +@opindex --colour +@cindex highlight, color, colour +The matching string is surrounded by the marker specify in @var{GREP_COLOR}. +@var{WHEN} may be `never', `always', or `auto'. + +@item -@var{num} +@opindex -NUM +Same as @samp{--context=@var{num}} lines of leading and trailing +context. However, grep will never print any given line more than once. + + +@item -V +@itemx --version +@opindex -V +@opindex --version +@cindex Version, printing +Print the version number of @command{grep} to the standard output stream. +This version number should be included in all bug reports. + +@item --help +@opindex --help +@cindex Usage summary, printing +Print a usage message briefly summarizing these command-line options +and the bug-reporting address, then exit. + +@itemx --binary-files=@var{type} +@opindex --binary-files +@cindex binary files +If the first few bytes of a file indicate that the file contains binary +data, assume that the file is of type @var{type}. By default, +@var{type} is @samp{binary}, and @command{grep} normally outputs either +a one-line message saying that a binary file matches, or no message if +there is no match. If @var{type} is @samp{without-match}, +@command{grep} assumes that a binary file does not match; +this is equivalent to the @samp{-I} option. If @var{type} +is @samp{text}, @command{grep} processes a binary file as if it were +text; this is equivalent to the @samp{-a} option. +@emph{Warning:} @samp{--binary-files=text} might output binary garbage, +which can have nasty side effects if the output is a terminal and if the +terminal driver interprets some of it as commands. + +@item -b +@itemx --byte-offset +@opindex -b +@opindex --byte-offset +@cindex byte offset +Print the byte offset within the input file before each line of output. +When @command{grep} runs on @sc{ms-dos} or MS-Windows, the printed +byte offsets +depend on whether the @samp{-u} (@samp{--unix-byte-offsets}) option is +used; see below. + +@item -D @var{action} +@itemx --devices=@var{action} +@opindex -D +@opindex --devices +@cindex device search +If an input file is a device, FIFO or socket, use @var{action} to process it. +By default, @var{action} is @samp{read}, which means that devices are +read just as if they were ordinary files. +If @var{action} is @samp{skip}, devices, FIFOs and sockets are silently +skipped. + +@item -d @var{action} +@itemx --directories=@var{action} +@opindex -d +@opindex --directories +@cindex directory search +If an input file is a directory, use @var{action} to process it. +By default, @var{action} is @samp{read}, which means that directories are +read just as if they were ordinary files (some operating systems +and filesystems disallow this, and will cause @command{grep} to print error +messages for every directory or silently skip them). If @var{action} is +@samp{skip}, directories are silently skipped. If @var{action} is +@samp{recurse}, @command{grep} reads all files under each directory, +recursively; this is equivalent to the @samp{-r} option. + +@item -H +@itemx --with-filename +@opindex -H +@opindex --With-filename +@cindex with filename prefix +Print the filename for each match. + +@item -h +@itemx --no-filename +@opindex -h +@opindex --no-filename +@cindex no filename prefix +Suppress the prefixing of filenames on output when multiple files are searched. + +@item --line-buffered +@opindex --line-buffered +@cindex line buffering +Set the line buffering policy, this can be a performance penality. + +@item --label=@var{LABEL} +@opindex --label +@cindex changing name of standard input +Displays input actually coming from standard input as input coming from file +@var{LABEL}. This is especially useful for tools like zgrep, e.g. +@command{gzip -cd foo.gz |grep --label=foo something} + +@item -L +@itemx --files-without-match +@opindex -L +@opindex --files-without-match +@cindex files which don't match +Suppress normal output; instead print the name of each input +file from which no output would normally have been printed. +The scanning of every file will stop on the first match. + +@item -a +@itemx --text +@opindex -a +@opindex --text +@cindex suppress binary data +@cindex binary files +Process a binary file as if it were text; this is equivalent to the +@samp{--binary-files=text} option. + +@item -I +Process a binary file as if it did not contain matching data; this is +equivalent to the @samp{--binary-files=without-match} option. + +@item -w +@itemx --word-regexp +@opindex -w +@opindex --word-regexp +@cindex matching whole words +Select only those lines containing matches that form +whole words. The test is that the matching substring +must either be at the beginning of the line, or preceded +by a non-word constituent character. Similarly, +it must be either at the end of the line or followed by +a non-word constituent character. Word-constituent +characters are letters, digits, and the underscore. + +@item -r +@itemx -R +@itemx --recursive +@opindex -r +@opindex --recursive +@cindex recursive search +@cindex searching directory trees +For each directory mentioned in the command line, read and process all +files in that directory, recursively. This is the same as the +@samp{--directories=recurse} option. + +@item --include=@var{file_pattern} +@opindex --include +@cindex include files +@cindex searching directory trees +When processing directories recursively, only files matching @var{file_pattern} +will be search. + +@item --exclude=@var{file_pattern} +@opindex --exclude +@cindex exclude files +@cindex searching directory trees +When processing directories recursively, skip files matching @var{file_pattern}. + +@item -m @var{num} +@itemx --max-count=@var{num} +@opindex -m +@opindex --max-count +@cindex max-count +Stop reading a file after @var{num} matching lines. If the input is +standard input from a regular file, and @var{num} matching lines are +output, @command{grep} ensures that the standard input is positioned to +just after the last matching line before exiting, regardless of the +presence of trailing context lines. This enables a calling process +to resume a search. For example, the following shell script makes use +of it: + +@example +while grep -m 1 PATTERN +do + echo xxxx +done < FILE +@end example + +But the following probably will not work because a pipe is not a regular +file: + +@example +# This probably will not work. +cat FILE | +while grep -m 1 PATTERN +do + echo xxxx +done +@end example + +When @command{grep} stops after NUM matching lines, it outputs +any trailing context lines. Since context does not include matching +lines, @command{grep} will stop when it encounters another matching line. +When the @samp{-c} or @samp{--count} option is also used, +@command{grep} does not output a count greater than @var{num}. +When the @samp{-v} or @samp{--invert-match} option is +also used, @command{grep} stops after outputting @var{num} +non-matching lines. + +@item -y +@opindex -y +@cindex case insensitive search, obsolete option +Obsolete synonym for @samp{-i}. + +@item -U +@itemx --binary +@opindex -U +@opindex --binary +@cindex DOS/Windows binary files +@cindex binary files, DOS/Windows +Treat the file(s) as binary. By default, under @sc{ms-dos} +and MS-Windows, @command{grep} guesses the file type by looking +at the contents of the first 32kB read from the file. +If @command{grep} decides the file is a text file, it strips the +@code{CR} characters from the original file contents (to make +regular expressions with @code{^} and @code{$} work correctly). +Specifying @samp{-U} overrules this guesswork, causing all +files to be read and passed to the matching mechanism +verbatim; if the file is a text file with @code{CR/LF} pairs +at the end of each line, this will cause some regular +expressions to fail. This option has no effect on platforms other than +@sc{ms-dos} and MS-Windows. + +@item -u +@itemx --unix-byte-offsets +@opindex -u +@opindex --unix-byte-offsets +@cindex DOS byte offsets +@cindex byte offsets, on DOS/Windows +Report Unix-style byte offsets. This switch causes +@command{grep} to report byte offsets as if the file were Unix style +text file, i.e., the byte offsets ignore the @code{CR} characters which were +stripped. This will produce results identical to running @command{grep} on +a Unix machine. This option has no effect unless @samp{-b} +option is also used; it has no effect on platforms other than @sc{ms-dos} and +MS-Windows. + +@item --mmap +@opindex --mmap +@cindex memory mapped input +If possible, use the @code{mmap} system call to read input, instead of +the default @code{read} system call. In some situations, @samp{--mmap} +yields better performance. However, @samp{--mmap} can cause undefined +behavior (including core dumps) if an input file shrinks while +@command{grep} is operating, or if an I/O error occurs. + +@item -Z +@itemx --null +@opindex -Z +@opindex --null +@cindex zero-terminated file names +Output a zero byte (the @sc{ascii} @code{NUL} character) instead of the +character that normally follows a file name. For example, @samp{grep +-lZ} outputs a zero byte after each file name instead of the usual +newline. This option makes the output unambiguous, even in the presence +of file names containing unusual characters like newlines. This option +can be used with commands like @samp{find -print0}, @samp{perl -0}, +@samp{sort -z}, and @samp{xargs -0} to process arbitrary file names, +even those that contain newline characters. + +@item -z +@itemx --null-data +@opindex -z +@opindex --null-data +@cindex zero-terminated lines +Treat the input as a set of lines, each terminated by a zero byte (the +@sc{ascii} @code{NUL} character) instead of a newline. Like the @samp{-Z} +or @samp{--null} option, this option can be used with commands like +@samp{sort -z} to process arbitrary file names. + +@end table + +Several additional options control which variant of the @command{grep} +matching engine is used. @xref{Grep Programs}. + +@section Environment Variables + +Grep's behavior is affected by the following environment variables. + +A locale @code{LC_@var{foo}} is specified by examining the three +environment variables @env{LC_ALL}, @env{LC_@var{foo}}, and @env{LANG}, +in that order. The first of these variables that is set specifies the +locale. For example, if @env{LC_ALL} is not set, but @env{LC_MESSAGES} +is set to @samp{pt_BR}, then Brazilian Portuguese is used for the +@code{LC_MESSAGES} locale. The C locale is used if none of these +environment variables are set, or if the locale catalog is not +installed, or if @command{grep} was not compiled with national language +support (@sc{nls}). + +@cindex environment variables + +@table @env + +@item GREP_OPTIONS +@vindex GREP_OPTIONS +@cindex default options environment variable +This variable specifies default options to be placed in front of any +explicit options. For example, if @code{GREP_OPTIONS} is +@samp{--binary-files=without-match --directories=skip}, @command{grep} +behaves as if the two options @samp{--binary-files=without-match} and +@samp{--directories=skip} had been specified before +any explicit options. Option specifications are separated by +whitespace. A backslash escapes the next character, so it can be used to +specify an option containing whitespace or a backslash. + +@item GREP_COLOR +@vindex GREP_COLOR +@cindex highlight markers +This variable specifies the surrounding markers use to highlight the matching +text. The default is control ascii red. + +@item LC_ALL +@itemx LC_COLLATE +@itemx LANG +@vindex LC_ALL +@vindex LC_COLLATE +@vindex LANG +@cindex character type +@cindex national language support +@cindex NLS +These variables specify the @code{LC_COLLATE} locale, which determines +the collating sequence used to interpret range expressions like +@samp{[a-z]}. + +@item LC_ALL +@itemx LC_CTYPE +@itemx LANG +@vindex LC_ALL +@vindex LC_CTYPE +@vindex LANG +@cindex character type +@cindex national language support +@cindex NLS +These variables specify the @code{LC_CTYPE} locale, which determines the +type of characters, e.g., which characters are whitespace. + +@item LC_ALL +@itemx LC_MESSAGES +@itemx LANG +@vindex LC_ALL +@vindex LC_MESSAGES +@vindex LANG +@cindex language of messages +@cindex message language +@cindex national language support +@cindex NLS +@cindex translation of message language +These variables specify the @code{LC_MESSAGES} locale, which determines +the language that @command{grep} uses for messages. The default C +locale uses American English messages. + +@item POSIXLY_CORRECT +@vindex POSIXLY_CORRECT +If set, @command{grep} behaves as @sc{posix.2} requires; otherwise, +@command{grep} behaves more like other @sc{gnu} programs. @sc{posix.2} +requires that options that +follow file names must be treated as file names; by default, such +options are permuted to the front of the operand list and are treated as +options. Also, @sc{posix.2} requires that unrecognized options be +diagnosed as +``illegal'', but since they are not really against the law the default +is to diagnose them as ``invalid''. @code{POSIXLY_CORRECT} also +disables @code{_@var{N}_GNU_nonoption_argv_flags_}, described below. + +@item _@var{N}_GNU_nonoption_argv_flags_ +@vindex _@var{N}_GNU_nonoption_argv_flags_ +(Here @code{@var{N}} is @command{grep}'s numeric process ID.) If the +@var{i}th character of this environment variable's value is @samp{1}, do +not consider the @var{i}th operand of @command{grep} to be an option, even if +it appears to be one. A shell can put this variable in the environment +for each command it runs, specifying which operands are the results of +file name wildcard expansion and therefore should not be treated as +options. This behavior is available only with the @sc{gnu} C library, and +only when @code{POSIXLY_CORRECT} is not set. + +@end table + +@node Diagnostics +@chapter Diagnostics + +Normally, exit status is 0 if selected lines are found and 1 otherwise. +But the exit status is 2 if an error occurred, unless the @option{-q} or +@option{--quiet} or @option{--silent} option is used and a selected line +is found. + +@node Grep Programs +@chapter @command{grep} programs + +@command{grep} searches the named input files (or standard input if no +files are named, or the file name @file{-} is given) for lines containing +a match to the given pattern. By default, @command{grep} prints the +matching lines. There are four major variants of @command{grep}, +controlled by the following options. + +@table @samp + +@item -G +@itemx --basic-regexp +@opindex -G +@opindex --basic-regexp +@cindex matching basic regular expressions +Interpret the pattern as a basic regular expression. This is the default. + +@item -E +@itemx --extended-regexp +@opindex -E +@opindex --extended-regexp +@cindex matching extended regular expressions +Interpret the pattern as an extended regular expression. + +@item -F +@itemx --fixed-strings +@opindex -F +@opindex --fixed-strings +@cindex matching fixed strings +Interpret the pattern as a list of fixed strings, separated +by newlines, any of which is to be matched. + +@item -P +@itemx --perl-regexp +@opindex -P +@opindex --perl-regexp +@cindex matching Perl regular expressions +Interpret the pattern as a Perl regular expression. + +@end table + +In addition, two variant programs @sc{egrep} and @sc{fgrep} are available. +@sc{egrep} is the same as @samp{grep -E}. @sc{fgrep} is the +same as @samp{grep -F}. + +@node Regular Expressions +@chapter Regular Expressions +@cindex regular expressions + +A @dfn{regular expression} is a pattern that describes a set of strings. +Regular expressions are constructed analogously to arithmetic expressions, +by using various operators to combine smaller expressions. +@command{grep} understands two different versions of regular expression +syntax: ``basic''(BRE) and ``extended''(ERE). In @sc{gnu} @command{grep}, +there is no difference in available functionality using either syntax. +In other implementations, basic regular expressions are less powerful. +The following description applies to extended regular expressions; +differences for basic regular expressions are summarized afterwards. + +The fundamental building blocks are the regular expressions that match +a single character. Most characters, including all letters and digits, +are regular expressions that match themselves. Any metacharacter +with special meaning may be quoted by preceding it with a backslash. + +A regular expression may be followed by one of several +repetition operators: + +@table @samp + +@item . +@opindex . +@cindex dot +@cindex period +The period @samp{.} matches any single character. + +@item ? +@opindex ? +@cindex question mark +@cindex match sub-expression at most once +The preceding item is optional and will be matched at most once. + +@item * +@opindex * +@cindex asterisk +@cindex match sub-expression zero or more times +The preceding item will be matched zero or more times. + +@item + +@opindex + +@cindex plus sign +The preceding item will be matched one or more times. + +@item @{@var{n}@} +@opindex @{n@} +@cindex braces, one argument +@cindex match sub-expression n times +The preceding item is matched exactly @var{n} times. + +@item @{@var{n},@} +@opindex @{n,@} +@cindex braces, second argument omitted +@cindex match sub-expression n or more times +The preceding item is matched n or more times. + +@item @{@var{n},@var{m}@} +@opindex @{n,m@} +@cindex braces, two arguments +The preceding item is matched at least @var{n} times, but not more than +@var{m} times. + +@end table + +Two regular expressions may be concatenated; the resulting regular +expression matches any string formed by concatenating two substrings +that respectively match the concatenated subexpressions. + +Two regular expressions may be joined by the infix operator @samp{|}; the +resulting regular expression matches any string matching either subexpression. + +Repetition takes precedence over concatenation, which in turn +takes precedence over alternation. A whole subexpression may be +enclosed in parentheses to override these precedence rules. + +@section Character Class + +@cindex bracket expression +@cindex character class +A @dfn{bracket expression} is a list of characters enclosed by @samp{[} and +@samp{]}. It matches any single character in that list; if the first +character of the list is the caret @samp{^}, then it matches any character +@strong{not} in the list. For example, the regular expression +@samp{[0123456789]} matches any single digit. + +@cindex range expression +Within a bracket expression, a @dfn{range expression} consists of two +characters separated by a hyphen. It matches any single character that +sorts between the two characters, inclusive, using the locale's +collating sequence and character set. For example, in the default C +locale, @samp{[a-d]} is equivalent to @samp{[abcd]}. Many locales sort +characters in dictionary order, and in these locales @samp{[a-d]} is +typically not equivalent to @samp{[abcd]}; it might be equivalent to +@samp{[aBbCcDd]}, for example. To obtain the traditional interpretation +of bracket expressions, you can use the C locale by setting the +@env{LC_ALL} environment variable to the value @samp{C}. + +Finally, certain named classes of characters are predefined within +bracket expressions, as follows. +Their interpretation depends on the @code{LC_CTYPE} locale; the +interpretation below is that of the C locale, which is the default +if no @code{LC_CTYPE} locale is specified. + +@cindex classes of characters +@cindex character classes +@table @samp + +@item [:alnum:] +@opindex alnum +@cindex alphanumeric characters +Alphanumeric characters: +@samp{[:alpha:]} and @samp{[:digit:]}. + +@item [:alpha:] +@opindex alpha +@cindex alphabetic characters +Alphabetic characters: +@samp{[:lower:]} and @samp{[:upper:]}. + +@item [:blank:] +@opindex blank +@cindex blank characters +Blank characters: +space and tab. + +@item [:cntrl:] +@opindex cntrl +@cindex control characters +Control characters. In @sc{ascii}, these characters have octal codes 000 +through 037, and 177 (@code{DEL}). In other character sets, these are +the equivalent characters, if any. + +@item [:digit:] +@opindex digit +@cindex digit characters +@cindex numeric characters +Digits: @code{0 1 2 3 4 5 6 7 8 9}. + +@item [:graph:] +@opindex graph +@cindex graphic characters +Graphical characters: +@samp{[:alnum:]} and @samp{[:punct:]}. + +@item [:lower:] +@opindex lower +@cindex lower-case letters +Lower-case letters: +@code{a b c d e f g h i j k l m n o p q r s t u v w x y z}. + +@item [:print:] +@opindex print +@cindex printable characters +Printable characters: +@samp{[:alnum:]}, @samp{[:punct:]}, and space. + +@item [:punct:] +@opindex punct +@cindex punctuation characters +Punctuation characters: +@code{!@: " # $ % & ' ( ) * + , - .@: / : ; < = > ?@: @@ [ \ ] ^ _ ` @{ | @} ~}. + +@item [:space:] +@opindex space +@cindex space characters +@cindex whitespace characters +Space characters: +tab, newline, vertical tab, form feed, carriage return, and space. + +@item [:upper:] +@opindex upper +@cindex upper-case letters +Upper-case letters: +@code{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}. + +@item [:xdigit:] +@opindex xdigit +@cindex xdigit class +@cindex hexadecimal digits +Hexadecimal digits: +@code{0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f}. + +@end table +For example, @samp{[[:alnum:]]} means @samp{[0-9A-Za-z]}, except the latter +depends upon the C locale and the @sc{ascii} character +encoding, whereas the former is independent of locale and character set. +(Note that the brackets in these class names are +part of the symbolic names, and must be included in addition to +the brackets delimiting the bracket list.) + +Most metacharacters lose their special meaning inside lists. + +@table @samp +@item ] +ends the list if it's not the first list item. So, if you want to make +the @samp{]} character a list item, you must put it first. + +@item [. +represents the open collating symbol. + +@item .] +represents the close collating symbol. + +@item [= +represents the open equivalence class. + +@item =] +represents the close equivalence class. + +@item [: +represents the open character class followed by a valid character class name. + +@item :] +represents the close character class followed by a valid character class name. + +@item - +represents the range if it's not first or last in a list or the ending point +of a range. + +@item ^ +represents the characters not in the list. If you want to make the @samp{^} +character a list item, place it anywhere but first. + +@end table + +@section Backslash Character +@cindex backslash + +The @samp{\} when followed by certain ordinary characters take a special +meaning : + +@table @samp + +@item @samp{\b} +Match the empty string at the edge of a word. + +@item @samp{\B} +Match the empty string provided it's not at the edge of a word. + +@item @samp{\<} +Match the empty string at the beginning of word. + +@item @samp{\>} +Match the empty string at the end of word. + +@item @samp{\w} +Match word constituent, it is a synonym for @samp{[[:alnum:]]}. + +@item @samp{\W} +Match non word constituent, it is a synonym for @samp{[^[:alnum:]]}. + +@end table + +For example , @samp{\brat\b} matches the separate word @samp{rat}, +@samp{c\Brat\Be} matches @samp{crate}, but @samp{dirty \Brat} doesn't +match @samp{dirty rat}. + +@section Anchoring +@cindex anchoring + +The caret @samp{^} and the dollar sign @samp{$} are metacharacters that +respectively match the empty string at the beginning and end of a line. + +@section Back-reference +@cindex back-reference + +The back-reference @samp{\@var{n}}, where @var{n} is a single digit, matches +the substring previously matched by the @var{n}th parenthesized subexpression +of the regular expression. For example, @samp{(a)\1} matches @samp{aa}. +When use with alternation if the group does not participate in the match, then +the back-reference makes the whole match fail. For example, @samp{a(.)|b\1} +will not match @samp{ba}. When multiple regular expressions are given with +@samp{-e} or from a file @samp{-f file}, the back-referecences are local to +each expression. + +@section Basic vs Extended +@cindex basic regular expressions + +In basic regular expressions the metacharacters @samp{?}, @samp{+}, +@samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning; +instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{}, +@samp{\|}, @samp{\(}, and @samp{\)}. + +@cindex interval specifications +Traditional @command{egrep} did not support the @samp{@{} metacharacter, +and some @command{egrep} implementations support @samp{\@{} instead, so +portable scripts should avoid @samp{@{} in @samp{egrep} patterns and +should use @samp{[@{]} to match a literal @samp{@{}. + +@sc{gnu} @command{egrep} attempts to support traditional usage by +assuming that @samp{@{} is not special if it would be the start of an +invalid interval specification. For example, the shell command +@samp{egrep '@{1'} searches for the two-character string @samp{@{1} +instead of reporting a syntax error in the regular expression. +@sc{posix.2} allows this behavior as an extension, but portable scripts +should avoid it. + +@node Usage +@chapter Usage + +@cindex Usage, examples +Here is an example shell command that invokes @sc{gnu} @command{grep}: + +@example +grep -i 'hello.*world' menu.h main.c +@end example + +@noindent +This lists all lines in the files @file{menu.h} and @file{main.c} that +contain the string @samp{hello} followed by the string @samp{world}; +this is because @samp{.*} matches zero or more characters within a line. +@xref{Regular Expressions}. The @samp{-i} option causes @command{grep} +to ignore case, causing it to match the line @samp{Hello, world!}, which +it would not otherwise match. @xref{Invoking}, for more details about +how to invoke @command{grep}. + +@cindex Using @command{grep}, Q&A +@cindex FAQ about @command{grep} usage +Here are some common questions and answers about @command{grep} usage. + +@enumerate + +@item +How can I list just the names of matching files? + +@example +grep -l 'main' *.c +@end example + +@noindent +lists the names of all C files in the current directory whose contents +mention @samp{main}. + +@item +How do I search directories recursively? + +@example +grep -r 'hello' /home/gigi +@end example + +@noindent +searches for @samp{hello} in all files under the directory +@file{/home/gigi}. For more control of which files are searched, use +@command{find}, @command{grep} and @command{xargs}. For example, +the following command searches only C files: + +@smallexample +find /home/gigi -name '*.c' -print | xargs grep 'hello' /dev/null +@end smallexample + +This differs from the command: + +@example +grep -r 'hello' *.c +@end example + +which merely looks for @samp{hello} in all files in the current +directory whose names end in @samp{.c}. Here the @option{-r} is +probably unnecessary, as recursion occurs only in the unlikely event +that one of @samp{.c} files is a directory. + +@item +What if a pattern has a leading @samp{-}? + +@example +grep -e '--cut here--' * +@end example + +@noindent +searches for all lines matching @samp{--cut here--}. Without @samp{-e}, +@command{grep} would attempt to parse @samp{--cut here--} as a list of +options. + +@item +Suppose I want to search for a whole word, not a part of a word? + +@example +grep -w 'hello' * +@end example + +@noindent +searches only for instances of @samp{hello} that are entire words; it +does not match @samp{Othello}. For more control, use @samp{\<} and +@samp{\>} to match the start and end of words. For example: + +@example +grep 'hello\>' * +@end example + +@noindent +searches only for words ending in @samp{hello}, so it matches the word +@samp{Othello}. + +@item +How do I output context around the matching lines? + +@example +grep -C 2 'hello' * +@end example + +@noindent +prints two lines of context around each matching line. + +@item +How do I force grep to print the name of the file? + +Append @file{/dev/null}: + +@example +grep 'eli' /etc/passwd /dev/null +@end example + +gets you: + +@smallexample +/etc/passwd:eli:DNGUTF58.IMe.:98:11:Eli Smith:/home/do/eli:/bin/bash +@end smallexample + +@item +Why do people use strange regular expressions on @command{ps} output? + +@example +ps -ef | grep '[c]ron' +@end example + +If the pattern had been written without the square brackets, it would +have matched not only the @command{ps} output line for @command{cron}, +but also the @command{ps} output line for @command{grep}. +Note that some platforms @command{ps} limit the ouput to the width +of the screen, grep does not have any limit on the length of a line +except the available memory. + +@item +Why does @command{grep} report ``Binary file matches''? + +If @command{grep} listed all matching ``lines'' from a binary file, it +would probably generate output that is not useful, and it might even +muck up your display. So @sc{gnu} @command{grep} suppresses output from +files that appear to be binary files. To force @sc{gnu} @command{grep} +to output lines even from files that appear to be binary, use the +@samp{-a} or @samp{--binary-files=text} option. To eliminate the +``Binary file matches'' messages, use the @samp{-I} or +@samp{--binary-files=without-match} option. + +@item +Why doesn't @samp{grep -lv} print nonmatching file names? + +@samp{grep -lv} lists the names of all files containing one or more +lines that do not match. To list the names of all files that contain no +matching lines, use the @samp{-L} or @samp{--files-without-match} +option. + +@item +I can do @sc{or} with @samp{|}, but what about @sc{and}? + +@example +grep 'paul' /etc/motd | grep 'franc,ois' +@end example + +@noindent +finds all lines that contain both @samp{paul} and @samp{franc,ois}. + +@item +How can I search in both standard input and in files? + +Use the special file name @samp{-}: + +@example +cat /etc/passwd | grep 'alain' - /etc/motd +@end example + +@item +@cindex palindromes +How to express palindromes in a regular expression? + +It can be done by using the back referecences, for example a palindrome +of 4 chararcters can be written in BRE. + +@example +grep -w -e '\(.\)\(.\).\2\1' file +@end example + +It matches the word "radar" or "civic". + +Guglielmo Bondioni proposed a single RE that finds all the palindromes up to 19 +characters long. + +@example +egrep -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' file +@end example + +Note this is done by using GNU ERE extensions, it might not be portable on +other greps. + +@item +Why are my expressions whith the vertical bar fail? + +@example +/bin/echo "ba" | egrep '(a)\1|(b)\1' +@end example + +The first alternate branch fails then the first group was not in the match +this will make the second alternate branch fails. For example, "aaba" will +match, the first group participate in the match and can be reuse in the +second branch. + +@item +What do @command{grep, fgrep, egrep} stand for ? + +grep comes from the way line editing was done on Unix. For example, +@command{ed} uses this syntax to print a list of matching lines on the screen. + +@example +global/regular expression/print +g/re/p +@end example + +@command{fgrep} stands for Fixed @command{grep}, @command{egrep} Extended +@command{grep}. + +@end enumerate + +@node Reporting Bugs, Copying, Usage, Top +@chapter Reporting bugs + +@cindex Bugs, reporting +Email bug reports to @email{bug-gnu-utils@@gnu.org}. +Be sure to include the word ``grep'' somewhere in the ``Subject:'' field. + +Large repetition counts in the @samp{@{n,m@}} construct may cause +@command{grep} to use lots of memory. In addition, certain other +obscure regular expressions require exponential time and +space, and may cause grep to run out of memory. +Back-references are very slow, and may require exponential time. + +@node Copying, GNU General Public License, Reporting Bugs, Top +@chapter Copying +@cindex Copying +GNU grep is licensed under the GNU GPL, which makes it @dfn{free +software}. + +Please note that ``free'' in ``free software'' refers to liberty, not +price. As some GNU project advocates like to point out, think of ``free +speech'' rather than ``free beer''. The exact and legally binding +distribution terms are spelled out below; in short, you have the right +(freedom) to run and change grep and distribute it to other people, and +even---if you want---charge money for doing either. The important +restriction is that you have to grant your recipients the same rights +and impose the same restrictions. + +This method of licensing software is also known as @dfn{open source} +because, among other things, it makes sure that all recipients will +receive the source code along with the program, and be able to improve +it. The GNU project prefers the term ``free software'' for reasons +outlined at +@url{http://www.gnu.org/philosophy/free-software-for-freedom.html}. + +The exact license terms are defined by this paragraph and the GNU +General Public License it refers to: + +@quotation +GNU grep 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. + +GNU grep 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. + +A copy of the GNU General Public License is included as part of this +manual; if you did not receive it, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +@end quotation + +In addition to this, this manual is free in the same sense: + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Sections being ``GNU General Public License'' and ``GNU Free +Documentation License'', with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the section +entitled ``GNU Free Documentation License''. +@end quotation + +@c #### Maybe we should wrap these licenses in ifinfo? Stallman says +@c that the GFDL needs to be present in the manual, and to me it would +@c suck to include the license for the manual and not the license for +@c the program. + +The full texts of the GNU General Public License and of the GNU Free +Documentation License are available below. + +@menu +* GNU General Public License:: GNU GPL +* GNU Free Documentation License:: GNU FDL +@end menu + +@node GNU General Public License, GNU Free Documentation License, Copying, Copying +@section GNU General Public License +@center Version 2, June 1991 +@cindex GPL, GNU General Public License + +@display +Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. +675 Mass Ave, Cambridge, MA 02139, 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 +@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 +@cindex no warranty + +@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 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 an idea of what it does.} +Copyright (C) 19@var{yy} @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., 675 Mass Ave, Cambridge, MA 02139, 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: + +@smallexample +@group +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 group +@end smallexample + +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. + +@node GNU Free Documentation License, Concept Index, GNU General Public License, Copying +@section GNU Free Documentation License +@center Version 1.1, March 2000 +@cindex FDL, GNU Free Documentation License + +@display +Copyright (C) 2000 Free Software Foundation, Inc. +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display +@sp 1 +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document ``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. + +@sp 1 +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The ``Document'', below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as ``you''. + +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. (For example, 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. + +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 ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +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 has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML 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. +@sp 1 +@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. +@sp 1 +@item +COPYING IN QUANTITY + +If you publish printed copies 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 publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. 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. +@sp 1 +@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: + +A. 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.@* +B. 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 less than five).@* +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher.@* +D. Preserve all the copyright notices of the Document.@* +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices.@* +F. 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.@* +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice.@* +H. Include an unaltered copy of this License.@* +I. Preserve the section entitled ``History'', and 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.@* +J. 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.@* +K. In any section entitled ``Acknowledgements'' or ``Dedications'', + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein.@* +L. 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.@* +M. Delete any section entitled ``Endorsements''. Such a section + may not be included in the Modified Version.@* +N. Do not retitle any existing section as ``Endorsements'' + or to conflict in title with any Invariant Section.@* +@sp 1 +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. +@sp 1 +@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. + +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.'' +@sp 1 +@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. +@sp 1 +@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, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an ``aggregate'', and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +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 quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. +@sp 1 +@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 provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. +@sp 1 +@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. +@sp 1 +@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 +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 + +@unnumberedsec 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.1 + or any later version published by the Free Software Foundation; + 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}. + A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample +If you have no Invariant Sections, write ``with no Invariant Sections'' +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write ``no Front-Cover Texts'' instead of +``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts. + +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. + +@page +@node Concept Index, Index, GNU Free Documentation License, Top +@unnumbered Concept Index + +This is a general index of all issues discussed in this manual, with the +exception of the @command{grep} commands and command-line options. + +@printindex cp + +@page +@node Index,, Concept Index, Top +@unnumbered Index + +This is an alphabetical list of all @command{grep} commands, command-line +options, and environment variables. + +@printindex fn + +@contents +@bye diff --git a/src/apps/bin/grep-2.5/doc/mdate-sh b/src/apps/bin/grep-2.5/doc/mdate-sh new file mode 100755 index 0000000000..c079aed3e2 --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/mdate-sh @@ -0,0 +1,97 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. +# Copyright 1995, 1996, 1997 Free Software Foundation, Inc. +# written by Ulrich Drepper , June 1995 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# Get the extended ls output of the file or directory. +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +if ls -L /dev/null 1>/dev/null 2>&1; then + set - x`ls -L -l -d $1` +else + set - x`ls -l -d $1` +fi +# The month is at least the fourth argument +# (3 shifts here, the next inside the loop). +shift +shift +shift + +# Find the month. Next argument is day, followed by the year or time. +month= +until test $month +do + shift + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +day=$2 + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year diff --git a/src/apps/bin/grep-2.5/doc/stamp-vti b/src/apps/bin/grep-2.5/doc/stamp-vti new file mode 100644 index 0000000000..0887dbefea --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/stamp-vti @@ -0,0 +1,4 @@ +@set UPDATED 22 January 2002 +@set UPDATED-MONTH January 2002 +@set EDITION 2.5 +@set VERSION 2.5 diff --git a/src/apps/bin/grep-2.5/doc/texinfo.tex b/src/apps/bin/grep-2.5/doc/texinfo.tex new file mode 100644 index 0000000000..0c98fa2847 --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/texinfo.tex @@ -0,0 +1,6200 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2000-12-12.07} +% +% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 +% Free Software Foundation, Inc. +% +% This texinfo.tex file is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation; either version 2, or (at +% your option) any later version. +% +% This texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write +% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +% Boston, MA 02111-1307, USA. +% +% In other words, you are welcome to use, share and improve this program. +% You are forbidden to forbid anyone else to use, share and improve +% what you give them. Help stamp out software-hoarding! +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% ftp://ftp.gnu.org/gnu/texinfo.tex +% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) +% ftp://texinfo.org/tex/texinfo.tex +% ftp://us.ctan.org/macros/texinfo/texinfo.tex +% (and all CTAN mirrors, finger ctan@us.ctan.org for a list). +% /home/gd/gnu/doc/texinfo.tex on the GNU machines. +% The texinfo.tex in any given Texinfo distribution could well be out +% of date, so if that's what you're using, please check. +% Texinfo has a small home page at http://texinfo.org/. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps. +% The extra runs of TeX get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages. You can get +% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/. + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + +% Save some parts of plain tex whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexi=\i +\let\ptexlbrace=\{ +\let\ptexrbrace=\} +\let\ptexstar=\* +\let\ptext=\t + +% We never want plain's outer \+ definition in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +\message{Basics,} +\chardef\other=12 + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi +\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi + +% Ignore a token. +% +\def\gobble#1{} + +\hyphenation{ap-pen-dix} +\hyphenation{mini-buf-fer mini-buf-fers} +\hyphenation{eshell} +\hyphenation{white-space} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen \bindingoffset +\newdimen \normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\ifx\eTeXversion\undefined +\def\loggingall{\tracingcommands2 \tracingstats2 + \tracingpages1 \tracingoutput1 \tracinglostchars1 + \tracingmacros2 \tracingparagraphs1 \tracingrestores1 + \showboxbreadth\maxdimen\showboxdepth\maxdimen +}% +\else +\def\loggingall{\tracingcommands3 \tracingstats2 + \tracingpages1 \tracingoutput1 \tracinglostchars1 + \tracingmacros2 \tracingparagraphs1 \tracingrestores1 + \tracingscantokens1 \tracingassigns1 \tracingifs1 + \tracinggroups1 \tracingnesting2 + \showboxbreadth\maxdimen\showboxdepth\maxdimen +}% +\fi + +% For @cropmarks command. +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \escapechar = `\\ % use backslash in output files. + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingxxx.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 2\baselineskip + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \turnoffactive + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1 \unvbox#1 +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg#1{% + \let\next = #1% + \begingroup + \obeylines + \futurelet\temp\parseargx +} + +% If the next token is an obeyed space (from an @example environment or +% the like), remove it and recurse. Otherwise, we're done. +\def\parseargx{% + % \obeyedspace is defined far below, after the definition of \sepspaces. + \ifx\obeyedspace\temp + \expandafter\parseargdiscardspace + \else + \expandafter\parseargline + \fi +} + +% Remove a single space (as the delimiter token to the macro call). +{\obeyspaces % + \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + % + % First remove any @c comment, then any @comment. + % Result of each macro is put in \toks0. + \argremovec #1\c\relax % + \expandafter\argremovecomment \the\toks0 \comment\relax % + % + % Call the caller's macro, saved as \next in \parsearg. + \expandafter\next\expandafter{\the\toks0}% + }% +} + +% Since all \c{,omment} does is throw away the argument, we can let TeX +% do that for us. The \relax here is matched by the \relax in the call +% in \parseargline; it could be more or less anything, its purpose is +% just to delimit the argument to the \c. +\def\argremovec#1\c#2\relax{\toks0 = {#1}} +\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} + +% \argremovec{,omment} might leave us with trailing spaces, though; e.g., +% @end itemize @c foo +% will have two active spaces as part of the argument with the +% `itemize'. Here we remove all active spaces from #1, and assign the +% result to \toks0. +% +% This loses if there are any *other* active characters besides spaces +% in the argument -- _ ^ +, for example -- since they get expanded. +% Fortunately, Texinfo does not define any such commands. (If it ever +% does, the catcode of the characters in questionwill have to be changed +% here.) But this means we cannot call \removeactivespaces as part of +% \argremovec{,omment}, since @c uses \parsearg, and thus the argument +% that \parsearg gets might well have any character at all in it. +% +\def\removeactivespaces#1{% + \begingroup + \ignoreactivespaces + \edef\temp{#1}% + \global\toks0 = \expandafter{\temp}% + \endgroup +} + +% Change the active space to expand to nothing. +% +\begingroup + \obeyspaces + \gdef\ignoreactivespaces{\obeyspaces\let =\empty} +\endgroup + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +%% These are used to keep @begin/@end levels from running away +%% Call \inENV within environments (after a \begingroup) +\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} +\def\ENVcheck{% +\ifENV\errmessage{Still within an environment; press RETURN to continue} +\endgroup\fi} % This is not perfect, but it should reduce lossage + +% @begin foo is the same as @foo, for now. +\newhelp\EMsimple{Press RETURN to continue.} + +\outer\def\begin{\parsearg\beginxxx} + +\def\beginxxx #1{% +\expandafter\ifx\csname #1\endcsname\relax +{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else +\csname #1\endcsname\fi} + +% @end foo executes the definition of \Efoo. +% +\def\end{\parsearg\endxxx} +\def\endxxx #1{% + \removeactivespaces{#1}% + \edef\endthing{\the\toks0}% + % + \expandafter\ifx\csname E\endthing\endcsname\relax + \expandafter\ifx\csname \endthing\endcsname\relax + % There's no \foo, i.e., no ``environment'' foo. + \errhelp = \EMsimple + \errmessage{Undefined command `@end \endthing'}% + \else + \unmatchedenderror\endthing + \fi + \else + % Everything's ok; the right environment has been started. + \csname E\endthing\endcsname + \fi +} + +% There is an environment #1, but it hasn't been started. Give an error. +% +\def\unmatchedenderror#1{% + \errhelp = \EMsimple + \errmessage{This `@end #1' doesn't have a matching `@#1'}% +} + +% Define the control sequence \E#1 to give an unmatched @end error. +% +\def\defineunmatchedend#1{% + \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% +} + + +% Single-spacing is done by various environments (specifically, in +% \nonfillstart and \quotations). +\newskip\singlespaceskip \singlespaceskip = 12.5pt +\def\singlespace{% + % Why was this kern here? It messes up equalizing space above and below + % environments. --karl, 6may93 + %{\advance \baselineskip by -\singlespaceskip + %\kern \baselineskip}% + \setleading \singlespaceskip +} + +%% Simple single-character @ commands + +% @@ prints an @ +% Kludge this until the fonts are right (grr). +\def\@{{\tt\char64}} + +% This is turned off because it was never documented +% and you can use @w{...} around a quote to suppress ligatures. +%% Define @` and @' to be the same as ` and ' +%% but suppressing ligatures. +%\def\`{{`}} +%\def\'{{'}} + +% Used to generate quoted braces. +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} +\let\{=\mylbrace +\let\}=\myrbrace +\begingroup + % Definitions to produce actual \{ & \} command in an index. + \catcode`\{ = 12 \catcode`\} = 12 + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\@ = 0 \catcode`\\ = 12 + @gdef@lbracecmd[\{]% + @gdef@rbracecmd[\}]% +@endgroup + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. +\let\, = \c +\let\dotaccent = \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \t +\let\ubaraccent = \b +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown +% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\hfil\break\hbox{}\ignorespaces} + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=3000 } + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=3000 } + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=3000 } + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +\def\group{\begingroup + \ifnum\catcode13=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + % + % The \vtop we start below produces a box with normal height and large + % depth; thus, TeX puts \baselineskip glue before it, and (when the + % next line of text is done) \lineskip glue after it. (See p.82 of + % the TeXbook.) Thus, space below is not quite equal to space + % above. But it's pretty close. + \def\Egroup{% + \egroup % End the \vtop. + \endgroup % End the \group. + }% + % + \vtop\bgroup + % We have to put a strut on the last line in case the @group is in + % the midst of an example, rather than completely enclosing it. + % Otherwise, the interline space between the last line of the group + % and the first line afterwards is too small. But we can't put the + % strut in \Egroup, since there it would be on a line by itself. + % Hence this just inserts a strut at the beginning of each line. + \everypar = {\strut}% + % + % Since we have a strut on every line, we don't need any of TeX's + % normal interline spacing. + \offinterlineskip + % + % OK, but now we have to do something about blank + % lines in the input in @example-like environments, which normally + % just turn into \lisppar, which will insert no space now that we've + % turned off the interline space. Simplest is to make them be an + % empty paragraph. + \ifx\par\lisppar + \edef\par{\leavevmode \par}% + % + % Reset ^^M's definition to new definition of \par. + \obeylines + \fi + % + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +\def\need{\parsearg\needx} + +% Old definition--didn't work. +%\def\needx #1{\par % +%% This method tries to make TeX break the page naturally +%% if the depth of the box does not fit. +%{\baselineskip=0pt% +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak +%\prevdepth=-1000pt +%}} + +\def\needx#1{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break + +\let\br = \par + +% @dots{} output an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \leavevmode + \hbox to 2em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% + \spacefactor=3000 +} + + +% @page forces the start of a new page +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\def\exdent{\parsearg\exdentyyy} +\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} + +% This defn is used inside nofill environments such as @example. +\def\nofillexdent{\parsearg\nofillexdentyyy} +\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount +\leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @include file insert text of that file as input. +% Allow normal characters that we make active in the argument (a file name). +\def\include{\begingroup + \catcode`\\=12 + \catcode`~=12 + \catcode`^=12 + \catcode`_=12 + \catcode`|=12 + \catcode`<=12 + \catcode`>=12 + \catcode`+=12 + \parsearg\includezzz} +% Restore active chars for included file. +\def\includezzz#1{\endgroup\begingroup + % Read the included file in a group so nested @include's work. + \def\thisfile{#1}% + \input\thisfile +\endgroup} + +\def\thisfile{} + +% @center line outputs that line, centered + +\def\center{\parsearg\centerzzz} +\def\centerzzz #1{{\advance\hsize by -\leftskip +\advance\hsize by -\rightskip +\centerline{#1}}} + +% @sp n outputs n lines of vertical space + +\def\sp{\parsearg\spxxx} +\def\spxxx #1{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment + +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} + +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% We cannot implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\def\paragraphindent{\parsearg\doparagraphindent} +\def\doparagraphindent#1{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\def\exampleindent{\parsearg\doexampleindent} +\def\doexampleindent#1{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math means output in math mode. +% We don't use $'s directly in the definition of \math because control +% sequences like \math are expanded when the toc file is written. Then, +% we read the toc file back, the $'s will be normal characters (as they +% should be, according to the definition of Texinfo). So we must use a +% control sequence to switch into and out of math mode. +% +% This isn't quite enough for @math to work properly in indices, but it +% seems unlikely it will ever be needed there. +% +\let\implicitmath = $ +\def\math#1{\implicitmath #1\implicitmath} + +% @bullet and @minus need the same treatment as @math, just above. +\def\bullet{\implicitmath\ptexbullet\implicitmath} +\def\minus{\implicitmath-\implicitmath} + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \iflinks + \readauxfile + \fi % \openindices needs to do some work in any case. + \openindices + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + % Just to be on the safe side, close the input stream before the \input. + \openin 1 texinfo.cnf + \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi + \closein1 + \temp + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +\ifx\pdfoutput\undefined + \pdffalse + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\linkcolor = \relax + \let\pdfmakeoutlines = \relax +\else + \pdftrue + \pdfoutput = 1 + \input pdfcolor + \def\dopdfimage#1#2#3{% + \def\imagewidth{#2}% + \def\imageheight{#3}% + \ifnum\pdftexversion < 14 + \pdfimage + \else + \pdfximage + \fi + \ifx\empty\imagewidth\else width \imagewidth \fi + \ifx\empty\imageheight\else height \imageheight \fi + {#1.pdf}% + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + \def\pdfmkdest#1{\pdfdest name{#1@} xyz} + \def\pdfmkpgn#1{#1@} + \let\linkcolor = \Blue % was Cyan, but that seems light? + \def\endlink{\Black\pdfendlink} + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + \def\pdfmakeoutlines{{% + \openin 1 \jobname.toc + \ifeof 1\else\bgroup + \closein 1 + \indexnofonts + \def\tt{} + \let\_ = \normalunderscore + % Thanh's hack / proper braces in bookmarks + \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace + \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace + % + \def\chapentry ##1##2##3{} + \def\unnumbchapentry ##1##2{} + \def\secentry ##1##2##3##4{\advancenumber{chap##2}} + \def\unnumbsecentry ##1##2{} + \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} + \def\unnumbsubsecentry ##1##2{} + \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} + \def\unnumbsubsubsecentry ##1##2{} + \input \jobname.toc + \def\chapentry ##1##2##3{% + \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} + \def\unnumbchapentry ##1##2{% + \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \def\secentry ##1##2##3##4{% + \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} + \def\unnumbsecentry ##1##2{% + \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \def\subsecentry ##1##2##3##4##5{% + \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} + \def\unnumbsubsecentry ##1##2{% + \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \def\subsubsecentry ##1##2##3##4##5##6{% + \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} + \def\unnumbsubsubsecentry ##1##2{% + \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \input \jobname.toc + \egroup\fi + }} + \def\makelinks #1,{% + \def\params{#1}\def\E{END}% + \ifx\params\E + \let\nextmakelinks=\relax + \else + \let\nextmakelinks=\makelinks + \ifnum\lnkcount>0,\fi + \picknum{#1}% + \startlink attr{/Border [0 0 0]} + goto name{\pdfmkpgn{\the\pgn}}% + \linkcolor #1% + \advance\lnkcount by 1% + \endlink + \fi + \nextmakelinks + } + \def\picknum#1{\expandafter\pn#1} + \def\pn#1{% + \def\p{#1}% + \ifx\p\lbrace + \let\nextpn=\ppn + \else + \let\nextpn=\ppnn + \def\first{#1} + \fi + \nextpn + } + \def\ppn#1{\pgn=#1\gobble} + \def\ppnn{\pgn=\first} + \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \ifx\p\space\else\addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \fi + \nextsp} + \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + \def\pdfurl#1{% + \begingroup + \normalturnoffactive\def\@{@}% + \leavevmode\Red + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + % #1 + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS| + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}} + \linkcolor #1\endlink} + \def\mkpgn#1{#1@} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\fi % \ifx\pdfoutput + + +\message{fonts,} +% Font-change commands. + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf analogous to plain's \rm, etc. +\newfam\sffam +\def\sf{\fam=\sffam \tensf} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this one. +\def\ttsl{\tenttsl} + +% Use Computer Modern fonts at \magstephalf (11pt). +\newcount\mainmagstep +\mainmagstep=\magstephalf + +% Set the font macro #1 to the font named #2, adding on the +% specified font prefix (normally `cm'). +% #3 is the font's design size, #4 is a scale factor +\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\undefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} %where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +\ifx\bigger\relax +\let\mainmagstep=\magstep1 +\setfont\textrm\rmshape{12}{1000} +\setfont\texttt\ttshape{12}{1000} +\else +\setfont\textrm\rmshape{10}{\mainmagstep} +\setfont\texttt\ttshape{10}{\mainmagstep} +\fi +% Instead of cmb10, you many want to use cmbx10. +% cmbx10 is a prettier font on its own, but cmb10 +% looks better when embedded in a line with cmr10. +\setfont\textbf\bfshape{10}{\mainmagstep} +\setfont\textit\itshape{10}{\mainmagstep} +\setfont\textsl\slshape{10}{\mainmagstep} +\setfont\textsf\sfshape{10}{\mainmagstep} +\setfont\textsc\scshape{10}{\mainmagstep} +\setfont\textttsl\ttslshape{10}{\mainmagstep} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep + +% A few fonts for @defun, etc. +\setfont\defbf\bxshape{10}{\magstep1} %was 1314 +\setfont\deftt\ttshape{10}{\magstep1} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\setfont\smallrm\rmshape{9}{1000} +\setfont\smalltt\ttshape{9}{1000} +\setfont\smallbf\bfshape{10}{900} +\setfont\smallit\itshape{9}{1000} +\setfont\smallsl\slshape{9}{1000} +\setfont\smallsf\sfshape{9}{1000} +\setfont\smallsc\scshape{10}{900} +\setfont\smallttsl\ttslshape{10}{900} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 + +% Fonts for title page: +\setfont\titlerm\rmbshape{12}{\magstep3} +\setfont\titleit\itbshape{10}{\magstep4} +\setfont\titlesl\slbshape{10}{\magstep4} +\setfont\titlett\ttbshape{12}{\magstep3} +\setfont\titlettsl\ttslshape{10}{\magstep4} +\setfont\titlesf\sfbshape{17}{\magstep1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} + +% Chapter (and unnumbered) fonts (17.28pt). +\setfont\chaprm\rmbshape{12}{\magstep2} +\setfont\chapit\itbshape{10}{\magstep3} +\setfont\chapsl\slbshape{10}{\magstep3} +\setfont\chaptt\ttbshape{12}{\magstep2} +\setfont\chapttsl\ttslshape{10}{\magstep3} +\setfont\chapsf\sfbshape{17}{1000} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 + +% Section fonts (14.4pt). +\setfont\secrm\rmbshape{12}{\magstep1} +\setfont\secit\itbshape{10}{\magstep2} +\setfont\secsl\slbshape{10}{\magstep2} +\setfont\sectt\ttbshape{12}{\magstep1} +\setfont\secttsl\ttslshape{10}{\magstep2} +\setfont\secsf\sfbshape{12}{\magstep1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 + +% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. +% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. +% \setfont\ssecsl\slshape{10}{\magstep1} +% \setfont\ssectt\ttshape{10}{\magstep1} +% \setfont\ssecsf\sfshape{10}{\magstep1} + +%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. +%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than +%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. +%\setfont\ssectt\ttshape{10}{1315} +%\setfont\ssecsf\sfshape{10}{1315} + +%\let\ssecbf=\ssecrm + +% Subsection fonts (13.15pt). +\setfont\ssecrm\rmbshape{12}{\magstephalf} +\setfont\ssecit\itbshape{10}{1315} +\setfont\ssecsl\slbshape{10}{1315} +\setfont\ssectt\ttbshape{12}{\magstephalf} +\setfont\ssecttsl\ttslshape{10}{1315} +\setfont\ssecsf\sfbshape{12}{\magstephalf} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{\magstep1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +% The smallcaps and symbol fonts should actually be scaled \magstep1.5, +% but that is not a standard magnification. + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts, we +% don't bother to reset \scriptfont and \scriptscriptfont (which would +% also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy + \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf + \textfont\ttfam = \tentt \textfont\sffam = \tensf +} + + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this so that font changes will continue to work +% in math mode, where it is the current \fam that is relevant in most +% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam +% \tenbf}, for example. By redefining \tenbf, we obviate the need to +% redefine \bf itself. +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl + \resetmathfonts} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \resetmathfonts \setleading{25pt}} +\def\titlefont#1{{\titlefonts\rm #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \resetmathfonts \setleading{11pt}} + +% Set up the default fonts, so we can use them for creating boxes. +% +\textfonts + +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000} +\setfont\shortcontbf\bxshape{12}{1000} +\setfont\shortcontsl\slshape{12}{1000} + +%% Add scribe-like font environments, plus @l for inline lisp (usually sans +%% serif) and @ii for TeX italic + +% \smartitalic{ARG} outputs arg in italics, followed by an italic correction +% unless the following character is such as not to need one. +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} +\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} + +\let\i=\smartitalic +\let\var=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic +\let\cite=\smartslanted + +\def\b#1{{\bf #1}} +\let\strong=\b + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +\def\t#1{% + {\tt \rawbackslash \frenchspacing #1}% + \null +} +\let\ttfont=\t +\def\samp#1{`\tclose{#1}'\null} +\setfont\keyrm\rmshape{8}{1000} +\font\keysy=cmsy9 +\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% + \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% + \vbox{\hrule\kern-0.4pt + \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% + \kern-0.4pt\hrule}% + \kern-.06em\raise0.4pt\hbox{\angleright}}}} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @file, @option are the same as @samp. +\let\file=\samp +\let\option=\samp + +% @code is a modification of @t, +% which makes spaces the same size as normal in the surrounding text. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \frenchspacing + #1% + }% + \null +} + +% We *must* turn on hyphenation at `-' and `_' in \code. +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. + +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. +% -- rms. +{ + \catcode`\-=\active + \catcode`\_=\active + % + \global\def\code{\begingroup + \catcode`\-=\active \let-\codedash + \catcode`\_=\active \let_\codeunder + \codex + } + % + % If we end up with any active - characters when handling the index, + % just treat them as a normal -. + \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} +} + +\def\realdash{-} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} +\def\codex #1{\tclose{#1}\endgroup} + +%\let\exp=\tclose %Was temporary + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\def\kbdinputstyle{\parsearg\kbdinputstylexxx} +\def\kbdinputstylexxx#1{% + \def\arg{#1}% + \ifx\arg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\arg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\arg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is kbdinputdistinct. (Too much of a hassle to call the macro, +% the catcodes are wrong for parsearg to work.) +\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} + +\def\xkey{\key} +\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +\ifx\one\xkey\ifx\threex\three \key{#2}% +\else{\tclose{\kbdfont\look}}\fi +\else{\tclose{\kbdfont\look}}\fi} + +% For @url, @env, @command quotes seem unnecessary, so use \code. +\let\url=\code +\let\env=\code +\let\command=\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. Perhaps eventually put in +% a hypertex \special here. +% +\def\uref#1{\douref #1,,,\finish} +\def\douref#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @acronym downcases the argument and prints in smallcaps. +\def\acronym#1{{\smallcaps \lowercase{#1}}} + +% @pounds{} is a sterling sign. +\def\pounds{{\it\$}} + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\def\shorttitlepage{\parsearg\shorttitlepagezzz} +\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\def\titlepage{\begingroup \parindent=0pt \textfonts + \let\subtitlerm=\tenrm + \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% + % + \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% + % + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % + % Now you can print the title using @title. + \def\title{\parsearg\titlezzz}% + \def\titlezzz##1{\leftline{\titlefonts\rm ##1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Now you can put text using @subtitle. + \def\subtitle{\parsearg\subtitlezzz}% + \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% + % + % @author should come last, but may come many times. + \def\author{\parsearg\authorzzz}% + \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi + {\authorfont \leftline{##1}}}% + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \oldpage + \let\page = \oldpage + \hbox{}}% +% \def\page{\oldpage \hbox{}} +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi + % + \ifpdf \pdfmakepagedesttrue \fi + % + \HEADINGSon +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make Tex use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + +\def\evenheading{\parsearg\evenheadingxxx} +\def\oddheading{\parsearg\oddheadingxxx} +\def\everyheading{\parsearg\everyheadingxxx} + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\oddfooting{\parsearg\oddfootingxxx} +\def\everyfooting{\parsearg\everyfootingxxx} + +{\catcode`\@=0 % + +\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} +\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} +\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} +\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} +\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -\baselineskip + \global\advance\vsize by -\baselineskip +} + +\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} +% +}% unbind the catcode of @. + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\HEADINGSoff{ +\global\evenheadline={\hfil} \global\evenfootline={\hfil} +\global\oddheadline={\hfil} \global\oddfootline={\hfil}} +\HEADINGSoff +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{ +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{ +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\undefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg\settitlezzz} +\def\settitlezzz #1{\gdef\thistitle{#1}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @vtable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} +\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} + +\def\internalBkitem{\smallbreak \parsearg\kitemzzz} +\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} + +\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% + \itemzzz {#1}} + +\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% + \itemzzz {#1}} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemfont{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. Unfortunately + % we can't prevent a possible page break at the following + % \baselineskip glue. + \nobreak + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a table}} +\def\itemx{\errmessage{@itemx while not in a table}} +\def\kitem{\errmessage{@kitem while not in a table}} +\def\kitemx{\errmessage{@kitemx while not in a table}} +\def\xitem{\errmessage{@xitem while not in a table}} +\def\xitemx{\errmessage{@xitemx while not in a table}} + +% Contains a kludge to get @end[description] to work. +\def\description{\tablez{\dontindex}{1}{}{}{}{}} + +% @table, @ftable, @vtable. +\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} +{\obeylines\obeyspaces% +\gdef\tablex #1^^M{% +\tabley\dontindex#1 \endtabley}} + +\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} +{\obeylines\obeyspaces% +\gdef\ftablex #1^^M{% +\tabley\fnitemindex#1 \endtabley +\def\Eftable{\endgraf\afterenvbreak\endgroup}% +\let\Etable=\relax}} + +\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} +{\obeylines\obeyspaces% +\gdef\vtablex #1^^M{% +\tabley\vritemindex#1 \endtabley +\def\Evtable{\endgraf\afterenvbreak\endgroup}% +\let\Etable=\relax}} + +\def\dontindex #1{} +\def\fnitemindex #1{\doind {fn}{\code{#1}}}% +\def\vritemindex #1{\doind {vr}{\code{#1}}}% + +{\obeyspaces % +\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% +\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} + +\def\tablez #1#2#3#4#5#6{% +\aboveenvbreak % +\begingroup % +\def\Edescription{\Etable}% Necessary kludge. +\let\itemindex=#1% +\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % +\ifnum 0#4>0 \tableindent=#4\mil \fi % +\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % +\def\itemfont{#2}% +\itemmax=\tableindent % +\advance \itemmax by -\itemmargin % +\advance \leftskip by \tableindent % +\exdentamount=\tableindent +\parindent = 0pt +\parskip = \smallskipamount +\ifdim \parskip=0pt \parskip=2pt \fi% +\def\Etable{\endgraf\afterenvbreak\endgroup}% +\let\item = \internalBitem % +\let\itemx = \internalBitemx % +\let\kitem = \internalBkitem % +\let\kitemx = \internalBkitemx % +\let\xitem = \internalBxitem % +\let\xitemx = \internalBxitemx % +} + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\def\itemize{\parsearg\itemizezzz} + +\def\itemizezzz #1{% + \begingroup % ended by the @end itemize + \itemizey {#1}{\Eitemize} +} + +\def\itemizey #1#2{% +\aboveenvbreak % +\itemmax=\itemindent % +\advance \itemmax by -\itemmargin % +\advance \leftskip by \itemindent % +\exdentamount=\itemindent +\parindent = 0pt % +\parskip = \smallskipamount % +\ifdim \parskip=0pt \parskip=2pt \fi% +\def#2{\endgraf\afterenvbreak\endgroup}% +\def\itemcontents{#1}% +\let\item=\itemizeitem} + +% Set sfcode to normal for the chars that usually have another value. +% These are `.?!:;,' +\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 + \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\def\enumerate{\parsearg\enumeratezzz} +\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + \begingroup % ended by the @end enumerate + % + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call itemizey, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \itemizey{#1.}\Eenumerate\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + +% Definition of @item while inside @itemize. + +\def\itemizeitem{% +\advance\itemno by 1 +{\let\par=\endgraf \smallbreak}% +\ifhmode \errmessage{In hmode at itemizeitem}\fi +{\parskip=0in \hskip 0pt +\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% +\vadjust{\penalty 1200}}% +\flushcr} + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. +% +% For those who want to use more than one line's worth of words in +% the preamble, break the line within one argument and it +% will parse correctly, i.e., +% +% @multitable {Column 1 template} {Column 2 template} {Column 3 +% template} +% Not: +% @multitable {Column 1 template} {Column 2 template} +% {Column 3 template} + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab, @multitable or @end multitable do not need to be on their +% own lines, but it will not hurt if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the part of the @columnfraction before the decimal point, which +% is presumably either 0 or the empty string (but we don't check, we +% just throw it away). #2 is the decimal part, which we use as the +% percent of \hsize for this column. +\def\pickupwholefraction#1.#2 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; + % typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% This used to have \hskip1sp. But then the space in a template line is +% not enough. That is bad. So let's go back to just & until we +% encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{&} + +% @multitable ... @end multitable definitions: +% +\def\multitable{\parsearg\dotable} +\def\dotable#1{\bgroup + \vskip\parskip + \let\item\crcr + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% + % + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % \everycr will reset column counter, \colcount, at the end of + % each line. Every column entry will cause \colcount to advance by one. + % The table preamble + % looks at the current \colcount to find the correct column width. + \everycr{\noalign{% + % + % \filbreak%% keeps underfull box messages off when table breaks over pages. + % Maybe so, but it also creates really weird page breaks when the table + % breaks over pages. Wouldn't \vfil be better? Wait until the problem + % manifests itself, so it can be fixed for real --karl. + \global\colcount=0\relax}}% + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup&\global\advance\colcount by 1\relax + \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively marking + % characters. + \noindent\ignorespaces##\unskip\multistrut}\cr +} + +\def\setmultitablespacing{% test to see if user has set \multitablelinespace. +% If so, do nothing. If not, give it an appropriate dimension based on +% current baselineskip. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +%% strut to put in table in case some entry doesn't have descenders, +%% to keep lines equally spaced +\let\multistrut = \strut +\else +%% FIXME: what is \box0 supposed to be? +\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 +width0pt\relax} \fi +%% Test to see if parskip is larger than space between lines of +%% table. If not, do nothing. +%% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi} + + +\message{conditionals,} +% Prevent errors for section commands. +% Used in @ignore and in failing conditionals. +\def\ignoresections{% + \let\chapter=\relax + \let\unnumbered=\relax + \let\top=\relax + \let\unnumberedsec=\relax + \let\unnumberedsection=\relax + \let\unnumberedsubsec=\relax + \let\unnumberedsubsection=\relax + \let\unnumberedsubsubsec=\relax + \let\unnumberedsubsubsection=\relax + \let\section=\relax + \let\subsec=\relax + \let\subsubsec=\relax + \let\subsection=\relax + \let\subsubsection=\relax + \let\appendix=\relax + \let\appendixsec=\relax + \let\appendixsection=\relax + \let\appendixsubsec=\relax + \let\appendixsubsection=\relax + \let\appendixsubsubsec=\relax + \let\appendixsubsubsection=\relax + \let\contents=\relax + \let\smallbook=\relax + \let\titlepage=\relax +} + +% Used in nested conditionals, where we have to parse the Texinfo source +% and so want to turn off most commands, in case they are used +% incorrectly. +% +\def\ignoremorecommands{% + \let\defcodeindex = \relax + \let\defcv = \relax + \let\deffn = \relax + \let\deffnx = \relax + \let\defindex = \relax + \let\defivar = \relax + \let\defmac = \relax + \let\defmethod = \relax + \let\defop = \relax + \let\defopt = \relax + \let\defspec = \relax + \let\deftp = \relax + \let\deftypefn = \relax + \let\deftypefun = \relax + \let\deftypeivar = \relax + \let\deftypeop = \relax + \let\deftypevar = \relax + \let\deftypevr = \relax + \let\defun = \relax + \let\defvar = \relax + \let\defvr = \relax + \let\ref = \relax + \let\xref = \relax + \let\printindex = \relax + \let\pxref = \relax + \let\settitle = \relax + \let\setchapternewpage = \relax + \let\setchapterstyle = \relax + \let\everyheading = \relax + \let\evenheading = \relax + \let\oddheading = \relax + \let\everyfooting = \relax + \let\evenfooting = \relax + \let\oddfooting = \relax + \let\headings = \relax + \let\include = \relax + \let\lowersections = \relax + \let\down = \relax + \let\raisesections = \relax + \let\up = \relax + \let\set = \relax + \let\clear = \relax + \let\item = \relax +} + +% Ignore @ignore ... @end ignore. +% +\def\ignore{\doignore{ignore}} + +% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. +% +\def\ifinfo{\doignore{ifinfo}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifnottex{\doignore{ifnottex}} +\def\html{\doignore{html}} +\def\menu{\doignore{menu}} +\def\direntry{\doignore{direntry}} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory = \comment + +% Ignore text until a line `@end #1'. +% +\def\doignore#1{\begingroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define a command to swallow text until we reach `@end #1'. + % This @ is a catcode 12 token (that is the normal catcode of @ in + % this texinfo.tex file). We change the catcode of @ below to match. + \long\def\doignoretext##1@end #1{\enddoignore}% + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \catcode32 = 10 + % + % Ignore braces, too, so mismatched braces don't cause trouble. + \catcode`\{ = 9 + \catcode`\} = 9 + % + % We must not have @c interpreted as a control sequence. + \catcode`\@ = 12 + % + % Make the letter c a comment character so that the rest of the line + % will be ignored. This way, the document can have (for example) + % @c @end ifinfo + % and the @end ifinfo will be properly ignored. + % (We've just changed @ to catcode 12.) + \catcode`\c = 14 + % + % And now expand that command. + \doignoretext +} + +% What we do to finish off ignored text. +% +\def\enddoignore{\endgroup\ignorespaces}% + +\newif\ifwarnedobs\warnedobsfalse +\def\obstexwarn{% + \ifwarnedobs\relax\else + % We need to warn folks that they may have trouble with TeX 3.0. + % This uses \immediate\write16 rather than \message to get newlines. + \immediate\write16{} + \immediate\write16{WARNING: for users of Unix TeX 3.0!} + \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} + \immediate\write16{If you are running another version of TeX, relax.} + \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} + \immediate\write16{ Then upgrade your TeX installation if you can.} + \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} + \immediate\write16{If you are stuck with version 3.0, run the} + \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} + \immediate\write16{ to use a workaround.} + \immediate\write16{} + \global\warnedobstrue + \fi +} + +% **In TeX 3.0, setting text in \nullfont hangs tex. For a +% workaround (which requires the file ``dummy.tfm'' to be installed), +% uncomment the following line: +%%%%%\font\nullfont=dummy\let\obstexwarn=\relax + +% Ignore text, except that we keep track of conditional commands for +% purposes of nesting, up to an `@end #1' command. +% +\def\nestedignore#1{% + \obstexwarn + % We must actually expand the ignored text to look for the @end + % command, so that nested ignore constructs work. Thus, we put the + % text into a \vbox and then do nothing with the result. To minimize + % the change of memory overflow, we follow the approach outlined on + % page 401 of the TeXbook: make the current font be a dummy font. + % + \setbox0 = \vbox\bgroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define `@end #1' to end the box, which will in turn undefine the + % @end command again. + \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% + % + % We are going to be parsing Texinfo commands. Most cause no + % trouble when they are used incorrectly, but some commands do + % complicated argument parsing or otherwise get confused, so we + % undefine them. + % + % We can't do anything about stray @-signs, unfortunately; + % they'll produce `undefined control sequence' errors. + \ignoremorecommands + % + % Set the current font to be \nullfont, a TeX primitive, and define + % all the font commands to also use \nullfont. We don't use + % dummy.tfm, as suggested in the TeXbook, because not all sites + % might have that installed. Therefore, math mode will still + % produce output, but that should be an extremely small amount of + % stuff compared to the main input. + % + \nullfont + \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont + \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont + \let\tensf=\nullfont + % Similarly for index fonts (mostly for their use in smallexample). + \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont + \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont + \let\smallsf=\nullfont + % + % Don't complain when characters are missing from the fonts. + \tracinglostchars = 0 + % + % Don't bother to do space factor calculations. + \frenchspacing + % + % Don't report underfull hboxes. + \hbadness = 10000 + % + % Do minimal line-breaking. + \pretolerance = 10000 + % + % Do not execute instructions in @tex + \def\tex{\doignore{tex}}% + % Do not execute macro definitions. + % `c' is a comment character, so the word `macro' will get cut off. + \def\macro{\doignore{ma}}% +} + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. Make sure the catcode of space is correct to avoid +% losing inside @example, for instance. +% +\def\set{\begingroup\catcode` =10 + \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. + \parsearg\setxxx} +\def\setxxx#1{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + \def\temp{#2}% + \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty + \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. + \fi + \endgroup +} +% Can't use \xdef to pre-expand #2 and save some time, since \temp or +% \next or other control sequences that we've defined might get us into +% an infinite loop. Consider `@set foo @cite{bar}'. +\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\def\clear{\parsearg\clearxxx} +\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} + +% @value{foo} gets the text saved in variable foo. +{ + \catcode`\_ = \active + % + % We might end up with active _ or - characters in the argument if + % we're called from @code, as @code{@value{foo-bar_}}. So \let any + % such active characters to their normal equivalents. + \gdef\value{\begingroup + \catcode`\-=12 \catcode`\_=12 + \indexbreaks \let_\normalunderscore + \valuexxx} +} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we \let\value to this in \indexdummies). Ones +% whose names contain - or _ still won't work, but we can't do anything +% about that. The command has to be fully expandable, since the result +% winds up in the index file. This means that if the variable's value +% contains other Texinfo commands, it's almost certain it will fail +% (although perhaps we could fix that with sufficient work to do a +% one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +\def\ifset{\parsearg\ifsetxxx} +\def\ifsetxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifsetfail + \else + \expandafter\ifsetsucceed + \fi +} +\def\ifsetsucceed{\conditionalsucceed{ifset}} +\def\ifsetfail{\nestedignore{ifset}} +\defineunmatchedend{ifset} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +\def\ifclear{\parsearg\ifclearxxx} +\def\ifclearxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifclearsucceed + \else + \expandafter\ifclearfail + \fi +} +\def\ifclearsucceed{\conditionalsucceed{ifclear}} +\def\ifclearfail{\nestedignore{ifclear}} +\defineunmatchedend{ifclear} + +% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text +% following, through the first @end iftex (etc.). Make `@end iftex' +% (etc.) valid only after an @iftex. +% +\def\iftex{\conditionalsucceed{iftex}} +\def\ifnothtml{\conditionalsucceed{ifnothtml}} +\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} +\defineunmatchedend{iftex} +\defineunmatchedend{ifnothtml} +\defineunmatchedend{ifnotinfo} + +% We can't just want to start a group at @iftex (for example) and end it +% at @end iftex, since then @set commands inside the conditional have no +% effect (they'd get reverted at the end of the group). So we must +% define \Eiftex to redefine itself to be its previous value. (We can't +% just define it to fail again with an ``unmatched end'' error, since +% the @ifset might be nested.) +% +\def\conditionalsucceed#1{% + \edef\temp{% + % Remember the current value of \E#1. + \let\nece{prevE#1} = \nece{E#1}% + % + % At the `@end #1', redefine \E#1 to be its previous value. + \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% + }% + \temp +} + +% We need to expand lots of \csname's, but we don't want to expand the +% control sequences after we've constructed them. +% +\def\nece#1{\expandafter\noexpand\csname#1\endcsname} + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within \newindex. +{\catcode`\@=11 +\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \undefined + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname\donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +\def\indexdummies{% +\def\ { }% +% Take care of the plain tex accent commands. +\def\"{\realbackslash "}% +\def\`{\realbackslash `}% +\def\'{\realbackslash '}% +\def\^{\realbackslash ^}% +\def\~{\realbackslash ~}% +\def\={\realbackslash =}% +\def\b{\realbackslash b}% +\def\c{\realbackslash c}% +\def\d{\realbackslash d}% +\def\u{\realbackslash u}% +\def\v{\realbackslash v}% +\def\H{\realbackslash H}% +% Take care of the plain tex special European modified letters. +\def\oe{\realbackslash oe}% +\def\ae{\realbackslash ae}% +\def\aa{\realbackslash aa}% +\def\OE{\realbackslash OE}% +\def\AE{\realbackslash AE}% +\def\AA{\realbackslash AA}% +\def\o{\realbackslash o}% +\def\O{\realbackslash O}% +\def\l{\realbackslash l}% +\def\L{\realbackslash L}% +\def\ss{\realbackslash ss}% +% Take care of texinfo commands likely to appear in an index entry. +% (Must be a way to avoid doing expansion at all, and thus not have to +% laboriously list every single command here.) +\def\@{@}% will be @@ when we switch to @ as escape char. +% Need these in case \tex is in effect and \{ is a \delimiter again. +% But can't use \lbracecmd and \rbracecmd because texindex assumes +% braces and backslashes are used only as delimiters. +\let\{ = \mylbrace +\let\} = \myrbrace +\def\_{{\realbackslash _}}% +\def\w{\realbackslash w }% +\def\bf{\realbackslash bf }% +%\def\rm{\realbackslash rm }% +\def\sl{\realbackslash sl }% +\def\sf{\realbackslash sf}% +\def\tt{\realbackslash tt}% +\def\gtr{\realbackslash gtr}% +\def\less{\realbackslash less}% +\def\hat{\realbackslash hat}% +\def\TeX{\realbackslash TeX}% +\def\dots{\realbackslash dots }% +\def\result{\realbackslash result}% +\def\equiv{\realbackslash equiv}% +\def\expansion{\realbackslash expansion}% +\def\print{\realbackslash print}% +\def\error{\realbackslash error}% +\def\point{\realbackslash point}% +\def\copyright{\realbackslash copyright}% +\def\tclose##1{\realbackslash tclose {##1}}% +\def\code##1{\realbackslash code {##1}}% +\def\uref##1{\realbackslash uref {##1}}% +\def\url##1{\realbackslash url {##1}}% +\def\env##1{\realbackslash env {##1}}% +\def\command##1{\realbackslash command {##1}}% +\def\option##1{\realbackslash option {##1}}% +\def\dotless##1{\realbackslash dotless {##1}}% +\def\samp##1{\realbackslash samp {##1}}% +\def\,##1{\realbackslash ,{##1}}% +\def\t##1{\realbackslash t {##1}}% +\def\r##1{\realbackslash r {##1}}% +\def\i##1{\realbackslash i {##1}}% +\def\b##1{\realbackslash b {##1}}% +\def\sc##1{\realbackslash sc {##1}}% +\def\cite##1{\realbackslash cite {##1}}% +\def\key##1{\realbackslash key {##1}}% +\def\file##1{\realbackslash file {##1}}% +\def\var##1{\realbackslash var {##1}}% +\def\kbd##1{\realbackslash kbd {##1}}% +\def\dfn##1{\realbackslash dfn {##1}}% +\def\emph##1{\realbackslash emph {##1}}% +\def\acronym##1{\realbackslash acronym {##1}}% +% +% Handle some cases of @value -- where the variable name does not +% contain - or _, and the value does not contain any +% (non-fully-expandable) commands. +\let\value = \expandablevalue +% +\unsepspaces +% Turn off macro expansion +\turnoffmacros +} + +% If an index command is used in an @example environment, any spaces +% therein should become regular spaces in the raw index file, not the +% expansion of \tie (\\leavevmode \penalty \@M \ ). +{\obeyspaces + \gdef\unsepspaces{\obeyspaces\let =\space}} + +% \indexnofonts no-ops all font-change commands. +% This is used when outputting the strings to sort the index by. +\def\indexdummyfont#1{#1} +\def\indexdummytex{TeX} +\def\indexdummydots{...} + +\def\indexnofonts{% +% Just ignore accents. +\let\,=\indexdummyfont +\let\"=\indexdummyfont +\let\`=\indexdummyfont +\let\'=\indexdummyfont +\let\^=\indexdummyfont +\let\~=\indexdummyfont +\let\==\indexdummyfont +\let\b=\indexdummyfont +\let\c=\indexdummyfont +\let\d=\indexdummyfont +\let\u=\indexdummyfont +\let\v=\indexdummyfont +\let\H=\indexdummyfont +\let\dotless=\indexdummyfont +% Take care of the plain tex special European modified letters. +\def\oe{oe}% +\def\ae{ae}% +\def\aa{aa}% +\def\OE{OE}% +\def\AE{AE}% +\def\AA{AA}% +\def\o{o}% +\def\O{O}% +\def\l{l}% +\def\L{L}% +\def\ss{ss}% +\let\w=\indexdummyfont +\let\t=\indexdummyfont +\let\r=\indexdummyfont +\let\i=\indexdummyfont +\let\b=\indexdummyfont +\let\emph=\indexdummyfont +\let\strong=\indexdummyfont +\let\cite=\indexdummyfont +\let\sc=\indexdummyfont +%Don't no-op \tt, since it isn't a user-level command +% and is used in the definitions of the active chars like <, >, |... +%\let\tt=\indexdummyfont +\let\tclose=\indexdummyfont +\let\code=\indexdummyfont +\let\url=\indexdummyfont +\let\uref=\indexdummyfont +\let\env=\indexdummyfont +\let\acronym=\indexdummyfont +\let\command=\indexdummyfont +\let\option=\indexdummyfont +\let\file=\indexdummyfont +\let\samp=\indexdummyfont +\let\kbd=\indexdummyfont +\let\key=\indexdummyfont +\let\var=\indexdummyfont +\let\TeX=\indexdummytex +\let\dots=\indexdummydots +\def\@{@}% +} + +% To define \realbackslash, we must make \ not be an escape. +% We must first make another character (@) an escape +% so we do not become unable to do a definition. + +{\catcode`\@=0 \catcode`\\=\other + @gdef@realbackslash{\}} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% For \ifx comparisons. +\def\emptymacro{\empty} + +% Most index entries go through here, but \dosubind is the general case. +% +\def\doind#1#2{\dosubind{#1}{#2}\empty} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% \empty if called from \doind, as we usually are. The main exception +% is with defuns, which call us directly. +% +\def\dosubind#1#2#3{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \fi + {% + \count255=\lastpenalty + {% + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + {% + \let\folio = 0% We will expand all macros now EXCEPT \folio. + \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + \def\thirdarg{#3}% + % + % If third arg is present, precede it with space in sort key. + \ifx\thirdarg\emptymacro + \let\subentry = \empty + \else + \def\subentry{ #3}% + \fi + % + % First process the index entry with all font commands turned + % off to get the string to sort by. + {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% + % + % Now the real index entry with the fonts. + \toks0 = {#2}% + % + % If third (subentry) arg is present, add it to the index + % string. And include a space. + \ifx\thirdarg\emptymacro \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + % Set up the complete index entry, with both the sort key + % and the original text, including any font commands. We write + % three arguments to \entry to the .?? file, texindex reduces to + % two when writing the .??s sorted result. + \edef\temp{% + \write\csname#1indfile\endcsname{% + \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% + }% + % + % If a skip is the last thing on the list now, preserve it + % by backing up by \lastskip, doing the \write, then inserting + % the skip again. Otherwise, the whatsit generated by the + % \write will make \lastskip zero. The result is that sequences + % like this: + % @end defun + % @tindex whatever + % @defun ... + % will have extra space inserted, because the \medbreak in the + % start of the @defun won't see the skip inserted by the @end of + % the previous defun. + % + % But don't do any of this if we're not in vertical mode. We + % don't want to do a \vskip and prematurely end a paragraph. + % + % Avoid page breaks due to these extra skips, too. + % + \iflinks + \ifvmode + \skip0 = \lastskip + \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi + \fi + % + \temp % do the write + % + % + \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi + \fi + }% + }% + \penalty\count255 + }% +} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\def\printindex{\parsearg\doprintindex} +\def\doprintindex#1{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \indexbreaks + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\rawbackslashxx}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \penalty -300 + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + \vskip .33\baselineskip plus .1\baselineskip + % + % Do our best not to break after the initial. + \nobreak +}} + +% This typesets a paragraph consisting of #1, dot leaders, and then #2 +% flush to the right margin. It is used for index and table of contents +% entries. The paragraph is indented by \leftskip. +% +\def\entry#1#2{\begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing columns. + \vskip 0pt plus1pt + % + % Start a ``paragraph'' for the index entry so the line breaking + % parameters we've set above will have an effect. + \noindent + % + % Insert the text of the index entry. TeX will do line-breaking on it. + #1% + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#2}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd\ \else% + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + \ #2% The page number ends the paragraph. + \fi + \fi% + \par +\endgroup} + +% Like \dotfill except takes at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm + +\def\secondary #1#2{ +{\parfillskip=0in \parskip=0in +\hangindent =1in \hangafter=1 +\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% \def\appendixletter{\char\the\appendixno} +% We do the following for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines this as the name of the chapter. +% page headings and footings can use it. @section does likewise. +\def\thischapter{} +\def\thissection{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raise/lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% Choose a numbered-heading macro +% #1 is heading level if unmodified by @raisesections or @lowersections +% #2 is text for heading +\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \chapterzzz{#2} +\or + \seczzz{#2} +\or + \numberedsubseczzz{#2} +\or + \numberedsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \chapterzzz{#2} + \else + \numberedsubsubseczzz{#2} + \fi +\fi +} + +% like \numhead, but chooses appendix heading levels +\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \appendixzzz{#2} +\or + \appendixsectionzzz{#2} +\or + \appendixsubseczzz{#2} +\or + \appendixsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \appendixzzz{#2} + \else + \appendixsubsubseczzz{#2} + \fi +\fi +} + +% like \numhead, but chooses numberless heading levels +\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \unnumberedzzz{#2} +\or + \unnumberedseczzz{#2} +\or + \unnumberedsubseczzz{#2} +\or + \unnumberedsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \unnumberedzzz{#2} + \else + \unnumberedsubsubseczzz{#2} + \fi +\fi +} + +% @chapter, @appendix, @unnumbered. +\def\thischaptername{No Chapter Title} +\outer\def\chapter{\parsearg\chapteryyy} +\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz #1{% +\secno=0 \subsecno=0 \subsubsecno=0 +\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% +\chapmacro {#1}{\the\chapno}% +\gdef\thissection{#1}% +\gdef\thischaptername{#1}% +% We don't substitute the actual chapter name into \thischapter +% because we don't want its macros evaluated now. +\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% + {\the\chapno}}}% +\temp +\donoderef +\global\let\section = \numberedsec +\global\let\subsection = \numberedsubsec +\global\let\subsubsection = \numberedsubsubsec +} + +\outer\def\appendix{\parsearg\appendixyyy} +\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz #1{% +\secno=0 \subsecno=0 \subsubsecno=0 +\global\advance \appendixno by 1 +\message{\putwordAppendix\space \appendixletter}% +\chapmacro {#1}{\putwordAppendix{} \appendixletter}% +\gdef\thissection{#1}% +\gdef\thischaptername{#1}% +\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% + {\putwordAppendix{} \appendixletter}}}% +\temp +\appendixnoderef +\global\let\section = \appendixsec +\global\let\subsection = \appendixsubsec +\global\let\subsubsection = \appendixsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\def\centerchap{\parsearg\centerchapyyy} +\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} + +% @top is like @unnumbered. +\outer\def\top{\parsearg\unnumberedyyy} + +\outer\def\unnumbered{\parsearg\unnumberedyyy} +\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz #1{% +\secno=0 \subsecno=0 \subsubsecno=0 +% +% This used to be simply \message{#1}, but TeX fully expands the +% argument to \message. Therefore, if #1 contained @-commands, TeX +% expanded them. For example, in `@unnumbered The @cite{Book}', TeX +% expanded @cite (which turns out to cause errors because \cite is meant +% to be executed, not expanded). +% +% Anyway, we don't want the fully-expanded definition of @cite to appear +% as a result of the \message, we just want `@cite' itself. We use +% \the to achieve this: TeX expands \the only once, +% simply yielding the contents of . (We also do this for +% the toc entries.) +\toks0 = {#1}\message{(\the\toks0)}% +% +\unnumbchapmacro {#1}% +\gdef\thischapter{#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% +\temp +\unnumbnoderef +\global\let\section = \unnumberedsec +\global\let\subsection = \unnumberedsubsec +\global\let\subsubsection = \unnumberedsubsubsec +} + +% Sections. +\outer\def\numberedsec{\parsearg\secyyy} +\def\secyyy #1{\numhead1{#1}} % normally calls seczzz +\def\seczzz #1{% +\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % +\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\the\chapno}{\the\secno}}}% +\temp +\donoderef +\nobreak +} + +\outer\def\appendixsection{\parsearg\appendixsecyyy} +\outer\def\appendixsec{\parsearg\appendixsecyyy} +\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz #1{% +\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % +\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\appendixletter}{\the\secno}}}% +\temp +\appendixnoderef +\nobreak +} + +\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} +\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz #1{% +\plainsecheading {#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} + +% Subsections. +\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} +\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz #1{% +\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % +\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}}}% +\temp +\donoderef +\nobreak +} + +\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} +\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz #1{% +\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % +\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}}}% +\temp +\appendixnoderef +\nobreak +} + +\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} +\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz #1{% +\plainsubsecheading {#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% + {\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} + +% Subsubsections. +\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} +\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz #1{% +\gdef\thissection{#1}\global\advance \subsubsecno by 1 % +\subsubsecheading {#1} + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\donoderef +\nobreak +} + +\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} +\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz #1{% +\gdef\thissection{#1}\global\advance \subsubsecno by 1 % +\subsubsecheading {#1} + {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\appendixnoderef +\nobreak +} + +\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} +\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz #1{% +\plainsubsubsecheading {#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% + {\the\toks0}}}% +\temp +\unnumbnoderef +\nobreak +} + +% These are variants which are not "outer", so they can appear in @ifinfo. +% Actually, they should now be obsolete; ordinary section commands should work. +\def\infotop{\parsearg\unnumberedzzz} +\def\infounnumbered{\parsearg\unnumberedzzz} +\def\infounnumberedsec{\parsearg\unnumberedseczzz} +\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} +\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} + +\def\infoappendix{\parsearg\appendixzzz} +\def\infoappendixsec{\parsearg\appendixseczzz} +\def\infoappendixsubsec{\parsearg\appendixsubseczzz} +\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} + +\def\infochapter{\parsearg\chapterzzz} +\def\infosection{\parsearg\sectionzzz} +\def\infosubsection{\parsearg\subsectionzzz} +\def\infosubsubsection{\parsearg\subsubsectionzzz} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\global\let\section = \numberedsec +\global\let\subsection = \numberedsubsec +\global\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +% NOTE on use of \vbox for chapter headings, section headings, and such: +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. +% 3) Likewise, headings look best if no \parindent is used, and +% if justification is not attempted. Hence \raggedright. + + +\def\majorheading{\parsearg\majorheadingzzz} +\def\majorheadingzzz #1{% +{\advance\chapheadingskip by 10pt \chapbreak }% +{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 200} + +\def\chapheading{\parsearg\chapheadingzzz} +\def\chapheadingzzz #1{\chapbreak % +{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 200} + +% @heading, @subheading, @subsubheading. +\def\heading{\parsearg\plainsecheading} +\def\subheading{\parsearg\plainsubsecheading} +\def\subsubheading{\parsearg\plainsubsubsecheading} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +%%% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} + +%%% Define plain chapter starts, and page on/off switching for it +% Parameter controlling skip before chapter headings (if needed) + +\newskip\chapheadingskip + +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{ +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +\def\CHAPFplain{ +\global\let\chapmacro=\chfplain +\global\let\unnumbchapmacro=\unnchfplain +\global\let\centerchapmacro=\centerchfplain} + +% Plain chapter opening. +% #1 is the text, #2 the chapter number or empty if unnumbered. +\def\chfplain#1#2{% + \pchapsepmacro + {% + \chapfonts \rm + \def\chapnum{#2}% + \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% Plain opening for unnumbered. +\def\unnchfplain#1{\chfplain{#1}{}} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerchfplain#1{{% + \def\centerparametersmaybe{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt + }% + \chfplain{#1}{}% +}} + +\CHAPFplain % The default + +\def\unnchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\nobreak +} + +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} + +\def\centerchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak +} + +\def\CHAPFopen{ +\global\let\chapmacro=\chfopen +\global\let\unnumbchapmacro=\unnchfopen +\global\let\centerchapmacro=\centerchfopen} + + +% Section titles. +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip {-1000}} +\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} +\def\plainsecheading#1{\sectionheading{sec}{}{#1}} + +% Subsection titles. +\newskip \subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} +\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} +\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} + +% Subsubsection titles. +\let\subsubsecheadingskip = \subsecheadingskip +\let\subsubsecheadingbreak = \subsecheadingbreak +\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} +\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} + + +% Print any size section title. +% +% #1 is the section type (sec/subsec/subsubsec), #2 is the section +% number (maybe empty), #3 the text. +\def\sectionheading#1#2#3{% + {% + \expandafter\advance\csname #1headingskip\endcsname by \parskip + \csname #1headingbreak\endcsname + }% + {% + % Switch to the right set of fonts. + \csname #1fonts\endcsname \rm + % + % Only insert the separating space if we have a section number. + \def\secnum{#2}% + \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 % zero if no section number + \unhbox0 #3}% + }% + \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. We supply {\folio} at the end of the +% argument, which will end up as the last argument to the \...entry macro. +% +% We open the .toc file here instead of at @setfilename or any other +% given time so that @contents can be put in the document anywhere. +% +\newif\iftocfileopened +\def\writetocentry#1{% + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + \iflinks \write\tocfile{#1{\folio}}\fi +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Finish up the main text and prepare to read what we've written +% to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \unnumbchapmacro{#1}\def\thischapter{}% + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + % We can't do this, because then an actual ^ in a section + % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. + %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \pageno = \lastnegativepageno \fi +} + + +% Normal (long) toc. +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \pdfmakeoutlines + \endgroup + \lastnegativepageno = \pageno + \pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\chapentry = \shortchapentry + \let\unnumbchapentry = \shortunnumberedentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\secentry ##1##2##3##4{} + \def\unnumbsecentry ##1##2{} + \def\subsecentry ##1##2##3##4##5{} + \def\unnumbsubsecentry ##1##2{} + \def\subsubsecentry ##1##2##3##4##5##6{} + \def\unnumbsubsubsecentry ##1##2{} + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \pageno = \savepageno +} +\let\shortcontents = \summarycontents + +\ifpdf + \pdfcatalog{/PageMode /UseOutlines}% +\fi + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Chapter-level things, for both the long and short contents. +\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} + +% See comments in \dochapentry re vbox and related settings +\def\shortchapentry#1#2#3{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% +} + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. +% We could simplify the code here by writing out an \appendixentry +% command in the toc file for appendices, instead of using \chapentry +% for both, but it doesn't seem worth it. +% +\newdimen\shortappendixwidth +% +\def\shortchaplabel#1{% + % Compute width of word "Appendix", may change with language. + \setbox0 = \hbox{\shortcontrm \putwordAppendix}% + \shortappendixwidth = \wd0 + % + % We typeset #1 in a box of constant width, regardless of the text of + % #1, so the chapter titles will come out aligned. + \setbox0 = \hbox{#1}% + \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi + % + % This space should be plenty, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + \advance\dimen0 by 1.1em + \hbox to \dimen0{#1\hfil}% +} + +\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} +\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} + +% Sections. +\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} +\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} + +% Subsections. +\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} +\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} + +% And subsubsections. +\def\subsubsecentry#1#2#3#4#5#6{% + \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} +\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} + +% This parameter controls the indentation of the various levels. +\newdimen\tocindent \tocindent = 3pc + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% Final typesetting of a toc entry; we use the same \entry macro as for +% the index entries, but we want to suppress hyphenation here. (We +% can't do that in the \entry macro, since index entries might consist +% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) +\def\tocentry#1#2{\begingroup + \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks + % Do not use \turnoffactive in these arguments. Since the toc is + % typeset in cmr, so characters such as _ would come out wrong; we + % have to do the usual translation tricks. + \entry{#1}{#2}% +\endgroup} + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\let\subsecentryfonts = \textfonts +\let\subsubsecentryfonts = \textfonts + + +\message{environments,} +% @foo ... @end foo. + +% Since these characters are used in examples, it should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% Furthermore, these definitions must come after we define our fonts. +\newbox\dblarrowbox \newbox\longdblarrowbox +\newbox\pushcharbox \newbox\bullbox +\newbox\equivbox \newbox\errorbox + +%{\tentt +%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} +%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} +%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} +%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} +% Adapted from the manmac format (p.420 of TeXbook) +%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex +% depth .1ex\hfil} +%} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +\def\point{$\star$} +\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% Adapted from the TeXbook's \boxit. +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} + +\global\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{ + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} + +% The @error{} command. +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @tex ... @end tex escapes into raw Tex temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain tex @ character. + +\def\tex{\begingroup + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie + \catcode `\%=14 + \catcode 43=12 % plus + \catcode`\"=12 + \catcode`\==12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \escapechar=`\\ + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\*=\ptexstar + \let\t=\ptext + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +\let\Etex=\endgroup} + +% Define @lisp ... @endlisp. +% @lisp does a \begingroup so it can rebind things, +% including the definition of @endlisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% Make each space character in the input produce a normal interword +% space in the output. Don't allow a line break at this space, as this +% is used only in environments like @example, where each line of input +% should produce a line of output anyway. +% +{\obeyspaces % +\gdef\sepspaces{\obeyspaces\let =\tie}} + +% Define \obeyedspace to be our active space, whatever it is. This is +% for use in \parsearg. +{\sepspaces% +\global\let\obeyedspace= } + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip +% +\def\aboveenvbreak{{\advance\envskipamount by \parskip +\endgraf \ifdim\lastskip<\envskipamount +\removelastskip \penalty-50 \vskip\envskipamount \fi}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\long\def\cartouche{% +\begingroup + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt %we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either +% side, and for 6pt waste from +% each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \hsize=\cartinner + \kern3pt + \begingroup + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip +\def\Ecartouche{% + \endgroup + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup +\endgroup +}} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\def\nonfillstart{% + \aboveenvbreak + \inENV % This group ends at the end of the body + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \singlespace + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + \parindent = 0pt + \emergencystretch = 0pt % don't try to avoid overfull boxes + % @cartouche defines \nonarrowing to inhibit narrowing + % at next level down. + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \let\exdent=\nofillexdent + \let\nonarrowing=\relax + \fi +} + +% Define the \E... control sequence only if we are inside the particular +% environment, so the error checking in \end will work. +% +% To end an @example-like environment, we first end the paragraph (via +% \afterenvbreak's vertical glue), and then the group. That way we keep +% the zero \parskip that the environments set -- \parskip glue will be +% inserted at the beginning of the next paragraph in the document, after +% the environment. +% +\def\nonfillfinish{\afterenvbreak\endgroup} + +% @lisp: indented, narrowed, typewriter font. +\def\lisp{\begingroup + \nonfillstart + \let\Elisp = \nonfillfinish + \tt + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} + +% @example: Same as @lisp. +\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} + +% @small... is usually equivalent to the non-small (@smallbook +% redefines). We must call \example (or whatever) last in the +% definition, since it reads the return following the @example (or +% whatever) command. +% +% This actually allows (for example) @end display inside an +% @smalldisplay. Too bad, but makeinfo will catch the error anyway. +% +\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} +\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} +\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} +\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} + +% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. +% Originally contributed by Pavel@xerox. +\def\smalllispx{\begingroup + \def\Esmalllisp{\nonfillfinish\endgroup}% + \def\Esmallexample{\nonfillfinish\endgroup}% + \smallfonts + \lisp +} + +% @display: same as @lisp except keep current font. +% +\def\display{\begingroup + \nonfillstart + \let\Edisplay = \nonfillfinish + \gobble +} + +% @smalldisplay (when @smallbook): @display plus smaller fonts. +% +\def\smalldisplayx{\begingroup + \def\Esmalldisplay{\nonfillfinish\endgroup}% + \smallfonts \rm + \display +} + +% @format: same as @display except don't narrow margins. +% +\def\format{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eformat = \nonfillfinish + \gobble +} + +% @smallformat (when @smallbook): @format plus smaller fonts. +% +\def\smallformatx{\begingroup + \def\Esmallformat{\nonfillfinish\endgroup}% + \smallfonts \rm + \format +} + +% @flushleft (same as @format). +% +\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} + +% @flushright. +% +\def\flushright{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eflushright = \nonfillfinish + \advance\leftskip by 0pt plus 1fill + \gobble +} + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. +% +\def\quotation{% + \begingroup\inENV %This group ends at the end of the @quotation body + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \singlespace + \parindent=0pt + % We have retained a nonzero parskip for the environment, since we're + % doing normal filling. So to avoid extra space below the environment... + \def\Equotation{\parskip = 0pt \nonfillfinish}% + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount = \lispnarrowing + \let\nonarrowing = \relax + \fi +} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p. 344; only we need to do '@' too +\def\dospecials{% + \do\ \do\\\do\@\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=12}\dospecials} +% +% [Knuth] pp. 380,381,391 +% Disable Spanish ligatures ?` and !` of \tt font +\begingroup + \catcode`\`=\active\gdef`{\relax\lq} +\endgroup +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \catcode`\`=\active + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +\def\starttabbox{\setbox0=\hbox\bgroup} +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen0=\wd0 % the width so far, or since the previous tab + \divide\dimen0 by\tabw + \multiply\dimen0 by\tabw % compute previous multiple of \tabw + \advance\dimen0 by\tabw % advance to next multiple of \tabw + \wd0=\dimen0 \box0 \starttabbox + }% + } +\endgroup +\def\setupverbatim{% + % Easiest (and conventionally used) font for verbatim + \tt + \def\par{\leavevmode\egroup\box0\endgraf}% + \catcode`\`=\active + \tabexpand + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12 + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}' +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +%% Include LaTeX hack for completeness -- never know +%% \begingroup +%% \catcode`|=0 \catcode`[=1 +%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active +%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ +%% #1|endgroup|def|Everbatim[]|end[verbatim]] +%% |endgroup +\begingroup + \catcode`\ =\active + \gdef\doverbatim#1@end verbatim{#1\end{verbatim}} +\endgroup +% +\def\verbatim{% + \def\Everbatim{\nonfillfinish\endgroup}% + \begingroup + \nonfillstart + \advance\leftskip by -\defbodyindent + \begingroup\setupverbatim\doverbatim +} + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +% Allow normal characters that we make active in the argument (a file name). +\def\verbatiminclude{% + \begingroup + \catcode`\\=12 + \catcode`~=12 + \catcode`^=12 + \catcode`_=12 + \catcode`|=12 + \catcode`<=12 + \catcode`>=12 + \catcode`+=12 + \parsearg\doverbatiminclude +} +\def\setupverbatiminclude{% + \begingroup + \nonfillstart + \advance\leftskip by -\defbodyindent + \begingroup\setupverbatim +} +% +\def\doverbatiminclude#1{% + % Restore active chars for included file. + \endgroup + \begingroup + \def\thisfile{#1}% + \expandafter\expandafter\setupverbatiminclude\input\thisfile + \endgroup\nonfillfinish\endgroup +} + + +\message{defuns,} +% @defun etc. + +% Allow user to change definition object font (\df) internally +\def\setdeffont #1 {\csname DEF#1\endcsname} + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deftypemargin \deftypemargin=12pt +\newskip\deflastargmargin \deflastargmargin=18pt + +\newcount\parencount +% define \functionparens, which makes ( and ) and & do special things. +% \functionparens affects the group it is contained in. +\def\activeparens{% +\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active +\catcode`\[=\active \catcode`\]=\active} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +\global\let(=\lparen \global\let)=\rparen +\global\let[=\lbrack \global\let]=\rbrack + +\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } +\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} +% This is used to turn on special parens +% but make & act ordinary (given that it's active). +\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} + +% Definitions of (, ) and & used in args for functions. +% This is the definition of ( outside of all parentheses. +\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested + \global\advance\parencount by 1 +} +% +% This is the definition of ( when already inside a level of parens. +\gdef\opnested{\char`\(\global\advance\parencount by 1 } +% +\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. + % also in that case restore the outer-level definition of (. + \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi + \global\advance \parencount by -1 } +% If we encounter &foo, then turn on ()-hacking afterwards +\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } +% +\gdef\normalparens{\boldbrax\let&=\ampnr} +} % End of definition inside \activeparens +%% These parens (in \boldbrax) actually are a little bolder than the +%% contained text. This is especially needed for [ and ] +\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } +\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } +\let\ampnr = \& +\def\lbrb{{\bf\char`\[}} +\def\rbrb{{\bf\char`\]}} + +% Active &'s sneak into the index arguments, so make sure it's defined. +{ + \catcode`& = 13 + \global\let& = \ampnr +} + +% First, defname, which formats the header line itself. +% #1 should be the function name. +% #2 should be the type of definition, such as "Function". + +\def\defname #1#2{% +% Get the values of \leftskip and \rightskip as they were +% outside the @def... +\dimen2=\leftskip +\advance\dimen2 by -\defbodyindent +\noindent +\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% +\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line +\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations +\parshape 2 0in \dimen0 \defargsindent \dimen1 +% Now output arg 2 ("Function" or some such) +% ending at \deftypemargin from the right margin, +% but stuck inside a box of width 0 so it does not interfere with linebreaking +{% Adjust \hsize to exclude the ambient margins, +% so that \rightline will obey them. +\advance \hsize by -\dimen2 +\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% +% Make all lines underfull and no complaints: +\tolerance=10000 \hbadness=10000 +\advance\leftskip by -\defbodyindent +\exdentamount=\defbodyindent +{\df #1}\enskip % Generate function name +} + +% Actually process the body of a definition +% #1 should be the terminating control sequence, such as \Edefun. +% #2 should be the "another name" control sequence, such as \defunx. +% #3 should be the control sequence that actually processes the header, +% such as \defunheader. + +\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% +\parindent=0in +\advance\leftskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup % +\catcode 61=\active % 61 is `=' +\obeylines\activeparens\spacesplit#3} + +% #1 is the \E... control sequence to end the definition (which we define). +% #2 is the \...x control sequence for consecutive fns (which we define). +% #3 is the control sequence to call to resume processing. +% #4, delimited by the space, is the class name. +% +\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% +\parindent=0in +\advance\leftskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} + +% Used for @deftypemethod and @deftypeivar. +% #1 is the \E... control sequence to end the definition (which we define). +% #2 is the \...x control sequence for consecutive fns (which we define). +% #3 is the control sequence to call to resume processing. +% #4, delimited by a space, is the class name. +% #5 is the method's return type. +% +\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV + \medbreak + \def#1{\endgraf\endgroup\medbreak}% + \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent + \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} + +% Used for @deftypeop. The change from \deftypemethparsebody is an +% extra argument at the beginning which is the `category', instead of it +% being the hardwired string `Method' or `Instance Variable'. We have +% to account for this both in the \...x definition and in parsing the +% input at hand. Thus also need a control sequence (passed as #5) for +% the \E... definition to assign the category name to. +% +\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV + \medbreak + \def#1{\endgraf\endgroup\medbreak}% + \def#2##1 ##2 ##3 {% + \def#4{##1}% + \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent + \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} + +\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 ##2 {\def#4{##1}% +\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% +\parindent=0in +\advance\leftskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} + +% These parsing functions are similar to the preceding ones +% except that they do not make parens into active characters. +% These are used for "variables" since they have no arguments. + +\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2{\begingroup\obeylines\spacesplit#3}% +\parindent=0in +\advance\leftskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup % +\catcode 61=\active % +\obeylines\spacesplit#3} + +% This is used for \def{tp,vr}parsebody. It could probably be used for +% some of the others, too, with some judicious conditionals. +% +\def\parsebodycommon#1#2#3{% + \begingroup\inENV % + \medbreak % + % Define the end token that this defining construct specifies + % so that it will exit this group. + \def#1{\endgraf\endgroup\medbreak}% + \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent + \begingroup\obeylines +} + +\def\defvrparsebody#1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \spacesplit{#3{#4}}% +} + +% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the +% type is just `struct', because we lose the braces in `{struct +% termios}' when \spacesplit reads its undelimited argument. Sigh. +% \let\deftpparsebody=\defvrparsebody +% +% So, to get around this, we put \empty in with the type name. That +% way, TeX won't find exactly `{...}' as an undelimited argument, and +% won't strip off the braces. +% +\def\deftpparsebody #1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \spacesplit{\parsetpheaderline{#3{#4}}}\empty +} + +% Fine, but then we have to eventually remove the \empty *and* the +% braces (if any). That's what this does. +% +\def\removeemptybraces\empty#1\relax{#1} + +% After \spacesplit has done its work, this is called -- #1 is the final +% thing to call, #2 the type name (which starts with \empty), and #3 +% (which might be empty) the arguments. +% +\def\parsetpheaderline#1#2#3{% + #1{\removeemptybraces#2\relax}{#3}% +}% + +\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % +\medbreak % +% Define the end token that this defining construct specifies +% so that it will exit this group. +\def#1{\endgraf\endgroup\medbreak}% +\def#2##1 ##2 {\def#4{##1}% +\begingroup\obeylines\spacesplit{#3{##2}}}% +\parindent=0in +\advance\leftskip by \defbodyindent +\exdentamount=\defbodyindent +\begingroup\obeylines\spacesplit{#3{#5}}} + +% Split up #2 at the first space token. +% call #1 with two arguments: +% the first is all of #2 before the space token, +% the second is all of #2 after that space token. +% If #2 contains no space token, all of it is passed as the first arg +% and the second is passed as empty. + +{\obeylines +\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% +\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% +\ifx\relax #3% +#1{#2}{}\else #1{#2}{#3#4}\fi}} + +% So much for the things common to all kinds of definitions. + +% Define @defun. + +% First, define the processing that is wanted for arguments of \defun +% Use this to expand the args and terminate the paragraph they make up + +\def\defunargs#1{\functionparens \sl +% Expand, preventing hyphenation at `-' chars. +% Note that groups don't affect changes in \hyphenchar. +% Set the font temporarily and use \font in case \setfont made \tensl a macro. +{\tensl\hyphenchar\font=0}% +#1% +{\tensl\hyphenchar\font=45}% +\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% +\interlinepenalty=10000 +\advance\rightskip by 0pt plus 1fil +\endgraf\nobreak\vskip -\parskip\nobreak +} + +\def\deftypefunargs #1{% +% Expand, preventing hyphenation at `-' chars. +% Note that groups don't affect changes in \hyphenchar. +% Use \boldbraxnoamp, not \functionparens, so that & is not special. +\boldbraxnoamp +\tclose{#1}% avoid \code because of side effects on active chars +\interlinepenalty=10000 +\advance\rightskip by 0pt plus 1fil +\endgraf\nobreak\vskip -\parskip\nobreak +} + +% Do complete processing of one @defun or @defunx line already parsed. + +% @deffn Command forward-char nchars + +\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} + +\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% +\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defun == @deffn Function + +\def\defun{\defparsebody\Edefun\defunx\defunheader} + +\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{\putwordDeffunc}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @deftypefun int foobar (int @var{foo}, float @var{bar}) + +\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} + +% #1 is the data type. #2 is the name and args. +\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} +% #1 is the data type, #2 the name, #3 the args. +\def\deftypefunheaderx #1#2 #3\relax{% +\doind {fn}{\code{#2}}% Make entry in function index +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}% +\deftypefunargs {#3}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) + +\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} + +% \defheaderxcond#1\relax$$$ +% puts #1 in @code, followed by a space, but does nothing if #1 is null. +\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} + +% #1 is the classification. #2 is the data type. #3 is the name and args. +\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} +% #1 is the classification, #2 the data type, #3 the name, #4 the args. +\def\deftypefnheaderx #1#2#3 #4\relax{% +\doind {fn}{\code{#3}}% Make entry in function index +\begingroup +\normalparens % notably, turn off `&' magic, which prevents +% at least some C++ text from working +\defname {\defheaderxcond#2\relax$$$#3}{#1}% +\deftypefunargs {#4}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defmac == @deffn Macro + +\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} + +\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{\putwordDefmac}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defspec == @deffn Special Form + +\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} + +\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{\putwordDefspec}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defop CATEGORY CLASS OPERATION ARG... +% +\def\defop #1 {\def\defoptype{#1}% +\defopparsebody\Edefop\defopx\defopheader\defoptype} +% +\def\defopheader#1#2#3{% +\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index +\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% +\defunargs {#3}\endgroup % +} + +% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... +% +\def\deftypeop #1 {\def\deftypeopcategory{#1}% + \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader + \deftypeopcategory} +% +% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. +\def\deftypeopheader#1#2#3#4{% + \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{\defheaderxcond#2\relax$$$#3} + {\deftypeopcategory\ \putwordon\ \code{#1}}% + \deftypefunargs{#4}% + \endgroup +} + +% @deftypemethod CLASS TYPE METHOD ARG... +% +\def\deftypemethod{% + \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} +% +% #1 is the class name, #2 the data type, #3 the method name, #4 the args. +\def\deftypemethodheader#1#2#3#4{% + \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% + \deftypefunargs{#4}% + \endgroup +} + +% @deftypeivar CLASS TYPE VARNAME +% +\def\deftypeivar{% + \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} +% +% #1 is the class name, #2 the data type, #3 the variable name. +\def\deftypeivarheader#1#2#3{% + \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index + \begingroup + \defname{\defheaderxcond#2\relax$$$#3} + {\putwordInstanceVariableof\ \code{#1}}% + \defvarargs{#3}% + \endgroup +} + +% @defmethod == @defop Method +% +\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} +% +% #1 is the class name, #2 the method name, #3 the args. +\def\defmethodheader#1#2#3{% + \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{#2}{\putwordMethodon\ \code{#1}}% + \defunargs{#3}% + \endgroup +} + +% @defcv {Class Option} foo-class foo-flag + +\def\defcv #1 {\def\defcvtype{#1}% +\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} + +\def\defcvarheader #1#2#3{% +\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index +\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% +\defvarargs {#3}\endgroup % +} + +% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME +% +\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} +% +\def\defivarheader#1#2#3{% + \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index + \begingroup + \defname{#2}{\putwordInstanceVariableof\ #1}% + \defvarargs{#3}% + \endgroup +} + +% @defvar +% First, define the processing that is wanted for arguments of @defvar. +% This is actually simple: just print them in roman. +% This must expand the args and terminate the paragraph they make up +\def\defvarargs #1{\normalparens #1% +\interlinepenalty=10000 +\endgraf\nobreak\vskip -\parskip\nobreak} + +% @defvr Counter foo-count + +\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} + +\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% +\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} + +% @defvar == @defvr Variable + +\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} + +\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index +\begingroup\defname {#1}{\putwordDefvar}% +\defvarargs {#2}\endgroup % +} + +% @defopt == @defvr {User Option} + +\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} + +\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index +\begingroup\defname {#1}{\putwordDefopt}% +\defvarargs {#2}\endgroup % +} + +% @deftypevar int foobar + +\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} + +% #1 is the data type. #2 is the name, perhaps followed by text that +% is actually part of the data type, which should not be put into the index. +\def\deftypevarheader #1#2{% +\dovarind#2 \relax% Make entry in variables index +\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}% +\interlinepenalty=10000 +\endgraf\nobreak\vskip -\parskip\nobreak +\endgroup} +\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} + +% @deftypevr {Global Flag} int enable + +\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} + +\def\deftypevrheader #1#2#3{\dovarind#3 \relax% +\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} +\interlinepenalty=10000 +\endgraf\nobreak\vskip -\parskip\nobreak +\endgroup} + +% Now define @deftp +% Args are printed in bold, a slight difference from @defvar. + +\def\deftpargs #1{\bf \defvarargs{#1}} + +% @deftp Class window height width ... + +\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} + +\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% +\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} + +% These definitions are used if you use @defunx (etc.) +% anywhere other than immediately after a @defun or @defunx. +% +\def\defcvx#1 {\errmessage{@defcvx in invalid context}} +\def\deffnx#1 {\errmessage{@deffnx in invalid context}} +\def\defivarx#1 {\errmessage{@defivarx in invalid context}} +\def\defmacx#1 {\errmessage{@defmacx in invalid context}} +\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} +\def\defoptx #1 {\errmessage{@defoptx in invalid context}} +\def\defopx#1 {\errmessage{@defopx in invalid context}} +\def\defspecx#1 {\errmessage{@defspecx in invalid context}} +\def\deftpx#1 {\errmessage{@deftpx in invalid context}} +\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} +\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} +\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} +\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} +\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} +\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} +\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} +\def\defunx#1 {\errmessage{@defunx in invalid context}} +\def\defvarx#1 {\errmessage{@defvarx in invalid context}} +\def\defvrx#1 {\errmessage{@defvrx in invalid context}} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scanmacro#1{% + \begingroup \newlinechar`\^^M + % Undo catcode changes of \startcontents and \doprintindex + \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ + % Append \endinput to make sure that TeX does not see the ending newline. + \toks0={#1\endinput}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \let\xeatspaces\eatspaces + \input \jobname.tmp + \endgroup +} +\else +\def\scanmacro#1{% +\begingroup \newlinechar`\^^M +% Undo catcode changes of \startcontents and \doprintindex +\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ +\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} +\fi + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? +\def\macrolist{} % List of all defined macros in the form + % \do\macro1\do\macro2... + +% Utility routines. +% Thisdoes \let #1 = #2, except with \csnames. +\def\cslet#1#2{% +\expandafter\expandafter +\expandafter\let +\expandafter\expandafter +\csname#1\endcsname +\csname#2\endcsname} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=12\catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \. + +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. + +\def\macrobodyctxt{% + \catcode`\~=12 + \catcode`\^=12 + \catcode`\_=12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \catcode`\+=12 + \catcode`\{=12 + \catcode`\}=12 + \catcode`\@=12 + \catcode`\^^M=12 + \usembodybackslash} + +\def\macroargctxt{% + \catcode`\~=12 + \catcode`\^=12 + \catcode`\_=12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \catcode`\+=12 + \catcode`\@=12 + \catcode`\\=12} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. + +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0% + \else + \expandafter\parsemargdef \argl;% + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{The name \the\macname\space is reserved}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + % Add the macroname to \macrolist + \toks0 = \expandafter{\macrolist\do}% + \xdef\macrolist{\the\toks0 + \expandafter\noexpand\csname\the\macname\endcsname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\def\unmacro{\parsearg\unmacroxxx} +\def\unmacroxxx#1{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist + \begingroup + \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% + \def\do##1{% + \def\tempb{##1}% + \ifx\tempa\tempb + % remove this + \else + \toks0 = \expandafter{\newmacrolist\do}% + \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% + \fi}% + \def\newmacrolist{}% + % Execute macro list to define \newmacrolist + \macrolist + \global\let\macrolist\newmacrolist + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname #1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.blah for each blah +% in the params list, to be ##N where N is the position in that list. +% That gets used by \mbodybackslash (above). + +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. + +\def\parsemargdef#1;{\paramno=0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1% + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \fi + \fi} + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg) +\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \next} + +% We mant to disable all macros during \shipout so that they are not +% expanded by \write. +\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% + \edef\next{\macrolist}\expandafter\endgroup\next} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Just make them active and then expand them all to nothing. +\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{\ignoreactivespaces +\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% + \expandafter\noexpand\csname#2\endcsname}% +\expandafter\endgroup\next} + + +\message{cross references,} +% @xref etc. + +\newwrite\auxfile + +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's job is to define \lastnode. +\def\node{\ENVcheck\parsearg\nodezzz} +\def\nodezzz#1{\nodexxx [#1,]} +\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +\let\nwnode=\node +\let\lastnode=\relax + +% The sectioning commands (@chapter, etc.) call these. +\def\donoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Ysectionnumberandtype}% + \global\let\lastnode=\relax + \fi +} +\def\unnumbnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% + \global\let\lastnode=\relax + \fi +} +\def\appendixnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Yappendixletterandtype}% + \global\let\lastnode=\relax + \fi +} + + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME, namely +% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have +% to set \indexdummies so commands such as @code in a section title +% aren't expanded. It would be nicer not to expand the titles in the +% first place, but there's so many layers that that is hard to do. +% +\def\setref#1#2{{% + \indexdummies + \pdfmkdest{#1}% + \dosetq{#1-title}{Ytitle}% + \dosetq{#1-pg}{Ypagenumber}% + \dosetq{#1-snt}{#2}% +}} + +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + \def\printedmanual{\ignorespaces #5}% + \def\printednodename{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual}% + \setbox0=\hbox{\printednodename}% + \ifdim \wd0 = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax + % Use the node name inside the square brackets. + \def\printednodename{\ignorespaces #1}% + \else + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1 > 0pt + % It is in another manual, so we don't have it. + \def\printednodename{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printednodename{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printednodename{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifpdf + \leavevmode + \getfilename{#4}% + \ifnum\filenamelength>0 + \startlink attr{/Border [0 0 0]}% + goto file{\the\filename.pdf} name{#1@}% + \else + \startlink attr{/Border [0 0 0]}% + goto name{#1@}% + \fi + \linkcolor + \fi + % + \ifdim \wd1 > 0pt + \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\normalturnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % [mynode], + [\printednodename],\space + % page 3 + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi + \endlink +\endgroup} + +% \dosetq is the interface for calls from other macros + +% Use \normalturnoffactive so that punctuation chars such as underscore +% and backslash work in node names. (\turnoffactive doesn't do \.) +\def\dosetq#1#2{% + {\let\folio=0% + \normalturnoffactive + \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% + \iflinks + \next + \fi + }% +} + +% \internalsetq {foo}{page} expands into +% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} +% When the aux file is read, ' is the escape character + +\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} + +% Things to be expanded by \internalsetq + +\def\Ypagenumber{\folio} + +\def\Ytitle{\thissection} + +\def\Ynothing{} + +\def\Ysectionnumberandtype{% +\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % +\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % +\else \ifnum \subsubsecno=0 % +\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % +\else % +\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % +\fi \fi \fi } + +\def\Yappendixletterandtype{% +\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% +\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % +\else \ifnum \subsubsecno=0 % +\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % +\else % +\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % +\fi \fi \fi } + +\gdef\xreftie{'tie} + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Non-3.0. +\else + \def\linenumber{\the\inputlineno:\space} +\fi + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. + +\def\refx#1#2{% + \expandafter\ifx\csname X#1\endcsname\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \csname X#1\endcsname + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. +% +\def\xrdef#1{\begingroup + % Reenable \ as an escape while reading the second argument. + \catcode`\\ = 0 + \afterassignment\endgroup + \expandafter\gdef\csname X#1\endcsname +} + +% Read the last existing aux file, if any. No error if none exists. +\def\readauxfile{\begingroup + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + \catcode`\@=\other + \catcode`\^=\other + % It was suggested to define this as 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % Make the characters 128-255 be printing characters + {% + \count 1=128 + \def\loop{% + \catcode\count 1=\other + \advance\count 1 by 1 + \ifnum \count 1<256 \loop \fi + }% + }% + % The aux file uses ' as the escape (for now). + % Turn off \ as an escape so we do not lose on + % entries which were dumped with control sequences in their names. + % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ + % Reference to such entries still does not work the way one would wish, + % but at least they do not bomb out when the aux file is read in. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\%=\other + \catcode`\'=0 + \catcode`\\=\other + % + \openin 1 \jobname.aux + \ifeof 1 \else + \closein 1 + \input \jobname.aux + \global\havexrefstrue + \global\warnedobstrue + \fi + % Open the new aux file. TeX will close it automatically at exit. + \openout\auxfile=\jobname.aux +\endgroup} + + +% Footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for info output only. +\let\footnotestyle=\comment + +\let\ptexfootnote=\footnote + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \footnotezzz +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset and anything else that uses +% \parseargline fail inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\long\gdef\footnotezzz{\insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Hang the footnote text off the number. + \hang + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + \futurelet\next\fo@t +} +\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t + \else\let\next\f@t\fi \next} +\def\f@@t{\bgroup\aftergroup\@foot\let\next} +\def\f@t#1{#1\@foot} +\def\@foot{\strut\par\egroup} + +}%end \catcode `\@=11 + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +\def\setleading#1{% + \normalbaselineskip = #1\relax + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + \closein 1 + % Do not bother showing banner with post-v2.7 epsf.tex (available in + % doc/epsf.tex until it shows up on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\undefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is just the usual extra ignored arg for parsing this stuff. +\def\imagexxx#1,#2,#3,#4\finish{% + \ifpdf + \centerline{\dopdfimage{#1}{#2}{#3}}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \begingroup + \catcode`\^^M = 5 % in case we're inside an example + % If the image is by itself, center it. + \ifvmode + \nobreak\bigskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \centerline{\epsfbox{#1.eps}}% + \bigbreak + \else + % In the middle of a paragraph, no extra space. + \epsfbox{#1.eps}% + \fi + \endgroup + \fi +} + + +\message{localization,} +% and i18n. + +% @documentlanguage is usually given very early, just after +% @setfilename. If done too late, it may not override everything +% properly. Single argument is the language abbreviation. +% It would be nice if we could set up a hyphenation file here. +% +\def\documentlanguage{\parsearg\dodocumentlanguage} +\def\dodocumentlanguage#1{% + \tex % read txi-??.tex file in plain TeX. + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \let\temp = \relax + \else + \def\temp{\input txi-#1.tex }% + \fi + \temp + \endgroup +} +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? In the current directory +should work if nowhere else does.} + + +% @documentencoding should change something in TeX eventually, most +% likely, but for now just recognize it. +\let\documentencoding = \comment + + +% Page size parameters. +% +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be so finicky about underfull hboxes, either. +\hbadness = 2000 + +% Following George Bush, just get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; 3) voffset; +% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can +% set \parskip and call \setleading for \baselineskip. +% +\def\internalpagesizes#1#2#3#4#5#6{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \setleading{13.2pt}% + % + % If page is nothing but text, make it come out even. + \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% +}} + +% Use @smallbook to reset parameters for 7x9.5 (or so) format. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \setleading{12pt}% + % + \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \deftypemargin = 0pt + \defbodyindent = .5cm + % + \let\smalldisplay = \smalldisplayx + \let\smallexample = \smalllispx + \let\smallformat = \smallformatx + \let\smalllisp = \smalllispx +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \setleading{12pt}% + \parskip = 3pt plus 2pt minus 1pt + % + \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% + % + \tolerance = 700 + \hfuzz = 1pt +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin +% 29mm, hence bottom margin 28mm, nominal side margin 3cm. +\def\afourlatex{{\globaldefs = 1 + \setleading{13.6pt}% + % + \afourpaper + \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% + % + \globaldefs = 0 +}} + +% Use @afourwide to print on European A4 paper in wide format. +\def\afourwide{% + \afourpaper + \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% + % + \globaldefs = 0 +} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\def\pagesizes{\parsearg\pagesizesxxx} +\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{13.2pt}% + % + \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other +\catcode`\~=\other +\catcode`\^=\other +\catcode`\_=\other +\catcode`\|=\other +\catcode`\<=\other +\catcode`\>=\other +\catcode`\+=\other +\catcode`\$=\other +\def\normaldoublequote{"} +\def\normaltilde{~} +\def\normalcaret{^} +\def\normalunderscore{_} +\def\normalverticalbar{|} +\def\normalless{<} +\def\normalgreater{>} +\def\normalplus{+} +\def\normaldollar{$} + +% This macro is used to make a character print one way in ttfont +% where it can probably just be output, and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active +\def~{{\tt\char126}} +\chardef\hat=`\^ +\catcode`\^=\active +\def^{{\tt \hat}} + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} + +\catcode`\|=\active +\def|{{\tt\char124}} +\chardef \less=`\< +\catcode`\<=\active +\def<{{\tt \less}} +\chardef \gtr=`\> +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +\catcode`\$=\active +\def${\ifusingit{{\sl\$}}\normaldollar} +%\catcode 27=\active +%\def^^[{$\diamondsuit$} + +% Set up an active definition for =, but don't enable it most of the time. +{\catcode`\==\active +\global\def={{\tt \char 61}}} + +\catcode`+=\active +\catcode`\_=\active + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +\catcode`\@=0 + +% \rawbackslashxx output one backslash character in current font +\global\chardef\rawbackslashxx=`\\ +%{\catcode`\\=\other +%@gdef@rawbackslashxx{\}} + +% \rawbackslash redefines \ as input to do \rawbackslashxx. +{\catcode`\\=\active +@gdef@rawbackslash{@let\=@rawbackslashxx }} + +% \normalbackslash outputs one backslash in fixed width font. +\def\normalbackslash{{\tt\rawbackslashxx}} + +% \catcode 17=0 % Define control-q +\catcode`\\=\active + +% Used sometimes to turn off (effectively) the active characters +% even after parsing them. +@def@turnoffactive{@let"=@normaldoublequote +@let\=@realbackslash +@let~=@normaltilde +@let^=@normalcaret +@let_=@normalunderscore +@let|=@normalverticalbar +@let<=@normalless +@let>=@normalgreater +@let+=@normalplus +@let$=@normaldollar} + +@def@normalturnoffactive{@let"=@normaldoublequote +@let\=@normalbackslash +@let~=@normaltilde +@let^=@normalcaret +@let_=@normalunderscore +@let|=@normalverticalbar +@let<=@normalless +@let>=@normalgreater +@let+=@normalplus +@let$=@normaldollar} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\{ in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also back turn on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These look ok in all fonts, so just make them not special. +@catcode`@& = @other +@catcode`@# = @other +@catcode`@% = @other + +@c Set initial fonts. +@textfonts +@rm + + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: diff --git a/src/apps/bin/grep-2.5/doc/version.texi b/src/apps/bin/grep-2.5/doc/version.texi new file mode 100644 index 0000000000..0887dbefea --- /dev/null +++ b/src/apps/bin/grep-2.5/doc/version.texi @@ -0,0 +1,4 @@ +@set UPDATED 22 January 2002 +@set UPDATED-MONTH January 2002 +@set EDITION 2.5 +@set VERSION 2.5 diff --git a/src/apps/bin/grep-2.5/grep.spec b/src/apps/bin/grep-2.5/grep.spec new file mode 100644 index 0000000000..dbed7f4155 --- /dev/null +++ b/src/apps/bin/grep-2.5/grep.spec @@ -0,0 +1,165 @@ +%define beta %nil +%define rel 1 +Summary: The GNU versions of grep pattern matching utilities. +Name: grep +Version: 2.5 +%if "%{beta}" != "" +Release: 0.%{beta}.%{rel} +%else +Release: %{rel} +%endif +License: GPL +Group: Applications/Text +Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}%{beta}.tar.bz2 +Prefix: %{_prefix} +Prereq: /sbin/install-info +Buildroot: %{_tmppath}/%{name}-%{version}-root +Requires: pcre +Buildrequires: pcre-devel + +%description +The GNU versions of commonly used grep utilities. Grep searches +through textual input for lines which contain a match to a specified +pattern and then prints the matching lines. GNU's grep utilities +include grep, egrep and fgrep. + +You should install grep on your system, because it is a very useful +utility for searching through text. + +%prep +%setup -q -n %{name}-%{version}%{beta} + +%build +[ ! -e configure ] && ./autogen.sh +%configure --prefix=/usr --without-included-regex +make + +%install +rm -rf ${RPM_BUILD_ROOT} +%makeinstall LDFLAGS=-s prefix=${RPM_BUILD_ROOT}%{_prefix} exec_prefix=${RPM_BUILD_ROOT} +%ifos Linux +mkdir -p $RPM_BUILD_ROOT/bin +mv $RPM_BUILD_ROOT%{_prefix}/bin/* $RPM_BUILD_ROOT/bin +rm -rf $RPM_BUILD_ROOT%{_prefix}/bin +%endif +gzip -9f $RPM_BUILD_ROOT%{_infodir}/grep* + +%find_lang %name + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%post +[ -e %{_infodir}/grep.info.gz ] && /sbin/install-info --quiet --info-dir=%{_infodir} %{_infodir}/grep.info.gz || : + +%preun +if [ $1 = 0 ]; then + [ -e %{_infodir}/grep.info.gz ] && /sbin/install-info --quiet --info-dir=%{_infodir} --delete %{_infodir}/grep.info.gz +fi + +%files -f %{name}.lang +%defattr(-,root,root) +%doc ABOUT-NLS AUTHORS THANKS TODO NEWS README ChangeLog + +%ifos Linux +/bin/* +%else +%{_prefix}/bin/* +%endif +%{_infodir}/*.info.gz +%{_mandir}/*/* + +%changelog +* Wed Mar 13 2002 Bernhard Rosenkraenzer 2.5-1 +- 2.5 final + +* Wed Jan 23 2002 Bernhard Rosenkraenzer 2.5-0.g.1 +- 2.5g + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Mon Nov 19 2001 Bernhard Rosenkraenzer 2.5-0.f.4 +- Update CVS to reduce bloat + +* Thu Nov 8 2001 Bernhard Rosenkraenzer 2.5-0.f.3 +- Don't fail %%post with --excludedocs + +* Wed Sep 26 2001 Bernhard Rosenkraenzer 2.5-0.f.2 +- Fix up echo A |grep '[A-Z0-9]' in locales other than C + +* Tue Sep 25 2001 Bernhard Rosenkraenzer 2.5-0.f.1 +- 2.5f, fixes #53603 + +* Wed Jul 18 2001 Bernhard Rosenkraenzer 2.4.2-7 +- Fix up the i18n patch - it used to break "grep '[]a]'" (#49003) +- revert to 2.4.2 (latest official release) for now + +* Mon May 28 2001 Bernhard Rosenkraenzer 2.5e-4 +- Fix "echo Linux forever |grep -D skip Linux" + +* Mon May 21 2001 Bernhard Rosenkraenzer 2.5e-3 +- Add new -D, --devices option +- Fix a bug with "directories" being uninitialized + +* Sun May 13 2001 Bernhard Rosenkraenzer 2.5e-2 +- Fix up the --color option to behave like the one from ls (--color=auto) + Sooner or later, some people will alias grep="grep --color" and wonder why + their scripts break. +- Update docs accordingly +- Get rid of the annoying blinking in grep --color + +* Sun May 13 2001 Bernhard Rosenkraenzer 2.5e-1 +- 2.5e + +* Tue Feb 27 2001 Trond Eivind Glomsrød +- use %%{_tmppath} +- langify + +* Sun Aug 20 2000 Jakub Jelinek +- i18n character ranges patch from Ulrich Drepper + +* Thu Jul 13 2000 Prospector +- automatic rebuild + +* Mon Jun 19 2000 Bernhard Rosenkraenzer +- FHSify + +* Tue Mar 21 2000 Florian La Roche +- update to 2.4.2 +- fix download URL + +* Thu Feb 03 2000 Bernhard Rosenkraenzer +- gzip info pages (Bug #9035) + +* Wed Feb 02 2000 Cristian Gafton +- fix description + +* Wed Dec 22 1999 Jeff Johnson +- update to 2.4. + +* Wed Oct 20 1999 Bill Nottingham +- prereq install-info + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 2) + +* Mon Mar 08 1999 Preston Brown +- upgraded to grep 2.3, added install-info %post/%preun for info + +* Wed Feb 24 1999 Preston Brown +- Injected new description and group. + +* Sat May 09 1998 Prospector System +- translations modified for de, fr, tr + +* Fri May 01 1998 Cristian Gafton +- updated to 2.2 + +* Thu Oct 16 1997 Donnie Barnes +- updated from 2.0 to 2.1 +- spec file cleanups +- added BuildRoot + +* Mon Jun 02 1997 Erik Troan +- built against glibc diff --git a/src/apps/bin/grep-2.5/install-sh b/src/apps/bin/grep-2.5/install-sh new file mode 100755 index 0000000000..e9de23842d --- /dev/null +++ b/src/apps/bin/grep-2.5/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/src/apps/bin/grep-2.5/intl/ChangeLog b/src/apps/bin/grep-2.5/intl/ChangeLog new file mode 100644 index 0000000000..46c011bf74 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/ChangeLog @@ -0,0 +1,2030 @@ +2002-01-31 Bruno Haible + + * gettext-0.11 released. + +2002-01-31 Bruno Haible + + * eval-plural.h: Renamed from plural-eval.c. + * dcigettext.c: Include eval-plural.h instead of plural-eval.c. + * Makefile.in (COMHDRS): Remove plural-eval.c, add eval-plural.h. + (DISTFILES.obsolete): Add plural-eval.c. + +2002-01-24 Bruno Haible + + * Makefile.in (libintl.la): Use @LTLIBICONV@ instead of @LIBICONV@. + +2002-01-10 Andrew Zabolotny + Bruno Haible + + * dcigettext.c (_nl_default_dirname): On OS/2, declare, not define. + * localcharset.c: Rework OS/2 support. + * config.charset: Add OS/2 support. + * os2compat.c: Renamed from os2.c. + (_nl_default_dirname): Define here. + * os2compat.h: Moved here from ../os2/. + * osdep.c: Update. + * Makefile.in (COMHDRS): Add os2compat.h. + (COMSRCS): Add os2compat.c, remove os2.c. + +2002-01-05 Bruno Haible + + * Makefile.in (libintl.la): Add -lc. Needed on AIX. + +2002-01-02 Bruno Haible + + * loadmsgcat.c (_nl_init_domain_conv): Convert extern declaration to + K&R syntax. + +2002-01-02 Bruno Haible + + * plural.y: Fix %expect count. + +2001-12-23 Bruno Haible + + * os2.c (os2_initialize): Use LOCALEDIR_MAX macro. + +2001-12-21 Bruno Haible + + * localcharset.c (ISSLASH): Provide definition for DOS-like systems. + +2001-12-21 Bruno Haible + + * libgettext.h: Moved to ../lib/gettext.h. + * Makefile.in (HEADERS): Remove libgettext.h. + (DISTFILES.obsolete): Add libgettext.h. + +2001-12-21 Bruno Haible + + * gmo.h: Renamed from gettext.h. + * gettext.h: Remove file. + * gettextP.h: Update accordingly. + * loadmsgcat.c: Likewise. + * Makefile.in (COMHDRS): Add gmo.h, remove gettext.h. + (DISTFILES.obsolete): Add gettext.h. + Update dependencies. + +2001-12-18 Bruno Haible + + * Makefile.in (LTV_CURRENT, LTV_REVISION, LTV_AGE): Bump to 2:0:0. + Used to force an soname of at least libintl.so.2 on Solaris, which + already has a different libintl.so.1 in /usr/lib. + +2001-12-15 Andrew Zabolotny + Bruno Haible + + * osdep.c: New file. + * os2.c: New file. + * dcigettext.c (DCIGETTEXT): Add backward compatibility support for + OS/2. + * localcharset.c: Add OS/2 support. + * localealias.c (_nl_expand_alias): Initialize locale_alias_path once, + but not statically. + * Makefile.in (COMSRCS): Add osdep.c, os2.c. + (OBJECTS): Add osdep.$lo. + +2001-12-12 Bruno Haible + + * libgettext.h [!ENABLE_NLS]: Cast all function results to + 'const char *'. + Reported by Alexandre Duret-Lutz . + +2001-12-03 Bruno Haible + + * Makefile.in (install-exec): Don't create an empty libdir. + (installdirs): Update accordingly. + +2001-11-30 Bruno Haible + + * plural-exp.h (plural_eval): Add back declaration. + * Makefile.in (OBJECTS): Remove plural-eval.$lo. + (COMSRCS): Remove plural-eval.c. + (COMHDRS): Add plural-eval.c. + (plural-eval.$lo): Remove dependency. + (dcigettext.$lo): Depend on plural-eval.c. + +2001-11-29 Bruno Haible + + * gettextP.h (_nl_locale_name): Don't declare inside glibc. + * localename.c (_nl_locale_name): Remove _LIBC conditional. + +2001-11-27 Ulrich Drepper + + * dcigettext.c (guess_category_value): Inside glibc, use setlocale + directly, not _nl_locale_name. + +2001-11-27 Ulrich Drepper + + * loadmsgcat.c (_nl_init_domain_conv): Modify #if expression. + +2001-11-27 Ulrich Drepper + + * plural-eval.c (plural_eval): Rename back from PLURAL_EVAL. + * plural-exp.h (PLURAL_EVAL): Remove declaration. + * dcigettext.c Include plural-eval.c. + (plural_lookup): Call plural_eval instead of PLURAL_EVAL. + +2001-11-22 Bruno Haible + + * plural-exp.h (GERMANIC_PLURAL): New declaration. + * plural-exp.c (GERMANIC_PLURAL): Renamed from germanic_plural. + * loadmsgcat.c (_nl_unload_domain): Update. + +2001-07-17 Ulrich Drepper + + * localealias.c (read_alias_file): Disable implicit locking + for the stream. Use _unlocked functions for glibc. + +2001-11-11 Bruno Haible + + * Makefile.in (dist): Avoid using hard links, because the automake-1.5 + generated toplevel 'distdir' target chmods all the distributed files. + +2001-11-10 Bruno Haible + + * libgnuintl.h (_INTL_PARAMS): Renamed from PARAMS, to avoid polluting + the user's namespace. + Also test for __GNUC__, __SUNPRO_C and __PROTOTYPES because on + 64-bit Solaris, we need prototypes although __STDC__ is often defined + to 0. __GNUC__ covers GCC, __SUNPRO_C covers Sun cc, regardless of + compilation flags. __PROTOTYPES covers other compilers when compiling + programs using autoconf's AC_C_PROTOTYPES. + * gettextP.h (PARAMS): Also test for __SUNPRO_C, because 64-bit Solaris + cc needs prototypes although it defines __STDC__ to 0 by default. + Also test for __cplusplus and __PROTOTYPES, just for consistency with + libgnuintl.h. + * hash-string.h (PARAMS): Likewise. + * loadinfo.h (PARAMS): Likewise. + * plural-exp.h (PARAMS): Likewise. + +2001-10-31 Bruno Haible + + * plural.y: Include , needed for NULL with SunOS 4 cc. + +2001-10-31 Bruno Haible + + * COPYING.LIB-2.0: Renamed from COPYING.LIB-2. + * Makefile.in (DISTFILES.gettext, install-data, uninstall): Update. + (DISTFILES.obsolete): Add COPYING.LIB-2. + +2001-10-09 Bruno Haible + + * localcharset.c (getc): Define as getc_unlocked if available. + +2001-09-27 Bruno Haible + + * Makefile.in (install-strip, installdirs): New rules. + +2001-09-24 Bruno Haible + + * localename.c: New file, integrating a function from + Tor Lillqvist . + * gettextP.h: New declaration. + * dcigettext.c (guess_category_value): Call _nl_locale_name. + * Makefile.in (COMSRCS): Add localename.c. + (OBJECTS): Add localename.$lo. + +2001-09-22 Bruno Haible + + * plural-eval.c: New file, extracted from dcigettext.c. + * plural-exp.h (PLURAL_EVAL): New declaration. + * dcigettext.c (plural_eval): Remove function, moved to plural-eval.c. + (plural_lookup): Call PLURAL_EVAL instead of plural_eval. + * Makefile.in (COMSRCS): Add plural-eval.c. + (OBJECTS): Add plural-eval.$lo. + +2001-09-22 Bruno Haible + + * plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Reject numbers that don't + start with a digit; nplurals must be positive. + +2001-10-20 Bruno Haible + + Assume strchr() exists. (Without it, explodename.c wouldn't link + anyway.) + * dcigettext.c (strchr): Remove fallback definition; it conflicts with + the variable 'index' in plural_lookup. + * l10nflist.c (strchr): Likewise. + * localealias.c (strchr): Likewise. + +2001-09-24 Bruno Haible + + * loadmsgcat.c (_nl_init_domain_conv): Also enable transliteration + when building on a glibc system but outside glibc. + +2001-09-02 Bruno Haible + + * plural-exp.h: New file, extracted from gettextP.h. + * plural-exp.c: New file, extracted from loadmsgcat.c. + * gettextP.h (struct expression, struct parse_args, + __gettext_free_exp, __gettextparse): Move to plural-exp.h. + * loadmsgcat.c: Include plural-exp.h. + (PLURAL_PARSE): Move macro to plural-exp.h. + (plvar, plone, germanic_plural, INIT_GERMANIC_PLURAL): Move to + plural-exp.c. + (_nl_load_domain): Move plural handling code to plural-exp.c. Call + EXTRACT_PLURAL_EXPRESSION. + * dcigettext.c: Include plural-exp.h. + * plural.y: Include plural-exp.h, not gettextP.h. + (FREE_EXPRESSION): Move macro to plural-exp.h. + * Makefile.in (DEFS): Define IN_LIBINTL. + (COMHDRS): Add plural-exp.h. + (COMSRCS): Add plural-exp.c. + (OBJECTS): Add plural-exp.$lo. + Update dependencies. + +2001-07-28 Bruno Haible + + * l10nflist.c (_nl_normalize_codeset): Cast isalnum, isalpha, isdigit, + tolower argument to 'unsigned char'. + * loadmsgcat.c (_nl_load_domain): Cast isspace argument to + 'unsigned char'. + * localealias.c (read_alias_file): Cast isspace argument to + 'unsigned char'. + +2001-07-23 Bruno Haible + + * gettext.h: Assume exists. + +2001-09-13 Bruno Haible + + * gettext-0.10.40 released. + +2001-07-11 Ulrich Drepper + + * locale.alias: Use he language code for hebrew, not iw. + +2001-09-13 Bruno Haible + + * *.h, *.c, *.y, Makefile.in: Change copyright notice from GPL to LGPL. + This is a reaction to a blackmail from the GNOME project which + threatened to distribute an LGPLed clone of libintl. + * COPYING.LIB-2, COPYING.LIB-2.1: New files. + * Makefile.in (DISTFILES.gettext): Add them. + (install-data): Install them. + (uninstall): Uninstall them. + +2001-07-24 Bruno Haible + + * gettext-0.10.39 released. + +2001-06-24 Bruno Haible + + * config.charset: Change canonical name of BIG5HKSCS to BIG5-HKSCS. + Change canonical name of SJIS to SHIFT_JIS. + +2001-06-12 Bruno Haible + + * dcigettext.c (DCIGETTEXT): Release the lock before returning. + +2001-04-30 Bruno Haible + + Silence "gcc -Wall -Wwrite-strings" warnings. + * localcharset.c (charset_aliases): Change type to 'const char *'. + (get_charset_aliases): Change type of 'cp' to 'const char *'. + +2001-05-23 Bruno Haible + + * gettext-0.10.38 released. + +2001-05-22 Bruno Haible + + * Makefile.in (install-data): Install plural.c as well. + (uninstall): Uninstall plural.c as well. + +2001-05-18 Bruno Haible + + * Makefile.in (dist): Don't assume $(srcdir) = ".". Distribute + file in either current directory or $(srcdir), whichever exists. + +2001-05-11 Bruno Haible + + * Makefile.in (install-exec): Don't install charset.alias on glibc 2.1 + systems. + +2001-04-30 Bruno Haible + + * dcigettext.c (getuid, getgid, geteuid, getegid): Provide default + definitions. Needed for mingw32. + +2001-04-19 Bruno Haible + + * gettext-0.10.37 released. + +2001-04-19 Bruno Haible + + * Makefile.in (LTV_CURRENT, LTV_REVISION, LTV_AGE): Bump to 1:1:0. + +2001-04-19 Bruno Haible + + * loadmsgcat.c (_nl_init_domain_conv): Don't append //TRANSLIT when + the libiconv version is smaller than 1.5. + +2001-04-09 Bruno Haible + + * loadmsgcat.c: Don't use GNU C extensions if __APPLE_CC__ is defined. + Apple's MacOS X compiler has not all the features that the regular + GCC with the same version number has. + +2001-04-07 Bruno Haible + + * gettextP.h (struct loaded_domain): Add codeset_cntr field. + (struct binding): Add codeset_cntr field. + (_nl_load_domain): Add domainbinding argument. + (_nl_init_domain_conv, _nl_free_domain_conv): New declarations. + (_nl_find_msg): New declaration, moved here from loadinfo.h. + * loadinfo.h (struct loaded_l10nfile): Remove domainbinding field. + (_nl_make_l10nflist): Remove domainbinding argument. + (_nl_find_msg): Move declaration to gettextP.h. + * bindtextdom.c (set_binding_values): Initialize ->codeset_cntr to 0. + Increment it when ->codeset is changed. + * dcigettext.c (DCIGETTEXT): Pass binding to _nl_find_msg. + (_nl_find_msg): Add domainbinding argument. Reinitialize the converter + if domainbinding->codeset_cntr has been incremented. + * finddomain.c (_nl_find_domain): Don't pass domainbinding to + _nl_make_l10nflist(). Pass it to _nl_load_domain() instead. + * l10nflist.c (_nl_make_l10nflist): Remove domainbinding argument. + * loadmsgcat.c (_nl_init_domain_conv): New function, extracted from + _nl_load_domain. Append //TRANSLIT also when using libiconv. + (_nl_free_domain_conv): New function, extracted from _nl_unload_domain. + (_nl_load_domain): Add domainbinding argument. Call + _nl_init_domain_conv. + (_nl_unload_domain): Call _nl_free_domain_conv. + +2001-04-09 Bruno Haible + + * dcigettext.c (HAVE_LOCALE_NULL): Don't define if __GNU_LIBRARY__ < 2 + (Linux libc5). + +2001-04-04 Bruno Haible + + * dcigettext.c (HAVE_LOCALE_NULL): Define also if __GNU_LIBRARY__. + +2001-04-04 Bruno Haible + + * Makefile.in (libdir, includedir, datadir): Use the autoconf + determined value, in order to respect the configure arguments. + (gettextsrcdir): Use $(datadir), not @datadir@. + +2001-03-29 Bruno Haible + + * gettext-0.10.36 released. + +2001-03-25 Bruno Haible + + * Makefile.in (install-data): Set execution bits on installed + config.charset. + +2001-03-23 Bruno Haible + + * Makefile.in (YACC): Use @INTLBISON@ instead of bison. + +2001-03-21 Bruno Haible + + * dcigettext.c (_nl_state_lock): Mark as #ifdef _LIBC. AIX 3 xlc + chokes on empty macro arguments. + * plural.y: Add #pragma for alloca on AIX 3. + +2001-03-20 Bruno Haible + + * Makefile.in (DISTFILES.generated): New variable. + (DISTFILES.gettext): Remove plural.c. + (dist): Use DISTFILES.generated. + (YACC): Use "bison -y" instead of @YACC@. + Needed for "make dist" to work in normal packages. + +2001-03-20 Bruno Haible + + * Makefile.in (dist): Don't depend on $(DISTFILES). Instead, generate + the files to be distributed through a recursive 'make' call. + +2001-03-17 Bruno Haible + + * gettextP.h (struct expression): Add operators lnot, less_than, + greater_than, less_or_equal, greater_or_equal. Replace args2/args3 + union by a 'nargs' counter and an 'args[]' array. + * plural.y: Don't include stdarg.h. + (new_exp): New function. + (new_exp_0, new_exp_2, new_exp_3): Rewritten to call new_exp. + (new_exp_1): New function. + ('?' ':'): Make right-associative. + (EQUOP2): New token, replaces '=' and '!'. + (CMPOP2): New token. + (ADDOP2): New token, replaces '+' and '-'. + (MULOP2): New token, replaces '*', '/' and '%'. + ('!'): New token. + (exp): Add rules for CMPOP2 and '!'. Don't call YYABORT. + (start): Call YYABORT here. + (FREE_EXPRESSION): Update. + (yylex): Don't skip "\\n". Recognize comparison and '!' operators. + Update for new token symbols. + * loadmsgcat.c (plvar, plone, germanic_plural, init_germanic_plural): + Update. + * dcigettext.c (_nl_find_msg): Optimize for space. + (plural_eval): Recognize comparison and '!' operators. Optimize for + space. + + * dcigettext.c (transcmp): New declaration. + +2001-03-10 Bruno Haible + + * Makefile.in (libintl.la): Pass -liconv and flag -no-undefined. + Needed on platforms like BeOS. + + * Makefile.in (all-no-yes): Depend on libgnuintl.$la, not libintl.$la. + (libgnuintl.a, libgnuintl.la): New targets. Needed for linking + ../tests/tstgettext on systems which have gettext() in libintl.so. + + * localcharset.c (locale_charset): Allow wildcard syntax. Resolve + alias also if codeset is empty. + * config.charset (BeOS): Use wildcard syntax. + + * loadmsgcat.c (_nl_load_domain): locale_charset() doesn't return NULL + any more. + +2001-03-09 Bruno Haible + + * config.charset: Update from libiconv-1.6. + * localcharset.c: Likewise. + +2001-02-25 Ulrich Drepper + + * locale.alias: Don't use nb_NO but define aliases for it. + +2001-01-26 Ulrich Drepper + + * loadmsgcat.c: Include for _LIBC. + +2001-03-09 Bruno Haible + + * dcigettext.c (transmem_block_t): Change to unsigned char, to avoid + compiler warning. + (_nl_find_msg): Add casts to avoid compiler warnings. + +2001-03-09 Bruno Haible + + * Makefile.in (DISTFILES.common): Remove ChangeLog. + (DISTFILES.obsolete): New variable. + (install-data): Install ChangeLog.inst as ChangeLog. Remove the files + listed in DISTFILES.obsolete. + (uninstall): Simplify. + (distclean): Remove ChangeLog.inst. + (dist): Mention ChangeLog explicitly. + +2001-03-04 Bruno Haible + + * dcigettext.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH, + IS_PATH_WITH_DIR): New macros. + (DCIGETTEXT): Use IS_ABSOLUTE_PATH and IS_PATH_WITH_DIR. Increment + path_max proportionally. + * loadinfo.h (PATH_SEPARATOR): New macro. + * l10nflist.c (_nl_make_l10nflist): Use PATH_SEPARATOR instead of ':'. + * localealias.c (_nl_expand_alias): Likewise. + * libgnuintl.h (gettext) [DJGPP]: Define as a macro as well. + +2001-03-06 Bruno Haible + + * libgnuintl.h (LC_MESSAGES): Don't define on Solaris. + +2001-02-24 Bruno Haible + + * dcigettext.c: Update comment about HAVE_LOCALE_NULL. + +2001-02-05 Bruno Haible + + * libgnuintl.h (LC_MESSAGES): Provide a default value. + +2001-01-30 Bruno Haible + + * config.charset: Update for FreeBSD 4.2. + +2001-01-21 Bruno Haible + + Use libtool. + * Makefile.in (l): Use INTL_LIBTOOL_SUFFIX_PREFIX instead of l. + (all-no): When USE_INCLUDED_LIBINTL is 'no' but BUILD_INCLUDED_LIBINTL + is 'yes', still build libintl.$la because the testsuite needs it. + (libintl.la): Add $(CPPFLAGS) $(CFLAGS) $(XCFLAGS). Linking via $(CC) + must use all $(CFLAGS). + (install-exec): Use libtool to install libintl.$la. + (uninstall): Use libtool to uninstall libintl.$la. + (mostlyclean): Remove *.la and the .libs subdir. + * intl-compat.c: Reorder. Add comment. + +2001-01-20 Bruno Haible + + * loadmsgcat.c (O_BINARY): Define on platforms that don't have it. + (_nl_load_domain): Open the catalog file in binary mode. + +2001-01-24 Bruno Haible + + * gettextP.h (SWAP): Remove declaration, to work around a compilation + failure on alphaev5-cray-unicosmk2.0.5.X. + +2001-01-15 Bruno Haible + + * dcigettext.c (_nl_find_msg): Cast the second iconv() arg, to avoid + a warning. + +2001-01-07 Bruno Haible + + * gettextP.h (__gettextdebug): Remove declaration. + (gettext_free_exp__, gettextparse__): New non-libc declarations. + * plural.y [!_LIBC]: Define gettextparse__, gettext_free_exp__, not + __gettextparse, __gettext_free_exp. + * loadmsgcat.c [!_LIBC]: Use gettextparse__, not __gettextparse. + +2001-01-07 Bruno Haible + + * libgnuintl.h: Renamed from intlh.inst.in. + Remove comment about __builtin_constant_p. + (gettext): Use NULL. + * libgettext.h: Completely rewritten. Now a conditional wrapper around + . Keep the handling of ENABLE_NLS and gettext_noop, remove + everything else. + * gettextP.h: Include gettext.h, for nls_uint32. + (gettext__, dgettext__, dcgettext__, textdomain__, bindtextdomain__, + bind_textdomain_codeset__): New declarations, from old libgettext.h. + * gettext.h: Don't include . + * Makefile.in (HEADERS): Add libgnuintl.h. + (DISTFILES.gettext): Remove intlh.inst.in. + (all-yes): Depend on libintl.h instead of intlh.inst. + (libintl.h): New target. Create as a copy of libgnuintl.h. + (intlh.inst): Remove target. + (install-exec): Update. + ($(OBJECTS): Depend on libgnuintl.h, not libgettext.h. + (mostlyclean): Remove libintl.h instead of intlh.inst. + (dist-libc): Remove target. + * bindtextdom.c: Include libgnuintl.h instead of libgettext.h. Don't + include gettext.h. + * dcgettext.c: Likewise. + * dcigettext.c: Likewise. + * dcngettext.c: Likewise. + * dngettext.c: Likewise. + * finddomain.c: Likewise. + * ngettext.c: Likewise. + * textdomain.c: Likewise. + * dgettext.c: Include libgnuintl.h instead of libgettext.h. Include + gettextP.h. + * gettext.c: Likewise. + * intl-compat.c: Likewise. + * localealias.c: Don't include gettext.h. + * plural.y: Likewise. + +2001-01-07 Bruno Haible + + Assume , , , exist. + * intlh.inst.in: Likewise. + * libgettext.h: Likewise. + * gettextP.h: Likewise. + * bindtextdom.c: Likewise. + * dcigettext.c: Likewise. + * dgettext.c: Likewise. + * dngettext.c: Likewise. + * explodename.c: Likewise. + * finddomain.c: Likewise. + * gettext.c: Likewise. + * l10nflist.c: Likewise. + * loadmsgcat.c: Likewise. + * localealias.c: Likewise. + * ngettext.c: Likewise. + * textdomain.c: Likewise. + +2001-01-06 Bruno Haible + + Remove catgets fallback code. + - It does not handle message clash prevention through domains and + dgettext(). + - It does not handle message catalog inheritance and the LANGUAGE + environment variable. + - It does not handle locale aliases. + - It does not handle automatic charset conversion. + - It does not handle plural form handling and ngettext(). + - It uses a slow string to integer conversion. + - It is sensitive against installation problems. + * cat-compat.c: Remove file. + * po2msg.sin, po2tbl.sin: Remove files. + * Makefile.in (datadir): Assume DATADIRNAME = share. + (SOURCES): Remove cat-compat.c. + (DISTFILES.common): Remove po2msg.sin, po2tbl.sin. + (distclean): No need to remove po2msg.sed, po2tbl.sed. + (../po/cat-id-tbl.$lo): Remove rule. + * libgettext.h (_msg_ent): Remove. + (_msg_tbl, _msg_tbl_length): Remove declarations. + (gettext, dgettext, ngettext, dngettext): Don't depend on + !HAVE_CATGETS. + +2001-01-04 Ulrich Drepper + + * plural.y (yylex): Minimal improvement in number scanner. + +2001-01-02 Ulrich Drepper + + * dcigettext.c (guess_category_value): Rewrite so that LANGUAGE value + is ignored if the selected locale is the C locale. + +2000-11-20 Ulrich Drepper + + * dcigettext.c (transcmp): Make s1 and s2 const. + * loadmsgcat.c (_nl_load_domain): Rearrange domain initialization to + avoid warning. + +2000-11-09 Ulrich Drepper + + * locale.alias: Add thai. + Patch by Chanop Silpa-Anan . + +2001-01-05 Bruno Haible + + * Makefile.in (INCLUDES): Remove reference to $(top_srcdir)/lib. + (.SUFFIXES): Put .c before .y, so that Solaris "make" uses the .c.o + rule, not the builtin .y.o rule. + (.y.c): Use $< instead of $^. $^ is not supported by SUSV2 "make" + specification. Remove $*.h explicitly: we don't need plural.h. + * gettextP.h: Include . + (__gettext_free_exp, __gettextparse): Convert prototype to K&R C + syntax. + * bindtextdom.c (offsetof): Provide fallback for platforms that lack + it, like SunOS4. + (set_binding_values): Convert prototype to K&R C syntax. + * cat-compat.c: Include stdlib.h, string.h whenever possible. + * dcigettext.c: Ignore the value of C_ALLOCA, because libintl.a + must not depend on external .o files. + (offsetof): Provide fallback for platforms that lack it, like SunOS4. + (transcmp): Convert to K&R C syntax. + * explodename.c Include stdlib.h whenever possible. + (_nl_find_language): Convert to K&R C syntax. + * finddomain.c: Include stdlib.h whenever possible. + * l10nflist.c Include stdlib.h whenever possible. + (_nl_normalize_codeset): Use tolower, not _tolower. + * loadmsgcat.c: Include stdlib.h whenever possible. + Include headers needed for alloca(). + (freea): New macro. + (_nl_load_domain): Add fallback code for platforms lacking strtoul, + like SunOS4. Add fallback code for platforms lacking alloca. + * localealias.c: Include stdlib.h whenever possible. + (ADD_BLOCK, FREE_BLOCK): Remove macros. + (freea): New macro. + (read_alias_file): Simplify fallback code for platforms lacking alloca. + * plural.y (new_exp_0, new_exp_2, new_exp_3): New functions. + (new_exp): Remove function. + (__gettext_free_exp, yylex, yyerror): Convert to K&R C syntax. + * textdomain.c: Include stdlib.h whenever possible. + * gettext.c: Likewise. + * ngettext.c: Likewise. + * localcharset.c (volatile): Define to empty if not using ANSI C. + +2001-01-01 Bruno Haible + + * Makefile.in (mostlyclean): Remove intlh.inst, charset.alias, + ref-add.sed, ref-del.sed. + (distclean): In the gettext package, remove VERSION. + +2001-01-01 Bruno Haible + + Finish implementation of plural form handling. + * dcigettext.c (known_translation_t): Rename 'domain' field to + 'domainname'. Remove 'plindex' field. Add 'domain' and + 'translation_length' fields. + (transcmp): Don't compare 'plindex' fields. + (plural_lookup): New function. + (DCIGETTEXT): Change cache handing in the plural case. Don't call + plural_eval before the translation and its catalog file have been + found. Remove plindex from cache key. Add 'translation_length' and + 'domain' to cache result. + (_nl_find_msg): Remove index argument, return length of translation + to the caller instead. Weaken comparison of string lengths, to account + for plural entries. Call iconv() on the entire result string, not + only on the portion needed so far. + * loadinfo.h (_nl_find_msg): Remove index argument, add lengthp + argument. + * loadmsgcat.c (_nl_load_domain): Adapt to _nl_find_msg change. + + * intl-compat.c (dcngettext, dngettext, ngettext): New functions. + * libgettext.h (ngettext__, dngettext__, dcngettext__): New + declarations. + (ngettext, dngettext): Add missing macro argument. + + * intlh.inst.in (ngettext, dngettext): Add missing macro argument. + +2000-12-31 Bruno Haible + + * gettextP.h (ZERO): New macro. + (struct binding): Always use ZERO. + * bindtextdom.c (set_binding_values): Use offsetof, not sizeof. + Include whenever possible. + * dcigettext.c (ZERO): Remove macro. + (struct transmem_list): Use ZERO. + (DCIGETTEXT): Use offsetof, not sizeof. + Include whenever possible. + + * config.charset: Update from libiconv-1.5.1. + * localcharset.c: Likewise. + +2000-12-30 Bruno Haible + + * locale.alias: New file, moved here from ../misc/locale.alias. Add + "Packages using this file" line. + * Makefile.in (DISTFILES.common): Add locale.alias. + (install-exec, uninstall): Install/deinstall locale.alias. + +2000-10-30 Ulrich Drepper + + * dcigettext.c (guess_category_value): For libc always use the + setlocale() method. + +2000-10-20 Ulrich Drepper + + * libintl.glibc (ngettext macro): Add missing parameter. + (dngettext macro): Likewise. + +2000-10-14 Ulrich Drepper + + * localealias.c (read_alias_file): Update string pointers in map[] + if realloc() changed the values. + Patch by Jakub Jelinek . + +2000-08-31 Ulrich Drepper + + * loadmsgcat.c: Use *stat64 instead of *stat internally. + + * dcigettext.c (free_mem): Correct freeing of _nl_domain_bindings + list. + +2000-08-27 Ulrich Drepper + + * dcigettext.c (DCIGETTEXT): Remove _nl_find_language in code to + determine invalid locale name. + +2000-08-20 Ulrich Drepper + + * dcigettext.c: Unify use of function aliases to make more compact + PLT. + + * loadmsgcat.c (_nl_unload_domain): Also free conv_tab element. + Pretty printing. + * plural.y (new_exp): Take number of optional parameters in second + parameter. Test for correct number of parameters and free correctly + in case of failure. Adjust all callers. + (yylex): Fix handling of '\0'. Allow ';' as terminator character. + +2000-07-14 Bruno Haible + + * dcigettext.c (dcigettext): Call plural_eval on all platforms, not + only those having tsearch. + +2000-06-30 Ulrich Drepper + + * dcigettext.c (_nl_find_msg): Correct reallocation of buffers in + case the translation is too large. Remember allocated memory blocks + in a list. + (free_mem): Free memory for translations. + +2000-06-16 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Call norm_add_slashes with new + parameter to always enable transliteration. + +1998-10-20 Paul Eggert + + * po2tbl.sin: Escape trigraphs. + +2000-10-12 Bruno Haible + + * finddomain.c: Remove unneeded includes. + +2000-10-12 Bruno Haible + + * localealias.c (memcpy): Return first argument, just like the real + memcpy function does. + * bindtextdom.c (memcpy): Likewise. + * finddomain.c (memcpy): Likewise. + * l10nflist.c (memcpy): Likewise. + * textdomain.c (memcpy): Likewise. + From Paul Eggert . + +2000-09-29 Bruno Haible + + * libintl.glibc: Update from current glibc version. + +2000-09-18 Bruno Haible + + * dcigettext.c: Outside libc, use local variable names that don't + clash with those in libc. + * bindtextdom.c: Likewise. + * textdomain.c: Likewise. + +2000-07-31 Bruno Haible + + * plural.y: Include config.h. Needed to define 'inline' away for C + compilers that don't support it. + (yylex): Don't use gcc specific case range syntax. + * loadmsgcat.y (INIT_GERMANIC_PLURAL): New macro, for old compilers. + +2000-07-28 Bruno Haible + + Simplification: In all cases where $(gnulocaledir) is used, it is + identical to $(localedir). + * Makefile.in (DEFS): Remove setting for GNULOCALEDIR. + * dcigettext.c (_nl_default_dirname): Initialize with LOCALEDIR. + +2000-07-28 Bruno Haible + + * xopen-msg.sed: Renamed to ... + * po2msg.sin: ... here. + * linux-msg.sed: Remove file. + * Makefile.in (DISTFILES.common): Update. + +2000-07-28 Bruno Haible + + * po2tbl.sed.in: Renamed to ... + * po2tbl.sin: ... here. + * Makefile.in (DISTFILES.common): Update. + +2000-07-28 Bruno Haible + + * Makefile.in (uninstall): Synchronize with the install target. + Really remove charset.alias when its reference count drops to 0. + +2000-07-28 Bruno Haible + + * Makefile.in (mkinstalldirs): New macro. Needed when configured with + --srcdir=; then ac_aux_dir will be a relative + pathname rooted at the top builddir, and @MKINSTALLDIRS@ likewise. + (install-exec, install-data): Use it. + +2000-07-26 Bruno Haible + + * Makefile.in (install-exec, install-data): Use $(SHELL) for calling + $(MKINSTALLDIRS), don't rely on its execution permissions. + + * Makefile.in (LTV_CURRENT, LTV_REVISION, LTV_AGE): New variables. + (libintl.la): Use them. + + * Makefile.in (install-exec, install-data, uninstall): Provide DESTDIR + support, as recommended by GNU standards. Fix misapplied 2000-06-16 + patch. + +2000-06-16 Bruno Haible + + * Makefile.in (COMSRCS): Add localcharset.c. + (OBJECTS): Add localcharset.$lo. + (DISTFILES.common): Add config.charset, ref-{add,del}.sin. + (DEFS): Add -DLIBDIR. + (all-yes): Add charset.alias, ref-{add,del}.sed. + (.SUFFIXES): Add .sin and .sed. + (.sin.sed, charset.alias): New rules. + (install-exec, uninstall): Install/deinstall charset.alias. + * localcharset.c: New file, from fileutils-4.0u. + * config.charset: New file, from fileutils-4.0u. + * red-add.sin, ref-del.sin: New files, from fileutils-4.0u. + + * intlh.inst.in (bind_textdomain_codeset): New declaration. + * libgettext.h (bind_textdomain_codeset, bind_textdomain_codeset__): + New declarations. + (bind_textdomain_codeset) [!ENABLE_NLS]: New macro. + * cat-compat.c (bind_textdomain_codeset): New function. + * intl-compat.c (bind_textdomain_codeset): New function. + + * libgettext.h (ngettext, dngettext, dcngettext): New + declarations. + (dcgettext): Remove macro definition. + (textdomain, bindtextdomain) [!ENABLE_NLS]: Parenthesize argument. + * intlh.inst.in (ngettext, dngettext, dcngettext): New + declarations. + (dcgettext): Remove macro definition. + + * *.h, *.c, *.y: Change copyright notice from LGPL to GPL. + +2000-05-21 Ulrich Drepper + + * dcigettext.c: Fix typo in comment. + +2000-05-08 Andreas Jaeger + + * bindtextdom.c (set_binding_values): Add prototype. + +2000-05-05 Bruno Haible + + * dcigettext.c (alignof): New macro. + (_nl_find_msg): Use it instead of __alignof__. Pass correct output + buffer length to __gconv/iconv. If malloc (freemem_size) fails, set + freemem_size to 0. + +2000-05-05 Bruno Haible + + * dcigettext.c (dcigettext): Fix interpretation of tsearch + return value. + +2000-05-06 Ulrich Drepper + + * dcigettext.c (DCIGETTEXT): Always define local variable `index'. + (mempcpy): Correct typo in parameter list. + + * hash-string.h: Don't include . + + * *.c, *.h, *.y: Update from glibc version. + +1998-04-29 Paul Eggert + + * Makefile.in (aliaspath): Don't put `.' at the end. + +1998-06-01 Ulrich Drepper + + * localealias.c (read_alias_file): Undo last change. + * l10nflist.c (_nl_normalize_codeset): Likewise. + * loadinfo.h: Likewise. + +1998-05-23 Ulrich Drepper + + * dcgettext.c: Don't use any alloca hack when C_ALLOCA is defined. + +1998-05-01 08:47 Ulrich Drepper + + * gettext-0.10.35 released. + +1998-04-29 Ulrich Drepper + + * intl/localealias.c (read_alias_file): Use unsigned char for + local variables. Remove unused variable tp. + * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char * + for type of codeset. For loosing Solaris systems. + * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset. + * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable + len if not needed. + Patches by Jim Meyering. + +1998-04-28 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Don't assign the element use_mmap if + mmap is not supported. + + * hash-string.h: Don't include . + +1998-04-27 Ulrich Drepper + + * textdomain.c: Use strdup is available. + + * localealias.c: Define HAVE_MEMPCPY so that we can use this + function. Define and use semapahores to protect modfication of + global objects when compiling for glibc. Add code to allow + freeing alias table. + + * l10nflist.c: Don't assume stpcpy not being a macro. + + * gettextP.h: Define internal_function macri if not already done. + Use glibc byte-swap macros instead of defining SWAP when compiled + for glibc. + (struct loaded_domain): Add elements to allow unloading. + + * Makefile.in (distclean): Don't remove libintl.h here. + + * bindtextdomain.c: Carry over changes from glibc. Use strdup if + available. + + * dcgettext.c: Don't assume stpcpy not being a macro. Mark internal + functions. Add memory freeing code for glibc. + + * dgettext.c: Update copyright. + + * explodename.c: Include stdlib.h and string.h only if they exist. + Use strings.h eventually. + + * finddomain.c: Mark internal functions. Use strdup if available. + Add memory freeing code for glibc. + +1997-10-10 20:00 Ulrich Drepper + + * libgettext.h: Fix dummy textdomain and bindtextdomain macros. + They should return reasonable values. + Reported by Tom Tromey . + +1997-09-16 03:33 Ulrich Drepper + + * libgettext.h: Define PARAMS also to `args' if __cplusplus is defined. + * intlh.inst.in: Likewise. + Reported by Jean-Marc Lasgouttes . + + * libintl.glibc: Update from current glibc version. + +1997-09-06 02:10 Ulrich Drepper + + * intlh.inst.in: Reformat copyright. + +1997-08-19 15:22 Ulrich Drepper + + * dcgettext.c (DCGETTEXT): Remove wrong comment. + +1997-08-16 00:13 Ulrich Drepper + + * Makefile.in (install-data): Don't change directory to install. + +1997-08-01 14:30 Ulrich Drepper + + * cat-compat.c: Fix copyright. + + * localealias.c: Don't define strchr unless !HAVE_STRCHR. + + * loadmsgcat.c: Update copyright. Fix typos. + + * l10nflist.c: Don't define strchr unless !HAVE_STRCHR. + (_nl_make_l10nflist): Handle sponsor and revision correctly. + + * gettext.c: Update copyright. + * gettext.h: Likewise. + * hash-string.h: Likewise. + + * finddomain.c: Remoave dead code. Define strchr only if + !HAVE_STRCHR. + + * explodename.c: Include . + + * explodename.c: Reformat copyright text. + (_nl_explode_name): Fix typo. + + * dcgettext.c: Define and use __set_errno. + (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is + not defined. + + * bindtextdom.c: Pretty printing. + +1997-05-01 02:25 Ulrich Drepper + + * dcgettext.c (guess_category_value): Don't depend on + HAVE_LC_MESSAGES. We don't need the macro here. + Patch by Bruno Haible . + + * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL + macro. Instead use HAVE_LOCALE_NULL and define it when using + glibc, as in dcgettext.c. + Patch by Bruno Haible . + + * Makefile.in (CPPFLAGS): New variable. Reported by François + Pinard. + +Mon Mar 10 06:51:17 1997 Ulrich Drepper + + * Makefile.in: Implement handling of libtool. + + * gettextP.h: Change data structures for use of generic lowlevel + i18n file handling. + +Wed Dec 4 20:21:18 1996 Ulrich Drepper + + * textdomain.c: Put parentheses around arguments of memcpy macro + definition. + * localealias.c: Likewise. + * l10nflist.c: Likewise. + * finddomain.c: Likewise. + * bindtextdom.c: Likewise. + Reported by Thomas Esken. + +Mon Nov 25 22:57:51 1996 Ulrich Drepper + + * textdomain.c: Move definition of `memcpy` macro to right + position. + +Fri Nov 22 04:01:58 1996 Ulrich Drepper + + * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using + bcopy if not already defined. Reported by Thomas Esken. + * bindtextdom.c: Likewise. + * l10nflist.c: Likewise. + * localealias.c: Likewise. + * textdomain.c: Likewise. + +Tue Oct 29 11:10:27 1996 Ulrich Drepper + + * Makefile.in (libdir): Change to use exec_prefix instead of + prefix. Reported by Knut-HÃ¥vardAksnes . + +Sat Aug 31 03:07:09 1996 Ulrich Drepper + + * l10nflist.c (_nl_normalize_codeset): We convert to lower case, + so don't prepend uppercase `ISO' for only numeric arg. + +Fri Jul 19 00:15:46 1996 Ulrich Drepper + + * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after + definition of _GNU_SOURCE. Patch by Roland McGrath. + + * Makefile.in (uninstall): Fix another bug with `for' loop and + empty arguments. Patch by Jim Meyering. Correct name os + uninstalled files: no intl- prefix anymore. + + * Makefile.in (install-data): Again work around shells which + cannot handle mpty for list. Reported by Jim Meyering. + +Sat Jul 13 18:11:35 1996 Ulrich Drepper + + * Makefile.in (install): Split goal. Now depend on install-exec + and install-data. + (install-exec, install-data): New goals. Created from former + install goal. + Reported by Karl Berry. + +Sat Jun 22 04:58:14 1996 Ulrich Drepper + + * Makefile.in (MKINSTALLDIRS): New variable. Path to + mkinstalldirs script. + (install): use MKINSTALLDIRS variable or if the script is not present + try to find it in the $top_scrdir). + +Wed Jun 19 02:56:56 1996 Ulrich Drepper + + * l10nflist.c: Linux libc *partly* includes the argz_* functions. + Grr. Work around by renaming the static version and use macros + for renaming. + +Tue Jun 18 20:11:17 1996 Ulrich Drepper + + * l10nflist.c: Correct presence test macros of __argz_* functions. + + * l10nflist.c: Include based on test of it instead when + __argz_* functions are available. + Reported by Andreas Schwab. + +Thu Jun 13 15:17:44 1996 Ulrich Drepper + + * explodename.c, l10nflist.c: Define NULL for dumb systems. + +Tue Jun 11 17:05:13 1996 Ulrich Drepper + + * intlh.inst.in, libgettext.h (dcgettext): Rename local variable + result to __result to prevent name clash. + + * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to + get prototype for stpcpy and strcasecmp. + + * intlh.inst.in, libgettext.h: Move declaration of + `_nl_msg_cat_cntr' outside __extension__ block to prevent warning + from gcc's -Wnested-extern option. + +Fri Jun 7 01:58:00 1996 Ulrich Drepper + + * Makefile.in (install): Remove comment. + +Thu Jun 6 17:28:17 1996 Ulrich Drepper + + * Makefile.in (install): Work around for another Buglix stupidity. + Always use an `else' close for `if's. Reported by Nelson Beebe. + + * Makefile.in (intlh.inst): Correct typo in phony rule. + Reported by Nelson Beebe. + +Thu Jun 6 01:49:52 1996 Ulrich Drepper + + * dcgettext.c (read_alias_file): Rename variable alloca_list to + block_list as the macro calls assume. + Patch by Eric Backus. + + * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using + malloc. + (read_alias_file): Rename varriabe alloca_list to block_list as the + macro calls assume. + Patch by Eric Backus. + + * l10nflist.c: Correct conditional for inclusion. + Reported by Roland McGrath. + + * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not + all-@USE_NLS@. + + * Makefile.in (install): intlh.inst comes from local dir, not + $(srcdir). + + * Makefile.in (intlh.inst): Special handling of this goal. If + used in gettext, this is really a rul to construct this file. If + used in any other package it is defined as a .PHONY rule with + empty body. + + * finddomain.c: Extract locale file information handling into + l10nfile.c. Rename local stpcpy__ function to stpcpy. + + * dcgettext.c (stpcpy): Add local definition. + + * l10nflist.c: Solve some portability problems. Patches partly by + Thomas Esken. Add local definition of stpcpy. + +Tue Jun 4 02:47:49 1996 Ulrich Drepper + + * intlh.inst.in: Don't depend including on + HAVE_LOCALE_H. Instead configure must rewrite this fiile + depending on the result of the configure run. + + * Makefile.in (install): libintl.inst is now called intlh.inst. + Add rules for updating intlh.inst from intlh.inst.in. + + * libintl.inst: Renamed to intlh.inst.in. + + * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1 + because gcc has __buitlin_alloca. + Reported by Roland McGrath. + +Mon Jun 3 00:32:16 1996 Ulrich Drepper + + * Makefile.in (installcheck): New goal to fulfill needs of + automake's distcheck. + + * Makefile.in (install): Reorder commands so that VERSION is + found. + + * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in + @datadir@/gettext. + (COMSRCS): Add l10nfile.c. + (OBJECTS): Add l10nfile.o. + (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common). + (DISTFILE.gettext): Remove $(DISTFILES.common). + (all-gettext): Remove goal. + (install): If $(PACKAGE) = gettext install, otherwose do nothing. No + package but gettext itself should install libintl.h + headers. + (dist): Extend goal to work for gettext, too. + (dist-gettext): Remove goal. + + * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc. + +Sun Jun 2 17:33:06 1996 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Parameter is now comes from + find_l10nfile. + +Sat Jun 1 02:23:03 1996 Ulrich Drepper + + * l10nflist.c (__argz_next): Add definition. + + * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca + code. Use new l10nfile handling. + + * localealias.c [!HAVE_ALLOCA]: Add code for handling missing + alloca code. + + * l10nflist.c: Initial revision. + +Tue Apr 2 18:51:18 1996 Ulrich Drepper + + * Makefile.in (all-gettext): New goal. Same as all-yes. + +Thu Mar 28 23:01:22 1996 Karl Eichwalder + + * Makefile.in (gettextsrcdir): Define using @datadir@. + +Tue Mar 26 12:39:14 1996 Ulrich Drepper + + * finddomain.c: Include . Reported by Roland McGrath. + +Sat Mar 23 02:00:35 1996 Ulrich Drepper + + * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing + with external declaration. + +Sat Mar 2 00:47:09 1996 Ulrich Drepper + + * Makefile.in (all-no): Rename from all_no. + +Sat Feb 17 00:25:59 1996 Ulrich Drepper + + * gettextP.h [loaded_domain]: Array `successor' must now contain up + to 63 elements (because of codeset name normalization). + + * finddomain.c: Implement codeset name normalization. + +Thu Feb 15 04:39:09 1996 Ulrich Drepper + + * Makefile.in (all): Define to `all-@USE_NLS@'. + (all-yes, all_no): New goals. `all-no' is noop, `all-yes' + is former all. + +Mon Jan 15 21:46:01 1996 Howard Gayle + + * localealias.c (alias_compare): Increment string pointers in loop + of strcasecmp replacement. + +Fri Dec 29 21:16:34 1995 Ulrich Drepper + + * Makefile.in (install-src): Who commented this goal out ? :-) + +Fri Dec 29 15:08:16 1995 Ulrich Drepper + + * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls + should not effect it because a missing catalog is no error. + Reported by Harald Knig . + +Tue Dec 19 22:09:13 1995 Ulrich Drepper + + * Makefile.in (Makefile): Explicitly use $(SHELL) for running + shell scripts. + +Fri Dec 15 17:34:59 1995 Andreas Schwab + + * Makefile.in (install-src): Only install library and header when + we use the own implementation. Don't do it when using the + system's gettext or catgets functions. + + * dcgettext.c (find_msg): Must not swap domain->hash_size here. + +Sat Dec 9 16:24:37 1995 Ulrich Drepper + + * localealias.c, libintl.inst, libgettext.h, hash-string.h, + gettextP.h, finddomain.c, dcgettext.c, cat-compat.c: + Use PARAMS instead of __P. Suggested by Roland McGrath. + +Tue Dec 5 11:39:14 1995 Larry Schwimmer + + * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if + !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty. + +Mon Dec 4 15:42:07 1995 Ulrich Drepper + + * Makefile.in (install-src): + Install libintl.inst instead of libintl.h.install. + +Sat Dec 2 22:51:38 1995 Marcus Daniels + + * cat-compat.c (textdomain): + Reverse order in which files are tried you load. First + try local file, when this failed absolute path. + +Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe + + * cat-compat.c (bindtextdomain): Add missing { }. + +Sun Nov 26 18:21:41 1995 Ulrich Drepper + + * libintl.inst: Add missing __P definition. Reported by Nelson Beebe. + + * Makefile.in: + Add dummy `all' and `dvi' goals. Reported by Tom Tromey. + +Sat Nov 25 16:12:01 1995 François Pinard + + * hash-string.h: Capitalize arguments of macros. + +Sat Nov 25 12:01:36 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Prevent files names longer than 13 + characters. libintl.h.glibc->libintl.glibc, + libintl.h.install->libintl.inst. Reported by Joshua R. Poulson. + +Sat Nov 25 11:31:12 1995 Eric Backus + + * dcgettext.c: Fix bug in preprocessor conditionals. + +Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe + + * libgettext.h: Solaris cc does not understand + #if !SYMBOL1 && !SYMBOL2. Sad but true. + +Thu Nov 23 16:22:14 1995 Ulrich Drepper + + * hash-string.h (hash_string): + Fix for machine with >32 bit `unsigned long's. + + * dcgettext.c (DCGETTEXT): + Fix horrible bug in loop for alternative translation. + +Thu Nov 23 01:45:29 1995 Ulrich Drepper + + * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed: + Some further simplifications in message number generation. + +Mon Nov 20 21:08:43 1995 Ulrich Drepper + + * libintl.h.glibc: Use __const instead of const in prototypes. + + * Makefile.in (install-src): + Install libintl.h.install instead of libintl.h. This + is a stripped-down version. Suggested by Peter Miller. + + * libintl.h.install, libintl.h.glibc: Initial revision. + + * localealias.c (_nl_expand_alias, read_alias_file): + Protect prototypes in type casts by __P. + +Tue Nov 14 16:43:58 1995 Ulrich Drepper + + * hash-string.h: Correct prototype for hash_string. + +Sun Nov 12 12:42:30 1995 Ulrich Drepper + + * hash-string.h (hash_string): Add prototype. + + * gettextP.h: Fix copyright. + (SWAP): Add prototype. + +Wed Nov 8 22:56:33 1995 Ulrich Drepper + + * localealias.c (read_alias_file): Forgot sizeof. + Avoid calling *printf function. This introduces a big overhead. + Patch by Roland McGrath. + +Tue Nov 7 14:21:08 1995 Ulrich Drepper + + * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy. + + * finddomain.c (stpcpy): + Define substitution function local. The macro was to flaky. + + * cat-compat.c: Fix typo. + + * xopen-msg.sed, linux-msg.sed: + While bringing message number to right place only accept digits. + + * linux-msg.sed, xopen-msg.sed: Now that the counter does not have + leading 0s we don't need to remove them. Reported by Marcus + Daniels. + + * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in + dependency. Reported by Marcus Daniels. + + * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement. + Generally cleanup using #if instead of #ifndef. + + * Makefile.in: Correct typos in comment. By François Pinard. + +Mon Nov 6 00:27:02 1995 Ulrich Drepper + + * Makefile.in (install-src): Don't install libintl.h and libintl.a + if we use an available gettext implementation. + +Sun Nov 5 22:02:08 1995 Ulrich Drepper + + * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported + by François Pinard. + + * libgettext.h: Use #if instead of #ifdef/#ifndef. + + * finddomain.c: + Comments describing what has to be done should start with FIXME. + +Sun Nov 5 19:38:01 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning. + DISTFILES.common names the files common to both dist goals. + DISTFILES.gettext are the files only distributed in GNU gettext. + +Sun Nov 5 17:32:54 1995 Ulrich Drepper + + * dcgettext.c (DCGETTEXT): Correct searching in derived locales. + This was necessary since a change in _nl_find_msg several weeks + ago. I really don't know this is still not fixed. + +Sun Nov 5 12:43:12 1995 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This + might mark a special condition. + + * finddomain.c (make_entry_rec): Don't make illegal entry as decided. + + * Makefile.in (dist): Suppress error message when ln failed. + Get files from $(srcdir) explicitly. + + * libgettext.h (gettext_const): Rename to gettext_noop. + +Fri Nov 3 07:36:50 1995 Ulrich Drepper + + * finddomain.c (make_entry_rec): + Protect against wrong locale names by testing mask. + + * libgettext.h (gettext_const): Add macro definition. + Capitalize macro arguments. + +Thu Nov 2 23:15:51 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Test for pointer != NULL before accessing value. + Reported by Tom Tromey. + + * gettext.c (NULL): + Define as (void*)0 instad of 0. Reported by François Pinard. + +Mon Oct 30 21:28:52 1995 Ulrich Drepper + + * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering. + +Sat Oct 28 23:20:47 1995 Ulrich Drepper + + * libgettext.h: Disable dcgettext optimization for Solaris 2.3. + + * localealias.c (alias_compare): + Peter Miller reported that tolower in some systems is + even dumber than I thought. Protect call by `isupper'. + +Fri Oct 27 22:22:51 1995 Ulrich Drepper + + * Makefile.in (libdir, includedir): New variables. + (install-src): Install libintl.a and libintl.h in correct dirs. + +Fri Oct 27 22:07:29 1995 Ulrich Drepper + + * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c. + + * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques. + + * localealias.c: + Fix typo and superflous test. Reported by Christian von Roques. + +Fri Oct 6 11:52:05 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Correct some remainder from the pre-CEN syntax. Now + we don't have a constant number of successors anymore. + +Wed Sep 27 21:41:13 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Add libintl.h.glibc. + + * Makefile.in (dist-libc): Add goal for packing sources for glibc. + (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc. + + * loadmsgcat.c: Forget to continue #if line. + + * localealias.c: + [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name + space clean. + + * dcgettext.c, finddomain.c: Better comment to last change. + + * loadmsgcat.c: + [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to + __fstat, __open, __close, __read, __mmap, and __munmap resp + to keep ANSI C name space clean. + + * finddomain.c: + [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean. + + * dcgettext.c: + [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to + keep ANSI C name space clean. + + * libgettext.h: + Include sys/types.h for those old SysV systems out there. + Reported by Francesco Potorti`. + + * loadmsgcat.c (use_mmap): Define if compiled for glibc. + + * bindtextdom.c: Include all those standard headers + unconditionally if _LIBC is defined. + + * finddomain.c: Fix 2 times defiend -> defined. + + * textdomain.c: Include libintl.h instead of libgettext.h when + compiling for glibc. Include all those standard headers + unconditionally if _LIBC is defined. + + * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc. + + * gettext.c: + Include libintl.h instead of libgettext.h when compiling for glibc. + Get NULL from stddef.h if we compile for glibc. + + * finddomain.c: Include libintl.h instead of libgettext.h when + compiling for glibc. Include all those standard headers + unconditionally if _LIBC is defined. + + * dcgettext.c: Include all those standard headers unconditionally + if _LIBC is defined. + + * dgettext.c: If compiled in glibc include libintl.h instead of + libgettext.h. + (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc. + + * dcgettext.c: If compiled in glibc include libintl.h instead of + libgettext.h. + (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc. + + * bindtextdom.c: + If compiled in glibc include libintl.h instead of libgettext.h. + +Mon Sep 25 22:23:06 1995 Ulrich Drepper + + * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0. + Reported by Marcus Daniels. + + * cat-compat.c (bindtextdomain): + String used in putenv must not be recycled. + Reported by Marcus Daniels. + + * libgettext.h (__USE_GNU_GETTEXT): + Additional symbol to signal that we use GNU gettext + library. + + * cat-compat.c (bindtextdomain): + Fix bug with the strange stpcpy replacement. + Reported by Nelson Beebe. + +Sat Sep 23 08:23:51 1995 Ulrich Drepper + + * cat-compat.c: Include for stpcpy prototype. + + * localealias.c (read_alias_file): + While expand strdup code temporary variable `cp' hided + higher level variable with same name. Rename to `tp'. + + * textdomain.c (textdomain): + Avoid warning by using temporary variable in strdup code. + + * finddomain.c (_nl_find_domain): Remove unused variable `application'. + +Thu Sep 21 15:51:44 1995 Ulrich Drepper + + * localealias.c (alias_compare): + Use strcasecmp() only if available. Else use + implementation in place. + + * intl-compat.c: + Wrapper functions now call *__ functions instead of __*. + + * libgettext.h: Declare prototypes for *__ functions instead for __*. + + * cat-compat.c, loadmsgcat.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + + * bindtextdom.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + Rename to bindtextdomain__ if not used in GNU C Library. + + * dgettext.c: + Rename function to dgettext__ if not used in GNU C Library. + + * gettext.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + Functions now called gettext__ if not used in GNU C Library. + + * dcgettext.c, localealias.c, textdomain.c, finddomain.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + +Sun Sep 17 23:14:49 1995 Ulrich Drepper + + * finddomain.c: Correct some bugs in handling of CEN standard + locale definitions. + +Thu Sep 7 01:49:28 1995 Ulrich Drepper + + * finddomain.c: Implement CEN syntax. + + * gettextP.h (loaded_domain): Extend number of successors to 31. + +Sat Aug 19 19:25:29 1995 Ulrich Drepper + + * Makefile.in (aliaspath): Remove path to X11 locale dir. + + * Makefile.in: Make install-src depend on install. This helps + gettext to install the sources and other packages can use the + install goal. + +Sat Aug 19 15:19:33 1995 Ulrich Drepper + + * Makefile.in (uninstall): Remove stuff installed by install-src. + +Tue Aug 15 13:13:53 1995 Ulrich Drepper + + * VERSION.in: Initial revision. + + * Makefile.in (DISTFILES): + Add VERSION file. This is not necessary for gettext, but + for other packages using this library. + +Tue Aug 15 06:16:44 1995 Ulrich Drepper + + * gettextP.h (_nl_find_domain): + New prototype after changing search strategy. + + * finddomain.c (_nl_find_domain): + We now try only to find a specified catalog. Fall back to other + catalogs listed in the locale list is now done in __dcgettext. + + * dcgettext.c (__dcgettext): + Now we provide message fall back even to different languages. + I.e. if a message is not available in one language all the other + in the locale list a tried. Formerly fall back was only possible + within one language. Implemented by moving one loop from + _nl_find_domain to here. + +Mon Aug 14 23:45:50 1995 Ulrich Drepper + + * Makefile.in (gettextsrcdir): + Directory where source of GNU gettext library are made + available. + (INSTALL, INSTALL_DATA): Programs used for installing sources. + (gettext-src): New. Rule to install GNU gettext sources for use in + gettextize shell script. + +Sun Aug 13 14:40:48 1995 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): + Use mmap for loading only when munmap function is + also available. + + * Makefile.in (install): Depend on `all' goal. + +Wed Aug 9 11:04:33 1995 Ulrich Drepper + + * localealias.c (read_alias_file): + Do not overwrite '\n' when terminating alias value string. + + * localealias.c (read_alias_file): + Handle long lines. Ignore the rest not fitting in + the buffer after the initial `fgets' call. + +Wed Aug 9 00:54:29 1995 Ulrich Drepper + + * gettextP.h (_nl_load_domain): + Add prototype, replacing prototype for _nl_load_msg_cat. + + * finddomain.c (_nl_find_domain): + Remove unneeded variable filename and filename_len. + (expand_alias): Remove prototype because functions does not + exist anymore. + + * localealias.c (read_alias_file): + Change type of fname_len parameter to int. + (xmalloc): Add prototype. + + * loadmsgcat.c: Better prototypes for xmalloc. + +Tue Aug 8 22:30:39 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Allow alias name to be constructed from the four components. + + * Makefile.in (aliaspath): New variable. Set to preliminary value. + (SOURCES): Add localealias.c. + (OBJECTS): Add localealias.o. + + * gettextP.h: Add prototype for _nl_expand_alias. + + * finddomain.c: Aliasing handled in intl/localealias.c. + + * localealias.c: Aliasing for locale names. + + * bindtextdom.c: Better prototypes for xmalloc and xstrdup. + +Mon Aug 7 23:47:42 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): gettext.perl is now found in misc/. + + * cat-compat.c (bindtextdomain): + Correct implementation. dirname parameter was not used. + Reported by Marcus Daniels. + + * gettextP.h (loaded_domain): + New fields `successor' and `decided' for oo, lazy + message handling implementation. + + * dcgettext.c: + Adopt for oo, lazy message handliing. + Now we can inherit translations from less specific locales. + (find_msg): New function. + + * loadmsgcat.c, finddomain.c: + Complete rewrite. Implement oo, lazy message handling :-). + We now have an additional environment variable `LANGUAGE' with + a higher priority than LC_ALL for the LC_MESSAGE locale. + Here we can set a colon separated list of specifications each + of the form `language[_territory[.codeset]][@modifier]'. + +Sat Aug 5 09:55:42 1995 Ulrich Drepper + + * finddomain.c (unistd.h): + Include to get _PC_PATH_MAX defined on system having it. + +Fri Aug 4 22:42:00 1995 Ulrich Drepper + + * finddomain.c (stpcpy): Include prototype. + + * Makefile.in (dist): Remove `copying instead' message. + +Wed Aug 2 18:52:03 1995 Ulrich Drepper + + * Makefile.in (ID, TAGS): Do not use $^. + +Tue Aug 1 20:07:11 1995 Ulrich Drepper + + * Makefile.in (TAGS, ID): Use $^ as command argument. + (TAGS): Give etags -o option t write to current directory, + not $(srcdir). + (ID): Use $(srcdir) instead os $(top_srcdir)/src. + (distclean): Remove ID. + +Sun Jul 30 11:51:46 1995 Ulrich Drepper + + * Makefile.in (gnulocaledir): + New variable, always using share/ for data directory. + (DEFS): Add GNULOCALEDIR, used in finddomain.c. + + * finddomain.c (_nl_default_dirname): + Set to GNULOCALEDIR, because it always has to point + to the directory where GNU gettext Library writes it to. + + * intl-compat.c (textdomain, bindtextdomain): + Undefine macros before function definition. + +Sat Jul 22 01:10:02 1995 Ulrich Drepper + + * libgettext.h (_LIBINTL_H): + Protect definition in case where this file is included as + libgettext.h on Solaris machines. Add comment about this. + +Wed Jul 19 02:36:42 1995 Ulrich Drepper + + * intl-compat.c (textdomain): Correct typo. + +Wed Jul 19 01:51:35 1995 Ulrich Drepper + + * dcgettext.c (dcgettext): Function now called __dcgettext. + + * dgettext.c (dgettext): Now called __dgettext and calls + __dcgettext. + + * gettext.c (gettext): + Function now called __gettext and calls __dgettext. + + * textdomain.c (textdomain): Function now called __textdomain. + + * bindtextdom.c (bindtextdomain): Function now called + __bindtextdomain. + + * intl-compat.c: Initial revision. + + * Makefile.in (SOURCES): Add intl-compat.c. + (OBJECTS): We always compile the GNU gettext library functions. + OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o, + and intl-compat.o. + (GETTOBJS): Contains now only intl-compat.o. + + * libgettext.h: + Re-include protection matches dualistic character of libgettext.h. + For all functions in GNU gettext library define __ counter part. + + * finddomain.c (strchr): Define as index if not found in C library. + (_nl_find_domain): For relative paths paste / in between. + +Tue Jul 18 16:37:45 1995 Ulrich Drepper + + * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h. + + * xopen-msg.sed: Fix bug with `msgstr ""' lines. + A little bit better comments. + +Tue Jul 18 01:18:27 1995 Ulrich Drepper + + * Makefile.in: + po-mode.el, makelinks, combine-sh are now found in ../misc. + + * po-mode.el, makelinks, combine-sh, elisp-comp: + Moved to ../misc/. + + * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__. + +Sun Jul 16 22:33:02 1995 Ulrich Drepper + + * Makefile.in (INSTALL, INSTALL_DATA): New variables. + (install-data, uninstall): Install/uninstall .elc file. + + * po-mode.el (Installation comment): + Add .pox as possible extension of .po files. + +Sun Jul 16 13:23:27 1995 Ulrich Drepper + + * elisp-comp: Complete new version by François: This does not + fail when not compiling in the source directory. + +Sun Jul 16 00:12:17 1995 Ulrich Drepper + + * Makefile.in (../po/cat-id-tbl.o): + Use $(MAKE) instead of make for recursive make. + + * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh. + (install-exec): Add missing dummy goal. + (install-data, uninstall): @ in multi-line shell command at + beginning, not in front of echo. Reported by Eric Backus. + +Sat Jul 15 00:21:28 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): + Rename libgettext.perl to gettext.perl to fit in 14 chars + file systems. + + * gettext.perl: + Rename to gettext.perl to fit in 14 chars file systems. + +Thu Jul 13 23:17:20 1995 Ulrich Drepper + + * cat-compat.c: If !STDC_HEADERS try to include malloc.h. + +Thu Jul 13 20:55:02 1995 Ulrich Drepper + + * po2tbl.sed.in: Pretty printing. + + * linux-msg.sed, xopen-msg.sed: + Correct bugs with handling substitute flags in branches. + + * hash-string.h (hash_string): + Old K&R compilers don't under stand `unsigned char'. + + * gettext.h (nls_uint32): + Some old K&R compilers (eg HP) don't understand `unsigned int'. + + * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes. + +Thu Jul 13 01:34:33 1995 Ulrich Drepper + + * Makefile.in (ELCFILES): New variable. + (DISTFILES): Add elisp-comp. + Add implicit rule for .el -> .elc compilation. + (install-data): install $ELCFILES + (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp. + + * elisp-comp: Initial revision + +Wed Jul 12 16:14:52 1995 Ulrich Drepper + + * Makefile.in: + cat-id-tbl.c is now found in po/. This enables us to use an identical + intl/ directory in all packages. + + * dcgettext.c (dcgettext): hashing does not work for table size <= 2. + + * textdomain.c: fix typo (#if def -> #if defined) + +Tue Jul 11 18:44:43 1995 Ulrich Drepper + + * Makefile.in (stamp-cat-id): use top_srcdir to address source files + (DISTFILES,distclean): move tupdate.perl to src/ + + * po-to-tbl.sed.in: + add additional jump to clear change flag to recognize multiline strings + +Tue Jul 11 01:32:50 1995 Ulrich Drepper + + * textdomain.c: Protect inclusion of stdlib.h and string.h. + + * loadmsgcat.c: Protect inclusion of stdlib.h. + + * libgettext.h: Protect inclusion of locale.h. + Allow use in C++ programs. + Define NULL is not happened already. + + * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of + po-to-tbl.sed. + (distclean): remove po-to-tbl.sed and tupdate.perl. + + * tupdate.perl.in: Substitute Perl path even in exec line. + Don't include entries without translation from old .po file. + +Tue Jul 4 00:41:51 1995 Ulrich Drepper + + * tupdate.perl.in: use "Updated: " in msgid "". + + * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR). + Define getenv if !__STDC__. + + * bindtextdom.c: Protect stdlib.h and string.h inclusion. + Define free if !__STDC__. + + * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. + Define free if !__STDC__. + + * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. + +Mon Jul 3 23:56:30 1995 Ulrich Drepper + + * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR. + Remove unneeded $(srcdir) from Makefile.in dependency. + + * makelinks: Add copyright and short description. + + * po-mode.el: Last version for 0.7. + + * tupdate.perl.in: Fix die message. + + * dcgettext.c: Protect include of string.h. + + * gettext.c: Protect include of stdlib.h and further tries to get NULL. + + * finddomain.c: Some corrections in includes. + + * Makefile.in (INCLUDES): Prune list correct path to Makefile.in. + + * po-to-tbl.sed: Adopt for new .po file format. + + * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format. + +Sun Jul 2 23:55:03 1995 Ulrich Drepper + + * tupdate.perl.in: Complete rewrite for new .po file format. + +Sun Jul 2 02:06:50 1995 Ulrich Drepper + + * First official release. This directory contains all the code + needed to internationalize own packages. It provides functions + which allow to use the X/Open catgets function with an interface + like the Uniforum gettext function. For system which does not + have neither of those a complete implementation is provided. diff --git a/src/apps/bin/grep-2.5/intl/Makefile b/src/apps/bin/grep-2.5/intl/Makefile new file mode 100644 index 0000000000..6d28a9ccc3 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/Makefile @@ -0,0 +1,337 @@ +# Makefile for directory with message catalog handling in GNU NLS Utilities. +# Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. + +PACKAGE = grep +VERSION = 2.5 + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. +top_builddir = .. + + +prefix = /usr/local +exec_prefix = ${prefix} +transform = s,x,x, +libdir = ${exec_prefix}/lib +includedir = ${prefix}/include +datadir = ${prefix}/share +localedir = $(datadir)/locale +gettextsrcdir = $(datadir)/gettext/intl +aliaspath = $(localedir) +subdir = intl + +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +MKINSTALLDIRS = ./mkinstalldirs +mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` + +l = + +AR = ar +CC = gcc +LIBTOOL = @LIBTOOL@ +RANLIB = ranlib +YACC = bison -y -d +YFLAGS = --name-prefix=__gettext + +DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ +-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL -DHAVE_CONFIG_H +CPPFLAGS = +CFLAGS = -g -O2 +LDFLAGS = + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +HEADERS = $(COMHDRS) libgnuintl.h loadinfo.h +COMHDRS = gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h +SOURCES = $(COMSRCS) intl-compat.c +COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ +finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ +explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ +plural-exp.c localcharset.c localename.c osdep.c os2compat.c +OBJECTS = $(GETTOBJS) bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ +finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ +explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ +plural.$lo plural-exp.$lo localcharset.$lo localename.$lo osdep.$lo +GETTOBJS = intl-compat.$lo +DISTFILES.common = Makefile.in \ +config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) +DISTFILES.generated = plural.c +DISTFILES.normal = VERSION +DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc +DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ +COPYING.LIB-2 gettext.h libgettext.h plural-eval.c + +# Libtool's library version information for libintl. +# Before making a gettext release, the gettext maintainer must change this +# according to the libtool documentation, section "Library interface versions". +# Maintainers of other packages that include the intl directory must *not* +# change these values. +LTV_CURRENT=2 +LTV_REVISION=0 +LTV_AGE=0 + +.SUFFIXES: +.SUFFIXES: .c .y .o .lo .sin .sed +.c.o: + $(COMPILE) $< +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) $< + +.y.c: + $(YACC) $(YFLAGS) --output $@ $< + rm -f $*.h + +.sin.sed: + sed -e '/^#/d' -e 's/@''PACKAGE''@/grep/g' $< > t-$@ + mv t-$@ $@ + +INCLUDES = -I.. -I. -I$(top_srcdir)/intl + +all: all-yes +all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed +all-no: all-no-yes +all-no-yes: libgnuintl.$la +all-no-no: + +libintl.a libgnuintl.a: $(OBJECTS) + rm -f $@ + $(AR) cru $@ $(OBJECTS) + $(RANLIB) $@ + +libintl.la libgnuintl.la: $(OBJECTS) + $(LIBTOOL) --mode=link \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ + $(OBJECTS) @LTLIBICONV@ -lc \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) \ + -no-undefined + +libintl.h: libgnuintl.h + cp $(srcdir)/libgnuintl.h libintl.h + +charset.alias: config.charset + $(SHELL) $(srcdir)/config.charset 'i586-pc-beos' > t-$@ + mv t-$@ $@ + +check: all + +# This installation goal is only used in GNU gettext. Packages which +# only use the library should use install instead. + +# We must not install the libintl.h/libintl.a files if we are on a +# system which has the GNU gettext() function in its C library or in a +# separate library. +# If you want to use the one which comes with this version of the +# package, you have to use `configure --with-included-gettext'. +install: install-exec install-data +install-exec: all + if test "$(PACKAGE)" = "gettext" \ + && test '$(GETTOBJS)' = '$(GETTOBJS)'; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ + $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ + $(LIBTOOL) --mode=install \ + $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ + else \ + : ; \ + fi + if test 'yes' = yes; then \ + test no != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ + temp=$(DESTDIR)$(libdir)/t-charset.alias; \ + dest=$(DESTDIR)$(libdir)/charset.alias; \ + if test -f $(DESTDIR)$(libdir)/charset.alias; then \ + orig=$(DESTDIR)$(libdir)/charset.alias; \ + sed -f ref-add.sed $$orig > $$temp; \ + $(INSTALL_DATA) $$temp $$dest; \ + rm -f $$temp; \ + else \ + if test no = no; then \ + orig=charset.alias; \ + sed -f ref-add.sed $$orig > $$temp; \ + $(INSTALL_DATA) $$temp $$dest; \ + rm -f $$temp; \ + fi; \ + fi; \ + $(mkinstalldirs) $(DESTDIR)$(localedir); \ + test -f $(DESTDIR)$(localedir)/locale.alias \ + && orig=$(DESTDIR)$(localedir)/locale.alias \ + || orig=$(srcdir)/locale.alias; \ + temp=$(DESTDIR)$(localedir)/t-locale.alias; \ + dest=$(DESTDIR)$(localedir)/locale.alias; \ + sed -f ref-add.sed $$orig > $$temp; \ + $(INSTALL_DATA) $$temp $$dest; \ + rm -f $$temp; \ + else \ + : ; \ + fi +install-data: all + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ + $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ + dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \ + for file in $$dists; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ + dists="$(DISTFILES.generated)"; \ + for file in $$dists; do \ + if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ + $(INSTALL_DATA) $$dir/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + dists="$(DISTFILES.obsolete)"; \ + for file in $$dists; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + +install-strip: install + +installdirs: + if test "$(PACKAGE)" = "gettext" \ + && test '$(GETTOBJS)' = '$(GETTOBJS)'; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ + else \ + : ; \ + fi + if test 'yes' = yes; then \ + test no != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ + $(mkinstalldirs) $(DESTDIR)$(localedir); \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + if test "$(PACKAGE)" = "gettext" \ + && test '$(GETTOBJS)' = '$(GETTOBJS)'; then \ + rm -f $(DESTDIR)$(includedir)/libintl.h; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libintl.$la; \ + else \ + : ; \ + fi + if test 'yes' = yes; then \ + if test -f $(DESTDIR)$(libdir)/charset.alias; then \ + temp=$(DESTDIR)$(libdir)/t-charset.alias; \ + dest=$(DESTDIR)$(libdir)/charset.alias; \ + sed -f ref-del.sed $$dest > $$temp; \ + if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ + rm -f $$dest; \ + else \ + $(INSTALL_DATA) $$temp $$dest; \ + fi; \ + rm -f $$temp; \ + fi; \ + if test -f $(DESTDIR)$(localedir)/locale.alias; then \ + temp=$(DESTDIR)$(localedir)/t-locale.alias; \ + dest=$(DESTDIR)$(localedir)/locale.alias; \ + sed -f ref-del.sed $$dest > $$temp; \ + if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ + rm -f $$dest; \ + else \ + $(INSTALL_DATA) $$temp $$dest; \ + fi; \ + rm -f $$temp; \ + fi; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext"; then \ + for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + +info dvi: + +$(OBJECTS): ../config.h libgnuintl.h +bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: gettextP.h gmo.h loadinfo.h +dcigettext.$lo: hash-string.h +explodename.$lo l10nflist.$lo: loadinfo.h +dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: plural-exp.h +dcigettext.$lo: eval-plural.h + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + + +mostlyclean: + rm -f *.a *.la *.o *.lo core core.* + rm -f libintl.h charset.alias ref-add.sed ref-del.sed + rm -f -r .libs _libs + +clean: mostlyclean + +distclean: clean + rm -f Makefile ID TAGS + if test "$(PACKAGE)" = gettext; then \ + rm -f ChangeLog.inst $(DISTFILES.normal); \ + else \ + : ; \ + fi + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + +# GNU gettext needs not contain the file `VERSION' but contains some +# other files which should not be distributed in other packages. +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: Makefile + if test "$(PACKAGE)" = gettext; then \ + additional="$(DISTFILES.gettext)"; \ + else \ + additional="$(DISTFILES.normal)"; \ + fi; \ + $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ + for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ + if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ + cp -p $$dir/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/intl/Makefile.in b/src/apps/bin/grep-2.5/intl/Makefile.in new file mode 100644 index 0000000000..c2cb20f113 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/Makefile.in @@ -0,0 +1,337 @@ +# Makefile for directory with message catalog handling in GNU NLS Utilities. +# Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = .. +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +transform = @program_transform_name@ +libdir = @libdir@ +includedir = @includedir@ +datadir = @datadir@ +localedir = $(datadir)/locale +gettextsrcdir = $(datadir)/gettext/intl +aliaspath = $(localedir) +subdir = intl + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` + +l = @INTL_LIBTOOL_SUFFIX_PREFIX@ + +AR = ar +CC = @CC@ +LIBTOOL = @LIBTOOL@ +RANLIB = @RANLIB@ +YACC = @INTLBISON@ -y -d +YFLAGS = --name-prefix=__gettext + +DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ +-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL @DEFS@ +CPPFLAGS = @CPPFLAGS@ +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +HEADERS = $(COMHDRS) libgnuintl.h loadinfo.h +COMHDRS = gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h +SOURCES = $(COMSRCS) intl-compat.c +COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ +finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ +explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ +plural-exp.c localcharset.c localename.c osdep.c os2compat.c +OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ +finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ +explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ +plural.$lo plural-exp.$lo localcharset.$lo localename.$lo osdep.$lo +GETTOBJS = intl-compat.$lo +DISTFILES.common = Makefile.in \ +config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) +DISTFILES.generated = plural.c +DISTFILES.normal = VERSION +DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc +DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ +COPYING.LIB-2 gettext.h libgettext.h plural-eval.c + +# Libtool's library version information for libintl. +# Before making a gettext release, the gettext maintainer must change this +# according to the libtool documentation, section "Library interface versions". +# Maintainers of other packages that include the intl directory must *not* +# change these values. +LTV_CURRENT=2 +LTV_REVISION=0 +LTV_AGE=0 + +.SUFFIXES: +.SUFFIXES: .c .y .o .lo .sin .sed +.c.o: + $(COMPILE) $< +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) $< + +.y.c: + $(YACC) $(YFLAGS) --output $@ $< + rm -f $*.h + +.sin.sed: + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ + mv t-$@ $@ + +INCLUDES = -I.. -I. -I$(top_srcdir)/intl + +all: all-@USE_INCLUDED_LIBINTL@ +all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed +all-no: all-no-@BUILD_INCLUDED_LIBINTL@ +all-no-yes: libgnuintl.$la +all-no-no: + +libintl.a libgnuintl.a: $(OBJECTS) + rm -f $@ + $(AR) cru $@ $(OBJECTS) + $(RANLIB) $@ + +libintl.la libgnuintl.la: $(OBJECTS) + $(LIBTOOL) --mode=link \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ + $(OBJECTS) @LTLIBICONV@ -lc \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) \ + -no-undefined + +libintl.h: libgnuintl.h + cp $(srcdir)/libgnuintl.h libintl.h + +charset.alias: config.charset + $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ + mv t-$@ $@ + +check: all + +# This installation goal is only used in GNU gettext. Packages which +# only use the library should use install instead. + +# We must not install the libintl.h/libintl.a files if we are on a +# system which has the GNU gettext() function in its C library or in a +# separate library. +# If you want to use the one which comes with this version of the +# package, you have to use `configure --with-included-gettext'. +install: install-exec install-data +install-exec: all + if test "$(PACKAGE)" = "gettext" \ + && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ + $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ + $(LIBTOOL) --mode=install \ + $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ + temp=$(DESTDIR)$(libdir)/t-charset.alias; \ + dest=$(DESTDIR)$(libdir)/charset.alias; \ + if test -f $(DESTDIR)$(libdir)/charset.alias; then \ + orig=$(DESTDIR)$(libdir)/charset.alias; \ + sed -f ref-add.sed $$orig > $$temp; \ + $(INSTALL_DATA) $$temp $$dest; \ + rm -f $$temp; \ + else \ + if test @GLIBC21@ = no; then \ + orig=charset.alias; \ + sed -f ref-add.sed $$orig > $$temp; \ + $(INSTALL_DATA) $$temp $$dest; \ + rm -f $$temp; \ + fi; \ + fi; \ + $(mkinstalldirs) $(DESTDIR)$(localedir); \ + test -f $(DESTDIR)$(localedir)/locale.alias \ + && orig=$(DESTDIR)$(localedir)/locale.alias \ + || orig=$(srcdir)/locale.alias; \ + temp=$(DESTDIR)$(localedir)/t-locale.alias; \ + dest=$(DESTDIR)$(localedir)/locale.alias; \ + sed -f ref-add.sed $$orig > $$temp; \ + $(INSTALL_DATA) $$temp $$dest; \ + rm -f $$temp; \ + else \ + : ; \ + fi +install-data: all + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ + $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ + dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \ + for file in $$dists; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ + dists="$(DISTFILES.generated)"; \ + for file in $$dists; do \ + if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ + $(INSTALL_DATA) $$dir/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + dists="$(DISTFILES.obsolete)"; \ + for file in $$dists; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + +install-strip: install + +installdirs: + if test "$(PACKAGE)" = "gettext" \ + && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ + $(mkinstalldirs) $(DESTDIR)$(localedir); \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + if test "$(PACKAGE)" = "gettext" \ + && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ + rm -f $(DESTDIR)$(includedir)/libintl.h; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libintl.$la; \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + if test -f $(DESTDIR)$(libdir)/charset.alias; then \ + temp=$(DESTDIR)$(libdir)/t-charset.alias; \ + dest=$(DESTDIR)$(libdir)/charset.alias; \ + sed -f ref-del.sed $$dest > $$temp; \ + if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ + rm -f $$dest; \ + else \ + $(INSTALL_DATA) $$temp $$dest; \ + fi; \ + rm -f $$temp; \ + fi; \ + if test -f $(DESTDIR)$(localedir)/locale.alias; then \ + temp=$(DESTDIR)$(localedir)/t-locale.alias; \ + dest=$(DESTDIR)$(localedir)/locale.alias; \ + sed -f ref-del.sed $$dest > $$temp; \ + if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ + rm -f $$dest; \ + else \ + $(INSTALL_DATA) $$temp $$dest; \ + fi; \ + rm -f $$temp; \ + fi; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext"; then \ + for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + +info dvi: + +$(OBJECTS): ../config.h libgnuintl.h +bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: gettextP.h gmo.h loadinfo.h +dcigettext.$lo: hash-string.h +explodename.$lo l10nflist.$lo: loadinfo.h +dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: plural-exp.h +dcigettext.$lo: eval-plural.h + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + + +mostlyclean: + rm -f *.a *.la *.o *.lo core core.* + rm -f libintl.h charset.alias ref-add.sed ref-del.sed + rm -f -r .libs _libs + +clean: mostlyclean + +distclean: clean + rm -f Makefile ID TAGS + if test "$(PACKAGE)" = gettext; then \ + rm -f ChangeLog.inst $(DISTFILES.normal); \ + else \ + : ; \ + fi + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + +# GNU gettext needs not contain the file `VERSION' but contains some +# other files which should not be distributed in other packages. +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: Makefile + if test "$(PACKAGE)" = gettext; then \ + additional="$(DISTFILES.gettext)"; \ + else \ + additional="$(DISTFILES.normal)"; \ + fi; \ + $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ + for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ + if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ + cp -p $$dir/$$file $(distdir); \ + done + +Makefile: Makefile.in ../config.status + cd .. \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/intl/bindtextdom.c b/src/apps/bin/grep-2.5/intl/bindtextdom.c new file mode 100644 index 0000000000..07e073d642 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/bindtextdom.c @@ -0,0 +1,369 @@ +/* Implementation of the bindtextdomain(3) function + Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "gettextP.h" + +#ifdef _LIBC +/* We have to handle multi-threaded applications. */ +# include +#else +/* Provide dummy implementation if this is outside glibc. */ +# define __libc_rwlock_define(CLASS, NAME) +# define __libc_rwlock_wrlock(NAME) +# define __libc_rwlock_unlock(NAME) +#endif + +/* The internal variables in the standalone libintl.a must have different + names than the internal variables in GNU libc, otherwise programs + using libintl.a cannot be linked statically. */ +#if !defined _LIBC +# define _nl_default_dirname _nl_default_dirname__ +# define _nl_domain_bindings _nl_domain_bindings__ +#endif + +/* Some compilers, like SunOS4 cc, don't have offsetof in . */ +#ifndef offsetof +# define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) +#endif + +/* @@ end of prolog @@ */ + +/* Contains the default location of the message catalogs. */ +extern const char _nl_default_dirname[]; + +/* List with bindings of specific domains. */ +extern struct binding *_nl_domain_bindings; + +/* Lock variable to protect the global data in the gettext implementation. */ +__libc_rwlock_define (extern, _nl_state_lock) + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define BINDTEXTDOMAIN __bindtextdomain +# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset +# ifndef strdup +# define strdup(str) __strdup (str) +# endif +#else +# define BINDTEXTDOMAIN bindtextdomain__ +# define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__ +#endif + +/* Prototypes for local functions. */ +static void set_binding_values PARAMS ((const char *domainname, + const char **dirnamep, + const char **codesetp)); + +/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP + to be used for the DOMAINNAME message catalog. + If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not + modified, only the current value is returned. + If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither + modified nor returned. */ +static void +set_binding_values (domainname, dirnamep, codesetp) + const char *domainname; + const char **dirnamep; + const char **codesetp; +{ + struct binding *binding; + int modified; + + /* Some sanity checks. */ + if (domainname == NULL || domainname[0] == '\0') + { + if (dirnamep) + *dirnamep = NULL; + if (codesetp) + *codesetp = NULL; + return; + } + + __libc_rwlock_wrlock (_nl_state_lock); + + modified = 0; + + for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) + { + int compare = strcmp (domainname, binding->domainname); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It is not in the list. */ + binding = NULL; + break; + } + } + + if (binding != NULL) + { + if (dirnamep) + { + const char *dirname = *dirnamep; + + if (dirname == NULL) + /* The current binding has be to returned. */ + *dirnamep = binding->dirname; + else + { + /* The domain is already bound. If the new value and the old + one are equal we simply do nothing. Otherwise replace the + old binding. */ + char *result = binding->dirname; + if (strcmp (dirname, result) != 0) + { + if (strcmp (dirname, _nl_default_dirname) == 0) + result = (char *) _nl_default_dirname; + else + { +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (dirname); +#else + size_t len = strlen (dirname) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result != NULL, 1)) + memcpy (result, dirname, len); +#endif + } + + if (__builtin_expect (result != NULL, 1)) + { + if (binding->dirname != _nl_default_dirname) + free (binding->dirname); + + binding->dirname = result; + modified = 1; + } + } + *dirnamep = result; + } + } + + if (codesetp) + { + const char *codeset = *codesetp; + + if (codeset == NULL) + /* The current binding has be to returned. */ + *codesetp = binding->codeset; + else + { + /* The domain is already bound. If the new value and the old + one are equal we simply do nothing. Otherwise replace the + old binding. */ + char *result = binding->codeset; + if (result == NULL || strcmp (codeset, result) != 0) + { +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (codeset); +#else + size_t len = strlen (codeset) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result != NULL, 1)) + memcpy (result, codeset, len); +#endif + + if (__builtin_expect (result != NULL, 1)) + { + if (binding->codeset != NULL) + free (binding->codeset); + + binding->codeset = result; + binding->codeset_cntr++; + modified = 1; + } + } + *codesetp = result; + } + } + } + else if ((dirnamep == NULL || *dirnamep == NULL) + && (codesetp == NULL || *codesetp == NULL)) + { + /* Simply return the default values. */ + if (dirnamep) + *dirnamep = _nl_default_dirname; + if (codesetp) + *codesetp = NULL; + } + else + { + /* We have to create a new binding. */ + size_t len = strlen (domainname) + 1; + struct binding *new_binding = + (struct binding *) malloc (offsetof (struct binding, domainname) + len); + + if (__builtin_expect (new_binding == NULL, 0)) + goto failed; + + memcpy (new_binding->domainname, domainname, len); + + if (dirnamep) + { + const char *dirname = *dirnamep; + + if (dirname == NULL) + /* The default value. */ + dirname = _nl_default_dirname; + else + { + if (strcmp (dirname, _nl_default_dirname) == 0) + dirname = _nl_default_dirname; + else + { + char *result; +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (dirname); + if (__builtin_expect (result == NULL, 0)) + goto failed_dirname; +#else + size_t len = strlen (dirname) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result == NULL, 0)) + goto failed_dirname; + memcpy (result, dirname, len); +#endif + dirname = result; + } + } + *dirnamep = dirname; + new_binding->dirname = (char *) dirname; + } + else + /* The default value. */ + new_binding->dirname = (char *) _nl_default_dirname; + + new_binding->codeset_cntr = 0; + + if (codesetp) + { + const char *codeset = *codesetp; + + if (codeset != NULL) + { + char *result; + +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (codeset); + if (__builtin_expect (result == NULL, 0)) + goto failed_codeset; +#else + size_t len = strlen (codeset) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result == NULL, 0)) + goto failed_codeset; + memcpy (result, codeset, len); +#endif + codeset = result; + new_binding->codeset_cntr++; + } + *codesetp = codeset; + new_binding->codeset = (char *) codeset; + } + else + new_binding->codeset = NULL; + + /* Now enqueue it. */ + if (_nl_domain_bindings == NULL + || strcmp (domainname, _nl_domain_bindings->domainname) < 0) + { + new_binding->next = _nl_domain_bindings; + _nl_domain_bindings = new_binding; + } + else + { + binding = _nl_domain_bindings; + while (binding->next != NULL + && strcmp (domainname, binding->next->domainname) > 0) + binding = binding->next; + + new_binding->next = binding->next; + binding->next = new_binding; + } + + modified = 1; + + /* Here we deal with memory allocation failures. */ + if (0) + { + failed_codeset: + if (new_binding->dirname != _nl_default_dirname) + free (new_binding->dirname); + failed_dirname: + free (new_binding); + failed: + if (dirnamep) + *dirnamep = NULL; + if (codesetp) + *codesetp = NULL; + } + } + + /* If we modified any binding, we flush the caches. */ + if (modified) + ++_nl_msg_cat_cntr; + + __libc_rwlock_unlock (_nl_state_lock); +} + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +char * +BINDTEXTDOMAIN (domainname, dirname) + const char *domainname; + const char *dirname; +{ + set_binding_values (domainname, &dirname, NULL); + return (char *) dirname; +} + +/* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +char * +BIND_TEXTDOMAIN_CODESET (domainname, codeset) + const char *domainname; + const char *codeset; +{ + set_binding_values (domainname, NULL, &codeset); + return (char *) codeset; +} + +#ifdef _LIBC +/* Aliases for function names in GNU C Library. */ +weak_alias (__bindtextdomain, bindtextdomain); +weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); +#endif diff --git a/src/apps/bin/grep-2.5/intl/bindtextdom.o b/src/apps/bin/grep-2.5/intl/bindtextdom.o new file mode 100644 index 0000000000..56b569262e Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/bindtextdom.o differ diff --git a/src/apps/bin/grep-2.5/intl/charset.alias b/src/apps/bin/grep-2.5/intl/charset.alias new file mode 100644 index 0000000000..3d89783d27 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/charset.alias @@ -0,0 +1,5 @@ +# This file contains a table of character encoding aliases, +# suitable for operating system 'beos'. +# It was automatically generated from config.charset. +# Packages using this file: +* UTF-8 diff --git a/src/apps/bin/grep-2.5/intl/config.charset b/src/apps/bin/grep-2.5/intl/config.charset new file mode 100755 index 0000000000..b91e0591b8 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/config.charset @@ -0,0 +1,440 @@ +#! /bin/sh +# Output a system dependent table of character encoding aliases. +# +# Copyright (C) 2000-2002 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# +# The table consists of lines of the form +# ALIAS CANONICAL +# +# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". +# ALIAS is compared in a case sensitive way. +# +# CANONICAL is the GNU canonical name for this character encoding. +# It must be an encoding supported by libiconv. Support by GNU libc is +# also desirable. CANONICAL is case insensitive. Usually an upper case +# MIME charset name is preferred. +# The current list of GNU canonical charset names is as follows. +# +# name used by which systems a MIME name? +# ASCII, ANSI_X3.4-1968 glibc solaris freebsd +# ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes +# ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes +# ISO-8859-3 glibc yes +# ISO-8859-4 osf solaris freebsd yes +# ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes +# ISO-8859-6 glibc aix hpux solaris yes +# ISO-8859-7 glibc aix hpux irix osf solaris yes +# ISO-8859-8 glibc aix hpux osf solaris yes +# ISO-8859-9 glibc aix hpux irix osf solaris yes +# ISO-8859-13 glibc +# ISO-8859-15 glibc aix osf solaris freebsd +# KOI8-R glibc solaris freebsd yes +# KOI8-U glibc freebsd yes +# CP437 dos +# CP775 dos +# CP850 aix osf dos +# CP852 dos +# CP855 dos +# CP856 aix +# CP857 dos +# CP861 dos +# CP862 dos +# CP864 dos +# CP865 dos +# CP866 freebsd dos +# CP869 dos +# CP874 win32 dos +# CP922 aix +# CP932 aix win32 dos +# CP943 aix +# CP949 osf win32 dos +# CP950 win32 dos +# CP1046 aix +# CP1124 aix +# CP1129 aix +# CP1250 win32 +# CP1251 glibc win32 +# CP1252 aix win32 +# CP1253 win32 +# CP1254 win32 +# CP1255 win32 +# CP1256 win32 +# CP1257 win32 +# GB2312 glibc aix hpux irix solaris freebsd yes +# EUC-JP glibc aix hpux irix osf solaris freebsd yes +# EUC-KR glibc aix hpux irix osf solaris freebsd yes +# EUC-TW glibc aix hpux irix osf solaris +# BIG5 glibc aix hpux osf solaris freebsd yes +# BIG5-HKSCS glibc +# GBK aix osf win32 dos +# GB18030 glibc +# SHIFT_JIS hpux osf solaris freebsd yes +# JOHAB glibc win32 +# TIS-620 glibc aix hpux osf solaris +# VISCII glibc yes +# HP-ROMAN8 hpux +# HP-ARABIC8 hpux +# HP-GREEK8 hpux +# HP-HEBREW8 hpux +# HP-TURKISH8 hpux +# HP-KANA8 hpux +# DEC-KANJI osf +# DEC-HANYU osf +# UTF-8 glibc aix hpux osf solaris yes +# +# Note: Names which are not marked as being a MIME name should not be used in +# Internet protocols for information interchange (mail, news, etc.). +# +# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications +# must understand both names and treat them as equivalent. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + +host="$1" +os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` +echo "# This file contains a table of character encoding aliases," +echo "# suitable for operating system '${os}'." +echo "# It was automatically generated from config.charset." +# List of references, updated during installation: +echo "# Packages using this file: " +case "$os" in + linux* | *-gnu*) + # With glibc-2.1 or newer, we don't need any canonicalization, + # because glibc has iconv and both glibc and libiconv support all + # GNU canonical names directly. Therefore, the Makefile does not + # need to install the alias file at all. + # The following applies only to glibc-2.0.x and older libcs. + echo "ISO_646.IRV:1983 ASCII" + ;; + aix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "IBM-850 CP850" + echo "IBM-856 CP856" + echo "IBM-921 ISO-8859-13" + echo "IBM-922 CP922" + echo "IBM-932 CP932" + echo "IBM-943 CP943" + echo "IBM-1046 CP1046" + echo "IBM-1124 CP1124" + echo "IBM-1129 CP1129" + echo "IBM-1252 CP1252" + echo "IBM-eucCN GB2312" + echo "IBM-eucJP EUC-JP" + echo "IBM-eucKR EUC-KR" + echo "IBM-eucTW EUC-TW" + echo "big5 BIG5" + echo "GBK GBK" + echo "TIS-620 TIS-620" + echo "UTF-8 UTF-8" + ;; + hpux*) + echo "iso88591 ISO-8859-1" + echo "iso88592 ISO-8859-2" + echo "iso88595 ISO-8859-5" + echo "iso88596 ISO-8859-6" + echo "iso88597 ISO-8859-7" + echo "iso88598 ISO-8859-8" + echo "iso88599 ISO-8859-9" + echo "iso885915 ISO-8859-15" + echo "roman8 HP-ROMAN8" + echo "arabic8 HP-ARABIC8" + echo "greek8 HP-GREEK8" + echo "hebrew8 HP-HEBREW8" + echo "turkish8 HP-TURKISH8" + echo "kana8 HP-KANA8" + echo "tis620 TIS-620" + echo "big5 BIG5" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "hp15CN GB2312" + #echo "ccdc ?" # what is this? + echo "SJIS SHIFT_JIS" + echo "utf8 UTF-8" + ;; + irix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + ;; + osf*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "cp850 CP850" + echo "big5 BIG5" + echo "dechanyu DEC-HANYU" + echo "dechanzi GB2312" + echo "deckanji DEC-KANJI" + echo "deckorean EUC-KR" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "GBK GBK" + echo "KSC5601 CP949" + echo "sdeckanji EUC-JP" + echo "SJIS SHIFT_JIS" + echo "TACTIS TIS-620" + echo "UTF-8 UTF-8" + ;; + solaris*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "koi8-r KOI8-R" + echo "BIG5 BIG5" + echo "gb2312 GB2312" + echo "cns11643 EUC-TW" + echo "5601 EUC-KR" + echo "eucJP EUC-JP" + echo "PCK SHIFT_JIS" + echo "TIS620.2533 TIS-620" + #echo "sun_eu_greek ?" # what is this? + echo "UTF-8 UTF-8" + ;; + freebsd* | os2*) + # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just + # reuse FreeBSD's locale data for OS/2. + echo "C ASCII" + echo "US-ASCII ASCII" + for l in la_LN lt_LN; do + echo "$l.ASCII ASCII" + done + for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ + lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do + echo "$l.ISO_8859-1 ISO-8859-1" + echo "$l.DIS_8859-15 ISO-8859-15" + done + for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do + echo "$l.ISO_8859-2 ISO-8859-2" + done + for l in la_LN lt_LT; do + echo "$l.ISO_8859-4 ISO-8859-4" + done + for l in ru_RU ru_SU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.ISO_8859-5 ISO-8859-5" + echo "$l.CP866 CP866" + done + echo "uk_UA.KOI8-U KOI8-U" + echo "zh_TW.BIG5 BIG5" + echo "zh_TW.Big5 BIG5" + echo "zh_CN.EUC GB2312" + echo "ja_JP.EUC EUC-JP" + echo "ja_JP.SJIS SHIFT_JIS" + echo "ja_JP.Shift_JIS SHIFT_JIS" + echo "ko_KR.EUC EUC-KR" + ;; + beos*) + # BeOS has a single locale, and it has UTF-8 encoding. + echo "* UTF-8" + ;; + msdosdjgpp*) + # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "#" + echo "# The encodings given here may not all be correct." + echo "# If you find that the encoding given for your language and" + echo "# country is not the one your DOS machine actually uses, just" + echo "# correct it in this file, and send a mail to" + echo "# Juan Manuel Guerrero " + echo "# and Bruno Haible ." + echo "#" + echo "C ASCII" + # ISO-8859-1 languages + echo "ca CP850" + echo "ca_ES CP850" + echo "da CP865" # not CP850 ?? + echo "da_DK CP865" # not CP850 ?? + echo "de CP850" + echo "de_AT CP850" + echo "de_CH CP850" + echo "de_DE CP850" + echo "en CP850" + echo "en_AU CP850" # not CP437 ?? + echo "en_CA CP850" + echo "en_GB CP850" + echo "en_NZ CP437" + echo "en_US CP437" + echo "en_ZA CP850" # not CP437 ?? + echo "es CP850" + echo "es_AR CP850" + echo "es_BO CP850" + echo "es_CL CP850" + echo "es_CO CP850" + echo "es_CR CP850" + echo "es_CU CP850" + echo "es_DO CP850" + echo "es_EC CP850" + echo "es_ES CP850" + echo "es_GT CP850" + echo "es_HN CP850" + echo "es_MX CP850" + echo "es_NI CP850" + echo "es_PA CP850" + echo "es_PY CP850" + echo "es_PE CP850" + echo "es_SV CP850" + echo "es_UY CP850" + echo "es_VE CP850" + echo "et CP850" + echo "et_EE CP850" + echo "eu CP850" + echo "eu_ES CP850" + echo "fi CP850" + echo "fi_FI CP850" + echo "fr CP850" + echo "fr_BE CP850" + echo "fr_CA CP850" + echo "fr_CH CP850" + echo "fr_FR CP850" + echo "ga CP850" + echo "ga_IE CP850" + echo "gd CP850" + echo "gd_GB CP850" + echo "gl CP850" + echo "gl_ES CP850" + echo "id CP850" # not CP437 ?? + echo "id_ID CP850" # not CP437 ?? + echo "is CP861" # not CP850 ?? + echo "is_IS CP861" # not CP850 ?? + echo "it CP850" + echo "it_CH CP850" + echo "it_IT CP850" + echo "lt CP775" + echo "lt_LT CP775" + echo "lv CP775" + echo "lv_LV CP775" + echo "nb CP865" # not CP850 ?? + echo "nb_NO CP865" # not CP850 ?? + echo "nl CP850" + echo "nl_BE CP850" + echo "nl_NL CP850" + echo "nn CP865" # not CP850 ?? + echo "nn_NO CP865" # not CP850 ?? + echo "no CP865" # not CP850 ?? + echo "no_NO CP865" # not CP850 ?? + echo "pt CP850" + echo "pt_BR CP850" + echo "pt_PT CP850" + echo "sv CP850" + echo "sv_SE CP850" + # ISO-8859-2 languages + echo "cs CP852" + echo "cs_CZ CP852" + echo "hr CP852" + echo "hr_HR CP852" + echo "hu CP852" + echo "hu_HU CP852" + echo "pl CP852" + echo "pl_PL CP852" + echo "ro CP852" + echo "ro_RO CP852" + echo "sk CP852" + echo "sk_SK CP852" + echo "sl CP852" + echo "sl_SI CP852" + echo "sq CP852" + echo "sq_AL CP852" + echo "sr CP852" # CP852 or CP866 or CP855 ?? + echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? + # ISO-8859-3 languages + echo "mt CP850" + echo "mt_MT CP850" + # ISO-8859-5 languages + echo "be CP866" + echo "be_BE CP866" + echo "bg CP866" # not CP855 ?? + echo "bg_BG CP866" # not CP855 ?? + echo "mk CP866" # not CP855 ?? + echo "mk_MK CP866" # not CP855 ?? + echo "ru KOI8-R" # not CP866 ?? + echo "ru_RU KOI8-R" # not CP866 ?? + # ISO-8859-6 languages + echo "ar CP864" + echo "ar_AE CP864" + echo "ar_DZ CP864" + echo "ar_EG CP864" + echo "ar_IQ CP864" + echo "ar_IR CP864" + echo "ar_JO CP864" + echo "ar_KW CP864" + echo "ar_MA CP864" + echo "ar_OM CP864" + echo "ar_QA CP864" + echo "ar_SA CP864" + echo "ar_SY CP864" + # ISO-8859-7 languages + echo "el CP869" + echo "el_GR CP869" + # ISO-8859-8 languages + echo "he CP862" + echo "he_IL CP862" + # ISO-8859-9 languages + echo "tr CP857" + echo "tr_TR CP857" + # Japanese + echo "ja CP932" + echo "ja_JP CP932" + # Chinese + echo "zh_CN GBK" + echo "zh_TW CP950" # not CP938 ?? + # Korean + echo "kr CP949" # not CP934 ?? + echo "kr_KR CP949" # not CP934 ?? + # Thai + echo "th CP874" + echo "th_TH CP874" + # Other + echo "eo CP850" + echo "eo_EO CP850" + ;; +esac diff --git a/src/apps/bin/grep-2.5/intl/dcgettext.c b/src/apps/bin/grep-2.5/intl/dcgettext.c new file mode 100644 index 0000000000..b7c96523dd --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/dcgettext.c @@ -0,0 +1,58 @@ +/* Implementation of the dcgettext(3) function. + Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DCGETTEXT __dcgettext +# define DCIGETTEXT __dcigettext +#else +# define DCGETTEXT dcgettext__ +# define DCIGETTEXT dcigettext__ +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +char * +DCGETTEXT (domainname, msgid, category) + const char *domainname; + const char *msgid; + int category; +{ + return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dcgettext, dcgettext); +#endif diff --git a/src/apps/bin/grep-2.5/intl/dcgettext.o b/src/apps/bin/grep-2.5/intl/dcgettext.o new file mode 100644 index 0000000000..350bca8048 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/dcgettext.o differ diff --git a/src/apps/bin/grep-2.5/intl/dcigettext.c b/src/apps/bin/grep-2.5/intl/dcigettext.c new file mode 100644 index 0000000000..2e724e19e7 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/dcigettext.c @@ -0,0 +1,1167 @@ +/* Implementation of the internal dcigettext function. + Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* Tell glibc's to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef __GNUC__ +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +#endif + +#include +#ifndef errno +extern int errno; +#endif +#ifndef __set_errno +# define __set_errno(val) errno = (val) +#endif + +#include +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include + +#if defined HAVE_SYS_PARAM_H || defined _LIBC +# include +#endif + +#include "gettextP.h" +#include "plural-exp.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "hash-string.h" + +/* Thread safetyness. */ +#ifdef _LIBC +# include +#else +/* Provide dummy implementation if this is outside glibc. */ +# define __libc_lock_define_initialized(CLASS, NAME) +# define __libc_lock_lock(NAME) +# define __libc_lock_unlock(NAME) +# define __libc_rwlock_define_initialized(CLASS, NAME) +# define __libc_rwlock_rdlock(NAME) +# define __libc_rwlock_unlock(NAME) +#endif + +/* Alignment of types. */ +#if defined __GNUC__ && __GNUC__ >= 2 +# define alignof(TYPE) __alignof__ (TYPE) +#else +# define alignof(TYPE) \ + ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) +#endif + +/* The internal variables in the standalone libintl.a must have different + names than the internal variables in GNU libc, otherwise programs + using libintl.a cannot be linked statically. */ +#if !defined _LIBC +# define _nl_default_default_domain _nl_default_default_domain__ +# define _nl_current_default_domain _nl_current_default_domain__ +# define _nl_default_dirname _nl_default_dirname__ +# define _nl_domain_bindings _nl_domain_bindings__ +#endif + +/* Some compilers, like SunOS4 cc, don't have offsetof in . */ +#ifndef offsetof +# define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) +#endif + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define getcwd __getcwd +# ifndef stpcpy +# define stpcpy __stpcpy +# endif +# define tfind __tfind +#else +# if !defined HAVE_GETCWD +char *getwd (); +# define getcwd(buf, max) getwd (buf) +# else +char *getcwd (); +# endif +# ifndef HAVE_STPCPY +static char *stpcpy PARAMS ((char *dest, const char *src)); +# endif +# ifndef HAVE_MEMPCPY +static void *mempcpy PARAMS ((void *dest, const void *src, size_t n)); +# endif +#endif + +/* Amount to increase buffer size by in each try. */ +#define PATH_INCR 32 + +/* The following is from pathmax.h. */ +/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define + PATH_MAX but might cause redefinition warnings when sys/param.h is + later included (as on MORE/BSD 4.3). */ +#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) +# include +#endif + +#ifndef _POSIX_PATH_MAX +# define _POSIX_PATH_MAX 255 +#endif + +#if !defined PATH_MAX && defined _PC_PATH_MAX +# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) +#endif + +/* Don't include sys/param.h if it already has been. */ +#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include +#endif + +#if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +#endif + +#ifndef PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +#endif + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, + it may be concatenated to a directory pathname. + IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) +# define IS_PATH_WITH_DIR(P) \ + (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) +# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +#endif + +/* This is the type used for the search tree where known translations + are stored. */ +struct known_translation_t +{ + /* Domain in which to search. */ + char *domainname; + + /* The category. */ + int category; + + /* State of the catalog counter at the point the string was found. */ + int counter; + + /* Catalog where the string was found. */ + struct loaded_l10nfile *domain; + + /* And finally the translation. */ + const char *translation; + size_t translation_length; + + /* Pointer to the string in question. */ + char msgid[ZERO]; +}; + +/* Root of the search tree with known translations. We can use this + only if the system provides the `tsearch' function family. */ +#if defined HAVE_TSEARCH || defined _LIBC +# include + +static void *root; + +# ifdef _LIBC +# define tsearch __tsearch +# endif + +/* Function to compare two entries in the table of known translations. */ +static int transcmp PARAMS ((const void *p1, const void *p2)); +static int +transcmp (p1, p2) + const void *p1; + const void *p2; +{ + const struct known_translation_t *s1; + const struct known_translation_t *s2; + int result; + + s1 = (const struct known_translation_t *) p1; + s2 = (const struct known_translation_t *) p2; + + result = strcmp (s1->msgid, s2->msgid); + if (result == 0) + { + result = strcmp (s1->domainname, s2->domainname); + if (result == 0) + /* We compare the category last (though this is the cheapest + operation) since it is hopefully always the same (namely + LC_MESSAGES). */ + result = s1->category - s2->category; + } + + return result; +} +#endif + +/* Name of the default domain used for gettext(3) prior any call to + textdomain(3). The default value for this is "messages". */ +const char _nl_default_default_domain[] = "messages"; + +/* Value used as the default domain for gettext(3). */ +const char *_nl_current_default_domain = _nl_default_default_domain; + +/* Contains the default location of the message catalogs. */ +#if defined __EMX__ +extern const char _nl_default_dirname[]; +#else +const char _nl_default_dirname[] = LOCALEDIR; +#endif + +/* List with bindings of specific domains created by bindtextdomain() + calls. */ +struct binding *_nl_domain_bindings; + +/* Prototypes for local functions. */ +static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain, + unsigned long int n, + const char *translation, + size_t translation_len)) + internal_function; +static const char *category_to_name PARAMS ((int category)) internal_function; +static const char *guess_category_value PARAMS ((int category, + const char *categoryname)) + internal_function; + + +/* For those loosing systems which don't have `alloca' we have to add + some additional code emulating it. */ +#ifdef HAVE_ALLOCA +/* Nothing has to be done. */ +# define ADD_BLOCK(list, address) /* nothing */ +# define FREE_BLOCKS(list) /* nothing */ +#else +struct block_list +{ + void *address; + struct block_list *next; +}; +# define ADD_BLOCK(list, addr) \ + do { \ + struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ + /* If we cannot get a free block we cannot add the new element to \ + the list. */ \ + if (newp != NULL) { \ + newp->address = (addr); \ + newp->next = (list); \ + (list) = newp; \ + } \ + } while (0) +# define FREE_BLOCKS(list) \ + do { \ + while (list != NULL) { \ + struct block_list *old = list; \ + list = list->next; \ + free (old); \ + } \ + } while (0) +# undef alloca +# define alloca(size) (malloc (size)) +#endif /* have alloca */ + + +#ifdef _LIBC +/* List of blocks allocated for translations. */ +typedef struct transmem_list +{ + struct transmem_list *next; + char data[ZERO]; +} transmem_block_t; +static struct transmem_list *transmem_list; +#else +typedef unsigned char transmem_block_t; +#endif + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DCIGETTEXT __dcigettext +#else +# define DCIGETTEXT dcigettext__ +#endif + +/* Lock variable to protect the global data in the gettext implementation. */ +#ifdef _LIBC +__libc_rwlock_define_initialized (, _nl_state_lock) +#endif + +/* Checking whether the binaries runs SUID must be done and glibc provides + easier methods therefore we make a difference here. */ +#ifdef _LIBC +# define ENABLE_SECURE __libc_enable_secure +# define DETERMINE_SECURE +#else +# ifndef HAVE_GETUID +# define getuid() 0 +# endif +# ifndef HAVE_GETGID +# define getgid() 0 +# endif +# ifndef HAVE_GETEUID +# define geteuid() getuid() +# endif +# ifndef HAVE_GETEGID +# define getegid() getgid() +# endif +static int enable_secure; +# define ENABLE_SECURE (enable_secure == 1) +# define DETERMINE_SECURE \ + if (enable_secure == 0) \ + { \ + if (getuid () != geteuid () || getgid () != getegid ()) \ + enable_secure = 1; \ + else \ + enable_secure = -1; \ + } +#endif + +/* Get the function to evaluate the plural expression. */ +#include "eval-plural.h" + +/* Look up MSGID in the DOMAINNAME message catalog for the current + CATEGORY locale and, if PLURAL is nonzero, search over string + depending on the plural form determined by N. */ +char * +DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) + const char *domainname; + const char *msgid1; + const char *msgid2; + int plural; + unsigned long int n; + int category; +{ +#ifndef HAVE_ALLOCA + struct block_list *block_list = NULL; +#endif + struct loaded_l10nfile *domain; + struct binding *binding; + const char *categoryname; + const char *categoryvalue; + char *dirname, *xdomainname; + char *single_locale; + char *retval; + size_t retlen; + int saved_errno; +#if defined HAVE_TSEARCH || defined _LIBC + struct known_translation_t *search; + struct known_translation_t **foundp = NULL; + size_t msgid_len; +#endif + size_t domainname_len; + + /* If no real MSGID is given return NULL. */ + if (msgid1 == NULL) + return NULL; + + __libc_rwlock_rdlock (_nl_state_lock); + + /* If DOMAINNAME is NULL, we are interested in the default domain. If + CATEGORY is not LC_MESSAGES this might not make much sense but the + definition left this undefined. */ + if (domainname == NULL) + domainname = _nl_current_default_domain; + + /* OS/2 specific: backward compatibility with older libintl versions */ +#ifdef LC_MESSAGES_COMPAT + if (category == LC_MESSAGES_COMPAT) + category = LC_MESSAGES; +#endif + +#if defined HAVE_TSEARCH || defined _LIBC + msgid_len = strlen (msgid1) + 1; + + /* Try to find the translation among those which we found at + some time. */ + search = (struct known_translation_t *) + alloca (offsetof (struct known_translation_t, msgid) + msgid_len); + memcpy (search->msgid, msgid1, msgid_len); + search->domainname = (char *) domainname; + search->category = category; + + foundp = (struct known_translation_t **) tfind (search, &root, transcmp); + if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) + { + /* Now deal with plural. */ + if (plural) + retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, + (*foundp)->translation_length); + else + retval = (char *) (*foundp)->translation; + + __libc_rwlock_unlock (_nl_state_lock); + return retval; + } +#endif + + /* Preserve the `errno' value. */ + saved_errno = errno; + + /* See whether this is a SUID binary or not. */ + DETERMINE_SECURE; + + /* First find matching binding. */ + for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) + { + int compare = strcmp (domainname, binding->domainname); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It is not in the list. */ + binding = NULL; + break; + } + } + + if (binding == NULL) + dirname = (char *) _nl_default_dirname; + else if (IS_ABSOLUTE_PATH (binding->dirname)) + dirname = binding->dirname; + else + { + /* We have a relative path. Make it absolute now. */ + size_t dirname_len = strlen (binding->dirname) + 1; + size_t path_max; + char *ret; + + path_max = (unsigned int) PATH_MAX; + path_max += 2; /* The getcwd docs say to do this. */ + + for (;;) + { + dirname = (char *) alloca (path_max + dirname_len); + ADD_BLOCK (block_list, dirname); + + __set_errno (0); + ret = getcwd (dirname, path_max); + if (ret != NULL || errno != ERANGE) + break; + + path_max += path_max / 2; + path_max += PATH_INCR; + } + + if (ret == NULL) + { + /* We cannot get the current working directory. Don't signal an + error but simply return the default string. */ + FREE_BLOCKS (block_list); + __libc_rwlock_unlock (_nl_state_lock); + __set_errno (saved_errno); + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); + } + + stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); + } + + /* Now determine the symbolic name of CATEGORY and its value. */ + categoryname = category_to_name (category); + categoryvalue = guess_category_value (category, categoryname); + + domainname_len = strlen (domainname); + xdomainname = (char *) alloca (strlen (categoryname) + + domainname_len + 5); + ADD_BLOCK (block_list, xdomainname); + + stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), + domainname, domainname_len), + ".mo"); + + /* Creating working area. */ + single_locale = (char *) alloca (strlen (categoryvalue) + 1); + ADD_BLOCK (block_list, single_locale); + + + /* Search for the given string. This is a loop because we perhaps + got an ordered list of languages to consider for the translation. */ + while (1) + { + /* Make CATEGORYVALUE point to the next element of the list. */ + while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') + ++categoryvalue; + if (categoryvalue[0] == '\0') + { + /* The whole contents of CATEGORYVALUE has been searched but + no valid entry has been found. We solve this situation + by implicitly appending a "C" entry, i.e. no translation + will take place. */ + single_locale[0] = 'C'; + single_locale[1] = '\0'; + } + else + { + char *cp = single_locale; + while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') + *cp++ = *categoryvalue++; + *cp = '\0'; + + /* When this is a SUID binary we must not allow accessing files + outside the dedicated directories. */ + if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) + /* Ingore this entry. */ + continue; + } + + /* If the current locale value is C (or POSIX) we don't load a + domain. Return the MSGID. */ + if (strcmp (single_locale, "C") == 0 + || strcmp (single_locale, "POSIX") == 0) + { + FREE_BLOCKS (block_list); + __libc_rwlock_unlock (_nl_state_lock); + __set_errno (saved_errno); + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); + } + + + /* Find structure describing the message catalog matching the + DOMAINNAME and CATEGORY. */ + domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); + + if (domain != NULL) + { + retval = _nl_find_msg (domain, binding, msgid1, &retlen); + + if (retval == NULL) + { + int cnt; + + for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) + { + retval = _nl_find_msg (domain->successor[cnt], binding, + msgid1, &retlen); + + if (retval != NULL) + { + domain = domain->successor[cnt]; + break; + } + } + } + + if (retval != NULL) + { + /* Found the translation of MSGID1 in domain DOMAIN: + starting at RETVAL, RETLEN bytes. */ + FREE_BLOCKS (block_list); + __set_errno (saved_errno); +#if defined HAVE_TSEARCH || defined _LIBC + if (foundp == NULL) + { + /* Create a new entry and add it to the search tree. */ + struct known_translation_t *newp; + + newp = (struct known_translation_t *) + malloc (offsetof (struct known_translation_t, msgid) + + msgid_len + domainname_len + 1); + if (newp != NULL) + { + newp->domainname = + mempcpy (newp->msgid, msgid1, msgid_len); + memcpy (newp->domainname, domainname, domainname_len + 1); + newp->category = category; + newp->counter = _nl_msg_cat_cntr; + newp->domain = domain; + newp->translation = retval; + newp->translation_length = retlen; + + /* Insert the entry in the search tree. */ + foundp = (struct known_translation_t **) + tsearch (newp, &root, transcmp); + if (foundp == NULL + || __builtin_expect (*foundp != newp, 0)) + /* The insert failed. */ + free (newp); + } + } + else + { + /* We can update the existing entry. */ + (*foundp)->counter = _nl_msg_cat_cntr; + (*foundp)->domain = domain; + (*foundp)->translation = retval; + (*foundp)->translation_length = retlen; + } +#endif + /* Now deal with plural. */ + if (plural) + retval = plural_lookup (domain, n, retval, retlen); + + __libc_rwlock_unlock (_nl_state_lock); + return retval; + } + } + } + /* NOTREACHED */ +} + + +char * +internal_function +_nl_find_msg (domain_file, domainbinding, msgid, lengthp) + struct loaded_l10nfile *domain_file; + struct binding *domainbinding; + const char *msgid; + size_t *lengthp; +{ + struct loaded_domain *domain; + size_t act; + char *result; + size_t resultlen; + + if (domain_file->decided == 0) + _nl_load_domain (domain_file, domainbinding); + + if (domain_file->data == NULL) + return NULL; + + domain = (struct loaded_domain *) domain_file->data; + + /* Locate the MSGID and its translation. */ + if (domain->hash_size > 2 && domain->hash_tab != NULL) + { + /* Use the hashing table. */ + nls_uint32 len = strlen (msgid); + nls_uint32 hash_val = hash_string (msgid); + nls_uint32 idx = hash_val % domain->hash_size; + nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); + + while (1) + { + nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]); + + if (nstr == 0) + /* Hash table entry is empty. */ + return NULL; + + /* Compare msgid with the original string at index nstr-1. + We compare the lengths with >=, not ==, because plural entries + are represented by strings with an embedded NUL. */ + if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) >= len + && (strcmp (msgid, + domain->data + W (domain->must_swap, + domain->orig_tab[nstr - 1].offset)) + == 0)) + { + act = nstr - 1; + goto found; + } + + if (idx >= domain->hash_size - incr) + idx -= domain->hash_size - incr; + else + idx += incr; + } + /* NOTREACHED */ + } + else + { + /* Try the default method: binary search in the sorted array of + messages. */ + size_t top, bottom; + + bottom = 0; + top = domain->nstrings; + while (bottom < top) + { + int cmp_val; + + act = (bottom + top) / 2; + cmp_val = strcmp (msgid, (domain->data + + W (domain->must_swap, + domain->orig_tab[act].offset))); + if (cmp_val < 0) + top = act; + else if (cmp_val > 0) + bottom = act + 1; + else + goto found; + } + /* No translation was found. */ + return NULL; + } + + found: + /* The translation was found at index ACT. If we have to convert the + string to use a different character set, this is the time. */ + result = ((char *) domain->data + + W (domain->must_swap, domain->trans_tab[act].offset)); + resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; + +#if defined _LIBC || HAVE_ICONV + if (domain->codeset_cntr + != (domainbinding != NULL ? domainbinding->codeset_cntr : 0)) + { + /* The domain's codeset has changed through bind_textdomain_codeset() + since the message catalog was initialized or last accessed. We + have to reinitialize the converter. */ + _nl_free_domain_conv (domain); + _nl_init_domain_conv (domain_file, domain, domainbinding); + } + + if ( +# ifdef _LIBC + domain->conv != (__gconv_t) -1 +# else +# if HAVE_ICONV + domain->conv != (iconv_t) -1 +# endif +# endif + ) + { + /* We are supposed to do a conversion. First allocate an + appropriate table with the same structure as the table + of translations in the file, where we can put the pointers + to the converted strings in. + There is a slight complication with plural entries. They + are represented by consecutive NUL terminated strings. We + handle this case by converting RESULTLEN bytes, including + NULs. */ + + if (domain->conv_tab == NULL + && ((domain->conv_tab = (char **) calloc (domain->nstrings, + sizeof (char *))) + == NULL)) + /* Mark that we didn't succeed allocating a table. */ + domain->conv_tab = (char **) -1; + + if (__builtin_expect (domain->conv_tab == (char **) -1, 0)) + /* Nothing we can do, no more memory. */ + goto converted; + + if (domain->conv_tab[act] == NULL) + { + /* We haven't used this string so far, so it is not + translated yet. Do this now. */ + /* We use a bit more efficient memory handling. + We allocate always larger blocks which get used over + time. This is faster than many small allocations. */ + __libc_lock_define_initialized (static, lock) +# define INITIAL_BLOCK_SIZE 4080 + static unsigned char *freemem; + static size_t freemem_size; + + const unsigned char *inbuf; + unsigned char *outbuf; + int malloc_count; +# ifndef _LIBC + transmem_block_t *transmem_list = NULL; +# endif + + __libc_lock_lock (lock); + + inbuf = (const unsigned char *) result; + outbuf = freemem + sizeof (size_t); + + malloc_count = 0; + while (1) + { + transmem_block_t *newmem; +# ifdef _LIBC + size_t non_reversible; + int res; + + if (freemem_size < sizeof (size_t)) + goto resize_freemem; + + res = __gconv (domain->conv, + &inbuf, inbuf + resultlen, + &outbuf, + outbuf + freemem_size - sizeof (size_t), + &non_reversible); + + if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) + break; + + if (res != __GCONV_FULL_OUTPUT) + { + __libc_lock_unlock (lock); + goto converted; + } + + inbuf = result; +# else +# if HAVE_ICONV + const char *inptr = (const char *) inbuf; + size_t inleft = resultlen; + char *outptr = (char *) outbuf; + size_t outleft; + + if (freemem_size < sizeof (size_t)) + goto resize_freemem; + + outleft = freemem_size - sizeof (size_t); + if (iconv (domain->conv, + (ICONV_CONST char **) &inptr, &inleft, + &outptr, &outleft) + != (size_t) (-1)) + { + outbuf = (unsigned char *) outptr; + break; + } + if (errno != E2BIG) + { + __libc_lock_unlock (lock); + goto converted; + } +# endif +# endif + + resize_freemem: + /* We must allocate a new buffer or resize the old one. */ + if (malloc_count > 0) + { + ++malloc_count; + freemem_size = malloc_count * INITIAL_BLOCK_SIZE; + newmem = (transmem_block_t *) realloc (transmem_list, + freemem_size); +# ifdef _LIBC + if (newmem != NULL) + transmem_list = transmem_list->next; + else + { + struct transmem_list *old = transmem_list; + + transmem_list = transmem_list->next; + free (old); + } +# endif + } + else + { + malloc_count = 1; + freemem_size = INITIAL_BLOCK_SIZE; + newmem = (transmem_block_t *) malloc (freemem_size); + } + if (__builtin_expect (newmem == NULL, 0)) + { + freemem = NULL; + freemem_size = 0; + __libc_lock_unlock (lock); + goto converted; + } + +# ifdef _LIBC + /* Add the block to the list of blocks we have to free + at some point. */ + newmem->next = transmem_list; + transmem_list = newmem; + + freemem = newmem->data; + freemem_size -= offsetof (struct transmem_list, data); +# else + transmem_list = newmem; + freemem = newmem; +# endif + + outbuf = freemem + sizeof (size_t); + } + + /* We have now in our buffer a converted string. Put this + into the table of conversions. */ + *(size_t *) freemem = outbuf - freemem - sizeof (size_t); + domain->conv_tab[act] = (char *) freemem; + /* Shrink freemem, but keep it aligned. */ + freemem_size -= outbuf - freemem; + freemem = outbuf; + freemem += freemem_size & (alignof (size_t) - 1); + freemem_size = freemem_size & ~ (alignof (size_t) - 1); + + __libc_lock_unlock (lock); + } + + /* Now domain->conv_tab[act] contains the translation of all + the plural variants. */ + result = domain->conv_tab[act] + sizeof (size_t); + resultlen = *(size_t *) domain->conv_tab[act]; + } + + converted: + /* The result string is converted. */ + +#endif /* _LIBC || HAVE_ICONV */ + + *lengthp = resultlen; + return result; +} + + +/* Look up a plural variant. */ +static char * +internal_function +plural_lookup (domain, n, translation, translation_len) + struct loaded_l10nfile *domain; + unsigned long int n; + const char *translation; + size_t translation_len; +{ + struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; + unsigned long int index; + const char *p; + + index = plural_eval (domaindata->plural, n); + if (index >= domaindata->nplurals) + /* This should never happen. It means the plural expression and the + given maximum value do not match. */ + index = 0; + + /* Skip INDEX strings at TRANSLATION. */ + p = translation; + while (index-- > 0) + { +#ifdef _LIBC + p = __rawmemchr (p, '\0'); +#else + p = strchr (p, '\0'); +#endif + /* And skip over the NUL byte. */ + p++; + + if (p >= translation + translation_len) + /* This should never happen. It means the plural expression + evaluated to a value larger than the number of variants + available for MSGID1. */ + return (char *) translation; + } + return (char *) p; +} + + +/* Return string representation of locale CATEGORY. */ +static const char * +internal_function +category_to_name (category) + int category; +{ + const char *retval; + + switch (category) + { +#ifdef LC_COLLATE + case LC_COLLATE: + retval = "LC_COLLATE"; + break; +#endif +#ifdef LC_CTYPE + case LC_CTYPE: + retval = "LC_CTYPE"; + break; +#endif +#ifdef LC_MONETARY + case LC_MONETARY: + retval = "LC_MONETARY"; + break; +#endif +#ifdef LC_NUMERIC + case LC_NUMERIC: + retval = "LC_NUMERIC"; + break; +#endif +#ifdef LC_TIME + case LC_TIME: + retval = "LC_TIME"; + break; +#endif +#ifdef LC_MESSAGES + case LC_MESSAGES: + retval = "LC_MESSAGES"; + break; +#endif +#ifdef LC_RESPONSE + case LC_RESPONSE: + retval = "LC_RESPONSE"; + break; +#endif +#ifdef LC_ALL + case LC_ALL: + /* This might not make sense but is perhaps better than any other + value. */ + retval = "LC_ALL"; + break; +#endif + default: + /* If you have a better idea for a default value let me know. */ + retval = "LC_XXX"; + } + + return retval; +} + +/* Guess value of current locale from value of the environment variables. */ +static const char * +internal_function +guess_category_value (category, categoryname) + int category; + const char *categoryname; +{ + const char *language; + const char *retval; + + /* The highest priority value is the `LANGUAGE' environment + variable. But we don't use the value if the currently selected + locale is the C locale. This is a GNU extension. */ + language = getenv ("LANGUAGE"); + if (language != NULL && language[0] == '\0') + language = NULL; + + /* We have to proceed with the POSIX methods of looking to `LC_ALL', + `LC_xxx', and `LANG'. On some systems this can be done by the + `setlocale' function itself. */ +#ifdef _LIBC + retval = setlocale (category, NULL); +#else + retval = _nl_locale_name (category, categoryname); +#endif + + /* Ignore LANGUAGE if the locale is set to "C" because + 1. "C" locale usually uses the ASCII encoding, and most international + messages use non-ASCII characters. These characters get displayed + as question marks (if using glibc's iconv()) or as invalid 8-bit + characters (because other iconv()s refuse to convert most non-ASCII + characters to ASCII). In any case, the output is ugly. + 2. The precise output of some programs in the "C" locale is specified + by POSIX and should not depend on environment variables like + "LANGUAGE". We allow such programs to use gettext(). */ + return language != NULL && strcmp (retval, "C") != 0 ? language : retval; +} + +/* @@ begin of epilog @@ */ + +/* We don't want libintl.a to depend on any other library. So we + avoid the non-standard function stpcpy. In GNU C Library this + function is available, though. Also allow the symbol HAVE_STPCPY + to be defined. */ +#if !_LIBC && !HAVE_STPCPY +static char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif + +#if !_LIBC && !HAVE_MEMPCPY +static void * +mempcpy (dest, src, n) + void *dest; + const void *src; + size_t n; +{ + return (void *) ((char *) memcpy (dest, src, n) + n); +} +#endif + + +#ifdef _LIBC +/* If we want to free all resources we have to do some work at + program's end. */ +static void __attribute__ ((unused)) +free_mem (void) +{ + void *old; + + while (_nl_domain_bindings != NULL) + { + struct binding *oldp = _nl_domain_bindings; + _nl_domain_bindings = _nl_domain_bindings->next; + if (oldp->dirname != _nl_default_dirname) + /* Yes, this is a pointer comparison. */ + free (oldp->dirname); + free (oldp->codeset); + free (oldp); + } + + if (_nl_current_default_domain != _nl_default_default_domain) + /* Yes, again a pointer comparison. */ + free ((char *) _nl_current_default_domain); + + /* Remove the search tree with the known translations. */ + __tdestroy (root, free); + root = NULL; + + while (transmem_list != NULL) + { + old = transmem_list; + transmem_list = transmem_list->next; + free (old); + } +} + +text_set_element (__libc_subfreeres, free_mem); +#endif diff --git a/src/apps/bin/grep-2.5/intl/dcigettext.o b/src/apps/bin/grep-2.5/intl/dcigettext.o new file mode 100644 index 0000000000..adc94f0ff9 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/dcigettext.o differ diff --git a/src/apps/bin/grep-2.5/intl/dcngettext.c b/src/apps/bin/grep-2.5/intl/dcngettext.c new file mode 100644 index 0000000000..c16af21269 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/dcngettext.c @@ -0,0 +1,60 @@ +/* Implementation of the dcngettext(3) function. + Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DCNGETTEXT __dcngettext +# define DCIGETTEXT __dcigettext +#else +# define DCNGETTEXT dcngettext__ +# define DCIGETTEXT dcigettext__ +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +char * +DCNGETTEXT (domainname, msgid1, msgid2, n, category) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; + int category; +{ + return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dcngettext, dcngettext); +#endif diff --git a/src/apps/bin/grep-2.5/intl/dcngettext.o b/src/apps/bin/grep-2.5/intl/dcngettext.o new file mode 100644 index 0000000000..11aae34890 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/dcngettext.o differ diff --git a/src/apps/bin/grep-2.5/intl/dgettext.c b/src/apps/bin/grep-2.5/intl/dgettext.c new file mode 100644 index 0000000000..3651207a0f --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/dgettext.c @@ -0,0 +1,59 @@ +/* Implementation of the dgettext(3) function. + Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DGETTEXT __dgettext +# define DCGETTEXT __dcgettext +#else +# define DGETTEXT dgettext__ +# define DCGETTEXT dcgettext__ +#endif + +/* Look up MSGID in the DOMAINNAME message catalog of the current + LC_MESSAGES locale. */ +char * +DGETTEXT (domainname, msgid) + const char *domainname; + const char *msgid; +{ + return DCGETTEXT (domainname, msgid, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dgettext, dgettext); +#endif diff --git a/src/apps/bin/grep-2.5/intl/dgettext.o b/src/apps/bin/grep-2.5/intl/dgettext.o new file mode 100644 index 0000000000..09840ab0d7 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/dgettext.o differ diff --git a/src/apps/bin/grep-2.5/intl/dngettext.c b/src/apps/bin/grep-2.5/intl/dngettext.c new file mode 100644 index 0000000000..f214e95b47 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/dngettext.c @@ -0,0 +1,61 @@ +/* Implementation of the dngettext(3) function. + Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DNGETTEXT __dngettext +# define DCNGETTEXT __dcngettext +#else +# define DNGETTEXT dngettext__ +# define DCNGETTEXT dcngettext__ +#endif + +/* Look up MSGID in the DOMAINNAME message catalog of the current + LC_MESSAGES locale and skip message according to the plural form. */ +char * +DNGETTEXT (domainname, msgid1, msgid2, n) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dngettext, dngettext); +#endif diff --git a/src/apps/bin/grep-2.5/intl/dngettext.o b/src/apps/bin/grep-2.5/intl/dngettext.o new file mode 100644 index 0000000000..07856a9bb6 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/dngettext.o differ diff --git a/src/apps/bin/grep-2.5/intl/eval-plural.h b/src/apps/bin/grep-2.5/intl/eval-plural.h new file mode 100644 index 0000000000..12d23264d3 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/eval-plural.h @@ -0,0 +1,105 @@ +/* Plural expression evaluation. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef STATIC +#define STATIC static +#endif + +/* Evaluate the plural expression and return an index value. */ +STATIC unsigned long int plural_eval PARAMS ((struct expression *pexp, + unsigned long int n)) + internal_function; + +STATIC +unsigned long int +internal_function +plural_eval (pexp, n) + struct expression *pexp; + unsigned long int n; +{ + switch (pexp->nargs) + { + case 0: + switch (pexp->operation) + { + case var: + return n; + case num: + return pexp->val.num; + default: + break; + } + /* NOTREACHED */ + break; + case 1: + { + /* pexp->operation must be lnot. */ + unsigned long int arg = plural_eval (pexp->val.args[0], n); + return ! arg; + } + case 2: + { + unsigned long int leftarg = plural_eval (pexp->val.args[0], n); + if (pexp->operation == lor) + return leftarg || plural_eval (pexp->val.args[1], n); + else if (pexp->operation == land) + return leftarg && plural_eval (pexp->val.args[1], n); + else + { + unsigned long int rightarg = plural_eval (pexp->val.args[1], n); + + switch (pexp->operation) + { + case mult: + return leftarg * rightarg; + case divide: + return leftarg / rightarg; + case module: + return leftarg % rightarg; + case plus: + return leftarg + rightarg; + case minus: + return leftarg - rightarg; + case less_than: + return leftarg < rightarg; + case greater_than: + return leftarg > rightarg; + case less_or_equal: + return leftarg <= rightarg; + case greater_or_equal: + return leftarg >= rightarg; + case equal: + return leftarg == rightarg; + case not_equal: + return leftarg != rightarg; + default: + break; + } + } + /* NOTREACHED */ + break; + } + case 3: + { + /* pexp->operation must be qmop. */ + unsigned long int boolarg = plural_eval (pexp->val.args[0], n); + return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); + } + } + /* NOTREACHED */ + return 0; +} diff --git a/src/apps/bin/grep-2.5/intl/explodename.c b/src/apps/bin/grep-2.5/intl/explodename.c new file mode 100644 index 0000000000..2985064c92 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/explodename.c @@ -0,0 +1,192 @@ +/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Contributed by Ulrich Drepper , 1995. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include "loadinfo.h" + +/* On some strange systems still no definition of NULL is found. Sigh! */ +#ifndef NULL +# if defined __STDC__ && __STDC__ +# define NULL ((void *) 0) +# else +# define NULL 0 +# endif +#endif + +/* @@ end of prolog @@ */ + +char * +_nl_find_language (name) + const char *name; +{ + while (name[0] != '\0' && name[0] != '_' && name[0] != '@' + && name[0] != '+' && name[0] != ',') + ++name; + + return (char *) name; +} + + +int +_nl_explode_name (name, language, modifier, territory, codeset, + normalized_codeset, special, sponsor, revision) + char *name; + const char **language; + const char **modifier; + const char **territory; + const char **codeset; + const char **normalized_codeset; + const char **special; + const char **sponsor; + const char **revision; +{ + enum { undecided, xpg, cen } syntax; + char *cp; + int mask; + + *modifier = NULL; + *territory = NULL; + *codeset = NULL; + *normalized_codeset = NULL; + *special = NULL; + *sponsor = NULL; + *revision = NULL; + + /* Now we determine the single parts of the locale name. First + look for the language. Termination symbols are `_' and `@' if + we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ + mask = 0; + syntax = undecided; + *language = cp = name; + cp = _nl_find_language (*language); + + if (*language == cp) + /* This does not make sense: language has to be specified. Use + this entry as it is without exploding. Perhaps it is an alias. */ + cp = strchr (*language, '\0'); + else if (cp[0] == '_') + { + /* Next is the territory. */ + cp[0] = '\0'; + *territory = ++cp; + + while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' + && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= TERRITORY; + + if (cp[0] == '.') + { + /* Next is the codeset. */ + syntax = xpg; + cp[0] = '\0'; + *codeset = ++cp; + + while (cp[0] != '\0' && cp[0] != '@') + ++cp; + + mask |= XPG_CODESET; + + if (*codeset != cp && (*codeset)[0] != '\0') + { + *normalized_codeset = _nl_normalize_codeset (*codeset, + cp - *codeset); + if (strcmp (*codeset, *normalized_codeset) == 0) + free ((char *) *normalized_codeset); + else + mask |= XPG_NORM_CODESET; + } + } + } + + if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) + { + /* Next is the modifier. */ + syntax = cp[0] == '@' ? xpg : cen; + cp[0] = '\0'; + *modifier = ++cp; + + while (syntax == cen && cp[0] != '\0' && cp[0] != '+' + && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= XPG_MODIFIER | CEN_AUDIENCE; + } + + if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) + { + syntax = cen; + + if (cp[0] == '+') + { + /* Next is special application (CEN syntax). */ + cp[0] = '\0'; + *special = ++cp; + + while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= CEN_SPECIAL; + } + + if (cp[0] == ',') + { + /* Next is sponsor (CEN syntax). */ + cp[0] = '\0'; + *sponsor = ++cp; + + while (cp[0] != '\0' && cp[0] != '_') + ++cp; + + mask |= CEN_SPONSOR; + } + + if (cp[0] == '_') + { + /* Next is revision (CEN syntax). */ + cp[0] = '\0'; + *revision = ++cp; + + mask |= CEN_REVISION; + } + } + + /* For CEN syntax values it might be important to have the + separator character in the file name, not for XPG syntax. */ + if (syntax == xpg) + { + if (*territory != NULL && (*territory)[0] == '\0') + mask &= ~TERRITORY; + + if (*codeset != NULL && (*codeset)[0] == '\0') + mask &= ~XPG_CODESET; + + if (*modifier != NULL && (*modifier)[0] == '\0') + mask &= ~XPG_MODIFIER; + } + + return mask; +} diff --git a/src/apps/bin/grep-2.5/intl/explodename.o b/src/apps/bin/grep-2.5/intl/explodename.o new file mode 100644 index 0000000000..baea63377f Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/explodename.o differ diff --git a/src/apps/bin/grep-2.5/intl/finddomain.c b/src/apps/bin/grep-2.5/intl/finddomain.c new file mode 100644 index 0000000000..2f103d5563 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/finddomain.c @@ -0,0 +1,198 @@ +/* Handle list of needed message catalogs + Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Written by Ulrich Drepper , 1995. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ +/* List of already loaded domains. */ +static struct loaded_l10nfile *_nl_loaded_domains; + + +/* Return a data structure describing the message catalog described by + the DOMAINNAME and CATEGORY parameters with respect to the currently + established bindings. */ +struct loaded_l10nfile * +internal_function +_nl_find_domain (dirname, locale, domainname, domainbinding) + const char *dirname; + char *locale; + const char *domainname; + struct binding *domainbinding; +{ + struct loaded_l10nfile *retval; + const char *language; + const char *modifier; + const char *territory; + const char *codeset; + const char *normalized_codeset; + const char *special; + const char *sponsor; + const char *revision; + const char *alias_value; + int mask; + + /* LOCALE can consist of up to four recognized parts for the XPG syntax: + + language[_territory[.codeset]][@modifier] + + and six parts for the CEN syntax: + + language[_territory][+audience][+special][,[sponsor][_revision]] + + Beside the first part all of them are allowed to be missing. If + the full specified locale is not found, the less specific one are + looked for. The various parts will be stripped off according to + the following order: + (1) revision + (2) sponsor + (3) special + (4) codeset + (5) normalized codeset + (6) territory + (7) audience/modifier + */ + + /* If we have already tested for this locale entry there has to + be one data set in the list of loaded domains. */ + retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, + strlen (dirname) + 1, 0, locale, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, domainname, 0); + if (retval != NULL) + { + /* We know something about this locale. */ + int cnt; + + if (retval->decided == 0) + _nl_load_domain (retval, domainbinding); + + if (retval->data != NULL) + return retval; + + for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) + { + if (retval->successor[cnt]->decided == 0) + _nl_load_domain (retval->successor[cnt], domainbinding); + + if (retval->successor[cnt]->data != NULL) + break; + } + return cnt >= 0 ? retval : NULL; + /* NOTREACHED */ + } + + /* See whether the locale value is an alias. If yes its value + *overwrites* the alias name. No test for the original value is + done. */ + alias_value = _nl_expand_alias (locale); + if (alias_value != NULL) + { +#if defined _LIBC || defined HAVE_STRDUP + locale = strdup (alias_value); + if (locale == NULL) + return NULL; +#else + size_t len = strlen (alias_value) + 1; + locale = (char *) malloc (len); + if (locale == NULL) + return NULL; + + memcpy (locale, alias_value, len); +#endif + } + + /* Now we determine the single parts of the locale name. First + look for the language. Termination symbols are `_' and `@' if + we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ + mask = _nl_explode_name (locale, &language, &modifier, &territory, + &codeset, &normalized_codeset, &special, + &sponsor, &revision); + + /* Create all possible locale entries which might be interested in + generalization. */ + retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, + strlen (dirname) + 1, mask, language, territory, + codeset, normalized_codeset, modifier, special, + sponsor, revision, domainname, 1); + if (retval == NULL) + /* This means we are out of core. */ + return NULL; + + if (retval->decided == 0) + _nl_load_domain (retval, domainbinding); + if (retval->data == NULL) + { + int cnt; + for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) + { + if (retval->successor[cnt]->decided == 0) + _nl_load_domain (retval->successor[cnt], domainbinding); + if (retval->successor[cnt]->data != NULL) + break; + } + } + + /* The room for an alias was dynamically allocated. Free it now. */ + if (alias_value != NULL) + free (locale); + + /* The space for normalized_codeset is dynamically allocated. Free it. */ + if (mask & XPG_NORM_CODESET) + free ((void *) normalized_codeset); + + return retval; +} + + +#ifdef _LIBC +static void __attribute__ ((unused)) +free_mem (void) +{ + struct loaded_l10nfile *runp = _nl_loaded_domains; + + while (runp != NULL) + { + struct loaded_l10nfile *here = runp; + if (runp->data != NULL) + _nl_unload_domain ((struct loaded_domain *) runp->data); + runp = runp->next; + free ((char *) here->filename); + free (here); + } +} + +text_set_element (__libc_subfreeres, free_mem); +#endif diff --git a/src/apps/bin/grep-2.5/intl/finddomain.o b/src/apps/bin/grep-2.5/intl/finddomain.o new file mode 100644 index 0000000000..688396b068 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/finddomain.o differ diff --git a/src/apps/bin/grep-2.5/intl/gettext.c b/src/apps/bin/grep-2.5/intl/gettext.c new file mode 100644 index 0000000000..22a6c24536 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/gettext.c @@ -0,0 +1,64 @@ +/* Implementation of gettext(3) function. + Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define __need_NULL +# include +#else +# include /* Just for NULL. */ +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define GETTEXT __gettext +# define DCGETTEXT __dcgettext +#else +# define GETTEXT gettext__ +# define DCGETTEXT dcgettext__ +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +char * +GETTEXT (msgid) + const char *msgid; +{ + return DCGETTEXT (NULL, msgid, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__gettext, gettext); +#endif diff --git a/src/apps/bin/grep-2.5/intl/gettext.o b/src/apps/bin/grep-2.5/intl/gettext.o new file mode 100644 index 0000000000..defa00eb8f Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/gettext.o differ diff --git a/src/apps/bin/grep-2.5/intl/gettextP.h b/src/apps/bin/grep-2.5/intl/gettextP.h new file mode 100644 index 0000000000..a642fdb6de --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/gettextP.h @@ -0,0 +1,201 @@ +/* Header describing internals of libintl library. + Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Written by Ulrich Drepper , 1995. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _GETTEXTP_H +#define _GETTEXTP_H + +#include /* Get size_t. */ + +#ifdef _LIBC +# include "../iconv/gconv_int.h" +#else +# if HAVE_ICONV +# include +# endif +#endif + +#include "loadinfo.h" + +#include "gmo.h" /* Get nls_uint32. */ + +/* @@ end of prolog @@ */ + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif +#endif + +#ifndef internal_function +# define internal_function +#endif + +/* Tell the compiler when a conditional or integer expression is + almost always true or almost always false. */ +#ifndef HAVE_BUILTIN_EXPECT +# define __builtin_expect(expr, val) (expr) +#endif + +#ifndef W +# define W(flag, data) ((flag) ? SWAP (data) : (data)) +#endif + + +#ifdef _LIBC +# include +# define SWAP(i) bswap_32 (i) +#else +static inline nls_uint32 +SWAP (i) + nls_uint32 i; +{ + return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); +} +#endif + + +/* The representation of an opened message catalog. */ +struct loaded_domain +{ + const char *data; + int use_mmap; + size_t mmap_size; + int must_swap; + nls_uint32 nstrings; + struct string_desc *orig_tab; + struct string_desc *trans_tab; + nls_uint32 hash_size; + nls_uint32 *hash_tab; + int codeset_cntr; +#ifdef _LIBC + __gconv_t conv; +#else +# if HAVE_ICONV + iconv_t conv; +# endif +#endif + char **conv_tab; + + struct expression *plural; + unsigned long int nplurals; +}; + +/* We want to allocate a string at the end of the struct. But ISO C + doesn't allow zero sized arrays. */ +#ifdef __GNUC__ +# define ZERO 0 +#else +# define ZERO 1 +#endif + +/* A set of settings bound to a message domain. Used to store settings + from bindtextdomain() and bind_textdomain_codeset(). */ +struct binding +{ + struct binding *next; + char *dirname; + int codeset_cntr; /* Incremented each time codeset changes. */ + char *codeset; + char domainname[ZERO]; +}; + +/* A counter which is incremented each time some previous translations + become invalid. + This variable is part of the external ABI of the GNU libintl. */ +extern int _nl_msg_cat_cntr; + +#ifndef _LIBC +const char *_nl_locale_name PARAMS ((int category, const char *categoryname)); +#endif + +struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, + char *__locale, + const char *__domainname, + struct binding *__domainbinding)) + internal_function; +void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain, + struct binding *__domainbinding)) + internal_function; +void _nl_unload_domain PARAMS ((struct loaded_domain *__domain)) + internal_function; +const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file, + struct loaded_domain *__domain, + struct binding *__domainbinding)) + internal_function; +void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain)) + internal_function; + +char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file, + struct binding *domainbinding, + const char *msgid, size_t *lengthp)) + internal_function; + +#ifdef _LIBC +extern char *__gettext PARAMS ((const char *__msgid)); +extern char *__dgettext PARAMS ((const char *__domainname, + const char *__msgid)); +extern char *__dcgettext PARAMS ((const char *__domainname, + const char *__msgid, int __category)); +extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2, + unsigned long int __n)); +extern char *__dngettext PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int n)); +extern char *__dcngettext PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category)); +extern char *__dcigettext PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + int __plural, unsigned long int __n, + int __category)); +extern char *__textdomain PARAMS ((const char *__domainname)); +extern char *__bindtextdomain PARAMS ((const char *__domainname, + const char *__dirname)); +extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname, + const char *__codeset)); +#else +extern char *gettext__ PARAMS ((const char *__msgid)); +extern char *dgettext__ PARAMS ((const char *__domainname, + const char *__msgid)); +extern char *dcgettext__ PARAMS ((const char *__domainname, + const char *__msgid, int __category)); +extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2, + unsigned long int __n)); +extern char *dngettext__ PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n)); +extern char *dcngettext__ PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category)); +extern char *dcigettext__ PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + int __plural, unsigned long int __n, + int __category)); +extern char *textdomain__ PARAMS ((const char *__domainname)); +extern char *bindtextdomain__ PARAMS ((const char *__domainname, + const char *__dirname)); +extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname, + const char *__codeset)); +#endif + +/* @@ begin of epilog @@ */ + +#endif /* gettextP.h */ diff --git a/src/apps/bin/grep-2.5/intl/gmo.h b/src/apps/bin/grep-2.5/intl/gmo.h new file mode 100644 index 0000000000..f05ae470c7 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/gmo.h @@ -0,0 +1,100 @@ +/* Description of GNU message catalog format: general file layout. + Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _GETTEXT_H +#define _GETTEXT_H 1 + +#include + +/* @@ end of prolog @@ */ + +/* The magic number of the GNU message catalog format. */ +#define _MAGIC 0x950412de +#define _MAGIC_SWAPPED 0xde120495 + +/* Revision number of the currently used .mo (binary) file format. */ +#define MO_REVISION_NUMBER 0 + +/* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but + as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work + when cross-compiling. */ + +#if __STDC__ +# define UINT_MAX_32_BITS 4294967295U +#else +# define UINT_MAX_32_BITS 0xFFFFFFFF +#endif + +/* If UINT_MAX isn't defined, assume it's a 32-bit type. + This should be valid for all systems GNU cares about because + that doesn't include 16-bit systems, and only modern systems + (that certainly have ) have 64+-bit integral types. */ + +#ifndef UINT_MAX +# define UINT_MAX UINT_MAX_32_BITS +#endif + +#if UINT_MAX == UINT_MAX_32_BITS +typedef unsigned nls_uint32; +#else +# if USHRT_MAX == UINT_MAX_32_BITS +typedef unsigned short nls_uint32; +# else +# if ULONG_MAX == UINT_MAX_32_BITS +typedef unsigned long nls_uint32; +# else + /* The following line is intended to throw an error. Using #error is + not portable enough. */ + "Cannot determine unsigned 32-bit data type." +# endif +# endif +#endif + + +/* Header for binary .mo file format. */ +struct mo_file_header +{ + /* The magic number. */ + nls_uint32 magic; + /* The revision number of the file format. */ + nls_uint32 revision; + /* The number of strings pairs. */ + nls_uint32 nstrings; + /* Offset of table with start offsets of original strings. */ + nls_uint32 orig_tab_offset; + /* Offset of table with start offsets of translation strings. */ + nls_uint32 trans_tab_offset; + /* Size of hashing table. */ + nls_uint32 hash_tab_size; + /* Offset of first hashing entry. */ + nls_uint32 hash_tab_offset; +}; + +struct string_desc +{ + /* Length of addressed string. */ + nls_uint32 length; + /* Offset of string in file. */ + nls_uint32 offset; +}; + +/* @@ begin of epilog @@ */ + +#endif /* gettext.h */ diff --git a/src/apps/bin/grep-2.5/intl/hash-string.h b/src/apps/bin/grep-2.5/intl/hash-string.h new file mode 100644 index 0000000000..b267a87788 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/hash-string.h @@ -0,0 +1,59 @@ +/* Description of GNU message catalog format: string hashing function. + Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* @@ end of prolog @@ */ + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +#endif + +/* We assume to have `unsigned long int' value with at least 32 bits. */ +#define HASHWORDBITS 32 + + +/* Defines the so called `hashpjw' function by P.J. Weinberger + [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, + 1986, 1987 Bell Telephone Laboratories, Inc.] */ +static unsigned long int hash_string PARAMS ((const char *__str_param)); + +static inline unsigned long int +hash_string (str_param) + const char *str_param; +{ + unsigned long int hval, g; + const char *str = str_param; + + /* Compute the hash value for the given string. */ + hval = 0; + while (*str != '\0') + { + hval <<= 4; + hval += (unsigned long int) *str++; + g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); + if (g != 0) + { + hval ^= g >> (HASHWORDBITS - 8); + hval ^= g; + } + } + return hval; +} diff --git a/src/apps/bin/grep-2.5/intl/intl-compat.c b/src/apps/bin/grep-2.5/intl/intl-compat.c new file mode 100644 index 0000000000..0a06ce947b --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/intl-compat.c @@ -0,0 +1,166 @@ +/* intl-compat.c - Stub functions to call gettext functions from GNU gettext + Library. + Copyright (C) 1995, 2000, 2001 Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "libgnuintl.h" +#include "gettextP.h" + +/* @@ end of prolog @@ */ + +/* This file redirects the gettext functions (without prefix or suffix) to + those defined in the included GNU gettext library (with "__" suffix). + It is compiled into libintl when the included GNU gettext library is + configured --with-included-gettext. + + This redirection works also in the case that the system C library or + the system libintl library contain gettext/textdomain/... functions. + If it didn't, we would need to add preprocessor level redirections to + libgnuintl.h of the following form: + +# define gettext gettext__ +# define dgettext dgettext__ +# define dcgettext dcgettext__ +# define ngettext ngettext__ +# define dngettext dngettext__ +# define dcngettext dcngettext__ +# define textdomain textdomain__ +# define bindtextdomain bindtextdomain__ +# define bind_textdomain_codeset bind_textdomain_codeset__ + + How does this redirection work? There are two cases. + A. When libintl.a is linked into an executable, it works because + functions defined in the executable always override functions in + the shared libraries. + B. When libintl.so is used, it works because + 1. those systems defining gettext/textdomain/... in the C library + (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are + ELF systems and define these symbols as weak, thus explicitly + letting other shared libraries override it. + 2. those systems defining gettext/textdomain/... in a standalone + libintl.so library (namely, Solaris 2.3 and newer) have this + shared library in /usr/lib, and the linker will search /usr/lib + *after* the directory where the GNU gettext library is installed. + + A third case, namely when libintl.a is linked into a shared library + whose name is not libintl.so, is not supported. In this case, on + Solaris, when -lintl precedes the linker option for the shared library + containing GNU gettext, the system's gettext would indeed override + the GNU gettext. Anyone doing this kind of stuff must be clever enough + to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker + command line. */ + + +#undef gettext +#undef dgettext +#undef dcgettext +#undef ngettext +#undef dngettext +#undef dcngettext +#undef textdomain +#undef bindtextdomain +#undef bind_textdomain_codeset + + +char * +gettext (msgid) + const char *msgid; +{ + return gettext__ (msgid); +} + + +char * +dgettext (domainname, msgid) + const char *domainname; + const char *msgid; +{ + return dgettext__ (domainname, msgid); +} + + +char * +dcgettext (domainname, msgid, category) + const char *domainname; + const char *msgid; + int category; +{ + return dcgettext__ (domainname, msgid, category); +} + + +char * +ngettext (msgid1, msgid2, n) + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return ngettext__ (msgid1, msgid2, n); +} + + +char * +dngettext (domainname, msgid1, msgid2, n) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return dngettext__ (domainname, msgid1, msgid2, n); +} + + +char * +dcngettext (domainname, msgid1, msgid2, n, category) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; + int category; +{ + return dcngettext__ (domainname, msgid1, msgid2, n, category); +} + + +char * +textdomain (domainname) + const char *domainname; +{ + return textdomain__ (domainname); +} + + +char * +bindtextdomain (domainname, dirname) + const char *domainname; + const char *dirname; +{ + return bindtextdomain__ (domainname, dirname); +} + + +char * +bind_textdomain_codeset (domainname, codeset) + const char *domainname; + const char *codeset; +{ + return bind_textdomain_codeset__ (domainname, codeset); +} diff --git a/src/apps/bin/grep-2.5/intl/intl-compat.o b/src/apps/bin/grep-2.5/intl/intl-compat.o new file mode 100644 index 0000000000..d879565a89 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/intl-compat.o differ diff --git a/src/apps/bin/grep-2.5/intl/l10nflist.c b/src/apps/bin/grep-2.5/intl/l10nflist.c new file mode 100644 index 0000000000..5f042325cc --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/l10nflist.c @@ -0,0 +1,400 @@ +/* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by Ulrich Drepper , 1995. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* Tell glibc's to provide a prototype for stpcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if defined _LIBC || defined HAVE_ARGZ_H +# include +#endif +#include +#include +#include + +#include "loadinfo.h" + +/* On some strange systems still no definition of NULL is found. Sigh! */ +#ifndef NULL +# if defined __STDC__ && __STDC__ +# define NULL ((void *) 0) +# else +# define NULL 0 +# endif +#endif + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# ifndef stpcpy +# define stpcpy(dest, src) __stpcpy(dest, src) +# endif +#else +# ifndef HAVE_STPCPY +static char *stpcpy PARAMS ((char *dest, const char *src)); +# endif +#endif + +/* Define function which are usually not available. */ + +#if !defined _LIBC && !defined HAVE___ARGZ_COUNT +/* Returns the number of strings in ARGZ. */ +static size_t argz_count__ PARAMS ((const char *argz, size_t len)); + +static size_t +argz_count__ (argz, len) + const char *argz; + size_t len; +{ + size_t count = 0; + while (len > 0) + { + size_t part_len = strlen (argz); + argz += part_len + 1; + len -= part_len + 1; + count++; + } + return count; +} +# undef __argz_count +# define __argz_count(argz, len) argz_count__ (argz, len) +#endif /* !_LIBC && !HAVE___ARGZ_COUNT */ + +#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY +/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's + except the last into the character SEP. */ +static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep)); + +static void +argz_stringify__ (argz, len, sep) + char *argz; + size_t len; + int sep; +{ + while (len > 0) + { + size_t part_len = strlen (argz); + argz += part_len; + len -= part_len + 1; + if (len > 0) + *argz++ = sep; + } +} +# undef __argz_stringify +# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) +#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ + +#if !defined _LIBC && !defined HAVE___ARGZ_NEXT +static char *argz_next__ PARAMS ((char *argz, size_t argz_len, + const char *entry)); + +static char * +argz_next__ (argz, argz_len, entry) + char *argz; + size_t argz_len; + const char *entry; +{ + if (entry) + { + if (entry < argz + argz_len) + entry = strchr (entry, '\0') + 1; + + return entry >= argz + argz_len ? NULL : (char *) entry; + } + else + if (argz_len > 0) + return argz; + else + return 0; +} +# undef __argz_next +# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) +#endif /* !_LIBC && !HAVE___ARGZ_NEXT */ + + +/* Return number of bits set in X. */ +static int pop PARAMS ((int x)); + +static inline int +pop (x) + int x; +{ + /* We assume that no more than 16 bits are used. */ + x = ((x & ~0x5555) >> 1) + (x & 0x5555); + x = ((x & ~0x3333) >> 2) + (x & 0x3333); + x = ((x >> 4) + x) & 0x0f0f; + x = ((x >> 8) + x) & 0xff; + + return x; +} + + +struct loaded_l10nfile * +_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, + territory, codeset, normalized_codeset, modifier, special, + sponsor, revision, filename, do_allocate) + struct loaded_l10nfile **l10nfile_list; + const char *dirlist; + size_t dirlist_len; + int mask; + const char *language; + const char *territory; + const char *codeset; + const char *normalized_codeset; + const char *modifier; + const char *special; + const char *sponsor; + const char *revision; + const char *filename; + int do_allocate; +{ + char *abs_filename; + struct loaded_l10nfile *last = NULL; + struct loaded_l10nfile *retval; + char *cp; + size_t entries; + int cnt; + + /* Allocate room for the full file name. */ + abs_filename = (char *) malloc (dirlist_len + + strlen (language) + + ((mask & TERRITORY) != 0 + ? strlen (territory) + 1 : 0) + + ((mask & XPG_CODESET) != 0 + ? strlen (codeset) + 1 : 0) + + ((mask & XPG_NORM_CODESET) != 0 + ? strlen (normalized_codeset) + 1 : 0) + + (((mask & XPG_MODIFIER) != 0 + || (mask & CEN_AUDIENCE) != 0) + ? strlen (modifier) + 1 : 0) + + ((mask & CEN_SPECIAL) != 0 + ? strlen (special) + 1 : 0) + + (((mask & CEN_SPONSOR) != 0 + || (mask & CEN_REVISION) != 0) + ? (1 + ((mask & CEN_SPONSOR) != 0 + ? strlen (sponsor) + 1 : 0) + + ((mask & CEN_REVISION) != 0 + ? strlen (revision) + 1 : 0)) : 0) + + 1 + strlen (filename) + 1); + + if (abs_filename == NULL) + return NULL; + + retval = NULL; + last = NULL; + + /* Construct file name. */ + memcpy (abs_filename, dirlist, dirlist_len); + __argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR); + cp = abs_filename + (dirlist_len - 1); + *cp++ = '/'; + cp = stpcpy (cp, language); + + if ((mask & TERRITORY) != 0) + { + *cp++ = '_'; + cp = stpcpy (cp, territory); + } + if ((mask & XPG_CODESET) != 0) + { + *cp++ = '.'; + cp = stpcpy (cp, codeset); + } + if ((mask & XPG_NORM_CODESET) != 0) + { + *cp++ = '.'; + cp = stpcpy (cp, normalized_codeset); + } + if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) + { + /* This component can be part of both syntaces but has different + leading characters. For CEN we use `+', else `@'. */ + *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; + cp = stpcpy (cp, modifier); + } + if ((mask & CEN_SPECIAL) != 0) + { + *cp++ = '+'; + cp = stpcpy (cp, special); + } + if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) + { + *cp++ = ','; + if ((mask & CEN_SPONSOR) != 0) + cp = stpcpy (cp, sponsor); + if ((mask & CEN_REVISION) != 0) + { + *cp++ = '_'; + cp = stpcpy (cp, revision); + } + } + + *cp++ = '/'; + stpcpy (cp, filename); + + /* Look in list of already loaded domains whether it is already + available. */ + last = NULL; + for (retval = *l10nfile_list; retval != NULL; retval = retval->next) + if (retval->filename != NULL) + { + int compare = strcmp (retval->filename, abs_filename); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It's not in the list. */ + retval = NULL; + break; + } + + last = retval; + } + + if (retval != NULL || do_allocate == 0) + { + free (abs_filename); + return retval; + } + + retval = (struct loaded_l10nfile *) + malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len) + * (1 << pop (mask)) + * sizeof (struct loaded_l10nfile *))); + if (retval == NULL) + return NULL; + + retval->filename = abs_filename; + retval->decided = (__argz_count (dirlist, dirlist_len) != 1 + || ((mask & XPG_CODESET) != 0 + && (mask & XPG_NORM_CODESET) != 0)); + retval->data = NULL; + + if (last == NULL) + { + retval->next = *l10nfile_list; + *l10nfile_list = retval; + } + else + { + retval->next = last->next; + last->next = retval; + } + + entries = 0; + /* If the DIRLIST is a real list the RETVAL entry corresponds not to + a real file. So we have to use the DIRLIST separation mechanism + of the inner loop. */ + cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask; + for (; cnt >= 0; --cnt) + if ((cnt & ~mask) == 0 + && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0) + && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0)) + { + /* Iterate over all elements of the DIRLIST. */ + char *dir = NULL; + + while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) + != NULL) + retval->successor[entries++] + = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, + language, territory, codeset, + normalized_codeset, modifier, special, + sponsor, revision, filename, 1); + } + retval->successor[entries] = NULL; + + return retval; +} + +/* Normalize codeset name. There is no standard for the codeset + names. Normalization allows the user to use any of the common + names. The return value is dynamically allocated and has to be + freed by the caller. */ +const char * +_nl_normalize_codeset (codeset, name_len) + const char *codeset; + size_t name_len; +{ + int len = 0; + int only_digit = 1; + char *retval; + char *wp; + size_t cnt; + + for (cnt = 0; cnt < name_len; ++cnt) + if (isalnum ((unsigned char) codeset[cnt])) + { + ++len; + + if (isalpha ((unsigned char) codeset[cnt])) + only_digit = 0; + } + + retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); + + if (retval != NULL) + { + if (only_digit) + wp = stpcpy (retval, "iso"); + else + wp = retval; + + for (cnt = 0; cnt < name_len; ++cnt) + if (isalpha ((unsigned char) codeset[cnt])) + *wp++ = tolower ((unsigned char) codeset[cnt]); + else if (isdigit ((unsigned char) codeset[cnt])) + *wp++ = codeset[cnt]; + + *wp = '\0'; + } + + return (const char *) retval; +} + + +/* @@ begin of epilog @@ */ + +/* We don't want libintl.a to depend on any other library. So we + avoid the non-standard function stpcpy. In GNU C Library this + function is available, though. Also allow the symbol HAVE_STPCPY + to be defined. */ +#if !_LIBC && !HAVE_STPCPY +static char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif diff --git a/src/apps/bin/grep-2.5/intl/l10nflist.o b/src/apps/bin/grep-2.5/intl/l10nflist.o new file mode 100644 index 0000000000..22e8d52e8c Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/l10nflist.o differ diff --git a/src/apps/bin/grep-2.5/intl/libgnuintl.h b/src/apps/bin/grep-2.5/intl/libgnuintl.h new file mode 100644 index 0000000000..7fd547ef04 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/libgnuintl.h @@ -0,0 +1,137 @@ +/* Message catalogs for internationalization. + Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _LIBINTL_H +#define _LIBINTL_H 1 + +#include + +/* The LC_MESSAGES locale category is the category used by the functions + gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. + On systems that don't define it, use an arbitrary value instead. + On Solaris, defines __LOCALE_H then includes (i.e. + this file!) and then only defines LC_MESSAGES. To avoid a redefinition + warning, don't define LC_MESSAGES in this case. */ +#if !defined LC_MESSAGES && !defined __LOCALE_H +# define LC_MESSAGES 1729 +#endif + +/* We define an additional symbol to signal that we use the GNU + implementation of gettext. */ +#define __USE_GNU_GETTEXT 1 + +/* Resolve a platform specific conflict on DJGPP. GNU gettext takes + precedence over _conio_gettext. */ +#ifdef __DJGPP__ +# undef gettext +# define gettext gettext +#endif + +/* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers + used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */ +#ifndef _INTL_PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define _INTL_PARAMS(args) args +# else +# define _INTL_PARAMS(args) () +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +extern char *gettext _INTL_PARAMS ((const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +extern char *dgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +extern char *dcgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid, + int __category)); + + +/* Similar to `gettext' but select the plural form corresponding to the + number N. */ +extern char *ngettext _INTL_PARAMS ((const char *__msgid1, + const char *__msgid2, + unsigned long int __n)); + +/* Similar to `dgettext' but select the plural form corresponding to the + number N. */ +extern char *dngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n)); + +/* Similar to `dcgettext' but select the plural form corresponding to the + number N. */ +extern char *dcngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n, + int __category)); + + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +extern char *textdomain _INTL_PARAMS ((const char *__domainname)); + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname, + const char *__dirname)); + +/* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname, + const char *__codeset)); + + +/* Optimized version of the functions above. */ +#if defined __OPTIMIZED +/* These are macros, but could also be inline functions. */ + +# define gettext(msgid) \ + dgettext (NULL, msgid) + +# define dgettext(domainname, msgid) \ + dcgettext (domainname, msgid, LC_MESSAGES) + +# define ngettext(msgid1, msgid2, n) \ + dngettext (NULL, msgid1, msgid2, n) + +# define dngettext(domainname, msgid1, msgid2, n) \ + dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) + +#endif /* Optimizing. */ + + +#ifdef __cplusplus +} +#endif + +#endif /* libintl.h */ diff --git a/src/apps/bin/grep-2.5/intl/libintl.a b/src/apps/bin/grep-2.5/intl/libintl.a new file mode 100644 index 0000000000..5d789a93f6 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/libintl.a differ diff --git a/src/apps/bin/grep-2.5/intl/libintl.glibc b/src/apps/bin/grep-2.5/intl/libintl.glibc new file mode 100644 index 0000000000..7298852f79 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/libintl.glibc @@ -0,0 +1,116 @@ +/* Message catalogs for internationalization. + Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc. + This file is derived from the file libgettext.h in the GNU gettext package. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _LIBINTL_H +#define _LIBINTL_H 1 + +#include + +/* We define an additional symbol to signal that we use the GNU + implementation of gettext. */ +#define __USE_GNU_GETTEXT 1 + +__BEGIN_DECLS + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +extern char *gettext (__const char *__msgid) __THROW; + +/* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +extern char *dgettext (__const char *__domainname, __const char *__msgid) + __THROW; +extern char *__dgettext (__const char *__domainname, __const char *__msgid) + __THROW __attribute_format_arg__ (2); + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +extern char *dcgettext (__const char *__domainname, + __const char *__msgid, int __category) __THROW; +extern char *__dcgettext (__const char *__domainname, + __const char *__msgid, int __category) + __THROW __attribute_format_arg__ (2); + + +/* Similar to `gettext' but select the plural form corresponding to the + number N. */ +extern char *ngettext (__const char *__msgid1, __const char *__msgid2, + unsigned long int __n) + __THROW __attribute_format_arg__ (1); + +/* Similar to `dgettext' but select the plural form corresponding to the + number N. */ +extern char *dngettext (__const char *__domainname, __const char *__msgid1, + __const char *__msgid2, unsigned long int __n) + __THROW __attribute_format_arg__ (2); + +/* Similar to `dcgettext' but select the plural form corresponding to the + number N. */ +extern char *dcngettext (__const char *__domainname, __const char *__msgid1, + __const char *__msgid2, unsigned long int __n, + int __category) + __THROW __attribute_format_arg__ (2); + + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +extern char *textdomain (__const char *__domainname) __THROW; + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +extern char *bindtextdomain (__const char *__domainname, + __const char *__dirname) __THROW; + +/* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +extern char *bind_textdomain_codeset (__const char *__domainname, + __const char *__codeset) __THROW; + + +/* Optimized version of the function above. */ +#if defined __OPTIMIZE__ + +/* We need NULL for `gettext'. */ +# define __need_NULL +# include + +/* We need LC_MESSAGES for `dgettext'. */ +# include + +/* These must be macros. Inlined functions are useless because the + `__builtin_constant_p' predicate in dcgettext would always return + false. */ + +# define gettext(msgid) dgettext (NULL, msgid) + +# define dgettext(domainname, msgid) \ + dcgettext (domainname, msgid, LC_MESSAGES) + +# define ngettext(msgid1, msgid2, n) dngettext (NULL, msgid1, msgid2, n) + +# define dngettext(domainname, msgid1, msgid2, n) \ + dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) + +#endif /* Optimizing. */ + +__END_DECLS + +#endif /* libintl.h */ diff --git a/src/apps/bin/grep-2.5/intl/libintl.h b/src/apps/bin/grep-2.5/intl/libintl.h new file mode 100644 index 0000000000..7fd547ef04 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/libintl.h @@ -0,0 +1,137 @@ +/* Message catalogs for internationalization. + Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _LIBINTL_H +#define _LIBINTL_H 1 + +#include + +/* The LC_MESSAGES locale category is the category used by the functions + gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. + On systems that don't define it, use an arbitrary value instead. + On Solaris, defines __LOCALE_H then includes (i.e. + this file!) and then only defines LC_MESSAGES. To avoid a redefinition + warning, don't define LC_MESSAGES in this case. */ +#if !defined LC_MESSAGES && !defined __LOCALE_H +# define LC_MESSAGES 1729 +#endif + +/* We define an additional symbol to signal that we use the GNU + implementation of gettext. */ +#define __USE_GNU_GETTEXT 1 + +/* Resolve a platform specific conflict on DJGPP. GNU gettext takes + precedence over _conio_gettext. */ +#ifdef __DJGPP__ +# undef gettext +# define gettext gettext +#endif + +/* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers + used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */ +#ifndef _INTL_PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define _INTL_PARAMS(args) args +# else +# define _INTL_PARAMS(args) () +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +extern char *gettext _INTL_PARAMS ((const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +extern char *dgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid)); + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +extern char *dcgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid, + int __category)); + + +/* Similar to `gettext' but select the plural form corresponding to the + number N. */ +extern char *ngettext _INTL_PARAMS ((const char *__msgid1, + const char *__msgid2, + unsigned long int __n)); + +/* Similar to `dgettext' but select the plural form corresponding to the + number N. */ +extern char *dngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n)); + +/* Similar to `dcgettext' but select the plural form corresponding to the + number N. */ +extern char *dcngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n, + int __category)); + + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +extern char *textdomain _INTL_PARAMS ((const char *__domainname)); + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname, + const char *__dirname)); + +/* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname, + const char *__codeset)); + + +/* Optimized version of the functions above. */ +#if defined __OPTIMIZED +/* These are macros, but could also be inline functions. */ + +# define gettext(msgid) \ + dgettext (NULL, msgid) + +# define dgettext(domainname, msgid) \ + dcgettext (domainname, msgid, LC_MESSAGES) + +# define ngettext(msgid1, msgid2, n) \ + dngettext (NULL, msgid1, msgid2, n) + +# define dngettext(domainname, msgid1, msgid2, n) \ + dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) + +#endif /* Optimizing. */ + + +#ifdef __cplusplus +} +#endif + +#endif /* libintl.h */ diff --git a/src/apps/bin/grep-2.5/intl/loadinfo.h b/src/apps/bin/grep-2.5/intl/loadinfo.h new file mode 100644 index 0000000000..d180962f52 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/loadinfo.h @@ -0,0 +1,121 @@ +/* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _LOADINFO_H +#define _LOADINFO_H 1 + +/* Declarations of locale dependent catalog lookup functions. + Implemented in + + localealias.c Possibly replace a locale name by another. + explodename.c Split a locale name into its various fields. + l10nflist.c Generate a list of filenames of possible message catalogs. + finddomain.c Find and open the relevant message catalogs. + + The main function _nl_find_domain() in finddomain.c is declared + in gettextP.h. + */ + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif +#endif + +#ifndef internal_function +# define internal_function +#endif + +/* Tell the compiler when a conditional or integer expression is + almost always true or almost always false. */ +#ifndef HAVE_BUILTIN_EXPECT +# define __builtin_expect(expr, val) (expr) +#endif + +/* Separator in PATH like lists of pathnames. */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define PATH_SEPARATOR ';' +#else + /* Unix */ +# define PATH_SEPARATOR ':' +#endif + +/* Encoding of locale name parts. */ +#define CEN_REVISION 1 +#define CEN_SPONSOR 2 +#define CEN_SPECIAL 4 +#define XPG_NORM_CODESET 8 +#define XPG_CODESET 16 +#define TERRITORY 32 +#define CEN_AUDIENCE 64 +#define XPG_MODIFIER 128 + +#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) +#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) + + +struct loaded_l10nfile +{ + const char *filename; + int decided; + + const void *data; + + struct loaded_l10nfile *next; + struct loaded_l10nfile *successor[1]; +}; + + +/* Normalize codeset name. There is no standard for the codeset + names. Normalization allows the user to use any of the common + names. The return value is dynamically allocated and has to be + freed by the caller. */ +extern const char *_nl_normalize_codeset PARAMS ((const char *codeset, + size_t name_len)); + +extern struct loaded_l10nfile * +_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list, + const char *dirlist, size_t dirlist_len, int mask, + const char *language, const char *territory, + const char *codeset, + const char *normalized_codeset, + const char *modifier, const char *special, + const char *sponsor, const char *revision, + const char *filename, int do_allocate)); + + +extern const char *_nl_expand_alias PARAMS ((const char *name)); + +/* normalized_codeset is dynamically allocated and has to be freed by + the caller. */ +extern int _nl_explode_name PARAMS ((char *name, const char **language, + const char **modifier, + const char **territory, + const char **codeset, + const char **normalized_codeset, + const char **special, + const char **sponsor, + const char **revision)); + +extern char *_nl_find_language PARAMS ((const char *name)); + +#endif /* loadinfo.h */ diff --git a/src/apps/bin/grep-2.5/intl/loadmsgcat.c b/src/apps/bin/grep-2.5/intl/loadmsgcat.c new file mode 100644 index 0000000000..76130ed278 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/loadmsgcat.c @@ -0,0 +1,445 @@ +/* Load needed message catalogs. + Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* Tell glibc's to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include + +#ifdef __GNUC__ +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +#endif + +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#ifdef _LIBC +# include +# include +#endif + +#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ + || (defined _LIBC && defined _POSIX_MAPPED_FILES) +# include +# undef HAVE_MMAP +# define HAVE_MMAP 1 +#else +# undef HAVE_MMAP +#endif + +#include "gmo.h" +#include "gettextP.h" +#include "plural-exp.h" + +#ifdef _LIBC +# include "../locale/localeinfo.h" +#endif + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ISO C functions. This is required by the standard + because some ISO C functions will require linking with this object + file and the name space must not be polluted. */ +# define open __open +# define close __close +# define read __read +# define mmap __mmap +# define munmap __munmap +#endif + +/* For those losing systems which don't have `alloca' we have to add + some additional code emulating it. */ +#ifdef HAVE_ALLOCA +# define freea(p) /* nothing */ +#else +# define alloca(n) malloc (n) +# define freea(p) free (p) +#endif + +/* For systems that distinguish between text and binary I/O. + O_BINARY is usually declared in . */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif +#ifdef __BEOS__ + /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif +/* On reasonable systems, binary I/O is the default. */ +#ifndef O_BINARY +# define O_BINARY 0 +#endif + +/* We need a sign, whether a new catalog was loaded, which can be associated + with all translations. This is important if the translations are + cached by one of GCC's features. */ +int _nl_msg_cat_cntr; + + +/* Initialize the codeset dependent parts of an opened message catalog. + Return the header entry. */ +const char * +internal_function +_nl_init_domain_conv (domain_file, domain, domainbinding) + struct loaded_l10nfile *domain_file; + struct loaded_domain *domain; + struct binding *domainbinding; +{ + /* Find out about the character set the file is encoded with. + This can be found (in textual form) in the entry "". If this + entry does not exist or if this does not contain the `charset=' + information, we will assume the charset matches the one the + current locale and we don't have to perform any conversion. */ + char *nullentry; + size_t nullentrylen; + + /* Preinitialize fields, to avoid recursion during _nl_find_msg. */ + domain->codeset_cntr = + (domainbinding != NULL ? domainbinding->codeset_cntr : 0); +#ifdef _LIBC + domain->conv = (__gconv_t) -1; +#else +# if HAVE_ICONV + domain->conv = (iconv_t) -1; +# endif +#endif + domain->conv_tab = NULL; + + /* Get the header entry. */ + nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen); + + if (nullentry != NULL) + { +#if defined _LIBC || HAVE_ICONV + const char *charsetstr; + + charsetstr = strstr (nullentry, "charset="); + if (charsetstr != NULL) + { + size_t len; + char *charset; + const char *outcharset; + + charsetstr += strlen ("charset="); + len = strcspn (charsetstr, " \t\n"); + + charset = (char *) alloca (len + 1); +# if defined _LIBC || HAVE_MEMPCPY + *((char *) mempcpy (charset, charsetstr, len)) = '\0'; +# else + memcpy (charset, charsetstr, len); + charset[len] = '\0'; +# endif + + /* The output charset should normally be determined by the + locale. But sometimes the locale is not used or not correctly + set up, so we provide a possibility for the user to override + this. Moreover, the value specified through + bind_textdomain_codeset overrides both. */ + if (domainbinding != NULL && domainbinding->codeset != NULL) + outcharset = domainbinding->codeset; + else + { + outcharset = getenv ("OUTPUT_CHARSET"); + if (outcharset == NULL || outcharset[0] == '\0') + { +# ifdef _LIBC + outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string; +# else +# if HAVE_ICONV + extern const char *locale_charset PARAMS ((void)); + outcharset = locale_charset (); +# endif +# endif + } + } + +# ifdef _LIBC + /* We always want to use transliteration. */ + outcharset = norm_add_slashes (outcharset, "TRANSLIT"); + charset = norm_add_slashes (charset, NULL); + if (__gconv_open (outcharset, charset, &domain->conv, + GCONV_AVOID_NOCONV) + != __GCONV_OK) + domain->conv = (__gconv_t) -1; +# else +# if HAVE_ICONV + /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, + we want to use transliteration. */ +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ + || _LIBICONV_VERSION >= 0x0105 + len = strlen (outcharset); + { + char *tmp = (char *) alloca (len + 10 + 1); + memcpy (tmp, outcharset, len); + memcpy (tmp + len, "//TRANSLIT", 10 + 1); + outcharset = tmp; + } +# endif + domain->conv = iconv_open (outcharset, charset); +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ + || _LIBICONV_VERSION >= 0x0105 + freea (outcharset); +# endif +# endif +# endif + + freea (charset); + } +#endif /* _LIBC || HAVE_ICONV */ + } + + return nullentry; +} + +/* Frees the codeset dependent parts of an opened message catalog. */ +void +internal_function +_nl_free_domain_conv (domain) + struct loaded_domain *domain; +{ + if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1) + free (domain->conv_tab); + +#ifdef _LIBC + if (domain->conv != (__gconv_t) -1) + __gconv_close (domain->conv); +#else +# if HAVE_ICONV + if (domain->conv != (iconv_t) -1) + iconv_close (domain->conv); +# endif +#endif +} + +/* Load the message catalogs specified by FILENAME. If it is no valid + message catalog do nothing. */ +void +internal_function +_nl_load_domain (domain_file, domainbinding) + struct loaded_l10nfile *domain_file; + struct binding *domainbinding; +{ + int fd; + size_t size; +#ifdef _LIBC + struct stat64 st; +#else + struct stat st; +#endif + struct mo_file_header *data = (struct mo_file_header *) -1; + int use_mmap = 0; + struct loaded_domain *domain; + const char *nullentry; + + domain_file->decided = 1; + domain_file->data = NULL; + + /* Note that it would be useless to store domainbinding in domain_file + because domainbinding might be == NULL now but != NULL later (after + a call to bind_textdomain_codeset). */ + + /* If the record does not represent a valid locale the FILENAME + might be NULL. This can happen when according to the given + specification the locale file name is different for XPG and CEN + syntax. */ + if (domain_file->filename == NULL) + return; + + /* Try to open the addressed file. */ + fd = open (domain_file->filename, O_RDONLY | O_BINARY); + if (fd == -1) + return; + + /* We must know about the size of the file. */ + if ( +#ifdef _LIBC + __builtin_expect (fstat64 (fd, &st) != 0, 0) +#else + __builtin_expect (fstat (fd, &st) != 0, 0) +#endif + || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) + || __builtin_expect (size < sizeof (struct mo_file_header), 0)) + { + /* Something went wrong. */ + close (fd); + return; + } + +#ifdef HAVE_MMAP + /* Now we are ready to load the file. If mmap() is available we try + this first. If not available or it failed we try to load it. */ + data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, + MAP_PRIVATE, fd, 0); + + if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) + { + /* mmap() call was successful. */ + close (fd); + use_mmap = 1; + } +#endif + + /* If the data is not yet available (i.e. mmap'ed) we try to load + it manually. */ + if (data == (struct mo_file_header *) -1) + { + size_t to_read; + char *read_ptr; + + data = (struct mo_file_header *) malloc (size); + if (data == NULL) + return; + + to_read = size; + read_ptr = (char *) data; + do + { + long int nb = (long int) read (fd, read_ptr, to_read); + if (nb <= 0) + { +#ifdef EINTR + if (nb == -1 && errno == EINTR) + continue; +#endif + close (fd); + return; + } + read_ptr += nb; + to_read -= nb; + } + while (to_read > 0); + + close (fd); + } + + /* Using the magic number we can test whether it really is a message + catalog file. */ + if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, + 0)) + { + /* The magic number is wrong: not a message catalog file. */ +#ifdef HAVE_MMAP + if (use_mmap) + munmap ((caddr_t) data, size); + else +#endif + free (data); + return; + } + + domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); + if (domain == NULL) + return; + domain_file->data = domain; + + domain->data = (char *) data; + domain->use_mmap = use_mmap; + domain->mmap_size = size; + domain->must_swap = data->magic != _MAGIC; + + /* Fill in the information about the available tables. */ + switch (W (domain->must_swap, data->revision)) + { + case 0: + domain->nstrings = W (domain->must_swap, data->nstrings); + domain->orig_tab = (struct string_desc *) + ((char *) data + W (domain->must_swap, data->orig_tab_offset)); + domain->trans_tab = (struct string_desc *) + ((char *) data + W (domain->must_swap, data->trans_tab_offset)); + domain->hash_size = W (domain->must_swap, data->hash_tab_size); + domain->hash_tab = (nls_uint32 *) + ((char *) data + W (domain->must_swap, data->hash_tab_offset)); + break; + default: + /* This is an invalid revision. */ +#ifdef HAVE_MMAP + if (use_mmap) + munmap ((caddr_t) data, size); + else +#endif + free (data); + free (domain); + domain_file->data = NULL; + return; + } + + /* Now initialize the character set converter from the character set + the file is encoded with (found in the header entry) to the domain's + specified character set or the locale's character set. */ + nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding); + + /* Also look for a plural specification. */ + EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); +} + + +#ifdef _LIBC +void +internal_function +_nl_unload_domain (domain) + struct loaded_domain *domain; +{ + if (domain->plural != &__gettext_germanic_plural) + __gettext_free_exp (domain->plural); + + _nl_free_domain_conv (domain); + +# ifdef _POSIX_MAPPED_FILES + if (domain->use_mmap) + munmap ((caddr_t) domain->data, domain->mmap_size); + else +# endif /* _POSIX_MAPPED_FILES */ + free ((void *) domain->data); + + free (domain); +} +#endif diff --git a/src/apps/bin/grep-2.5/intl/loadmsgcat.o b/src/apps/bin/grep-2.5/intl/loadmsgcat.o new file mode 100644 index 0000000000..ea20fc5a9e Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/loadmsgcat.o differ diff --git a/src/apps/bin/grep-2.5/intl/localcharset.c b/src/apps/bin/grep-2.5/intl/localcharset.c new file mode 100644 index 0000000000..bc5587bf60 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/localcharset.c @@ -0,0 +1,345 @@ +/* Determine a canonical name for the current locale's character encoding. + + Copyright (C) 2000-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* Written by Bruno Haible . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if HAVE_STDDEF_H +# include +#endif + +#include +#if HAVE_STRING_H +# include +#else +# include +#endif +#if HAVE_STDLIB_H +# include +#endif + +#if defined _WIN32 || defined __WIN32__ +# undef WIN32 /* avoid warning on mingw32 */ +# define WIN32 +#endif + +#if defined __EMX__ +/* Assume EMX program runs on OS/2, even if compiled under DOS. */ +# define OS2 +#endif + +#if !defined WIN32 +# if HAVE_LANGINFO_CODESET +# include +# else +# if HAVE_SETLOCALE +# include +# endif +# endif +#elif defined WIN32 +# define WIN32_LEAN_AND_MEAN +# include +#endif +#if defined OS2 +# define INCL_DOS +# include +#endif + +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + +#ifndef DIRECTORY_SEPARATOR +# define DIRECTORY_SEPARATOR '/' +#endif + +#ifndef ISSLASH +# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) +#endif + +#ifdef HAVE_GETC_UNLOCKED +# undef getc +# define getc getc_unlocked +#endif + +/* The following static variable is declared 'volatile' to avoid a + possible multithread problem in the function get_charset_aliases. If we + are running in a threaded environment, and if two threads initialize + 'charset_aliases' simultaneously, both will produce the same value, + and everything will be ok if the two assignments to 'charset_aliases' + are atomic. But I don't know what will happen if the two assignments mix. */ +#if __STDC__ != 1 +# define volatile /* empty */ +#endif +/* Pointer to the contents of the charset.alias file, if it has already been + read, else NULL. Its format is: + ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ +static const char * volatile charset_aliases; + +/* Return a pointer to the contents of the charset.alias file. */ +static const char * +get_charset_aliases () +{ + const char *cp; + + cp = charset_aliases; + if (cp == NULL) + { +#if !defined WIN32 + FILE *fp; + const char *dir = LIBDIR; + const char *base = "charset.alias"; + char *file_name; + + /* Concatenate dir and base into freshly allocated file_name. */ + { + size_t dir_len = strlen (dir); + size_t base_len = strlen (base); + int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); + file_name = (char *) malloc (dir_len + add_slash + base_len + 1); + if (file_name != NULL) + { + memcpy (file_name, dir, dir_len); + if (add_slash) + file_name[dir_len] = DIRECTORY_SEPARATOR; + memcpy (file_name + dir_len + add_slash, base, base_len + 1); + } + } + + if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) + /* Out of memory or file not found, treat it as empty. */ + cp = ""; + else + { + /* Parse the file's contents. */ + int c; + char buf1[50+1]; + char buf2[50+1]; + char *res_ptr = NULL; + size_t res_size = 0; + size_t l1, l2; + + for (;;) + { + c = getc (fp); + if (c == EOF) + break; + if (c == '\n' || c == ' ' || c == '\t') + continue; + if (c == '#') + { + /* Skip comment, to end of line. */ + do + c = getc (fp); + while (!(c == EOF || c == '\n')); + if (c == EOF) + break; + continue; + } + ungetc (c, fp); + if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) + break; + l1 = strlen (buf1); + l2 = strlen (buf2); + if (res_size == 0) + { + res_size = l1 + 1 + l2 + 1; + res_ptr = (char *) malloc (res_size + 1); + } + else + { + res_size += l1 + 1 + l2 + 1; + res_ptr = (char *) realloc (res_ptr, res_size + 1); + } + if (res_ptr == NULL) + { + /* Out of memory. */ + res_size = 0; + break; + } + strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); + strcpy (res_ptr + res_size - (l2 + 1), buf2); + } + fclose (fp); + if (res_size == 0) + cp = ""; + else + { + *(res_ptr + res_size) = '\0'; + cp = res_ptr; + } + } + + if (file_name != NULL) + free (file_name); + +#else + + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ + +# if defined WIN32 + cp = "CP936" "\0" "GBK" "\0" + "CP1361" "\0" "JOHAB" "\0"; +# endif +#endif + + charset_aliases = cp; + } + + return cp; +} + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ + +#ifdef STATIC +STATIC +#endif +const char * +locale_charset () +{ + const char *codeset; + const char *aliases; + +#if !(defined WIN32 || defined OS2) + +# if HAVE_LANGINFO_CODESET + + /* Most systems support nl_langinfo (CODESET) nowadays. */ + codeset = nl_langinfo (CODESET); + +# else + + /* On old systems which lack it, use setlocale or getenv. */ + const char *locale = NULL; + + /* But most old systems don't have a complete set of locales. Some + (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't + use setlocale here; it would return "C" when it doesn't support the + locale name the user has set. */ +# if HAVE_SETLOCALE && 0 + locale = setlocale (LC_CTYPE, NULL); +# endif + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + } + + /* On some old systems, one used to set locale = "iso8859_1". On others, + you set it to "language_COUNTRY.charset". In any case, we resolve it + through the charset.alias file. */ + codeset = locale; + +# endif + +#elif defined WIN32 + + static char buf[2 + 10 + 1]; + + /* Win32 has a function returning the locale's codepage as a number. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + +#elif defined OS2 + + const char *locale; + static char buf[2 + 10 + 1]; + ULONG cp[3]; + ULONG cplen; + + /* Allow user to override the codeset, as set in the operating system, + with standard language environment variables. */ + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + + /* Resolve through the charset.alias file. */ + codeset = locale; + } + else + { + /* OS/2 has a function returning the locale's codepage as a number. */ + if (DosQueryCp (sizeof (cp), cp, &cplen)) + codeset = ""; + else + { + sprintf (buf, "CP%u", cp[0]); + codeset = buf; + } + } + +#endif + + if (codeset == NULL) + /* The canonical name cannot be determined. */ + codeset = ""; + + /* Resolve alias. */ + for (aliases = get_charset_aliases (); + *aliases != '\0'; + aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) + if (strcmp (codeset, aliases) == 0 + || (aliases[0] == '*' && aliases[1] == '\0')) + { + codeset = aliases + strlen (aliases) + 1; + break; + } + + return codeset; +} diff --git a/src/apps/bin/grep-2.5/intl/localcharset.o b/src/apps/bin/grep-2.5/intl/localcharset.o new file mode 100644 index 0000000000..5c88e38602 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/localcharset.o differ diff --git a/src/apps/bin/grep-2.5/intl/locale.alias b/src/apps/bin/grep-2.5/intl/locale.alias new file mode 100644 index 0000000000..bd7b9b31eb --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/locale.alias @@ -0,0 +1,78 @@ +# Locale name alias data base. +# Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. + +# The format of this file is the same as for the corresponding file of +# the X Window System, which normally can be found in +# /usr/lib/X11/locale/locale.alias +# A single line contains two fields: an alias and a substitution value. +# All entries are case independent. + +# Note: This file is far from being complete. If you have a value for +# your own site which you think might be useful for others too, share +# it with the rest of us. Send it using the `glibcbug' script to +# bugs@gnu.org. + +# Packages using this file: + +bokmal no_NO.ISO-8859-1 +bokmål no_NO.ISO-8859-1 +catalan ca_ES.ISO-8859-1 +croatian hr_HR.ISO-8859-2 +czech cs_CZ.ISO-8859-2 +danish da_DK.ISO-8859-1 +dansk da_DK.ISO-8859-1 +deutsch de_DE.ISO-8859-1 +dutch nl_NL.ISO-8859-1 +eesti et_EE.ISO-8859-1 +estonian et_EE.ISO-8859-1 +finnish fi_FI.ISO-8859-1 +français fr_FR.ISO-8859-1 +french fr_FR.ISO-8859-1 +galego gl_ES.ISO-8859-1 +galician gl_ES.ISO-8859-1 +german de_DE.ISO-8859-1 +greek el_GR.ISO-8859-7 +hebrew he_IL.ISO-8859-8 +hrvatski hr_HR.ISO-8859-2 +hungarian hu_HU.ISO-8859-2 +icelandic is_IS.ISO-8859-1 +italian it_IT.ISO-8859-1 +japanese ja_JP.eucJP +japanese.euc ja_JP.eucJP +ja_JP ja_JP.eucJP +ja_JP.ujis ja_JP.eucJP +japanese.sjis ja_JP.SJIS +korean ko_KR.eucKR +korean.euc ko_KR.eucKR +ko_KR ko_KR.eucKR +lithuanian lt_LT.ISO-8859-13 +nb_NO no_NO.ISO-8859-1 +nb_NO.ISO-8859-1 no_NO.ISO-8859-1 +norwegian no_NO.ISO-8859-1 +nynorsk nn_NO.ISO-8859-1 +polish pl_PL.ISO-8859-2 +portuguese pt_PT.ISO-8859-1 +romanian ro_RO.ISO-8859-2 +russian ru_RU.ISO-8859-5 +slovak sk_SK.ISO-8859-2 +slovene sl_SI.ISO-8859-2 +slovenian sl_SI.ISO-8859-2 +spanish es_ES.ISO-8859-1 +swedish sv_SE.ISO-8859-1 +thai th_TH.TIS-620 +turkish tr_TR.ISO-8859-9 diff --git a/src/apps/bin/grep-2.5/intl/localealias.c b/src/apps/bin/grep-2.5/intl/localealias.c new file mode 100644 index 0000000000..456e41e37d --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/localealias.c @@ -0,0 +1,419 @@ +/* Handle aliases for locale names. + Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* Tell glibc's to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#if defined _LIBC || defined HAVE___FSETLOCKING +# include +#endif +#include + +#ifdef __GNUC__ +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +#endif + +#include +#include + +#include "gettextP.h" + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define strcasecmp __strcasecmp + +# ifndef mempcpy +# define mempcpy __mempcpy +# endif +# define HAVE_MEMPCPY 1 +# define HAVE___FSETLOCKING 1 + +/* We need locking here since we can be called from different places. */ +# include + +__libc_lock_define_initialized (static, lock); +#endif + +#ifndef internal_function +# define internal_function +#endif + +/* Some optimizations for glibc. */ +#ifdef _LIBC +# define FEOF(fp) feof_unlocked (fp) +# define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp) +#else +# define FEOF(fp) feof (fp) +# define FGETS(buf, n, fp) fgets (buf, n, fp) +#endif + +/* For those losing systems which don't have `alloca' we have to add + some additional code emulating it. */ +#ifdef HAVE_ALLOCA +# define freea(p) /* nothing */ +#else +# define alloca(n) malloc (n) +# define freea(p) free (p) +#endif + +#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED +# undef fgets +# define fgets(buf, len, s) fgets_unlocked (buf, len, s) +#endif +#if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED +# undef feof +# define feof(s) feof_unlocked (s) +#endif + + +struct alias_map +{ + const char *alias; + const char *value; +}; + + +static char *string_space; +static size_t string_space_act; +static size_t string_space_max; +static struct alias_map *map; +static size_t nmap; +static size_t maxmap; + + +/* Prototypes for local functions. */ +static size_t read_alias_file PARAMS ((const char *fname, int fname_len)) + internal_function; +static int extend_alias_table PARAMS ((void)); +static int alias_compare PARAMS ((const struct alias_map *map1, + const struct alias_map *map2)); + + +const char * +_nl_expand_alias (name) + const char *name; +{ + static const char *locale_alias_path; + struct alias_map *retval; + const char *result = NULL; + size_t added; + +#ifdef _LIBC + __libc_lock_lock (lock); +#endif + + if (locale_alias_path == NULL) + locale_alias_path = LOCALE_ALIAS_PATH; + + do + { + struct alias_map item; + + item.alias = name; + + if (nmap > 0) + retval = (struct alias_map *) bsearch (&item, map, nmap, + sizeof (struct alias_map), + (int (*) PARAMS ((const void *, + const void *)) + ) alias_compare); + else + retval = NULL; + + /* We really found an alias. Return the value. */ + if (retval != NULL) + { + result = retval->value; + break; + } + + /* Perhaps we can find another alias file. */ + added = 0; + while (added == 0 && locale_alias_path[0] != '\0') + { + const char *start; + + while (locale_alias_path[0] == PATH_SEPARATOR) + ++locale_alias_path; + start = locale_alias_path; + + while (locale_alias_path[0] != '\0' + && locale_alias_path[0] != PATH_SEPARATOR) + ++locale_alias_path; + + if (start < locale_alias_path) + added = read_alias_file (start, locale_alias_path - start); + } + } + while (added != 0); + +#ifdef _LIBC + __libc_lock_unlock (lock); +#endif + + return result; +} + + +static size_t +internal_function +read_alias_file (fname, fname_len) + const char *fname; + int fname_len; +{ + FILE *fp; + char *full_fname; + size_t added; + static const char aliasfile[] = "/locale.alias"; + + full_fname = (char *) alloca (fname_len + sizeof aliasfile); +#ifdef HAVE_MEMPCPY + mempcpy (mempcpy (full_fname, fname, fname_len), + aliasfile, sizeof aliasfile); +#else + memcpy (full_fname, fname, fname_len); + memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); +#endif + + fp = fopen (full_fname, "r"); + freea (full_fname); + if (fp == NULL) + return 0; + +#ifdef HAVE___FSETLOCKING + /* No threads present. */ + __fsetlocking (fp, FSETLOCKING_BYCALLER); +#endif + + added = 0; + while (!FEOF (fp)) + { + /* It is a reasonable approach to use a fix buffer here because + a) we are only interested in the first two fields + b) these fields must be usable as file names and so must not + be that long + */ + char buf[BUFSIZ]; + char *alias; + char *value; + char *cp; + + if (FGETS (buf, sizeof buf, fp) == NULL) + /* EOF reached. */ + break; + + /* Possibly not the whole line fits into the buffer. Ignore + the rest of the line. */ + if (strchr (buf, '\n') == NULL) + { + char altbuf[BUFSIZ]; + do + if (FGETS (altbuf, sizeof altbuf, fp) == NULL) + /* Make sure the inner loop will be left. The outer loop + will exit at the `feof' test. */ + break; + while (strchr (altbuf, '\n') == NULL); + } + + cp = buf; + /* Ignore leading white space. */ + while (isspace ((unsigned char) cp[0])) + ++cp; + + /* A leading '#' signals a comment line. */ + if (cp[0] != '\0' && cp[0] != '#') + { + alias = cp++; + while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) + ++cp; + /* Terminate alias name. */ + if (cp[0] != '\0') + *cp++ = '\0'; + + /* Now look for the beginning of the value. */ + while (isspace ((unsigned char) cp[0])) + ++cp; + + if (cp[0] != '\0') + { + size_t alias_len; + size_t value_len; + + value = cp++; + while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) + ++cp; + /* Terminate value. */ + if (cp[0] == '\n') + { + /* This has to be done to make the following test + for the end of line possible. We are looking for + the terminating '\n' which do not overwrite here. */ + *cp++ = '\0'; + *cp = '\n'; + } + else if (cp[0] != '\0') + *cp++ = '\0'; + + if (nmap >= maxmap) + if (__builtin_expect (extend_alias_table (), 0)) + return added; + + alias_len = strlen (alias) + 1; + value_len = strlen (value) + 1; + + if (string_space_act + alias_len + value_len > string_space_max) + { + /* Increase size of memory pool. */ + size_t new_size = (string_space_max + + (alias_len + value_len > 1024 + ? alias_len + value_len : 1024)); + char *new_pool = (char *) realloc (string_space, new_size); + if (new_pool == NULL) + return added; + + if (__builtin_expect (string_space != new_pool, 0)) + { + size_t i; + + for (i = 0; i < nmap; i++) + { + map[i].alias += new_pool - string_space; + map[i].value += new_pool - string_space; + } + } + + string_space = new_pool; + string_space_max = new_size; + } + + map[nmap].alias = memcpy (&string_space[string_space_act], + alias, alias_len); + string_space_act += alias_len; + + map[nmap].value = memcpy (&string_space[string_space_act], + value, value_len); + string_space_act += value_len; + + ++nmap; + ++added; + } + } + } + + /* Should we test for ferror()? I think we have to silently ignore + errors. --drepper */ + fclose (fp); + + if (added > 0) + qsort (map, nmap, sizeof (struct alias_map), + (int (*) PARAMS ((const void *, const void *))) alias_compare); + + return added; +} + + +static int +extend_alias_table () +{ + size_t new_size; + struct alias_map *new_map; + + new_size = maxmap == 0 ? 100 : 2 * maxmap; + new_map = (struct alias_map *) realloc (map, (new_size + * sizeof (struct alias_map))); + if (new_map == NULL) + /* Simply don't extend: we don't have any more core. */ + return -1; + + map = new_map; + maxmap = new_size; + return 0; +} + + +#ifdef _LIBC +static void __attribute__ ((unused)) +free_mem (void) +{ + if (string_space != NULL) + free (string_space); + if (map != NULL) + free (map); +} +text_set_element (__libc_subfreeres, free_mem); +#endif + + +static int +alias_compare (map1, map2) + const struct alias_map *map1; + const struct alias_map *map2; +{ +#if defined _LIBC || defined HAVE_STRCASECMP + return strcasecmp (map1->alias, map2->alias); +#else + const unsigned char *p1 = (const unsigned char *) map1->alias; + const unsigned char *p2 = (const unsigned char *) map2->alias; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + /* I know this seems to be odd but the tolower() function in + some systems libc cannot handle nonalpha characters. */ + c1 = isupper (*p1) ? tolower (*p1) : *p1; + c2 = isupper (*p2) ? tolower (*p2) : *p2; + if (c1 == '\0') + break; + ++p1; + ++p2; + } + while (c1 == c2); + + return c1 - c2; +#endif +} diff --git a/src/apps/bin/grep-2.5/intl/localealias.o b/src/apps/bin/grep-2.5/intl/localealias.o new file mode 100644 index 0000000000..b7627bc1e9 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/localealias.o differ diff --git a/src/apps/bin/grep-2.5/intl/localename.c b/src/apps/bin/grep-2.5/intl/localename.c new file mode 100644 index 0000000000..a8aad600f9 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/localename.c @@ -0,0 +1,693 @@ +/* Determine the current selected locale. + Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Ulrich Drepper , 1995. */ +/* Win32 code written by Tor Lillqvist . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#if defined _WIN32 || defined __WIN32__ +# undef WIN32 /* avoid warning on mingw32 */ +# define WIN32 +#endif + +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +# include +/* Mingw headers don't have latest language and sublanguage codes. */ +# ifndef LANG_AFRIKAANS +# define LANG_AFRIKAANS 0x36 +# endif +# ifndef LANG_ALBANIAN +# define LANG_ALBANIAN 0x1c +# endif +# ifndef LANG_ARABIC +# define LANG_ARABIC 0x01 +# endif +# ifndef LANG_ARMENIAN +# define LANG_ARMENIAN 0x2b +# endif +# ifndef LANG_ASSAMESE +# define LANG_ASSAMESE 0x4d +# endif +# ifndef LANG_AZERI +# define LANG_AZERI 0x2c +# endif +# ifndef LANG_BASQUE +# define LANG_BASQUE 0x2d +# endif +# ifndef LANG_BELARUSIAN +# define LANG_BELARUSIAN 0x23 +# endif +# ifndef LANG_BENGALI +# define LANG_BENGALI 0x45 +# endif +# ifndef LANG_CATALAN +# define LANG_CATALAN 0x03 +# endif +# ifndef LANG_ESTONIAN +# define LANG_ESTONIAN 0x25 +# endif +# ifndef LANG_FAEROESE +# define LANG_FAEROESE 0x38 +# endif +# ifndef LANG_FARSI +# define LANG_FARSI 0x29 +# endif +# ifndef LANG_GEORGIAN +# define LANG_GEORGIAN 0x37 +# endif +# ifndef LANG_GUJARATI +# define LANG_GUJARATI 0x47 +# endif +# ifndef LANG_HEBREW +# define LANG_HEBREW 0x0d +# endif +# ifndef LANG_HINDI +# define LANG_HINDI 0x39 +# endif +# ifndef LANG_INDONESIAN +# define LANG_INDONESIAN 0x21 +# endif +# ifndef LANG_KANNADA +# define LANG_KANNADA 0x4b +# endif +# ifndef LANG_KASHMIRI +# define LANG_KASHMIRI 0x60 +# endif +# ifndef LANG_KAZAK +# define LANG_KAZAK 0x3f +# endif +# ifndef LANG_KONKANI +# define LANG_KONKANI 0x57 +# endif +# ifndef LANG_LATVIAN +# define LANG_LATVIAN 0x26 +# endif +# ifndef LANG_LITHUANIAN +# define LANG_LITHUANIAN 0x27 +# endif +# ifndef LANG_MACEDONIAN +# define LANG_MACEDONIAN 0x2f +# endif +# ifndef LANG_MALAY +# define LANG_MALAY 0x3e +# endif +# ifndef LANG_MALAYALAM +# define LANG_MALAYALAM 0x4c +# endif +# ifndef LANG_MANIPURI +# define LANG_MANIPURI 0x58 +# endif +# ifndef LANG_MARATHI +# define LANG_MARATHI 0x4e +# endif +# ifndef LANG_NEPALI +# define LANG_NEPALI 0x61 +# endif +# ifndef LANG_ORIYA +# define LANG_ORIYA 0x48 +# endif +# ifndef LANG_PUNJABI +# define LANG_PUNJABI 0x46 +# endif +# ifndef LANG_SANSKRIT +# define LANG_SANSKRIT 0x4f +# endif +# ifndef LANG_SERBIAN +# define LANG_SERBIAN 0x1a +# endif +# ifndef LANG_SINDHI +# define LANG_SINDHI 0x59 +# endif +# ifndef LANG_SLOVAK +# define LANG_SLOVAK 0x1b +# endif +# ifndef LANG_SWAHILI +# define LANG_SWAHILI 0x41 +# endif +# ifndef LANG_TAMIL +# define LANG_TAMIL 0x49 +# endif +# ifndef LANG_TATAR +# define LANG_TATAR 0x44 +# endif +# ifndef LANG_TELUGU +# define LANG_TELUGU 0x4a +# endif +# ifndef LANG_THAI +# define LANG_THAI 0x1e +# endif +# ifndef LANG_UKRAINIAN +# define LANG_UKRAINIAN 0x22 +# endif +# ifndef LANG_URDU +# define LANG_URDU 0x20 +# endif +# ifndef LANG_UZBEK +# define LANG_UZBEK 0x43 +# endif +# ifndef LANG_VIETNAMESE +# define LANG_VIETNAMESE 0x2a +# endif +# ifndef SUBLANG_ARABIC_SAUDI_ARABIA +# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 +# endif +# ifndef SUBLANG_ARABIC_IRAQ +# define SUBLANG_ARABIC_IRAQ 0x02 +# endif +# ifndef SUBLANG_ARABIC_EGYPT +# define SUBLANG_ARABIC_EGYPT 0x03 +# endif +# ifndef SUBLANG_ARABIC_LIBYA +# define SUBLANG_ARABIC_LIBYA 0x04 +# endif +# ifndef SUBLANG_ARABIC_ALGERIA +# define SUBLANG_ARABIC_ALGERIA 0x05 +# endif +# ifndef SUBLANG_ARABIC_MOROCCO +# define SUBLANG_ARABIC_MOROCCO 0x06 +# endif +# ifndef SUBLANG_ARABIC_TUNISIA +# define SUBLANG_ARABIC_TUNISIA 0x07 +# endif +# ifndef SUBLANG_ARABIC_OMAN +# define SUBLANG_ARABIC_OMAN 0x08 +# endif +# ifndef SUBLANG_ARABIC_YEMEN +# define SUBLANG_ARABIC_YEMEN 0x09 +# endif +# ifndef SUBLANG_ARABIC_SYRIA +# define SUBLANG_ARABIC_SYRIA 0x0a +# endif +# ifndef SUBLANG_ARABIC_JORDAN +# define SUBLANG_ARABIC_JORDAN 0x0b +# endif +# ifndef SUBLANG_ARABIC_LEBANON +# define SUBLANG_ARABIC_LEBANON 0x0c +# endif +# ifndef SUBLANG_ARABIC_KUWAIT +# define SUBLANG_ARABIC_KUWAIT 0x0d +# endif +# ifndef SUBLANG_ARABIC_UAE +# define SUBLANG_ARABIC_UAE 0x0e +# endif +# ifndef SUBLANG_ARABIC_BAHRAIN +# define SUBLANG_ARABIC_BAHRAIN 0x0f +# endif +# ifndef SUBLANG_ARABIC_QATAR +# define SUBLANG_ARABIC_QATAR 0x10 +# endif +# ifndef SUBLANG_AZERI_LATIN +# define SUBLANG_AZERI_LATIN 0x01 +# endif +# ifndef SUBLANG_AZERI_CYRILLIC +# define SUBLANG_AZERI_CYRILLIC 0x02 +# endif +# ifndef SUBLANG_CHINESE_MACAU +# define SUBLANG_CHINESE_MACAU 0x05 +# endif +# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA +# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 +# endif +# ifndef SUBLANG_ENGLISH_JAMAICA +# define SUBLANG_ENGLISH_JAMAICA 0x08 +# endif +# ifndef SUBLANG_ENGLISH_CARIBBEAN +# define SUBLANG_ENGLISH_CARIBBEAN 0x09 +# endif +# ifndef SUBLANG_ENGLISH_BELIZE +# define SUBLANG_ENGLISH_BELIZE 0x0a +# endif +# ifndef SUBLANG_ENGLISH_TRINIDAD +# define SUBLANG_ENGLISH_TRINIDAD 0x0b +# endif +# ifndef SUBLANG_ENGLISH_ZIMBABWE +# define SUBLANG_ENGLISH_ZIMBABWE 0x0c +# endif +# ifndef SUBLANG_ENGLISH_PHILIPPINES +# define SUBLANG_ENGLISH_PHILIPPINES 0x0d +# endif +# ifndef SUBLANG_FRENCH_LUXEMBOURG +# define SUBLANG_FRENCH_LUXEMBOURG 0x05 +# endif +# ifndef SUBLANG_FRENCH_MONACO +# define SUBLANG_FRENCH_MONACO 0x06 +# endif +# ifndef SUBLANG_GERMAN_LUXEMBOURG +# define SUBLANG_GERMAN_LUXEMBOURG 0x04 +# endif +# ifndef SUBLANG_GERMAN_LIECHTENSTEIN +# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 +# endif +# ifndef SUBLANG_KASHMIRI_INDIA +# define SUBLANG_KASHMIRI_INDIA 0x02 +# endif +# ifndef SUBLANG_MALAY_MALAYSIA +# define SUBLANG_MALAY_MALAYSIA 0x01 +# endif +# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM +# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 +# endif +# ifndef SUBLANG_NEPALI_INDIA +# define SUBLANG_NEPALI_INDIA 0x02 +# endif +# ifndef SUBLANG_SERBIAN_LATIN +# define SUBLANG_SERBIAN_LATIN 0x02 +# endif +# ifndef SUBLANG_SERBIAN_CYRILLIC +# define SUBLANG_SERBIAN_CYRILLIC 0x03 +# endif +# ifndef SUBLANG_SPANISH_GUATEMALA +# define SUBLANG_SPANISH_GUATEMALA 0x04 +# endif +# ifndef SUBLANG_SPANISH_COSTA_RICA +# define SUBLANG_SPANISH_COSTA_RICA 0x05 +# endif +# ifndef SUBLANG_SPANISH_PANAMA +# define SUBLANG_SPANISH_PANAMA 0x06 +# endif +# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC +# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 +# endif +# ifndef SUBLANG_SPANISH_VENEZUELA +# define SUBLANG_SPANISH_VENEZUELA 0x08 +# endif +# ifndef SUBLANG_SPANISH_COLOMBIA +# define SUBLANG_SPANISH_COLOMBIA 0x09 +# endif +# ifndef SUBLANG_SPANISH_PERU +# define SUBLANG_SPANISH_PERU 0x0a +# endif +# ifndef SUBLANG_SPANISH_ARGENTINA +# define SUBLANG_SPANISH_ARGENTINA 0x0b +# endif +# ifndef SUBLANG_SPANISH_ECUADOR +# define SUBLANG_SPANISH_ECUADOR 0x0c +# endif +# ifndef SUBLANG_SPANISH_CHILE +# define SUBLANG_SPANISH_CHILE 0x0d +# endif +# ifndef SUBLANG_SPANISH_URUGUAY +# define SUBLANG_SPANISH_URUGUAY 0x0e +# endif +# ifndef SUBLANG_SPANISH_PARAGUAY +# define SUBLANG_SPANISH_PARAGUAY 0x0f +# endif +# ifndef SUBLANG_SPANISH_BOLIVIA +# define SUBLANG_SPANISH_BOLIVIA 0x10 +# endif +# ifndef SUBLANG_SPANISH_EL_SALVADOR +# define SUBLANG_SPANISH_EL_SALVADOR 0x11 +# endif +# ifndef SUBLANG_SPANISH_HONDURAS +# define SUBLANG_SPANISH_HONDURAS 0x12 +# endif +# ifndef SUBLANG_SPANISH_NICARAGUA +# define SUBLANG_SPANISH_NICARAGUA 0x13 +# endif +# ifndef SUBLANG_SPANISH_PUERTO_RICO +# define SUBLANG_SPANISH_PUERTO_RICO 0x14 +# endif +# ifndef SUBLANG_SWEDISH_FINLAND +# define SUBLANG_SWEDISH_FINLAND 0x02 +# endif +# ifndef SUBLANG_URDU_PAKISTAN +# define SUBLANG_URDU_PAKISTAN 0x01 +# endif +# ifndef SUBLANG_URDU_INDIA +# define SUBLANG_URDU_INDIA 0x02 +# endif +# ifndef SUBLANG_UZBEK_LATIN +# define SUBLANG_UZBEK_LATIN 0x01 +# endif +# ifndef SUBLANG_UZBEK_CYRILLIC +# define SUBLANG_UZBEK_CYRILLIC 0x02 +# endif +#endif + +/* XPG3 defines the result of 'setlocale (category, NULL)' as: + "Directs 'setlocale()' to query 'category' and return the current + setting of 'local'." + However it does not specify the exact format. Neither do SUSV2 and + ISO C 99. So we can use this feature only on selected systems (e.g. + those using GNU C Library). */ +#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2) +# define HAVE_LOCALE_NULL +#endif + +/* Determine the current locale's name, and canonicalize it into XPG syntax + language[_territory[.codeset]][@modifier] + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ + +const char * +_nl_locale_name (category, categoryname) + int category; + const char *categoryname; +{ + const char *retval; + +#ifndef WIN32 + + /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. + On some systems this can be done by the 'setlocale' function itself. */ +# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL + retval = setlocale (category, NULL); +# else + /* Setting of LC_ALL overwrites all other. */ + retval = getenv ("LC_ALL"); + if (retval == NULL || retval[0] == '\0') + { + /* Next comes the name of the desired category. */ + retval = getenv (categoryname); + if (retval == NULL || retval[0] == '\0') + { + /* Last possibility is the LANG environment variable. */ + retval = getenv ("LANG"); + if (retval == NULL || retval[0] == '\0') + /* We use C as the default domain. POSIX says this is + implementation defined. */ + retval = "C"; + } + } +# endif + + return retval; + +#else /* WIN32 */ + + /* Return an XPG style locale name language[_territory][@modifier]. + Don't even bother determining the codeset; it's not useful in this + context, because message catalogs are not specific to a single + codeset. */ + + LCID lcid; + LANGID langid; + int primary, sub; + + /* Let the user override the system settings through environment + variables, as on POSIX systems. */ + retval = getenv ("LC_ALL"); + if (retval != NULL && retval[0] != '\0') + return retval; + retval = getenv (categoryname); + if (retval != NULL && retval[0] != '\0') + return retval; + retval = getenv ("LANG"); + if (retval != NULL && retval[0] != '\0') + return retval; + + /* Use native Win32 API locale ID. */ + lcid = GetThreadLocale (); + + /* Strip off the sorting rules, keep only the language part. */ + langid = LANGIDFROMLCID (lcid); + + /* Split into language and territory part. */ + primary = PRIMARYLANGID (langid); + sub = SUBLANGID (langid); + switch (primary) + { + case LANG_AFRIKAANS: return "af_ZA"; + case LANG_ALBANIAN: return "sq_AL"; + case LANG_ARABIC: + switch (sub) + { + case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; + case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; + case SUBLANG_ARABIC_EGYPT: return "ar_EG"; + case SUBLANG_ARABIC_LIBYA: return "ar_LY"; + case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; + case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; + case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; + case SUBLANG_ARABIC_OMAN: return "ar_OM"; + case SUBLANG_ARABIC_YEMEN: return "ar_YE"; + case SUBLANG_ARABIC_SYRIA: return "ar_SY"; + case SUBLANG_ARABIC_JORDAN: return "ar_JO"; + case SUBLANG_ARABIC_LEBANON: return "ar_LB"; + case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; + case SUBLANG_ARABIC_UAE: return "ar_AE"; + case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; + case SUBLANG_ARABIC_QATAR: return "ar_QA"; + } + return "ar"; + case LANG_ARMENIAN: return "hy_AM"; + case LANG_ASSAMESE: return "as_IN"; + case LANG_AZERI: + switch (sub) + { + /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ + case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; + case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; + } + return "az"; + case LANG_BASQUE: + return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ + case LANG_BELARUSIAN: return "be_BY"; + case LANG_BENGALI: return "bn_IN"; + case LANG_BULGARIAN: return "bg_BG"; + case LANG_CATALAN: return "ca_ES"; + case LANG_CHINESE: + switch (sub) + { + case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; + case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; + case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; + case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; + case SUBLANG_CHINESE_MACAU: return "zh_MO"; + } + return "zh"; + case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN + * What used to be called Serbo-Croatian + * should really now be two separate + * languages because of political reasons. + * (Says tml, who knows nothing about Serbian + * or Croatian.) + * (I can feel those flames coming already.) + */ + switch (sub) + { + /* FIXME: How to distinguish Croatian and Latin Serbian locales? */ + case SUBLANG_SERBIAN_LATIN: return "sr_YU"; + case SUBLANG_SERBIAN_CYRILLIC: return "sr_YU@cyrillic"; + default: return "hr_HR"; + } + case LANG_CZECH: return "cs_CZ"; + case LANG_DANISH: return "da_DK"; + case LANG_DUTCH: + switch (sub) + { + case SUBLANG_DUTCH: return "nl_NL"; + case SUBLANG_DUTCH_BELGIAN: return "nl_BE"; + } + return "nl"; + case LANG_ENGLISH: + switch (sub) + { + /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought + * English was the language spoken in England. + * Oh well. + */ + case SUBLANG_ENGLISH_US: return "en_US"; + case SUBLANG_ENGLISH_UK: return "en_GB"; + case SUBLANG_ENGLISH_AUS: return "en_AU"; + case SUBLANG_ENGLISH_CAN: return "en_CA"; + case SUBLANG_ENGLISH_NZ: return "en_NZ"; + case SUBLANG_ENGLISH_EIRE: return "en_IE"; + case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; + case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; + case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ + case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; + case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; + case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; + case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; + } + return "en"; + case LANG_ESTONIAN: return "et_EE"; + case LANG_FAEROESE: return "fo_FO"; + case LANG_FARSI: return "fa_IR"; + case LANG_FINNISH: return "fi_FI"; + case LANG_FRENCH: + switch (sub) + { + case SUBLANG_FRENCH: return "fr_FR"; + case SUBLANG_FRENCH_BELGIAN: return "fr_BE"; + case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; + case SUBLANG_FRENCH_SWISS: return "fr_CH"; + case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; + case SUBLANG_FRENCH_MONACO: return "fr_MC"; + } + return "fr"; + case LANG_GEORGIAN: return "ka_GE"; + case LANG_GERMAN: + switch (sub) + { + case SUBLANG_GERMAN: return "de_DE"; + case SUBLANG_GERMAN_SWISS: return "de_CH"; + case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; + case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; + case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; + } + return "de"; + case LANG_GREEK: return "el_GR"; + case LANG_GUJARATI: return "gu_IN"; + case LANG_HEBREW: return "he_IL"; + case LANG_HINDI: return "hi_IN"; + case LANG_HUNGARIAN: return "hu_HU"; + case LANG_ICELANDIC: return "is_IS"; + case LANG_INDONESIAN: return "id_ID"; + case LANG_ITALIAN: + switch (sub) + { + case SUBLANG_ITALIAN: return "it_IT"; + case SUBLANG_ITALIAN_SWISS: return "it_CH"; + } + return "it"; + case LANG_JAPANESE: return "ja_JP"; + case LANG_KANNADA: return "kn_IN"; + case LANG_KASHMIRI: + switch (sub) + { + case SUBLANG_DEFAULT: return "ks_PK"; + case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; + } + return "ks"; + case LANG_KAZAK: return "kk_KZ"; + case LANG_KONKANI: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "kok_IN"; + case LANG_KOREAN: return "ko_KR"; + case LANG_LATVIAN: return "lv_LV"; + case LANG_LITHUANIAN: return "lt_LT"; + case LANG_MACEDONIAN: return "mk_MK"; + case LANG_MALAY: + switch (sub) + { + case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; + case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; + } + return "ms"; + case LANG_MALAYALAM: return "ml_IN"; + case LANG_MANIPURI: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "mni_IN"; + case LANG_MARATHI: return "mr_IN"; + case LANG_NEPALI: + switch (sub) + { + case SUBLANG_DEFAULT: return "ne_NP"; + case SUBLANG_NEPALI_INDIA: return "ne_IN"; + } + return "ne"; + case LANG_NORWEGIAN: + switch (sub) + { + case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO"; + case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; + } + return "no"; + case LANG_ORIYA: return "or_IN"; + case LANG_POLISH: return "pl_PL"; + case LANG_PORTUGUESE: + switch (sub) + { + case SUBLANG_PORTUGUESE: return "pt_PT"; + /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. + Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ + case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; + } + return "pt"; + case LANG_PUNJABI: return "pa_IN"; + case LANG_ROMANIAN: return "ro_RO"; + case LANG_RUSSIAN: + return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA". */ + case LANG_SANSKRIT: return "sa_IN"; + case LANG_SINDHI: return "sd"; + case LANG_SLOVAK: return "sk_SK"; + case LANG_SLOVENIAN: return "sl_SI"; + case LANG_SORBIAN: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "wen_DE"; + case LANG_SPANISH: + switch (sub) + { + case SUBLANG_SPANISH: return "es_ES"; + case SUBLANG_SPANISH_MEXICAN: return "es_MX"; + case SUBLANG_SPANISH_MODERN: + return "es_ES@modern"; /* not seen on Unix */ + case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; + case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; + case SUBLANG_SPANISH_PANAMA: return "es_PA"; + case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; + case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; + case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; + case SUBLANG_SPANISH_PERU: return "es_PE"; + case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; + case SUBLANG_SPANISH_ECUADOR: return "es_EC"; + case SUBLANG_SPANISH_CHILE: return "es_CL"; + case SUBLANG_SPANISH_URUGUAY: return "es_UY"; + case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; + case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; + case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; + case SUBLANG_SPANISH_HONDURAS: return "es_HN"; + case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; + case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; + } + return "es"; + case LANG_SWAHILI: return "sw"; + case LANG_SWEDISH: + switch (sub) + { + case SUBLANG_DEFAULT: return "sv_SE"; + case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; + } + return "sv"; + case LANG_TAMIL: + return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ + case LANG_TATAR: return "tt"; + case LANG_TELUGU: return "te_IN"; + case LANG_THAI: return "th_TH"; + case LANG_TURKISH: return "tr_TR"; + case LANG_UKRAINIAN: return "uk_UA"; + case LANG_URDU: + switch (sub) + { + case SUBLANG_URDU_PAKISTAN: return "ur_PK"; + case SUBLANG_URDU_INDIA: return "ur_IN"; + } + return "ur"; + case LANG_UZBEK: + switch (sub) + { + /* FIXME: Adjust this when Uzbek locales appear on Unix. */ + case SUBLANG_UZBEK_LATIN: return "uz_UZ@latin"; + case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; + } + return "uz"; + case LANG_VIETNAMESE: return "vi_VN"; + default: return "C"; + } + +#endif +} diff --git a/src/apps/bin/grep-2.5/intl/localename.o b/src/apps/bin/grep-2.5/intl/localename.o new file mode 100644 index 0000000000..2758cfc219 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/localename.o differ diff --git a/src/apps/bin/grep-2.5/intl/ngettext.c b/src/apps/bin/grep-2.5/intl/ngettext.c new file mode 100644 index 0000000000..fb3ec5a91e --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/ngettext.c @@ -0,0 +1,68 @@ +/* Implementation of ngettext(3) function. + Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define __need_NULL +# include +#else +# include /* Just for NULL. */ +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +#include + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define NGETTEXT __ngettext +# define DCNGETTEXT __dcngettext +#else +# define NGETTEXT ngettext__ +# define DCNGETTEXT dcngettext__ +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +char * +NGETTEXT (msgid1, msgid2, n) + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__ngettext, ngettext); +#endif diff --git a/src/apps/bin/grep-2.5/intl/ngettext.o b/src/apps/bin/grep-2.5/intl/ngettext.o new file mode 100644 index 0000000000..be3a098dfe Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/ngettext.o differ diff --git a/src/apps/bin/grep-2.5/intl/os2compat.c b/src/apps/bin/grep-2.5/intl/os2compat.c new file mode 100644 index 0000000000..5959ef5c09 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/os2compat.c @@ -0,0 +1,109 @@ +/* OS/2 compatibility functions. + Copyright (C) 2001-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#define OS2_AWARE +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +/* A version of getenv() that works from DLLs */ +extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); + +char * +_nl_getenv (const char *name) +{ + unsigned char *value; + if (DosScanEnv (name, &value)) + return NULL; + else + return value; +} + +char _nl_default_dirname[] = /* a 260+1 bytes large buffer */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0" +#define LOCALEDIR_MAX 260 + +char *_os2_libdir = NULL; +char *_os2_localealiaspath = NULL; +char *_os2_localedir = NULL; + +static __attribute__((constructor)) void +os2_initialize () +{ + char *root = getenv ("UNIXROOT"); + char *gnulocaledir = getenv ("GNULOCALEDIR"); + + _os2_libdir = gnulocaledir; + if (!_os2_libdir) + { + if (root) + { + size_t sl = strlen (root); + _os2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); + memcpy (_os2_libdir, root, sl); + memcpy (_os2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); + } + else + _os2_libdir = LIBDIR; + } + + _os2_localealiaspath = gnulocaledir; + if (!_os2_localealiaspath) + { + if (root) + { + size_t sl = strlen (root); + _os2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); + memcpy (_os2_localealiaspath, root, sl); + memcpy (_os2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); + } + else + _os2_localealiaspath = LOCALE_ALIAS_PATH; + } + + _os2_localedir = gnulocaledir; + if (!_os2_localedir) + { + if (root) + { + size_t sl = strlen (root); + _os2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); + memcpy (_os2_localedir, root, sl); + memcpy (_os2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); + } + else + _os2_localedir = LOCALEDIR; + } + + { + extern const char _nl_default_dirname__[]; + if (strlen (_os2_localedir) <= LOCALEDIR_MAX) + strcpy (_nl_default_dirname__, _os2_localedir); + } +} diff --git a/src/apps/bin/grep-2.5/intl/os2compat.h b/src/apps/bin/grep-2.5/intl/os2compat.h new file mode 100644 index 0000000000..3605e7a366 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/os2compat.h @@ -0,0 +1,46 @@ +/* OS/2 compatibility defines. + This file is intended to be included from config.h + Copyright (C) 2001-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* When included from os2compat.h we need all the original definitions */ +#ifndef OS2_AWARE + +#undef LIBDIR +#define LIBDIR _os2_libdir +extern char *_os2_libdir; + +#undef LOCALEDIR +#define LOCALEDIR _os2_localedir +extern char *_os2_localedir; + +#undef LOCALE_ALIAS_PATH +#define LOCALE_ALIAS_PATH _os2_localealiaspath +extern char *_os2_localealiaspath; + +#endif + +#undef HAVE_STRCASECMP +#define HAVE_STRCASECMP 1 +#define strcasecmp stricmp +#define strncasecmp strnicmp + +/* We have our own getenv() which works even if library is compiled as DLL */ +#define getenv _nl_getenv + +/* Older versions of gettext used -1 as the value of LC_MESSAGES */ +#define LC_MESSAGES_COMPAT (-1) diff --git a/src/apps/bin/grep-2.5/intl/osdep.c b/src/apps/bin/grep-2.5/intl/osdep.c new file mode 100644 index 0000000000..b372598381 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/osdep.c @@ -0,0 +1,24 @@ +/* OS dependent parts of libintl. + Copyright (C) 2001-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#if defined __EMX__ +# include "os2compat.c" +#else +/* Avoid AIX compiler warning. */ +typedef int dummy; +#endif diff --git a/src/apps/bin/grep-2.5/intl/osdep.o b/src/apps/bin/grep-2.5/intl/osdep.o new file mode 100644 index 0000000000..9d6a6f680c Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/osdep.o differ diff --git a/src/apps/bin/grep-2.5/intl/plural-exp.c b/src/apps/bin/grep-2.5/intl/plural-exp.c new file mode 100644 index 0000000000..c937c011ac --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/plural-exp.c @@ -0,0 +1,156 @@ +/* Expression parsing for plural form selection. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include "plural-exp.h" + +#if (defined __GNUC__ && !defined __APPLE_CC__) \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) + +/* These structs are the constant expression for the germanic plural + form determination. It represents the expression "n != 1". */ +static const struct expression plvar = +{ + .nargs = 0, + .operation = var, +}; +static const struct expression plone = +{ + .nargs = 0, + .operation = num, + .val = + { + .num = 1 + } +}; +struct expression GERMANIC_PLURAL = +{ + .nargs = 2, + .operation = not_equal, + .val = + { + .args = + { + [0] = (struct expression *) &plvar, + [1] = (struct expression *) &plone + } + } +}; + +# define INIT_GERMANIC_PLURAL() + +#else + +/* For compilers without support for ISO C 99 struct/union initializers: + Initialization at run-time. */ + +static struct expression plvar; +static struct expression plone; +struct expression GERMANIC_PLURAL; + +static void +init_germanic_plural () +{ + if (plone.val.num == 0) + { + plvar.nargs = 0; + plvar.operation = var; + + plone.nargs = 0; + plone.operation = num; + plone.val.num = 1; + + GERMANIC_PLURAL.nargs = 2; + GERMANIC_PLURAL.operation = not_equal; + GERMANIC_PLURAL.val.args[0] = &plvar; + GERMANIC_PLURAL.val.args[1] = &plone; + } +} + +# define INIT_GERMANIC_PLURAL() init_germanic_plural () + +#endif + +void +internal_function +EXTRACT_PLURAL_EXPRESSION (nullentry, pluralp, npluralsp) + const char *nullentry; + struct expression **pluralp; + unsigned long int *npluralsp; +{ + if (nullentry != NULL) + { + const char *plural; + const char *nplurals; + + plural = strstr (nullentry, "plural="); + nplurals = strstr (nullentry, "nplurals="); + if (plural == NULL || nplurals == NULL) + goto no_plural; + else + { + char *endp; + unsigned long int n; + struct parse_args args; + + /* First get the number. */ + nplurals += 9; + while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) + ++nplurals; + if (!(*nplurals >= '0' && *nplurals <= '9')) + goto no_plural; +#if defined HAVE_STRTOUL || defined _LIBC + n = strtoul (nplurals, &endp, 10); +#else + for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) + n = n * 10 + (*endp - '0'); +#endif + if (nplurals == endp) + goto no_plural; + *npluralsp = n; + + /* Due to the restrictions bison imposes onto the interface of the + scanner function we have to put the input string and the result + passed up from the parser into the same structure which address + is passed down to the parser. */ + plural += 7; + args.cp = plural; + if (PLURAL_PARSE (&args) != 0) + goto no_plural; + *pluralp = args.res; + } + } + else + { + /* By default we are using the Germanic form: singular form only + for `one', the plural form otherwise. Yes, this is also what + English is using since English is a Germanic language. */ + no_plural: + INIT_GERMANIC_PLURAL (); + *pluralp = &GERMANIC_PLURAL; + *npluralsp = 2; + } +} diff --git a/src/apps/bin/grep-2.5/intl/plural-exp.h b/src/apps/bin/grep-2.5/intl/plural-exp.h new file mode 100644 index 0000000000..6a4bba0193 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/plural-exp.h @@ -0,0 +1,122 @@ +/* Expression parsing and evaluation for plural form selection. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _PLURAL_EXP_H +#define _PLURAL_EXP_H + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif +#endif + +#ifndef internal_function +# define internal_function +#endif + + +/* This is the representation of the expressions to determine the + plural form. */ +struct expression +{ + int nargs; /* Number of arguments. */ + enum operator + { + /* Without arguments: */ + var, /* The variable "n". */ + num, /* Decimal number. */ + /* Unary operators: */ + lnot, /* Logical NOT. */ + /* Binary operators: */ + mult, /* Multiplication. */ + divide, /* Division. */ + module, /* Modulo operation. */ + plus, /* Addition. */ + minus, /* Subtraction. */ + less_than, /* Comparison. */ + greater_than, /* Comparison. */ + less_or_equal, /* Comparison. */ + greater_or_equal, /* Comparison. */ + equal, /* Comparison for equality. */ + not_equal, /* Comparison for inequality. */ + land, /* Logical AND. */ + lor, /* Logical OR. */ + /* Ternary operators: */ + qmop /* Question mark operator. */ + } operation; + union + { + unsigned long int num; /* Number value for `num'. */ + struct expression *args[3]; /* Up to three arguments. */ + } val; +}; + +/* This is the data structure to pass information to the parser and get + the result in a thread-safe way. */ +struct parse_args +{ + const char *cp; + struct expression *res; +}; + + +/* Names for the libintl functions are a problem. This source code is used + 1. in the GNU C Library library, + 2. in the GNU libintl library, + 3. in the GNU gettext tools. + The function names in each situation must be different, to allow for + binary incompatible changes in 'struct expression'. Furthermore, + 1. in the GNU C Library library, the names have a __ prefix, + 2.+3. in the GNU libintl library and in the GNU gettext tools, the names + must follow ANSI C and not start with __. + So we have to distinguish the three cases. */ +#ifdef _LIBC +# define FREE_EXPRESSION __gettext_free_exp +# define PLURAL_PARSE __gettextparse +# define GERMANIC_PLURAL __gettext_germanic_plural +# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural +#elif defined (IN_LIBINTL) +# define FREE_EXPRESSION gettext_free_exp__ +# define PLURAL_PARSE gettextparse__ +# define GERMANIC_PLURAL gettext_germanic_plural__ +# define EXTRACT_PLURAL_EXPRESSION gettext_extract_plural__ +#else +# define FREE_EXPRESSION free_plural_expression +# define PLURAL_PARSE parse_plural_expression +# define GERMANIC_PLURAL germanic_plural +# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression +#endif + +extern void FREE_EXPRESSION PARAMS ((struct expression *exp)) + internal_function; +extern int PLURAL_PARSE PARAMS ((void *arg)); +extern struct expression GERMANIC_PLURAL; +extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry, + struct expression **pluralp, + unsigned long int *npluralsp)) + internal_function; + +#if !defined (_LIBC) && !defined (IN_LIBINTL) +extern unsigned long int plural_eval PARAMS ((struct expression *pexp, + unsigned long int n)); +#endif + +#endif /* _PLURAL_EXP_H */ diff --git a/src/apps/bin/grep-2.5/intl/plural-exp.o b/src/apps/bin/grep-2.5/intl/plural-exp.o new file mode 100644 index 0000000000..6c31fb3c08 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/plural-exp.o differ diff --git a/src/apps/bin/grep-2.5/intl/plural.c b/src/apps/bin/grep-2.5/intl/plural.c new file mode 100644 index 0000000000..c9ff63fbdb --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/plural.c @@ -0,0 +1,1322 @@ + +/* A Bison parser, made from plural.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define yyparse __gettextparse +#define yylex __gettextlex +#define yyerror __gettexterror +#define yylval __gettextlval +#define yychar __gettextchar +#define yydebug __gettextdebug +#define yynerrs __gettextnerrs +#define EQUOP2 257 +#define CMPOP2 258 +#define ADDOP2 259 +#define MULOP2 260 +#define NUMBER 261 + +#line 1 "plural.y" + +/* Expression parsing for plural form selection. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* The bison generated parser uses alloca. AIX 3 forces us to put this + declaration at the beginning of the file. The declaration in bison's + skeleton file comes too late. This must come before + because may include arbitrary system headers. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "plural-exp.h" + +/* The main function generated by the parser is called __gettextparse, + but we want it to be called PLURAL_PARSE. */ +#ifndef _LIBC +# define __gettextparse PLURAL_PARSE +#endif + +#define YYLEX_PARAM &((struct parse_args *) arg)->cp +#define YYPARSE_PARAM arg + +#line 49 "plural.y" +typedef union { + unsigned long int num; + enum operator op; + struct expression *exp; +} YYSTYPE; +#line 55 "plural.y" + +/* Prototypes for local functions. */ +static struct expression *new_exp PARAMS ((int nargs, enum operator op, + struct expression * const *args)); +static inline struct expression *new_exp_0 PARAMS ((enum operator op)); +static inline struct expression *new_exp_1 PARAMS ((enum operator op, + struct expression *right)); +static struct expression *new_exp_2 PARAMS ((enum operator op, + struct expression *left, + struct expression *right)); +static inline struct expression *new_exp_3 PARAMS ((enum operator op, + struct expression *bexp, + struct expression *tbranch, + struct expression *fbranch)); +static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); +static void yyerror PARAMS ((const char *str)); + +/* Allocation of expressions. */ + +static struct expression * +new_exp (nargs, op, args) + int nargs; + enum operator op; + struct expression * const *args; +{ + int i; + struct expression *newp; + + /* If any of the argument could not be malloc'ed, just return NULL. */ + for (i = nargs - 1; i >= 0; i--) + if (args[i] == NULL) + goto fail; + + /* Allocate a new expression. */ + newp = (struct expression *) malloc (sizeof (*newp)); + if (newp != NULL) + { + newp->nargs = nargs; + newp->operation = op; + for (i = nargs - 1; i >= 0; i--) + newp->val.args[i] = args[i]; + return newp; + } + + fail: + for (i = nargs - 1; i >= 0; i--) + FREE_EXPRESSION (args[i]); + + return NULL; +} + +static inline struct expression * +new_exp_0 (op) + enum operator op; +{ + return new_exp (0, op, NULL); +} + +static inline struct expression * +new_exp_1 (op, right) + enum operator op; + struct expression *right; +{ + struct expression *args[1]; + + args[0] = right; + return new_exp (1, op, args); +} + +static struct expression * +new_exp_2 (op, left, right) + enum operator op; + struct expression *left; + struct expression *right; +{ + struct expression *args[2]; + + args[0] = left; + args[1] = right; + return new_exp (2, op, args); +} + +static inline struct expression * +new_exp_3 (op, bexp, tbranch, fbranch) + enum operator op; + struct expression *bexp; + struct expression *tbranch; + struct expression *fbranch; +{ + struct expression *args[3]; + + args[0] = bexp; + args[1] = tbranch; + args[2] = fbranch; + return new_exp (3, op, args); +} + +#include + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 27 +#define YYFLAG -32768 +#define YYNTBASE 16 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 10, 2, 2, 2, 2, 5, 2, 14, + 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 12, 2, 2, + 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 6, 7, 8, 9, + 11 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 8, 12, 16, 20, 24, 28, 32, 35, + 37, 39 +}; + +static const short yyrhs[] = { 17, + 0, 17, 3, 17, 12, 17, 0, 17, 4, 17, + 0, 17, 5, 17, 0, 17, 6, 17, 0, 17, + 7, 17, 0, 17, 8, 17, 0, 17, 9, 17, + 0, 10, 17, 0, 13, 0, 11, 0, 14, 17, + 15, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 174, 182, 186, 190, 194, 198, 202, 206, 210, 214, + 218, 223 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","'?'","'|'", +"'&'","EQUOP2","CMPOP2","ADDOP2","MULOP2","'!'","NUMBER","':'","'n'","'('","')'", +"start","exp", NULL +}; +#endif + +static const short yyr1[] = { 0, + 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17 +}; + +static const short yyr2[] = { 0, + 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, + 1, 3 +}; + +static const short yydefact[] = { 0, + 0, 11, 10, 0, 1, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 12, 0, 3, 4, 5, 6, + 7, 8, 0, 2, 0, 0, 0 +}; + +static const short yydefgoto[] = { 25, + 5 +}; + +static const short yypact[] = { -9, + -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9, + -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26, + -3,-32768, -9, 34, 21, 53,-32768 +}; + +static const short yypgoto[] = {-32768, + -1 +}; + + +#define YYLAST 53 + + +static const short yytable[] = { 6, + 1, 2, 7, 3, 4, 14, 16, 17, 18, 19, + 20, 21, 22, 8, 9, 10, 11, 12, 13, 14, + 26, 24, 12, 13, 14, 15, 8, 9, 10, 11, + 12, 13, 14, 13, 14, 23, 8, 9, 10, 11, + 12, 13, 14, 10, 11, 12, 13, 14, 11, 12, + 13, 14, 27 +}; + +static const short yycheck[] = { 1, + 10, 11, 4, 13, 14, 9, 8, 9, 10, 11, + 12, 13, 14, 3, 4, 5, 6, 7, 8, 9, + 0, 23, 7, 8, 9, 15, 3, 4, 5, 6, + 7, 8, 9, 8, 9, 12, 3, 4, 5, 6, + 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, + 8, 9, 0 +}; +#define YYPURE 1 + +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/local/share/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/local/share/bison.simple" + +/* 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. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 1: +#line 175 "plural.y" +{ + if (yyvsp[0].exp == NULL) + YYABORT; + ((struct parse_args *) arg)->res = yyvsp[0].exp; + ; + break;} +case 2: +#line 183 "plural.y" +{ + yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp); + ; + break;} +case 3: +#line 187 "plural.y" +{ + yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp); + ; + break;} +case 4: +#line 191 "plural.y" +{ + yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp); + ; + break;} +case 5: +#line 195 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + ; + break;} +case 6: +#line 199 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + ; + break;} +case 7: +#line 203 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + ; + break;} +case 8: +#line 207 "plural.y" +{ + yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); + ; + break;} +case 9: +#line 211 "plural.y" +{ + yyval.exp = new_exp_1 (lnot, yyvsp[0].exp); + ; + break;} +case 10: +#line 215 "plural.y" +{ + yyval.exp = new_exp_0 (var); + ; + break;} +case 11: +#line 219 "plural.y" +{ + if ((yyval.exp = new_exp_0 (num)) != NULL) + yyval.exp->val.num = yyvsp[0].num; + ; + break;} +case 12: +#line 224 "plural.y" +{ + yyval.exp = yyvsp[-1].exp; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/local/share/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 229 "plural.y" + + +void +internal_function +FREE_EXPRESSION (exp) + struct expression *exp; +{ + if (exp == NULL) + return; + + /* Handle the recursive case. */ + switch (exp->nargs) + { + case 3: + FREE_EXPRESSION (exp->val.args[2]); + /* FALLTHROUGH */ + case 2: + FREE_EXPRESSION (exp->val.args[1]); + /* FALLTHROUGH */ + case 1: + FREE_EXPRESSION (exp->val.args[0]); + /* FALLTHROUGH */ + default: + break; + } + + free (exp); +} + + +static int +yylex (lval, pexp) + YYSTYPE *lval; + const char **pexp; +{ + const char *exp = *pexp; + int result; + + while (1) + { + if (exp[0] == '\0') + { + *pexp = exp; + return YYEOF; + } + + if (exp[0] != ' ' && exp[0] != '\t') + break; + + ++exp; + } + + result = *exp++; + switch (result) + { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + unsigned long int n = result - '0'; + while (exp[0] >= '0' && exp[0] <= '9') + { + n *= 10; + n += exp[0] - '0'; + ++exp; + } + lval->num = n; + result = NUMBER; + } + break; + + case '=': + if (exp[0] == '=') + { + ++exp; + lval->op = equal; + result = EQUOP2; + } + else + result = YYERRCODE; + break; + + case '!': + if (exp[0] == '=') + { + ++exp; + lval->op = not_equal; + result = EQUOP2; + } + break; + + case '&': + case '|': + if (exp[0] == result) + ++exp; + else + result = YYERRCODE; + break; + + case '<': + if (exp[0] == '=') + { + ++exp; + lval->op = less_or_equal; + } + else + lval->op = less_than; + result = CMPOP2; + break; + + case '>': + if (exp[0] == '=') + { + ++exp; + lval->op = greater_or_equal; + } + else + lval->op = greater_than; + result = CMPOP2; + break; + + case '*': + lval->op = mult; + result = MULOP2; + break; + + case '/': + lval->op = divide; + result = MULOP2; + break; + + case '%': + lval->op = module; + result = MULOP2; + break; + + case '+': + lval->op = plus; + result = ADDOP2; + break; + + case '-': + lval->op = minus; + result = ADDOP2; + break; + + case 'n': + case '?': + case ':': + case '(': + case ')': + /* Nothing, just return the character. */ + break; + + case ';': + case '\n': + case '\0': + /* Be safe and let the user call this function again. */ + --exp; + result = YYEOF; + break; + + default: + result = YYERRCODE; +#if YYDEBUG != 0 + --exp; +#endif + break; + } + + *pexp = exp; + + return result; +} + + +static void +yyerror (str) + const char *str; +{ + /* Do nothing. We don't print error messages here. */ +} diff --git a/src/apps/bin/grep-2.5/intl/plural.o b/src/apps/bin/grep-2.5/intl/plural.o new file mode 100644 index 0000000000..202e79a953 Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/plural.o differ diff --git a/src/apps/bin/grep-2.5/intl/plural.y b/src/apps/bin/grep-2.5/intl/plural.y new file mode 100644 index 0000000000..616b7c11a2 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/plural.y @@ -0,0 +1,409 @@ +%{ +/* Expression parsing for plural form selection. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* The bison generated parser uses alloca. AIX 3 forces us to put this + declaration at the beginning of the file. The declaration in bison's + skeleton file comes too late. This must come before + because may include arbitrary system headers. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "plural-exp.h" + +/* The main function generated by the parser is called __gettextparse, + but we want it to be called PLURAL_PARSE. */ +#ifndef _LIBC +# define __gettextparse PLURAL_PARSE +#endif + +#define YYLEX_PARAM &((struct parse_args *) arg)->cp +#define YYPARSE_PARAM arg +%} +%pure_parser +%expect 7 + +%union { + unsigned long int num; + enum operator op; + struct expression *exp; +} + +%{ +/* Prototypes for local functions. */ +static struct expression *new_exp PARAMS ((int nargs, enum operator op, + struct expression * const *args)); +static inline struct expression *new_exp_0 PARAMS ((enum operator op)); +static inline struct expression *new_exp_1 PARAMS ((enum operator op, + struct expression *right)); +static struct expression *new_exp_2 PARAMS ((enum operator op, + struct expression *left, + struct expression *right)); +static inline struct expression *new_exp_3 PARAMS ((enum operator op, + struct expression *bexp, + struct expression *tbranch, + struct expression *fbranch)); +static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); +static void yyerror PARAMS ((const char *str)); + +/* Allocation of expressions. */ + +static struct expression * +new_exp (nargs, op, args) + int nargs; + enum operator op; + struct expression * const *args; +{ + int i; + struct expression *newp; + + /* If any of the argument could not be malloc'ed, just return NULL. */ + for (i = nargs - 1; i >= 0; i--) + if (args[i] == NULL) + goto fail; + + /* Allocate a new expression. */ + newp = (struct expression *) malloc (sizeof (*newp)); + if (newp != NULL) + { + newp->nargs = nargs; + newp->operation = op; + for (i = nargs - 1; i >= 0; i--) + newp->val.args[i] = args[i]; + return newp; + } + + fail: + for (i = nargs - 1; i >= 0; i--) + FREE_EXPRESSION (args[i]); + + return NULL; +} + +static inline struct expression * +new_exp_0 (op) + enum operator op; +{ + return new_exp (0, op, NULL); +} + +static inline struct expression * +new_exp_1 (op, right) + enum operator op; + struct expression *right; +{ + struct expression *args[1]; + + args[0] = right; + return new_exp (1, op, args); +} + +static struct expression * +new_exp_2 (op, left, right) + enum operator op; + struct expression *left; + struct expression *right; +{ + struct expression *args[2]; + + args[0] = left; + args[1] = right; + return new_exp (2, op, args); +} + +static inline struct expression * +new_exp_3 (op, bexp, tbranch, fbranch) + enum operator op; + struct expression *bexp; + struct expression *tbranch; + struct expression *fbranch; +{ + struct expression *args[3]; + + args[0] = bexp; + args[1] = tbranch; + args[2] = fbranch; + return new_exp (3, op, args); +} + +%} + +/* This declares that all operators have the same associativity and the + precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. + There is no unary minus and no bitwise operators. + Operators with the same syntactic behaviour have been merged into a single + token, to save space in the array generated by bison. */ +%right '?' /* ? */ +%left '|' /* || */ +%left '&' /* && */ +%left EQUOP2 /* == != */ +%left CMPOP2 /* < > <= >= */ +%left ADDOP2 /* + - */ +%left MULOP2 /* * / % */ +%right '!' /* ! */ + +%token EQUOP2 CMPOP2 ADDOP2 MULOP2 +%token NUMBER +%type exp + +%% + +start: exp + { + if ($1 == NULL) + YYABORT; + ((struct parse_args *) arg)->res = $1; + } + ; + +exp: exp '?' exp ':' exp + { + $$ = new_exp_3 (qmop, $1, $3, $5); + } + | exp '|' exp + { + $$ = new_exp_2 (lor, $1, $3); + } + | exp '&' exp + { + $$ = new_exp_2 (land, $1, $3); + } + | exp EQUOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp CMPOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp ADDOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp MULOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | '!' exp + { + $$ = new_exp_1 (lnot, $2); + } + | 'n' + { + $$ = new_exp_0 (var); + } + | NUMBER + { + if (($$ = new_exp_0 (num)) != NULL) + $$->val.num = $1; + } + | '(' exp ')' + { + $$ = $2; + } + ; + +%% + +void +internal_function +FREE_EXPRESSION (exp) + struct expression *exp; +{ + if (exp == NULL) + return; + + /* Handle the recursive case. */ + switch (exp->nargs) + { + case 3: + FREE_EXPRESSION (exp->val.args[2]); + /* FALLTHROUGH */ + case 2: + FREE_EXPRESSION (exp->val.args[1]); + /* FALLTHROUGH */ + case 1: + FREE_EXPRESSION (exp->val.args[0]); + /* FALLTHROUGH */ + default: + break; + } + + free (exp); +} + + +static int +yylex (lval, pexp) + YYSTYPE *lval; + const char **pexp; +{ + const char *exp = *pexp; + int result; + + while (1) + { + if (exp[0] == '\0') + { + *pexp = exp; + return YYEOF; + } + + if (exp[0] != ' ' && exp[0] != '\t') + break; + + ++exp; + } + + result = *exp++; + switch (result) + { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + unsigned long int n = result - '0'; + while (exp[0] >= '0' && exp[0] <= '9') + { + n *= 10; + n += exp[0] - '0'; + ++exp; + } + lval->num = n; + result = NUMBER; + } + break; + + case '=': + if (exp[0] == '=') + { + ++exp; + lval->op = equal; + result = EQUOP2; + } + else + result = YYERRCODE; + break; + + case '!': + if (exp[0] == '=') + { + ++exp; + lval->op = not_equal; + result = EQUOP2; + } + break; + + case '&': + case '|': + if (exp[0] == result) + ++exp; + else + result = YYERRCODE; + break; + + case '<': + if (exp[0] == '=') + { + ++exp; + lval->op = less_or_equal; + } + else + lval->op = less_than; + result = CMPOP2; + break; + + case '>': + if (exp[0] == '=') + { + ++exp; + lval->op = greater_or_equal; + } + else + lval->op = greater_than; + result = CMPOP2; + break; + + case '*': + lval->op = mult; + result = MULOP2; + break; + + case '/': + lval->op = divide; + result = MULOP2; + break; + + case '%': + lval->op = module; + result = MULOP2; + break; + + case '+': + lval->op = plus; + result = ADDOP2; + break; + + case '-': + lval->op = minus; + result = ADDOP2; + break; + + case 'n': + case '?': + case ':': + case '(': + case ')': + /* Nothing, just return the character. */ + break; + + case ';': + case '\n': + case '\0': + /* Be safe and let the user call this function again. */ + --exp; + result = YYEOF; + break; + + default: + result = YYERRCODE; +#if YYDEBUG != 0 + --exp; +#endif + break; + } + + *pexp = exp; + + return result; +} + + +static void +yyerror (str) + const char *str; +{ + /* Do nothing. We don't print error messages here. */ +} diff --git a/src/apps/bin/grep-2.5/intl/ref-add.sed b/src/apps/bin/grep-2.5/intl/ref-add.sed new file mode 100644 index 0000000000..e7cc4dae4b --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/ref-add.sed @@ -0,0 +1,10 @@ +/^# Packages using this file: / { + s/# Packages using this file:// + ta + :a + s/ grep / grep / + tb + s/ $/ grep / + :b + s/^/# Packages using this file:/ +} diff --git a/src/apps/bin/grep-2.5/intl/ref-add.sin b/src/apps/bin/grep-2.5/intl/ref-add.sin new file mode 100644 index 0000000000..167374e3c5 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/ref-add.sin @@ -0,0 +1,31 @@ +# Add this package to a list of references stored in a text file. +# +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# +# Written by Bruno Haible . +# +/^# Packages using this file: / { + s/# Packages using this file:// + ta + :a + s/ @PACKAGE@ / @PACKAGE@ / + tb + s/ $/ @PACKAGE@ / + :b + s/^/# Packages using this file:/ +} diff --git a/src/apps/bin/grep-2.5/intl/ref-del.sed b/src/apps/bin/grep-2.5/intl/ref-del.sed new file mode 100644 index 0000000000..c3529c59b3 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/ref-del.sed @@ -0,0 +1,5 @@ +/^# Packages using this file: / { + s/# Packages using this file:// + s/ grep / / + s/^/# Packages using this file:/ +} diff --git a/src/apps/bin/grep-2.5/intl/ref-del.sin b/src/apps/bin/grep-2.5/intl/ref-del.sin new file mode 100644 index 0000000000..613cf37f3b --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/ref-del.sin @@ -0,0 +1,26 @@ +# Remove this package from a list of references stored in a text file. +# +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# +# Written by Bruno Haible . +# +/^# Packages using this file: / { + s/# Packages using this file:// + s/ @PACKAGE@ / / + s/^/# Packages using this file:/ +} diff --git a/src/apps/bin/grep-2.5/intl/textdomain.c b/src/apps/bin/grep-2.5/intl/textdomain.c new file mode 100644 index 0000000000..2e420ad772 --- /dev/null +++ b/src/apps/bin/grep-2.5/intl/textdomain.c @@ -0,0 +1,142 @@ +/* Implementation of the textdomain(3) function. + Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "gettextP.h" + +#ifdef _LIBC +/* We have to handle multi-threaded applications. */ +# include +#else +/* Provide dummy implementation if this is outside glibc. */ +# define __libc_rwlock_define(CLASS, NAME) +# define __libc_rwlock_wrlock(NAME) +# define __libc_rwlock_unlock(NAME) +#endif + +/* The internal variables in the standalone libintl.a must have different + names than the internal variables in GNU libc, otherwise programs + using libintl.a cannot be linked statically. */ +#if !defined _LIBC +# define _nl_default_default_domain _nl_default_default_domain__ +# define _nl_current_default_domain _nl_current_default_domain__ +#endif + +/* @@ end of prolog @@ */ + +/* Name of the default text domain. */ +extern const char _nl_default_default_domain[]; + +/* Default text domain in which entries for gettext(3) are to be found. */ +extern const char *_nl_current_default_domain; + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define TEXTDOMAIN __textdomain +# ifndef strdup +# define strdup(str) __strdup (str) +# endif +#else +# define TEXTDOMAIN textdomain__ +#endif + +/* Lock variable to protect the global data in the gettext implementation. */ +__libc_rwlock_define (extern, _nl_state_lock) + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +char * +TEXTDOMAIN (domainname) + const char *domainname; +{ + char *new_domain; + char *old_domain; + + /* A NULL pointer requests the current setting. */ + if (domainname == NULL) + return (char *) _nl_current_default_domain; + + __libc_rwlock_wrlock (_nl_state_lock); + + old_domain = (char *) _nl_current_default_domain; + + /* If domain name is the null string set to default domain "messages". */ + if (domainname[0] == '\0' + || strcmp (domainname, _nl_default_default_domain) == 0) + { + _nl_current_default_domain = _nl_default_default_domain; + new_domain = (char *) _nl_current_default_domain; + } + else if (strcmp (domainname, old_domain) == 0) + /* This can happen and people will use it to signal that some + environment variable changed. */ + new_domain = old_domain; + else + { + /* If the following malloc fails `_nl_current_default_domain' + will be NULL. This value will be returned and so signals we + are out of core. */ +#if defined _LIBC || defined HAVE_STRDUP + new_domain = strdup (domainname); +#else + size_t len = strlen (domainname) + 1; + new_domain = (char *) malloc (len); + if (new_domain != NULL) + memcpy (new_domain, domainname, len); +#endif + + if (new_domain != NULL) + _nl_current_default_domain = new_domain; + } + + /* We use this possibility to signal a change of the loaded catalogs + since this is most likely the case and there is no other easy we + to do it. Do it only when the call was successful. */ + if (new_domain != NULL) + { + ++_nl_msg_cat_cntr; + + if (old_domain != new_domain && old_domain != _nl_default_default_domain) + free (old_domain); + } + + __libc_rwlock_unlock (_nl_state_lock); + + return new_domain; +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__textdomain, textdomain); +#endif diff --git a/src/apps/bin/grep-2.5/intl/textdomain.o b/src/apps/bin/grep-2.5/intl/textdomain.o new file mode 100644 index 0000000000..8096ee910e Binary files /dev/null and b/src/apps/bin/grep-2.5/intl/textdomain.o differ diff --git a/src/apps/bin/grep-2.5/lib/Jamfile b/src/apps/bin/grep-2.5/lib/Jamfile new file mode 100644 index 0000000000..6a5482d930 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/Jamfile @@ -0,0 +1,32 @@ +SubDir OBOS_TOP src apps bin grep-2.5 lib ; + +SubDirCcFlags += -DHAVE_CONFIG_H ; + +StaticLibrary greputils : +alloca.c +atexit.c +closeout.c +error.c +exclude.c +fnmatch.c +getopt.c +getopt1.c +hard-locale.c +isdir.c +malloc.c +memchr.c +obstack.c +quotearg.c +realloc.c +regex.c +savedir.c +stpcpy.c +strtol.c +strtoul.c +strtoull.c +strtoumax.c +xmalloc.c +xstrtol.c +xstrtoumax.c +: STATIC_LIBRARY_DIR +; diff --git a/src/apps/bin/grep-2.5/lib/Makefile b/src/apps/bin/grep-2.5/lib/Makefile new file mode 100644 index 0000000000..1ed56fc59e --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/Makefile @@ -0,0 +1,516 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + + + +# + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/grep +pkglibdir = $(libdir)/grep +pkgincludedir = $(includedir)/grep +top_builddir = .. + +ACLOCAL = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal +AUTOCONF = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf +AUTOMAKE = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake +AUTOHEADER = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader + +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i586-pc-beos +AMTAR = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar +AWK = gawk +BUILD_INCLUDED_LIBINTL = yes +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +CC = gcc +CPP = gcc -E +DATADIRNAME = share +DEPDIR = .deps +EXEEXT = +GENCAT = gencat +GETCONF = +GLIBC21 = no +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +GMSGFMT = : +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INSTOBJEXT = .mo +INTLBISON = bison +INTLLIBS = $(top_builddir)/intl/libintl.a +INTLOBJS = $(GETTOBJS) +INTL_LIBTOOL_SUFFIX_PREFIX = +LIBICONV = +MKINSTALLDIRS = ./mkinstalldirs +MSGFMT = : +OBJEXT = o +PACKAGE = grep +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +POSUB = po +RANLIB = ranlib +SEP = : +SYMLINK = ln -s +SYMLINKFROM = grep +U = +USE_INCLUDED_LIBINTL = yes +USE_NLS = yes +VERSION = 2.5 +am__include = include +am__quote = +install_sh = /boot/home/Development/current/src/apps/bin/grep-2.5/install-sh + +AUTOMAKE_OPTIONS = ../src/ansi2knr + +SUBDIRS = posix + +noinst_LIBRARIES = libgreputils.a + +INCLUDES = -I.. -I$(srcdir) -I../intl +DEFS = -DLIBDIR=\"$(libdir)\" -DHAVE_CONFIG_H + +libgreputils_a_SOURCES = \ + closeout.c error.c exclude.c hard-locale.c \ + isdir.c obstack.c quotearg.c savedir.c xmalloc.c xstrtol.c xstrtoumax.c + + +libgreputils_a_LIBADD = +noinst_HEADERS = \ + closeout.h error.h exclude.h fnmatch.h getopt.h \ + hard-locale.h obstack.h quotearg.h regex.h savedir.h xalloc.h xstrtol.h + + +EXTRA_DIST = strtol.c malloc.c realloc.c +subdir = lib +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libgreputils_a_AR = $(AR) cru +libgreputils_a_DEPENDENCIES = +am_libgreputils_a_OBJECTS = closeout$U.$(OBJEXT) error$U.$(OBJEXT) \ + exclude$U.$(OBJEXT) hard-locale$U.$(OBJEXT) isdir$U.$(OBJEXT) \ + obstack$U.$(OBJEXT) quotearg$U.$(OBJEXT) savedir$U.$(OBJEXT) \ + xmalloc$U.$(OBJEXT) xstrtol$U.$(OBJEXT) xstrtoumax$U.$(OBJEXT) +libgreputils_a_OBJECTS = $(am_libgreputils_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = +LDFLAGS = +LIBS = +depcomp = $(SHELL) $(top_srcdir)/depcomp +DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/atexit.Po \ + $(DEPDIR)/closeout$U.Po $(DEPDIR)/error$U.Po \ + $(DEPDIR)/exclude$U.Po $(DEPDIR)/fnmatch.Po \ + $(DEPDIR)/getopt.Po $(DEPDIR)/getopt1.Po \ + $(DEPDIR)/hard-locale$U.Po $(DEPDIR)/isdir$U.Po \ + $(DEPDIR)/malloc.Po $(DEPDIR)/memchr.Po \ + $(DEPDIR)/obstack$U.Po $(DEPDIR)/quotearg$U.Po \ + $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \ + $(DEPDIR)/savedir$U.Po $(DEPDIR)/stpcpy.Po \ + $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \ + $(DEPDIR)/strtoumax.Po $(DEPDIR)/xmalloc$U.Po \ + $(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoumax$U.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = -g -O2 +DIST_SOURCES = $(libgreputils_a_SOURCES) +HEADERS = $(noinst_HEADERS) + + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in alloca.c \ + atexit.c fnmatch.c getopt.c getopt1.c malloc.c memchr.c \ + realloc.c regex.c stpcpy.c strtoul.c strtoull.c strtoumax.c +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = $(libgreputils_a_SOURCES) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +AR = ar + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libgreputils.a: $(libgreputils_a_OBJECTS) $(libgreputils_a_DEPENDENCIES) + -rm -f libgreputils.a + $(libgreputils_a_AR) libgreputils.a $(libgreputils_a_OBJECTS) $(libgreputils_a_LIBADD) + $(RANLIB) libgreputils.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +ANSI2KNR = ../src/ansi2knr +../src/ansi2knr: + cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr + +mostlyclean-kr: + -rm -f *_.c + +include $(DEPDIR)/alloca.Po +include $(DEPDIR)/atexit.Po +include $(DEPDIR)/closeout$U.Po +include $(DEPDIR)/error$U.Po +include $(DEPDIR)/exclude$U.Po +include $(DEPDIR)/fnmatch.Po +include $(DEPDIR)/getopt.Po +include $(DEPDIR)/getopt1.Po +include $(DEPDIR)/hard-locale$U.Po +include $(DEPDIR)/isdir$U.Po +include $(DEPDIR)/malloc.Po +include $(DEPDIR)/memchr.Po +include $(DEPDIR)/obstack$U.Po +include $(DEPDIR)/quotearg$U.Po +include $(DEPDIR)/realloc.Po +include $(DEPDIR)/regex.Po +include $(DEPDIR)/savedir$U.Po +include $(DEPDIR)/stpcpy.Po +include $(DEPDIR)/strtoul.Po +include $(DEPDIR)/strtoull.Po +include $(DEPDIR)/strtoumax.Po +include $(DEPDIR)/xmalloc$U.Po +include $(DEPDIR)/xstrtol$U.Po +include $(DEPDIR)/xstrtoumax$U.Po + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: + source='$<' object='$@' libtool=no \ + depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ + $(CCDEPMODE) $(depcomp) \ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: + source='$<' object='$@' libtool=no \ + depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ + $(CCDEPMODE) $(depcomp) \ + $(COMPILE) -c `cygpath -w $<` +CCDEPMODE = depmode=gcc +alloca_.c: alloca.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c || rm -f alloca_.c +atexit_.c: atexit.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/atexit.c; then echo $(srcdir)/atexit.c; else echo atexit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > atexit_.c || rm -f atexit_.c +closeout_.c: closeout.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > closeout_.c || rm -f closeout_.c +error_.c: error.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c || rm -f error_.c +exclude_.c: exclude.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > exclude_.c || rm -f exclude_.c +fnmatch_.c: fnmatch.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c || rm -f fnmatch_.c +getopt_.c: getopt.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c || rm -f getopt_.c +getopt1_.c: getopt1.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c || rm -f getopt1_.c +hard-locale_.c: hard-locale.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hard-locale.c; then echo $(srcdir)/hard-locale.c; else echo hard-locale.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hard-locale_.c || rm -f hard-locale_.c +isdir_.c: isdir.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isdir_.c || rm -f isdir_.c +malloc_.c: malloc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c || rm -f malloc_.c +memchr_.c: memchr.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memchr.c; then echo $(srcdir)/memchr.c; else echo memchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memchr_.c || rm -f memchr_.c +obstack_.c: obstack.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > obstack_.c || rm -f obstack_.c +quotearg_.c: quotearg.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quotearg_.c || rm -f quotearg_.c +realloc_.c: realloc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c || rm -f realloc_.c +regex_.c: regex.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c || rm -f regex_.c +savedir_.c: savedir.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > savedir_.c || rm -f savedir_.c +stpcpy_.c: stpcpy.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c || rm -f stpcpy_.c +strtoul_.c: strtoul.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c || rm -f strtoul_.c +strtoull_.c: strtoull.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c || rm -f strtoull_.c +strtoumax_.c: strtoumax.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c || rm -f strtoumax_.c +xmalloc_.c: xmalloc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xmalloc_.c || rm -f xmalloc_.c +xstrtol_.c: xstrtol.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtol_.c || rm -f xstrtol_.c +xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c || rm -f xstrtoumax_.c +alloca_.$(OBJEXT) atexit_.$(OBJEXT) closeout_.$(OBJEXT) \ +error_.$(OBJEXT) exclude_.$(OBJEXT) fnmatch_.$(OBJEXT) \ +getopt_.$(OBJEXT) getopt1_.$(OBJEXT) hard-locale_.$(OBJEXT) \ +isdir_.$(OBJEXT) malloc_.$(OBJEXT) memchr_.$(OBJEXT) obstack_.$(OBJEXT) \ +quotearg_.$(OBJEXT) realloc_.$(OBJEXT) regex_.$(OBJEXT) \ +savedir_.$(OBJEXT) stpcpy_.$(OBJEXT) strtoul_.$(OBJEXT) \ +strtoull_.$(OBJEXT) strtoumax_.$(OBJEXT) xmalloc_.$(OBJEXT) \ +xstrtol_.$(OBJEXT) xstrtoumax_.$(OBJEXT) : $(ANSI2KNR) +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(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 $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-noinstLIBRARIES clean-recursive distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-kr mostlyclean-recursive tags \ + tags-recursive uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/lib/Makefile.am b/src/apps/bin/grep-2.5/lib/Makefile.am new file mode 100644 index 0000000000..df2c64c274 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/Makefile.am @@ -0,0 +1,20 @@ +# +AUTOMAKE_OPTIONS = ../src/ansi2knr + +SUBDIRS = posix + +noinst_LIBRARIES = libgreputils.a + +INCLUDES = -I.. -I$(srcdir) -I../intl +DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@ + +libgreputils_a_SOURCES = \ + closeout.c error.c exclude.c hard-locale.c \ + isdir.c obstack.c quotearg.c savedir.c xmalloc.c xstrtol.c xstrtoumax.c + +libgreputils_a_LIBADD = @LIBOBJS@ @ALLOCA@ +noinst_HEADERS = \ + closeout.h error.h exclude.h fnmatch.h getopt.h \ + hard-locale.h obstack.h quotearg.h regex.h savedir.h xalloc.h xstrtol.h + +EXTRA_DIST = strtol.c malloc.c realloc.c diff --git a/src/apps/bin/grep-2.5/lib/Makefile.in b/src/apps/bin/grep-2.5/lib/Makefile.in new file mode 100644 index 0000000000..917821c878 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/Makefile.in @@ -0,0 +1,516 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GETCONF = @GETCONF@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SEP = @SEP@ +SYMLINK = @SYMLINK@ +SYMLINKFROM = @SYMLINKFROM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AUTOMAKE_OPTIONS = ../src/ansi2knr + +SUBDIRS = posix + +noinst_LIBRARIES = libgreputils.a + +INCLUDES = -I.. -I$(srcdir) -I../intl +DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@ + +libgreputils_a_SOURCES = \ + closeout.c error.c exclude.c hard-locale.c \ + isdir.c obstack.c quotearg.c savedir.c xmalloc.c xstrtol.c xstrtoumax.c + + +libgreputils_a_LIBADD = @LIBOBJS@ @ALLOCA@ +noinst_HEADERS = \ + closeout.h error.h exclude.h fnmatch.h getopt.h \ + hard-locale.h obstack.h quotearg.h regex.h savedir.h xalloc.h xstrtol.h + + +EXTRA_DIST = strtol.c malloc.c realloc.c +subdir = lib +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libgreputils_a_AR = $(AR) cru +libgreputils_a_DEPENDENCIES = @LIBOBJS@ @ALLOCA@ +am_libgreputils_a_OBJECTS = closeout$U.$(OBJEXT) error$U.$(OBJEXT) \ + exclude$U.$(OBJEXT) hard-locale$U.$(OBJEXT) isdir$U.$(OBJEXT) \ + obstack$U.$(OBJEXT) quotearg$U.$(OBJEXT) savedir$U.$(OBJEXT) \ + xmalloc$U.$(OBJEXT) xstrtol$U.$(OBJEXT) xstrtoumax$U.$(OBJEXT) +libgreputils_a_OBJECTS = $(am_libgreputils_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/atexit.Po \ +@AMDEP_TRUE@ $(DEPDIR)/closeout$U.Po $(DEPDIR)/error$U.Po \ +@AMDEP_TRUE@ $(DEPDIR)/exclude$U.Po $(DEPDIR)/fnmatch.Po \ +@AMDEP_TRUE@ $(DEPDIR)/getopt.Po $(DEPDIR)/getopt1.Po \ +@AMDEP_TRUE@ $(DEPDIR)/hard-locale$U.Po $(DEPDIR)/isdir$U.Po \ +@AMDEP_TRUE@ $(DEPDIR)/malloc.Po $(DEPDIR)/memchr.Po \ +@AMDEP_TRUE@ $(DEPDIR)/obstack$U.Po $(DEPDIR)/quotearg$U.Po \ +@AMDEP_TRUE@ $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \ +@AMDEP_TRUE@ $(DEPDIR)/savedir$U.Po $(DEPDIR)/stpcpy.Po \ +@AMDEP_TRUE@ $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \ +@AMDEP_TRUE@ $(DEPDIR)/strtoumax.Po $(DEPDIR)/xmalloc$U.Po \ +@AMDEP_TRUE@ $(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoumax$U.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(libgreputils_a_SOURCES) +HEADERS = $(noinst_HEADERS) + + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in alloca.c \ + atexit.c fnmatch.c getopt.c getopt1.c malloc.c memchr.c \ + realloc.c regex.c stpcpy.c strtoul.c strtoull.c strtoumax.c +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = $(libgreputils_a_SOURCES) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +AR = ar + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libgreputils.a: $(libgreputils_a_OBJECTS) $(libgreputils_a_DEPENDENCIES) + -rm -f libgreputils.a + $(libgreputils_a_AR) libgreputils.a $(libgreputils_a_OBJECTS) $(libgreputils_a_LIBADD) + $(RANLIB) libgreputils.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +ANSI2KNR = ../src/ansi2knr +../src/ansi2knr: + cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr + +mostlyclean-kr: + -rm -f *_.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/atexit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/closeout$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/error$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/exclude$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fnmatch.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$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/isdir$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/malloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memchr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/obstack$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/quotearg$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/realloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/regex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/savedir$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/stpcpy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoumax.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/xmalloc$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/xstrtol$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/xstrtoumax$U.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` +CCDEPMODE = @CCDEPMODE@ +alloca_.c: alloca.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c || rm -f alloca_.c +atexit_.c: atexit.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/atexit.c; then echo $(srcdir)/atexit.c; else echo atexit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > atexit_.c || rm -f atexit_.c +closeout_.c: closeout.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > closeout_.c || rm -f closeout_.c +error_.c: error.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c || rm -f error_.c +exclude_.c: exclude.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > exclude_.c || rm -f exclude_.c +fnmatch_.c: fnmatch.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c || rm -f fnmatch_.c +getopt_.c: getopt.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c || rm -f getopt_.c +getopt1_.c: getopt1.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c || rm -f getopt1_.c +hard-locale_.c: hard-locale.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hard-locale.c; then echo $(srcdir)/hard-locale.c; else echo hard-locale.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hard-locale_.c || rm -f hard-locale_.c +isdir_.c: isdir.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isdir_.c || rm -f isdir_.c +malloc_.c: malloc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c || rm -f malloc_.c +memchr_.c: memchr.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memchr.c; then echo $(srcdir)/memchr.c; else echo memchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memchr_.c || rm -f memchr_.c +obstack_.c: obstack.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > obstack_.c || rm -f obstack_.c +quotearg_.c: quotearg.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quotearg_.c || rm -f quotearg_.c +realloc_.c: realloc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c || rm -f realloc_.c +regex_.c: regex.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c || rm -f regex_.c +savedir_.c: savedir.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > savedir_.c || rm -f savedir_.c +stpcpy_.c: stpcpy.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c || rm -f stpcpy_.c +strtoul_.c: strtoul.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c || rm -f strtoul_.c +strtoull_.c: strtoull.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c || rm -f strtoull_.c +strtoumax_.c: strtoumax.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c || rm -f strtoumax_.c +xmalloc_.c: xmalloc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xmalloc_.c || rm -f xmalloc_.c +xstrtol_.c: xstrtol.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtol_.c || rm -f xstrtol_.c +xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c || rm -f xstrtoumax_.c +alloca_.$(OBJEXT) atexit_.$(OBJEXT) closeout_.$(OBJEXT) \ +error_.$(OBJEXT) exclude_.$(OBJEXT) fnmatch_.$(OBJEXT) \ +getopt_.$(OBJEXT) getopt1_.$(OBJEXT) hard-locale_.$(OBJEXT) \ +isdir_.$(OBJEXT) malloc_.$(OBJEXT) memchr_.$(OBJEXT) obstack_.$(OBJEXT) \ +quotearg_.$(OBJEXT) realloc_.$(OBJEXT) regex_.$(OBJEXT) \ +savedir_.$(OBJEXT) stpcpy_.$(OBJEXT) strtoul_.$(OBJEXT) \ +strtoull_.$(OBJEXT) strtoumax_.$(OBJEXT) xmalloc_.$(OBJEXT) \ +xstrtol_.$(OBJEXT) xstrtoumax_.$(OBJEXT) : $(ANSI2KNR) +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(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 $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-noinstLIBRARIES clean-recursive distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-kr mostlyclean-recursive tags \ + tags-recursive uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/lib/alloca.c b/src/apps/bin/grep-2.5/lib/alloca.c new file mode 100644 index 0000000000..55a80677f7 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/alloca.c @@ -0,0 +1,503 @@ +/* alloca.c -- allocate automatically reclaimed memory + (Mostly) portable public-domain implementation -- D A Gwyn + + This implementation of the PWB library alloca function, + which is used to allocate space off the run-time stack so + that it is automatically reclaimed upon procedure exit, + was inspired by discussions with J. Q. Johnson of Cornell. + J.Otto Tennant contributed the Cray support. + + There are some preprocessor constants that can + be defined when compiling for your specific system, for + improved efficiency; however, the defaults should be okay. + + The general concept of this implementation is to keep + track of all alloca-allocated blocks, and reclaim any + that are found to be deeper in the stack than the current + invocation. This heuristic does not reclaim storage as + soon as it becomes invalid, but it will do so eventually. + + As a special case, alloca(0) reclaims storage without + allocating any. It is a good idea to use alloca(0) in + your main control loop, etc. to force garbage collection. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if HAVE_STRING_H +# include +#endif +#if HAVE_STDLIB_H +# include +#endif + +#ifdef emacs +# include "blockinput.h" +#endif + +/* If compiling with GCC 2, this file's not needed. */ +#if !defined (__GNUC__) || __GNUC__ < 2 + +/* If someone has defined alloca as a macro, + there must be some other way alloca is supposed to work. */ +# ifndef alloca + +# ifdef emacs +# ifdef static +/* actually, only want this if static is defined as "" + -- this is for usg, in which emacs must undefine static + in order to make unexec workable + */ +# ifndef STACK_DIRECTION +you +lose +-- must know STACK_DIRECTION at compile-time +# endif /* STACK_DIRECTION undefined */ +# endif /* static */ +# endif /* emacs */ + +/* If your stack is a linked list of frames, you have to + provide an "address metric" ADDRESS_FUNCTION macro. */ + +# if defined (CRAY) && defined (CRAY_STACKSEG_END) +long i00afunc (); +# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) +# else +# define ADDRESS_FUNCTION(arg) &(arg) +# endif + +# if __STDC__ +typedef void *pointer; +# else +typedef char *pointer; +# endif + +# ifndef NULL +# define NULL 0 +# endif + +/* Different portions of Emacs need to call different versions of + malloc. The Emacs executable needs alloca to call xmalloc, because + ordinary malloc isn't protected from input signals. On the other + hand, the utilities in lib-src need alloca to call malloc; some of + them are very simple, and don't have an xmalloc routine. + + Non-Emacs programs expect this to call xmalloc. + + Callers below should use malloc. */ + +# ifndef emacs +# define malloc xmalloc +# endif +extern pointer malloc (); + +/* Define STACK_DIRECTION 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 */ + +# ifndef STACK_DIRECTION +# define STACK_DIRECTION 0 /* Direction unknown. */ +# endif + +# if STACK_DIRECTION != 0 + +# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ + +# else /* STACK_DIRECTION == 0; need run-time code. */ + +static int stack_dir; /* 1 or -1 once known. */ +# define STACK_DIR stack_dir + +static void +find_stack_direction () +{ + static char *addr = NULL; /* Address of first `dummy', once known. */ + auto char dummy; /* To get stack address. */ + + if (addr == NULL) + { /* Initial entry. */ + addr = ADDRESS_FUNCTION (dummy); + + find_stack_direction (); /* Recurse once. */ + } + else + { + /* Second entry. */ + if (ADDRESS_FUNCTION (dummy) > addr) + stack_dir = 1; /* Stack grew upward. */ + else + stack_dir = -1; /* Stack grew downward. */ + } +} + +# endif /* STACK_DIRECTION == 0 */ + +/* An "alloca header" is used to: + (a) chain together all alloca'ed blocks; + (b) keep track of stack depth. + + It is very important that sizeof(header) agree with malloc + alignment chunk size. The following default should work okay. */ + +# ifndef ALIGN_SIZE +# define ALIGN_SIZE sizeof(double) +# endif + +typedef union hdr +{ + char align[ALIGN_SIZE]; /* To force sizeof(header). */ + struct + { + union hdr *next; /* For chaining headers. */ + char *deep; /* For stack depth measure. */ + } h; +} header; + +static header *last_alloca_header = NULL; /* -> last alloca header. */ + +/* Return a pointer to at least SIZE bytes of storage, + which will be automatically reclaimed upon exit from + the procedure that called alloca. Originally, this space + was supposed to be taken from the current stack frame of the + caller, but that method cannot be made to work for some + implementations of C, for example under Gould's UTX/32. */ + +pointer +alloca (unsigned size) +{ + auto char probe; /* Probes stack depth: */ + register char *depth = ADDRESS_FUNCTION (probe); + +# if STACK_DIRECTION == 0 + if (STACK_DIR == 0) /* Unknown growth direction. */ + find_stack_direction (); +# endif + + /* Reclaim garbage, defined as all alloca'd storage that + was allocated from deeper in the stack than currently. */ + + { + register header *hp; /* Traverses linked list. */ + +# ifdef emacs + BLOCK_INPUT; +# endif + + for (hp = last_alloca_header; hp != NULL;) + if ((STACK_DIR > 0 && hp->h.deep > depth) + || (STACK_DIR < 0 && hp->h.deep < depth)) + { + register header *np = hp->h.next; + + free ((pointer) hp); /* Collect garbage. */ + + hp = np; /* -> next header. */ + } + else + break; /* Rest are not deeper. */ + + last_alloca_header = hp; /* -> last valid storage. */ + +# ifdef emacs + UNBLOCK_INPUT; +# endif + } + + if (size == 0) + return NULL; /* No allocation required. */ + + /* Allocate combined header + user data storage. */ + + { + register pointer new = malloc (sizeof (header) + size); + /* Address of header. */ + + if (new == 0) + abort(); + + ((header *) new)->h.next = last_alloca_header; + ((header *) new)->h.deep = depth; + + last_alloca_header = (header *) new; + + /* User storage begins just after header. */ + + return (pointer) ((char *) new + sizeof (header)); + } +} + +# if defined (CRAY) && defined (CRAY_STACKSEG_END) + +# ifdef DEBUG_I00AFUNC +# include +# endif + +# ifndef CRAY_STACK +# define CRAY_STACK +# ifndef CRAY2 +/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ +struct stack_control_header + { + long shgrow:32; /* Number of times stack has grown. */ + long shaseg:32; /* Size of increments to stack. */ + long shhwm:32; /* High water mark of stack. */ + long shsize:32; /* Current size of stack (all segments). */ + }; + +/* The stack segment linkage control information occurs at + the high-address end of a stack segment. (The stack + grows from low addresses to high addresses.) The initial + part of the stack segment linkage control information is + 0200 (octal) words. This provides for register storage + for the routine which overflows the stack. */ + +struct stack_segment_linkage + { + long ss[0200]; /* 0200 overflow words. */ + long sssize:32; /* Number of words in this segment. */ + long ssbase:32; /* Offset to stack base. */ + long:32; + long sspseg:32; /* Offset to linkage control of previous + segment of stack. */ + long:32; + long sstcpt:32; /* Pointer to task common address block. */ + long sscsnm; /* Private control structure number for + microtasking. */ + long ssusr1; /* Reserved for user. */ + long ssusr2; /* Reserved for user. */ + long sstpid; /* Process ID for pid based multi-tasking. */ + long ssgvup; /* Pointer to multitasking thread giveup. */ + long sscray[7]; /* Reserved for Cray Research. */ + long ssa0; + long ssa1; + long ssa2; + long ssa3; + long ssa4; + long ssa5; + long ssa6; + long ssa7; + long sss0; + long sss1; + long sss2; + long sss3; + long sss4; + long sss5; + long sss6; + long sss7; + }; + +# else /* CRAY2 */ +/* The following structure defines the vector of words + returned by the STKSTAT library routine. */ +struct stk_stat + { + long now; /* Current total stack size. */ + long maxc; /* Amount of contiguous space which would + be required to satisfy the maximum + stack demand to date. */ + long high_water; /* Stack high-water mark. */ + long overflows; /* Number of stack overflow ($STKOFEN) calls. */ + long hits; /* Number of internal buffer hits. */ + long extends; /* Number of block extensions. */ + long stko_mallocs; /* Block allocations by $STKOFEN. */ + long underflows; /* Number of stack underflow calls ($STKRETN). */ + long stko_free; /* Number of deallocations by $STKRETN. */ + long stkm_free; /* Number of deallocations by $STKMRET. */ + long segments; /* Current number of stack segments. */ + long maxs; /* Maximum number of stack segments so far. */ + long pad_size; /* Stack pad size. */ + long current_address; /* Current stack segment address. */ + long current_size; /* Current stack segment size. This + number is actually corrupted by STKSTAT to + include the fifteen word trailer area. */ + long initial_address; /* Address of initial segment. */ + long initial_size; /* Size of initial segment. */ + }; + +/* The following structure describes the data structure which trails + any stack segment. I think that the description in 'asdef' is + out of date. I only describe the parts that I am sure about. */ + +struct stk_trailer + { + long this_address; /* Address of this block. */ + long this_size; /* Size of this block (does not include + this trailer). */ + long unknown2; + long unknown3; + long link; /* Address of trailer block of previous + segment. */ + long unknown5; + long unknown6; + long unknown7; + long unknown8; + long unknown9; + long unknown10; + long unknown11; + long unknown12; + long unknown13; + long unknown14; + }; + +# endif /* CRAY2 */ +# endif /* not CRAY_STACK */ + +# ifdef CRAY2 +/* Determine a "stack measure" for an arbitrary ADDRESS. + I doubt that "lint" will like this much. */ + +static long +i00afunc (long *address) +{ + struct stk_stat status; + struct stk_trailer *trailer; + long *block, size; + long result = 0; + + /* We want to iterate through all of the segments. The first + step is to get the stack status structure. We could do this + more quickly and more directly, perhaps, by referencing the + $LM00 common block, but I know that this works. */ + + STKSTAT (&status); + + /* Set up the iteration. */ + + trailer = (struct stk_trailer *) (status.current_address + + status.current_size + - 15); + + /* There must be at least one stack segment. Therefore it is + a fatal error if "trailer" is null. */ + + if (trailer == 0) + abort (); + + /* Discard segments that do not contain our argument address. */ + + while (trailer != 0) + { + block = (long *) trailer->this_address; + size = trailer->this_size; + if (block == 0 || size == 0) + abort (); + trailer = (struct stk_trailer *) trailer->link; + if ((block <= address) && (address < (block + size))) + break; + } + + /* Set the result to the offset in this segment and add the sizes + of all predecessor segments. */ + + result = address - block; + + if (trailer == 0) + { + return result; + } + + do + { + if (trailer->this_size <= 0) + abort (); + result += trailer->this_size; + trailer = (struct stk_trailer *) trailer->link; + } + while (trailer != 0); + + /* We are done. Note that if you present a bogus address (one + not in any segment), you will get a different number back, formed + from subtracting the address of the first block. This is probably + not what you want. */ + + return (result); +} + +# else /* not CRAY2 */ +/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. + Determine the number of the cell within the stack, + given the address of the cell. The purpose of this + routine is to linearize, in some sense, stack addresses + for alloca. */ + +static long +i00afunc (long address) +{ + long stkl = 0; + + long size, pseg, this_segment, stack; + long result = 0; + + struct stack_segment_linkage *ssptr; + + /* Register B67 contains the address of the end of the + current stack segment. If you (as a subprogram) store + your registers on the stack and find that you are past + the contents of B67, you have overflowed the segment. + + B67 also points to the stack segment linkage control + area, which is what we are really interested in. */ + + stkl = CRAY_STACKSEG_END (); + ssptr = (struct stack_segment_linkage *) stkl; + + /* If one subtracts 'size' from the end of the segment, + one has the address of the first word of the segment. + + If this is not the first segment, 'pseg' will be + nonzero. */ + + pseg = ssptr->sspseg; + size = ssptr->sssize; + + this_segment = stkl - size; + + /* It is possible that calling this routine itself caused + a stack overflow. Discard stack segments which do not + contain the target address. */ + + while (!(this_segment <= address && address <= stkl)) + { +# ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); +# endif + if (pseg == 0) + break; + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + this_segment = stkl - size; + } + + result = address - this_segment; + + /* If you subtract pseg from the current end of the stack, + you get the address of the previous stack segment's end. + This seems a little convoluted to me, but I'll bet you save + a cycle somewhere. */ + + while (pseg != 0) + { +# ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o\n", pseg, size); +# endif + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + result += size; + } + return (result); +} + +# endif /* not CRAY2 */ +# endif /* CRAY */ + +# endif /* no alloca */ +#endif /* not GCC version 2 */ diff --git a/src/apps/bin/grep-2.5/lib/atexit.c b/src/apps/bin/grep-2.5/lib/atexit.c new file mode 100644 index 0000000000..85e992f72e --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/atexit.c @@ -0,0 +1,14 @@ +/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */ +/* This function is in the public domain. --Mike Stump. */ + +#include "config.h" + +int +atexit(f) + void (*f)(); +{ + /* If the system doesn't provide a definition for atexit, use on_exit + if the system provides that. */ + on_exit (f, 0); + return 0; +} diff --git a/src/apps/bin/grep-2.5/lib/closeout.c b/src/apps/bin/grep-2.5/lib/closeout.c new file mode 100644 index 0000000000..4fdac32b2e --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/closeout.c @@ -0,0 +1,121 @@ +/* closeout.c - close standard output + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +#if ENABLE_NLS +# include +# define _(Text) gettext (Text) +#else +# define _(Text) Text +#endif + +#if HAVE_STDLIB_H +# include +#endif +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#include + +#include +#ifndef errno +extern int errno; +#endif + +#include "closeout.h" +#include "error.h" +#include "quotearg.h" +#if 0 +#include "__fpending.h" +#endif + +static int default_exit_status = EXIT_FAILURE; +static const char *file_name; + +/* Set the value to be used for the exit status when close_stdout is called. + This is useful when it is not convenient to call close_stdout_status, + e.g., when close_stdout is called via atexit. */ +void +close_stdout_set_status (int status) +{ + default_exit_status = status; +} + +/* Set the file name to be reported in the event an error is detected + by close_stdout_status. */ +void +close_stdout_set_file_name (const char *file) +{ + file_name = file; +} + +/* Close standard output, exiting with status STATUS on failure. + If a program writes *anything* to stdout, that program should `fflush' + stdout and make sure that it succeeds before exiting. Otherwise, + suppose that you go to the extreme of checking the return status + of every function that does an explicit write to stdout. The last + printf can succeed in writing to the internal stream buffer, and yet + the fclose(stdout) could still fail (due e.g., to a disk full error) + when it tries to write out that buffered data. Thus, you would be + left with an incomplete output file and the offending program would + exit successfully. + + FIXME: note the fflush suggested above is implicit in the fclose + we actually do below. Consider doing only the fflush and/or using + setvbuf to inhibit buffering. + + Besides, it's wasteful to check the return value from every call + that writes to stdout -- just let the internal stream state record + the failure. That's what the ferror test is checking below. + + It's important to detect such failures and exit nonzero because many + tools (most notably `make' and other build-management systems) depend + on being able to detect failure in other tools via their exit status. */ + +void +close_stdout_status (int status) +{ + int e = ferror (stdout) ? 0 : -1; + +#if 0 + if (__fpending (stdout) == 0) + return; +#endif + + if (fclose (stdout) != 0) + e = errno; + + if (0 < e) + { + char const *write_error = _("write error"); + if (file_name) + error (status, e, "%s: %s", quotearg_colon (file_name), write_error); + else + error (status, e, "%s", write_error); + } +} + +/* Close standard output, exiting with status EXIT_FAILURE on failure. */ +void +close_stdout (void) +{ + close_stdout_status (default_exit_status); +} diff --git a/src/apps/bin/grep-2.5/lib/closeout.h b/src/apps/bin/grep-2.5/lib/closeout.h new file mode 100644 index 0000000000..80f24e45f9 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/closeout.h @@ -0,0 +1,17 @@ +#ifndef CLOSEOUT_H +# define CLOSEOUT_H 1 + +# ifndef PARAMS +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +# endif + +void close_stdout_set_status PARAMS ((int status)); +void close_stdout_set_file_name PARAMS ((const char *file)); +void close_stdout PARAMS ((void)); +void close_stdout_status PARAMS ((int status)); + +#endif diff --git a/src/apps/bin/grep-2.5/lib/config.h b/src/apps/bin/grep-2.5/lib/config.h new file mode 100644 index 0000000000..64fb5420aa --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/config.h @@ -0,0 +1,341 @@ +/* config.h. Generated by configure. */ +/* config.hin. Generated from configure.in by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +//#define ENABLE_NLS 1 + +/* We are building grep */ +#define GREP 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARGZ_H */ + +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Define to 1 if you have the `btowc' function. */ +#define HAVE_BTOWC 1 + +/* Define to 1 if you have the `dcgettext' function. */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if strerror_r is declared. */ +#define HAVE_DECL_STRERROR_R 1 + +/* Define if declares strtoul. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define if declares strtoull. */ +#define HAVE_DECL_STRTOULL 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define if the malloc check has been performed. */ +#define HAVE_DONE_WORKING_MALLOC_CHECK 1 + +/* Define if the realloc check has been performed. */ +#define HAVE_DONE_WORKING_REALLOC_CHECK 1 + +/* Define to 1 if you have the `doprnt' function. */ +/* #undef HAVE_DOPRNT */ + +/* Define if text file lines end in CRLF. */ +/* #undef HAVE_DOS_FILE_CONTENTS */ + +/* Define if your OS uses backslashes as directory separators */ +/* #undef HAVE_DOS_FILE_NAMES */ + +/* Define to 1 if you have the `feof_unlocked' function. */ +#define HAVE_FEOF_UNLOCKED 1 + +/* Define to 1 if you have the `fgets_unlocked' function. */ +#define HAVE_FGETS_UNLOCKED 1 + +/* Define to 1 if you have the `fnmatch' function. */ +#define HAVE_FNMATCH 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getegid' function. */ +#define HAVE_GETEGID 1 + +/* Define to 1 if you have the `geteuid' function. */ +#define HAVE_GETEUID 1 + +/* Define to 1 if you have the `getgid' function. */ +#define HAVE_GETGID 1 + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define if you have and nl_langinfo(CODESET). */ +/* #undef HAVE_LANGINFO_CODESET */ + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBINTL_H */ + +/* Define to 1 if you have the `pcre' library (-lpcre). */ +/* #undef HAVE_LIBPCRE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `mbrtowc' function. */ +#define HAVE_MBRTOWC 1 + +/* Define to 1 if you have the `memchr' function. */ +#define HAVE_MEMCHR 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mempcpy' function. */ +/* #undef HAVE_MEMPCPY */ + +/* Define to 1 if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the `munmap' function. */ +/* #undef HAVE_MUNMAP */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NL_TYPES_H */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `setenv' function. */ +/* #undef HAVE_SETENV */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setmode' function. */ +/* #undef HAVE_SETMODE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the 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 `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the `strtoull' function. */ +/* #undef HAVE_STRTOULL */ + +/* Define to 1 if you have the `strtoumax' function. */ +#define HAVE_STRTOUMAX 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tsearch' function. */ +/* #undef HAVE_TSEARCH */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the unsigned long long type. */ +#define HAVE_UNSIGNED_LONG_LONG 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wctype' function. */ +#define HAVE_WCTYPE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WCTYPE_H */ + +/* Define to 1 if strerror_r returns a string. */ +#define HAVE_WORKING_STRERROR_R 1 + +/* Define to 1 if you have the `__argz_count' function. */ +/* #undef HAVE___ARGZ_COUNT */ + +/* Define to 1 if you have the `__argz_next' function. */ +/* #undef HAVE___ARGZ_NEXT */ + +/* Define to 1 if you have the `__argz_stringify' function. */ +/* #undef HAVE___ARGZ_STRINGIFY */ + +/* Define as const if the declaration of iconv() needs const. */ +/* #undef ICONV_CONST */ + +/* Name of package */ +#define PACKAGE "grep" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define if compiler has function prototypes */ +#define PROTOTYPES 1 + +/* 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 the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.5" + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to make fseeko etc. visible, on some hosts. */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define if your compiler is broken */ +/* #undef alloca */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +/* #undef inline */ + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to a type if does not define. */ +#define mbstate_t int + +/* Define to `long' if does not define. */ +/* #undef off_t */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +/* Define to unsigned long or unsigned long long if doesn't + define. */ +/* #undef uintmax_t */ diff --git a/src/apps/bin/grep-2.5/lib/error.c b/src/apps/bin/grep-2.5/lib/error.c new file mode 100644 index 0000000000..c78b6cffb9 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/error.c @@ -0,0 +1,276 @@ +/* Error handler for noninteractive utilities + Copyright (C) 1990-1998, 2000 Free Software Foundation, Inc. + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Written by David MacKenzie . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#if HAVE_LIBINTL_H +# include +#endif + +#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC +# if __STDC__ +# include +# define VA_START(args, lastarg) va_start(args, lastarg) +# else +# include +# define VA_START(args, lastarg) va_start(args) +# endif +#else +# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 +# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; +#endif + +#if STDC_HEADERS || _LIBC +# include +# include +#else +void exit (); +#endif + +#include "error.h" + +#ifndef HAVE_DECL_STRERROR_R +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_STRERROR_R +char *strerror_r (); +#endif + +#ifndef _ +# 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) ( +#if __STDC__ - 0 + void +#endif + ); + +/* 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 + +/* In GNU libc we want do not want to use the common name `error' directly. + Instead make it a weak alias. */ +# define error __error +# define error_at_line __error_at_line + +# ifdef USE_IN_LIBIO +# include +# define fflush(s) _IO_fflush (s) +# endif + +#else /* not _LIBC */ + +/* The calling program should define program_name and set it to the + name of the executing program. */ +extern char *program_name; + +# ifdef HAVE_STRERROR_R +# define __strerror_r strerror_r +# else +# if HAVE_STRERROR +# ifndef strerror /* On some systems, strerror is a macro */ +char *strerror (); +# endif +# else +static char * +private_strerror (errnum) + int errnum; +{ + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum > 0 && errnum <= sys_nerr) + return _(sys_errlist[errnum]); + return _("Unknown system error"); +} +# define strerror private_strerror +# endif /* HAVE_STRERROR */ +# endif /* HAVE_STRERROR_R */ +#endif /* not _LIBC */ + +/* 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. */ +/* VARARGS */ + +void +#if defined VA_START && __STDC__ +error (int status, int errnum, const char *message, ...) +#else +error (status, errnum, message, va_alist) + int status; + int errnum; + char *message; + va_dcl +#endif +{ +#ifdef VA_START + va_list args; +#endif + + if (error_print_progname) + (*error_print_progname) (); + else + { + fflush (stdout); + fprintf (stderr, "%s: ", program_name); + } + +#ifdef VA_START + VA_START (args, message); +# if HAVE_VPRINTF || _LIBC + vfprintf (stderr, message, args); +# else + _doprnt (message, args, stderr); +# endif + va_end (args); +#else + fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); +#endif + + ++error_message_count; + if (errnum) + { +#if defined HAVE_STRERROR_R || _LIBC + char errbuf[1024]; +# if HAVE_WORKING_STRERROR_R || _LIBC + fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf)); +# else + /* Don't use __strerror_r's return value because on some systems + (at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */ + __strerror_r (errnum, errbuf, sizeof errbuf); + fprintf (stderr, ": %s", errbuf); +# endif +#else + fprintf (stderr, ": %s", strerror (errnum)); +#endif + } + putc ('\n', stderr); + fflush (stderr); + if (status) + exit (status); +} + +/* 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 +#if defined VA_START && __STDC__ +error_at_line (int status, int errnum, const char *file_name, + unsigned int line_number, const char *message, ...) +#else +error_at_line (status, errnum, file_name, line_number, message, va_alist) + int status; + int errnum; + const char *file_name; + unsigned int line_number; + char *message; + va_dcl +#endif +{ +#ifdef VA_START + va_list args; +#endif + + 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))) + /* Simply return and print nothing. */ + return; + + old_file_name = file_name; + old_line_number = line_number; + } + + if (error_print_progname) + (*error_print_progname) (); + else + { + fflush (stdout); + fprintf (stderr, "%s:", program_name); + } + + if (file_name != NULL) + fprintf (stderr, "%s:%d: ", file_name, line_number); + +#ifdef VA_START + VA_START (args, message); +# if HAVE_VPRINTF || _LIBC + vfprintf (stderr, message, args); +# else + _doprnt (message, args, stderr); +# endif + va_end (args); +#else + fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); +#endif + + ++error_message_count; + if (errnum) + { +#if defined HAVE_STRERROR_R || _LIBC + char errbuf[1024]; +# if HAVE_WORKING_STRERROR_R || _LIBC + fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf)); +# else + /* Don't use __strerror_r's return value because on some systems + (at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */ + __strerror_r (errnum, errbuf, sizeof errbuf); + fprintf (stderr, ": %s", errbuf); +# endif +#else + fprintf (stderr, ": %s", strerror (errnum)); +#endif + } + putc ('\n', stderr); + fflush (stderr); + if (status) + exit (status); +} + +#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 diff --git a/src/apps/bin/grep-2.5/lib/error.h b/src/apps/bin/grep-2.5/lib/error.h new file mode 100644 index 0000000000..20f75824d6 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/error.h @@ -0,0 +1,78 @@ +/* Declaration for error-reporting function + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _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) || __STRICT_ANSI__ +# 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 + +#if defined (__STDC__) && __STDC__ + +/* 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); + +#else +void error (); +void error_at_line (); +extern void (*error_print_progname) (); +#endif + +/* 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 */ diff --git a/src/apps/bin/grep-2.5/lib/exclude.c b/src/apps/bin/grep-2.5/lib/exclude.c new file mode 100644 index 0000000000..1925a398a0 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/exclude.c @@ -0,0 +1,128 @@ +/* exclude.c -- exclude file names + Copyright 1992, 1993, 1994, 1997, 1999, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Paul Eggert */ + +#if HAVE_CONFIG_H +# include +#endif + +#include +#ifndef errno +extern int errno; +#endif +#include +#include +#include +#include + +void *xmalloc PARAMS ((size_t)); +void *xrealloc PARAMS ((void *, size_t)); + +/* Keep track of excluded file name patterns. */ + +struct exclude + { + char const **exclude; + int exclude_alloc; + int exclude_count; + }; + +struct exclude * +new_exclude (void) +{ + struct exclude *ex = (struct exclude *) xmalloc (sizeof (struct exclude)); + ex->exclude_count = 0; + ex->exclude_alloc = 64; + ex->exclude = (char const **) xmalloc (ex->exclude_alloc * sizeof (char *)); + return ex; +} + +int +excluded_filename (struct exclude const *ex, char const *f, int options) +{ + char const * const *exclude = ex->exclude; + int exclude_count = ex->exclude_count; + int i; + + for (i = 0; i < exclude_count; i++) + if (fnmatch (exclude[i], f, options) == 0) + return 1; + + return 0; +} + +void +add_exclude (struct exclude *ex, char const *pattern) +{ + if (ex->exclude_alloc <= ex->exclude_count) + ex->exclude = (char const **) xrealloc (ex->exclude, + ((ex->exclude_alloc *= 2) + * sizeof (char *))); + + ex->exclude[ex->exclude_count++] = pattern; +} + +int +add_exclude_file (void (*add_func) PARAMS ((struct exclude *, char const *)), + struct exclude *ex, char const *filename, char line_end) +{ + int use_stdin = filename[0] == '-' && !filename[1]; + FILE *in; + char *buf; + char *p; + char const *pattern; + char const *lim; + size_t buf_alloc = 1024; + size_t buf_count = 0; + int c; + int e = 0; + + if (use_stdin) + in = stdin; + else if (! (in = fopen (filename, "r"))) + return -1; + + buf = xmalloc (buf_alloc); + + while ((c = getc (in)) != EOF) + { + buf[buf_count++] = c; + if (buf_count == buf_alloc) + buf = xrealloc (buf, buf_alloc *= 2); + } + + buf = xrealloc (buf, buf_count + 1); + + if (ferror (in)) + e = errno; + + if (!use_stdin && fclose (in) != 0) + e = errno; + + for (pattern = p = buf, lim = buf + buf_count; p <= lim; p++) + if (p < lim ? *p == line_end : buf < p && p[-1]) + { + *p = '\0'; + (*add_func) (ex, pattern); + pattern = p + 1; + } + + errno = e; + return e ? -1 : 0; +} diff --git a/src/apps/bin/grep-2.5/lib/exclude.h b/src/apps/bin/grep-2.5/lib/exclude.h new file mode 100644 index 0000000000..8a48a00ece --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/exclude.h @@ -0,0 +1,35 @@ +/* exclude.h -- declarations for excluding file names + Copyright 1992, 1993, 1994, 1997, 1999 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, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Paul Eggert */ + +#ifndef PARAMS +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +#endif + +struct exclude; + +struct exclude *new_exclude PARAMS ((void)); +void add_exclude PARAMS ((struct exclude *, char const *)); +int add_exclude_file PARAMS ((void (*) (struct exclude *, char const *), + struct exclude *, char const *, char)); +int excluded_filename PARAMS ((struct exclude const *, char const *, int)); diff --git a/src/apps/bin/grep-2.5/lib/fnmatch.c b/src/apps/bin/grep-2.5/lib/fnmatch.c new file mode 100644 index 0000000000..9bff8c220a --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/fnmatch.c @@ -0,0 +1,230 @@ +/* Copyright 1991, 1992, 1993, 1996, 1997, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +/* Enable GNU extensions in fnmatch.h. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#include +#include +#include + +#if defined STDC_HEADERS || !defined isascii +# define IN_CTYPE_DOMAIN(c) 1 +#else +# define IN_CTYPE_DOMAIN(c) isascii (c) +#endif + +#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c)) + + +#ifndef errno +extern int errno; +#endif + +/* Match STRING against the filename pattern PATTERN, returning zero if + it matches, nonzero if not. */ +int +fnmatch (const char *pattern, const char *string, int flags) +{ + register const char *p = pattern, *n = string; + register char c; + +/* Note that this evaluates C many times. */ +#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER ((unsigned char) (c)) \ + ? tolower ((unsigned char) (c)) \ + : (c)) + + while ((c = *p++) != '\0') + { + c = FOLD (c); + + switch (c) + { + case '?': + if (*n == '\0') + return FNM_NOMATCH; + else if ((flags & FNM_FILE_NAME) && *n == '/') + return FNM_NOMATCH; + else if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + break; + + case '\\': + if (!(flags & FNM_NOESCAPE)) + { + c = *p++; + if (c == '\0') + /* Trailing \ loses. */ + return FNM_NOMATCH; + c = FOLD (c); + } + if (FOLD (*n) != c) + return FNM_NOMATCH; + break; + + case '*': + if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + + for (c = *p++; c == '?' || c == '*'; c = *p++) + { + if (c == '?') + { + /* A ? needs to match one character. */ + if (*n == '\0' || (*n == '/' && (flags & FNM_FILE_NAME))) + /* There isn't another character; no match. */ + return FNM_NOMATCH; + else + /* One character of the string is consumed in matching + this ? wildcard, so *??? won't match if there are + less than three characters. */ + ++n; + } + } + + if (c == '\0') + { + if ((flags & (FNM_FILE_NAME | FNM_LEADING_DIR)) == FNM_FILE_NAME) + for (; *n != '\0'; n++) + if (*n == '/') + return FNM_NOMATCH; + return 0; + } + + { + char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; + c1 = FOLD (c1); + for (--p; *n != '\0'; ++n) + if ((c == '[' || FOLD (*n) == c1) && + fnmatch (p, n, flags & ~FNM_PERIOD) == 0) + return 0; + else if (*n == '/' && (flags & FNM_FILE_NAME)) + break; + return FNM_NOMATCH; + } + + case '[': + { + /* Nonzero if the sense of the character class is inverted. */ + register int not; + + if (*n == '\0') + return FNM_NOMATCH; + + if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + + not = (*p == '!' || *p == '^'); + if (not) + ++p; + + c = *p++; + for (;;) + { + register char cstart = c, cend = c; + + if (!(flags & FNM_NOESCAPE) && c == '\\') + { + if (*p == '\0') + return FNM_NOMATCH; + cstart = cend = *p++; + } + + cstart = cend = FOLD (cstart); + + if (c == '\0') + /* [ (unterminated) loses. */ + return FNM_NOMATCH; + + c = *p++; + c = FOLD (c); + + if ((flags & FNM_FILE_NAME) && c == '/') + /* [/] can never match. */ + return FNM_NOMATCH; + + if (c == '-' && *p != ']') + { + cend = *p++; + if (!(flags & FNM_NOESCAPE) && cend == '\\') + cend = *p++; + if (cend == '\0') + return FNM_NOMATCH; + cend = FOLD (cend); + + c = *p++; + } + + if (FOLD (*n) >= cstart && FOLD (*n) <= cend) + goto matched; + + if (c == ']') + break; + } + if (!not) + return FNM_NOMATCH; + break; + + matched:; + /* Skip the rest of the [...] that already matched. */ + while (c != ']') + { + if (c == '\0') + /* [... (unterminated) loses. */ + return FNM_NOMATCH; + + c = *p++; + if (!(flags & FNM_NOESCAPE) && c == '\\') + { + if (*p == '\0') + return FNM_NOMATCH; + /* XXX 1003.2d11 is unclear if this is right. */ + ++p; + } + } + if (not) + return FNM_NOMATCH; + } + break; + + default: + if (c != FOLD (*n)) + return FNM_NOMATCH; + } + + ++n; + } + + if (*n == '\0') + return 0; + + if ((flags & FNM_LEADING_DIR) && *n == '/') + /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ + return 0; + + return FNM_NOMATCH; + +#undef FOLD +} diff --git a/src/apps/bin/grep-2.5/lib/fnmatch.h b/src/apps/bin/grep-2.5/lib/fnmatch.h new file mode 100644 index 0000000000..af1dcf523b --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/fnmatch.h @@ -0,0 +1,69 @@ +/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _FNMATCH_H + +#define _FNMATCH_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) +#undef __P +#define __P(protos) protos +#else /* Not C++ or ANSI C. */ +#undef __P +#define __P(protos) () +/* We can get away without defining `const' here only because in this file + it is used only inside the prototype for `fnmatch', which is elided in + non-ANSI C where `const' is problematical. */ +#endif /* C++ or ANSI C. */ + + +/* We #undef these before defining them because some losing systems + (HP-UX A.08.07 for example) define these in . */ +#undef FNM_PATHNAME +#undef FNM_NOESCAPE +#undef FNM_PERIOD + +/* Bits set in the FLAGS argument to `fnmatch'. */ +#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ +#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ +#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ + +#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) +#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +#endif + +/* Value returned by `fnmatch' if STRING does not match PATTERN. */ +#define FNM_NOMATCH 1 + +/* Match STRING against the filename pattern PATTERN, + returning zero if it matches, FNM_NOMATCH if not. */ +extern int fnmatch __P ((const char *__pattern, const char *__string, + int __flags)); + +#ifdef __cplusplus +} +#endif + +#endif /* fnmatch.h */ diff --git a/src/apps/bin/grep-2.5/lib/getopt.c b/src/apps/bin/grep-2.5/lib/getopt.c new file mode 100644 index 0000000000..d176d3e7e7 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/getopt.c @@ -0,0 +1,1049 @@ +/* Getopt for GNU. + NOTE: The canonical source of this file is maintained with the GNU + C Library. Bugs can be reported to bug-glibc@gnu.org. + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +# define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +# include +#else +# if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +# ifndef const +# define const +# endif +# endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. 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. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +# include +# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +# include +# include +#endif /* GNU C library. */ + +#ifdef VMS +# include +# if HAVE_STRING_H - 0 +# include +# endif +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. + When compiling libc, the _ macro is predefined. */ +# ifdef HAVE_LIBINTL_H +# include +# define _(msgid) gettext (msgid) +# else +# define _(msgid) (msgid) +# endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* 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. */ + +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. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_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. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* 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. + + 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. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +# include +# define my_index strchr +#else + +# if HAVE_STRING_H +# include +# else +# include +# endif + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +#ifndef getenv +extern char *getenv (); +#endif + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +# if (!defined __STDC__ || !__STDC__) && !defined strlen +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +# endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* 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. */ + +static int first_nonopt; +static int last_nonopt; + +#ifdef _LIBC +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; + +static int nonoption_flags_max_len; +static int nonoption_flags_len; + +static int original_argc; +static char *const *original_argv; + +/* Make sure the environment variable bash 2.0 puts in the environment + is valid for the getopt call we must make sure that the ARGV passed + to getopt is that one passed to the process. */ +static void +__attribute__ ((unused)) +store_args_and_env (int argc, char *const *argv) +{ + /* XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ + original_argc = argc; + original_argv = argv; +} +# ifdef text_set_element +text_set_element (__libc_subinit, store_args_and_env); +# endif /* text_set_element */ + +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined __STDC__ && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#ifdef _LIBC + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined __STDC__ && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); +#endif +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#ifdef _LIBC + if (posixly_correct == NULL + && argc == original_argc && argv == original_argv) + { + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; + } + else + nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (optind == 0 || !__getopt_initialized) + { + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#ifdef _LIBC +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + 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 '?': + 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 */ diff --git a/src/apps/bin/grep-2.5/lib/getopt.h b/src/apps/bin/grep-2.5/lib/getopt.h new file mode 100644 index 0000000000..39f4a16862 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/getopt.h @@ -0,0 +1,169 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@gnu.org. + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#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 +{ +# if defined __STDC__ && __STDC__ + const char *name; +# else + char *name; +# endif + /* 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'. */ + +#if (defined __STDC__ && __STDC__) || defined PROTOTYPES +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif +#else /* not ((defined __STDC__ && __STDC__) || defined PROTOTYPES) */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* (defined __STDC__ && __STDC__) || defined PROTOTYPES */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/src/apps/bin/grep-2.5/lib/getopt1.c b/src/apps/bin/grep-2.5/lib/getopt1.c new file mode 100644 index 0000000000..9c8256567c --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/getopt1.c @@ -0,0 +1,188 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@gnu.org. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#else +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif +#endif + +#include "getopt.h" + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. 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. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* 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 (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + 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 */ diff --git a/src/apps/bin/grep-2.5/lib/hard-locale.c b/src/apps/bin/grep-2.5/lib/hard-locale.c new file mode 100644 index 0000000000..1c75b390a6 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/hard-locale.c @@ -0,0 +1,85 @@ +/* hard-locale.c -- Determine whether a locale is hard. + Copyright 1997, 1998, 1999 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +#ifndef __GNUC__ +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + # pragma alloca +# else +# ifdef _WIN32 +# include +# include +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#if HAVE_LOCALE_H +# include +#endif + +#if HAVE_STRING_H +# include +#endif + +/* Return nonzero if the current CATEGORY locale is hard, i.e. if you + can't get away with assuming traditional C or POSIX behavior. */ +int +hard_locale (int category) +{ +#if ! (defined ENABLE_NLS && HAVE_SETLOCALE) + return 0; +#else + + int hard = 1; + char const *p = setlocale (category, 0); + + if (p) + { +# if defined __GLIBC__ && __GLIBC__ >= 2 + if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0) + hard = 0; +# else + char *locale = alloca (strlen (p) + 1); + strcpy (locale, p); + + /* 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 = 0; + + /* Restore the caller's locale. */ + setlocale (category, locale); +# endif + } + + return hard; + +#endif +} diff --git a/src/apps/bin/grep-2.5/lib/hard-locale.h b/src/apps/bin/grep-2.5/lib/hard-locale.h new file mode 100644 index 0000000000..5b054d9a5c --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/hard-locale.h @@ -0,0 +1,18 @@ +#ifndef HARD_LOCALE_H_ +# define HARD_LOCALE_H_ 1 + +# if HAVE_CONFIG_H +# include +# endif + +# ifndef PARAMS +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +# endif + +int hard_locale PARAMS ((int)); + +#endif /* HARD_LOCALE_H_ */ diff --git a/src/apps/bin/grep-2.5/lib/isdir.c b/src/apps/bin/grep-2.5/lib/isdir.c new file mode 100644 index 0000000000..01cf8d5e4a --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/isdir.c @@ -0,0 +1,42 @@ +/* isdir.c -- determine whether a directory exists + Copyright (C) 1990, 1998 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +#include +#include + +#if STAT_MACROS_BROKEN +# undef S_ISDIR +#endif + +#if !defined S_ISDIR && defined S_IFDIR +# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR) +#endif + +/* If PATH is an existing directory or symbolic link to a directory, + return nonzero, else 0. */ + +int +isdir (const char *path) +{ + struct stat stats; + + return stat (path, &stats) == 0 && S_ISDIR (stats.st_mode); +} diff --git a/src/apps/bin/grep-2.5/lib/libgreputils.a b/src/apps/bin/grep-2.5/lib/libgreputils.a new file mode 100644 index 0000000000..d5a8dad6ae Binary files /dev/null and b/src/apps/bin/grep-2.5/lib/libgreputils.a differ diff --git a/src/apps/bin/grep-2.5/lib/malloc.c b/src/apps/bin/grep-2.5/lib/malloc.c new file mode 100644 index 0000000000..1d198709a9 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/malloc.c @@ -0,0 +1,26 @@ +/* rpl_malloc.c -- a replacement for malloc that don't accept 0 size + Copyright (C) 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include + +void * +rpl_malloc(size_t size) +{ + if (!size) + size++; + return malloc(size); +} diff --git a/src/apps/bin/grep-2.5/lib/memchr.c b/src/apps/bin/grep-2.5/lib/memchr.c new file mode 100644 index 0000000000..8c3b59c1bb --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/memchr.c @@ -0,0 +1,199 @@ +/* Copyright (C) 1991, 1993, 1997, 1999 Free Software Foundation, Inc. + Based on strlen implementation by Torbjorn Granlund (tege@sics.se), + with help from Dan Sahlin (dan@sics.se) and + commentary by Jim Blandy (jimb@ai.mit.edu); + adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), + and implemented by Roland McGrath (roland@ai.mit.edu). + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#undef __ptr_t +#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) +# define __ptr_t void * +#else /* Not C++ or ANSI C. */ +# define __ptr_t char * +#endif /* C++ or ANSI C. */ + +#if defined (_LIBC) +# include +#endif + +#if defined (HAVE_LIMITS_H) || defined (_LIBC) +# include +#endif + +#define LONG_MAX_32_BITS 2147483647 + +#ifndef LONG_MAX +# define LONG_MAX LONG_MAX_32_BITS +#endif + +#include + + +/* Search no more than N bytes of S for C. */ + +__ptr_t +memchr (s, c, n) + const __ptr_t s; + int c; + size_t n; +{ + const unsigned char *char_ptr; + const unsigned long int *longword_ptr; + unsigned long int longword, magic_bits, charmask; + + c = (unsigned char) c; + + /* Handle the first few characters by reading one character at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = (const unsigned char *) s; + n > 0 && ((unsigned long int) char_ptr + & (sizeof (longword) - 1)) != 0; + --n, ++char_ptr) + if (*char_ptr == c) + return (__ptr_t) char_ptr; + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to 8-byte longwords. */ + + longword_ptr = (unsigned long int *) char_ptr; + + /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits + the "holes." Note that there is a hole just to the left of + each byte, with an extra at the end: + + bits: 01111110 11111110 11111110 11111111 + bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD + + The 1-bits make sure that carries propagate to the next 0-bit. + The 0-bits provide holes for carries to fall into. */ + + if (sizeof (longword) != 4 && sizeof (longword) != 8) + abort (); + +#if LONG_MAX <= LONG_MAX_32_BITS + magic_bits = 0x7efefeff; +#else + magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff; +#endif + + /* Set up a longword, each of whose bytes is C. */ + charmask = c | (c << 8); + charmask |= charmask << 16; +#if LONG_MAX > LONG_MAX_32_BITS + charmask |= charmask << 32; +#endif + + /* Instead of the traditional loop which tests each character, + we will test a longword at a time. The tricky part is testing + if *any of the four* bytes in the longword in question are zero. */ + while (n >= sizeof (longword)) + { + /* We tentatively exit the loop if adding MAGIC_BITS to + LONGWORD fails to change any of the hole bits of LONGWORD. + + 1) Is this safe? Will it catch all the zero bytes? + Suppose there is a byte with all zeros. Any carry bits + propagating from its left will fall into the hole at its + least significant bit and stop. Since there will be no + carry from its most significant bit, the LSB of the + byte to the left will be unchanged, and the zero will be + detected. + + 2) Is this worthwhile? Will it ignore everything except + zero bytes? Suppose every byte of LONGWORD has a bit set + somewhere. There will be a carry into bit 8. If bit 8 + is set, this will carry into bit 16. If bit 8 is clear, + one of bits 9-15 must be set, so there will be a carry + into bit 16. Similarly, there will be a carry into bit + 24. If one of bits 24-30 is set, there will be a carry + into bit 31, so all of the hole bits will be changed. + + The one misfire occurs when bits 24-30 are clear and bit + 31 is set; in this case, the hole at bit 31 is not + changed. If we had access to the processor carry flag, + we could close this loophole by putting the fourth hole + at bit 32! + + So it ignores everything except 128's, when they're aligned + properly. + + 3) But wait! Aren't we looking for C, not zero? + Good point. So what we do is XOR LONGWORD with a longword, + each of whose bytes is C. This turns each byte that is C + into a zero. */ + + longword = *longword_ptr++ ^ charmask; + + /* Add MAGIC_BITS to LONGWORD. */ + if ((((longword + magic_bits) + + /* Set those bits that were unchanged by the addition. */ + ^ ~longword) + + /* Look at only the hole bits. If any of the hole bits + are unchanged, most likely one of the bytes was a + zero. */ + & ~magic_bits) != 0) + { + /* Which of the bytes was C? If none of them were, it was + a misfire; continue the search. */ + + const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); + + if (cp[0] == c) + return (__ptr_t) cp; + if (cp[1] == c) + return (__ptr_t) &cp[1]; + if (cp[2] == c) + return (__ptr_t) &cp[2]; + if (cp[3] == c) + return (__ptr_t) &cp[3]; +#if LONG_MAX > 2147483647 + if (cp[4] == c) + return (__ptr_t) &cp[4]; + if (cp[5] == c) + return (__ptr_t) &cp[5]; + if (cp[6] == c) + return (__ptr_t) &cp[6]; + if (cp[7] == c) + return (__ptr_t) &cp[7]; +#endif + } + + n -= sizeof (longword); + } + + char_ptr = (const unsigned char *) longword_ptr; + + while (n-- > 0) + { + if (*char_ptr == c) + return (__ptr_t) char_ptr; + else + ++char_ptr; + } + + return 0; +} diff --git a/src/apps/bin/grep-2.5/lib/obstack.c b/src/apps/bin/grep-2.5/lib/obstack.c new file mode 100644 index 0000000000..17c6313431 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/obstack.c @@ -0,0 +1,598 @@ +/* obstack.c - subroutines used implicitly by object stack macros + Copyright (C) 1988-1994,96,97,98,99 Free Software Foundation, Inc. + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "obstack.h" + +/* 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 /* Random thing to get __GNU_LIBRARY__. */ +#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 +#include +#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + + +#ifndef ELIDE_CODE + + +#if defined (__STDC__) && __STDC__ +#define POINTER void * +#else +#define POINTER char * +#endif + +/* Determine default alignment. */ +struct fooalign {char x; double d;}; +#define DEFAULT_ALIGNMENT \ + ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0)) +/* 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. */ +union fooround {long x; double d;}; +#define 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'. */ +#if defined (__STDC__) && __STDC__ +static void print_and_abort (void); +void (*obstack_alloc_failed_handler) (void) = print_and_abort; +#else +static void print_and_abort (); +void (*obstack_alloc_failed_handler) () = print_and_abort; +#endif + +/* Exit value used when `print_and_abort' is used. */ +#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H +#include +#endif +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 1 +#endif +int obstack_exit_failure = EXIT_FAILURE; + +/* The non-GNU-C macros copy the obstack into this global variable + to avoid multiple evaluation. */ + +struct obstack *_obstack; + +/* 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. */ + +#if defined (__STDC__) && __STDC__ +#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) +#else +#define CALL_CHUNKFUN(h, size) \ + (((h) -> use_extra_arg) \ + ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ + : (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size))) + +#define CALL_FREEFUN(h, old_chunk) \ + do { \ + if ((h) -> use_extra_arg) \ + (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ + else \ + (*(void (*) ()) (h)->freefun) ((old_chunk)); \ + } while (0) +#endif + + +/* 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 (h, size, alignment, chunkfun, freefun) + struct obstack *h; + int size; + int alignment; +#if defined (__STDC__) && __STDC__ + POINTER (*chunkfun) (long); + void (*freefun) (void *); +#else + POINTER (*chunkfun) (); + void (*freefun) (); +#endif +{ + register struct _obstack_chunk *chunk; /* points to new chunk */ + + if (alignment == 0) + alignment = (int) 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; + } + +#if defined (__STDC__) && __STDC__ + h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; + h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; +#else + h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; + h->freefun = freefun; +#endif + 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 = chunk->contents; + 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 (h, size, alignment, chunkfun, freefun, arg) + struct obstack *h; + int size; + int alignment; +#if defined (__STDC__) && __STDC__ + POINTER (*chunkfun) (POINTER, long); + void (*freefun) (POINTER, POINTER); +#else + POINTER (*chunkfun) (); + void (*freefun) (); +#endif + POINTER arg; +{ + register struct _obstack_chunk *chunk; /* points to new chunk */ + + if (alignment == 0) + alignment = (int) 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; + } + +#if defined(__STDC__) && __STDC__ + h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; + h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; +#else + h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; + h->freefun = freefun; +#endif + 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 = chunk->contents; + 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 (h, length) + 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; + + /* Compute size for new chunk. */ + new_size = (obj_size + length) + (obj_size >> 3) + 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; + + /* 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 *)new_chunk->contents)[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++) + new_chunk->contents[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->object_base == old_chunk->contents && ! h->maybe_empty_object) + { + new_chunk->prev = old_chunk->prev; + CALL_FREEFUN (h, old_chunk); + } + + h->object_base = new_chunk->contents; + h->next_free = h->object_base + obj_size; + /* The new chunk certainly contains no empty object yet. */ + h->maybe_empty_object = 0; +} + +/* 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. */ + +#if defined (__STDC__) && __STDC__ +/* 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, POINTER obj); +#endif + +int +_obstack_allocated_p (h, obj) + struct obstack *h; + POINTER 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 && ((POINTER) lp >= obj || (POINTER) (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 + +/* This function has two names with identical definitions. + This is the first one, called from non-ANSI code. */ + +void +_obstack_free (h, obj) + struct obstack *h; + POINTER 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 && ((POINTER) lp >= obj || (POINTER) (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 (); +} + +/* This function is used from ANSI code. */ + +void +obstack_free (h, obj) + struct obstack *h; + POINTER 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 && ((POINTER) lp >= obj || (POINTER) (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 (); +} + +int +_obstack_memory_used (h) + 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. */ +#ifndef _ +# ifdef HAVE_LIBINTL_H +# include +# ifndef _ +# define _(Str) gettext (Str) +# endif +# else +# define _(Str) (Str) +# endif +#endif +#if defined _LIBC && defined USE_IN_LIBIO +# include +# define fputs(s, f) _IO_fputs (s, f) +#endif + +static void +print_and_abort () +{ + fputs (_("memory exhausted"), stderr); + fputc ('\n', stderr); + exit (obstack_exit_failure); +} + +#if 0 +/* These are now turned off because the applications do not use it + and it uses bcopy via obstack_grow, which causes trouble on sysV. */ + +/* Now define the functional versions of the obstack macros. + Define them to simply use the corresponding macros to do the job. */ + +#if defined (__STDC__) && __STDC__ +/* These function definitions do not work with non-ANSI preprocessors; + they won't pass through the macro names in parentheses. */ + +/* The function names appear in parentheses in order to prevent + the macro-definitions of the names from being expanded there. */ + +POINTER (obstack_base) (obstack) + struct obstack *obstack; +{ + return obstack_base (obstack); +} + +POINTER (obstack_next_free) (obstack) + struct obstack *obstack; +{ + return obstack_next_free (obstack); +} + +int (obstack_object_size) (obstack) + struct obstack *obstack; +{ + return obstack_object_size (obstack); +} + +int (obstack_room) (obstack) + struct obstack *obstack; +{ + return obstack_room (obstack); +} + +int (obstack_make_room) (obstack, length) + struct obstack *obstack; + int length; +{ + return obstack_make_room (obstack, length); +} + +void (obstack_grow) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; +{ + obstack_grow (obstack, pointer, length); +} + +void (obstack_grow0) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; +{ + obstack_grow0 (obstack, pointer, length); +} + +void (obstack_1grow) (obstack, character) + struct obstack *obstack; + int character; +{ + obstack_1grow (obstack, character); +} + +void (obstack_blank) (obstack, length) + struct obstack *obstack; + int length; +{ + obstack_blank (obstack, length); +} + +void (obstack_1grow_fast) (obstack, character) + struct obstack *obstack; + int character; +{ + obstack_1grow_fast (obstack, character); +} + +void (obstack_blank_fast) (obstack, length) + struct obstack *obstack; + int length; +{ + obstack_blank_fast (obstack, length); +} + +POINTER (obstack_finish) (obstack) + struct obstack *obstack; +{ + return obstack_finish (obstack); +} + +POINTER (obstack_alloc) (obstack, length) + struct obstack *obstack; + int length; +{ + return obstack_alloc (obstack, length); +} + +POINTER (obstack_copy) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; +{ + return obstack_copy (obstack, pointer, length); +} + +POINTER (obstack_copy0) (obstack, pointer, length) + struct obstack *obstack; + POINTER pointer; + int length; +{ + return obstack_copy0 (obstack, pointer, length); +} + +#endif /* __STDC__ */ + +#endif /* 0 */ + +#endif /* !ELIDE_CODE */ diff --git a/src/apps/bin/grep-2.5/lib/obstack.h b/src/apps/bin/grep-2.5/lib/obstack.h new file mode 100644 index 0000000000..4d49ce024b --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/obstack.h @@ -0,0 +1,593 @@ +/* obstack.h - object stack macros + Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc. + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in /gd/gnu/lib. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* 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 use subtraction of (char *) 0 instead of casting to int + because on word-addressable machines a simple cast to int + may ignore the byte-within-word field of the pointer. */ + +#ifndef __PTR_TO_INT +# define __PTR_TO_INT(P) ((P) - (char *) 0) +#endif + +#ifndef __INT_TO_PTR +# define __INT_TO_PTR(P) ((P) + (char *) 0) +#endif + +/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is + defined, as with GNU C, use that; that way we don't pollute the + namespace with 's symbols. Otherwise, if is + available, include it and use ptrdiff_t. In traditional C, long is + the best that we can do. */ + +#ifdef __PTRDIFF_TYPE__ +# define PTR_INT_TYPE __PTRDIFF_TYPE__ +#else +# ifdef HAVE_STDDEF_H +# include +# define PTR_INT_TYPE ptrdiff_t +# else +# define PTR_INT_TYPE long +# endif +#endif + +#if defined _LIBC || defined HAVE_STRING_H +# include +# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N)) +#else +# ifdef memcpy +# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N)) +# else +# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N)) +# endif +#endif + +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 */ + PTR_INT_TYPE temp; /* Temporary for some macros. */ + int alignment_mask; /* Mask of alignment for each object. */ +#if defined __STDC__ && __STDC__ + /* 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 */ +#else + struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */ + void (*freefun) (); /* User's function to free a chunk. */ + char *extra_arg; /* first arg for chunk alloc/dealloc funcs */ +#endif + 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. */ + +#if defined __STDC__ && __STDC__ +extern void _obstack_newchunk (struct obstack *, int); +extern void _obstack_free (struct obstack *, void *); +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 *); +#else +extern void _obstack_newchunk (); +extern void _obstack_free (); +extern int _obstack_begin (); +extern int _obstack_begin_1 (); +extern int _obstack_memory_used (); +#endif + +#if defined __STDC__ && __STDC__ + +/* Do the function-declarations after the structs + but before defining the macros. */ + +void obstack_init (struct obstack *obstack); + +void * obstack_alloc (struct obstack *obstack, int size); + +void * obstack_copy (struct obstack *obstack, void *address, int size); +void * obstack_copy0 (struct obstack *obstack, void *address, int size); + +void obstack_free (struct obstack *obstack, void *block); + +void obstack_blank (struct obstack *obstack, int size); + +void obstack_grow (struct obstack *obstack, void *data, int size); +void obstack_grow0 (struct obstack *obstack, void *data, int size); + +void obstack_1grow (struct obstack *obstack, int data_char); +void obstack_ptr_grow (struct obstack *obstack, void *data); +void obstack_int_grow (struct obstack *obstack, int data); + +void * obstack_finish (struct obstack *obstack); + +int obstack_object_size (struct obstack *obstack); + +int obstack_room (struct obstack *obstack); +void obstack_make_room (struct obstack *obstack, int size); +void obstack_1grow_fast (struct obstack *obstack, int data_char); +void obstack_ptr_grow_fast (struct obstack *obstack, void *data); +void obstack_int_grow_fast (struct obstack *obstack, int data); +void obstack_blank_fast (struct obstack *obstack, int size); + +void * obstack_base (struct obstack *obstack); +void * obstack_next_free (struct obstack *obstack); +int obstack_alignment_mask (struct obstack *obstack); +int obstack_chunk_size (struct obstack *obstack); +int obstack_memory_used (struct obstack *obstack); + +#endif /* __STDC__ */ + +/* Non-ANSI C cannot really support alternative functions for these macros, + so we do not declare them. */ + +/* 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. */ +#if defined __STDC__ && __STDC__ +extern void (*obstack_alloc_failed_handler) (void); +#else +extern void (*obstack_alloc_failed_handler) (); +#endif + +/* 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) ((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 in + standard C version. */ +#if defined __STDC__ && __STDC__ + +# 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)) + +#else + +# define obstack_init(h) \ + _obstack_begin ((h), 0, 0, \ + (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free) + +# define obstack_begin(h, size) \ + _obstack_begin ((h), (size), 0, \ + (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free) + +# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ + _obstack_begin ((h), (size), (alignment), \ + (void *(*) ()) (chunkfun), (void (*) ()) (freefun)) + +# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ + _obstack_begin_1 ((h), (size), (alignment), \ + (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg)) + +# define obstack_chunkfun(h, newchunkfun) \ + ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun)) + +# define obstack_freefun(h, newfreefun) \ + ((h) -> freefun = (void (*)()) (newfreefun)) + +#endif + +#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 *__o = (OBSTACK); \ + (unsigned) (__o->next_free - __o->object_base); }) + +# define obstack_room(OBSTACK) \ + __extension__ \ + ({ struct obstack *__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 *__o = (OBSTACK); \ + (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); }) + +# 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); \ + _obstack_memcpy (__o->next_free, (char *) (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); \ + _obstack_memcpy (__o->next_free, (char *) (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); \ + *(__o->next_free)++ = (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 *)); \ + *((void **)__o->next_free)++ = ((void *)datum); \ + (void) 0; }) + +# 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)); \ + *((int *)__o->next_free)++ = ((int)datum); \ + (void) 0; }) + +# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr) +# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) + +# 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); \ + __o->next_free += __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; \ + value = (void *) __o1->object_base; \ + if (__o1->next_free == value) \ + __o1->maybe_empty_object = 1; \ + __o1->next_free \ + = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\ + & ~ (__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 - (h)->chunk->contents == 0) + +/* 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 = (length), \ + (((h)->next_free + (h)->temp > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), (h)->temp), 0) : 0)) + +# define obstack_grow(h,where,length) \ +( (h)->temp = (length), \ + (((h)->next_free + (h)->temp > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ + _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \ + (h)->next_free += (h)->temp) + +# define obstack_grow0(h,where,length) \ +( (h)->temp = (length), \ + (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \ + _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \ + (h)->next_free += (h)->temp, \ + *((h)->next_free)++ = 0) + +# define obstack_1grow(h,datum) \ +( (((h)->next_free + 1 > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), 1), 0) : 0), \ + (*((h)->next_free)++ = (datum))) + +# define obstack_ptr_grow(h,datum) \ +( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ + (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum))) + +# define obstack_int_grow(h,datum) \ +( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ + ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ + (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum))) + +# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr) +# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) + +# define obstack_blank(h,length) \ +( (h)->temp = (length), \ + (((h)->chunk_limit - (h)->next_free < (h)->temp) \ + ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ + ((h)->next_free += (h)->temp)) + +# 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 = __PTR_TO_INT ((h)->object_base), \ + (h)->next_free \ + = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \ + & ~ ((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, \ + __INT_TO_PTR ((h)->temp)) + +# if defined __STDC__ && __STDC__ +# define obstack_free(h,obj) \ +( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ + (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ + ? (int) ((h)->next_free = (h)->object_base \ + = (h)->temp + (char *) (h)->chunk) \ + : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) +# else +# define obstack_free(h,obj) \ +( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ + (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ + ? (int) ((h)->next_free = (h)->object_base \ + = (h)->temp + (char *) (h)->chunk) \ + : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0))) +# endif + +#endif /* not __GNUC__ or not __STDC__ */ + +#ifdef __cplusplus +} /* C++ */ +#endif + +#endif /* obstack.h */ diff --git a/src/apps/bin/grep-2.5/lib/quotearg.c b/src/apps/bin/grep-2.5/lib/quotearg.c new file mode 100644 index 0000000000..2a7ba4c445 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/quotearg.c @@ -0,0 +1,613 @@ +/* quotearg.c - quote arguments for output + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Paul Eggert */ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_STDDEF_H +# include /* For the definition of size_t on windows w/MSVC. */ +#endif +#include +#include +#include + +#include + +#if ENABLE_NLS +# include +# define _(text) gettext (text) +#else +# define _(text) text +#endif +#define N_(text) text + +#if HAVE_LIMITS_H +# include +#endif +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif +#ifndef UCHAR_MAX +# define UCHAR_MAX ((unsigned char) -1) +#endif + +#if HAVE_C_BACKSLASH_A +# define ALERT_CHAR '\a' +#else +# define ALERT_CHAR '\7' +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_STRING_H +# include +#endif + +#if HAVE_WCHAR_H +# include +#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 mbsinit(ps) 1 +# define iswprint(wc) ISPRINT ((unsigned char) (wc)) +#endif + +#ifndef iswprint +# if HAVE_WCTYPE_H +# include +# endif +# if !defined iswprint && !HAVE_ISWPRINT +# define iswprint(wc) 1 +# endif +#endif + +#define INT_BITS (sizeof (int) * CHAR_BIT) + +#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 solaris2.6. */ +#undef ISPRINT +#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c)) + +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. */ + 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) +{ + struct quoting_options *p + = (struct quoting_options *) xmalloc (sizeof (struct quoting_options)); + *p = *(o ? o : &default_quoting_options); + 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; + 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 -1, 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; + int backslash_escapes = 0; + int 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 = 1; + quote_string = "\""; + quote_string_len = 1; + break; + + case escape_quoting_style: + backslash_escapes = 1; + break; + + case locale_quoting_style: + case clocale_quoting_style: + { + /* 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. */ + + 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 = 1; + 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_t) -1 ? 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 '?': + 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. */ + i += 2; + c = arg[i + 2]; + STORE ('?'); + STORE ('\\'); + STORE ('?'); + break; + } + break; + + default: + break; + } + break; + + case ALERT_CHAR: 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 '~': + if (i != 0) + break; + /* Fall through. */ + case ' ': + case '!': /* special in bash */ + case '"': case '$': case '&': + case '(': case ')': case '*': case ';': + case '<': 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 '=': + 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': + case '{': case '}': + /* 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; + + int printable; + + if (unibyte_locale) + { + m = 1; + printable = ISPRINT (c); + } + else + { + mbstate_t mbstate; + memset (&mbstate, 0, sizeof mbstate); + + m = 0; + printable = 1; + if (argsize == (size_t) -1) + 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 = 0; + break; + } + else if (bytes == (size_t) -2) + { + printable = 0; + while (i + m < argsize && arg[i + m]) + m++; + break; + } + else + { + if (! iswprint (w)) + printable = 0; + 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 (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 -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) +{ + struct quoting_options const *p = o ? o : &default_quoting_options; + return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, + p->style, p); +} + +/* Use storage slot N to return a quoted version of the string ARG. + 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, + struct quoting_options const *options) +{ + /* 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; + struct slotvec + { + size_t size; + char *val; + }; + static struct slotvec slotvec0 = {sizeof slot0, slot0}; + static struct slotvec *slotvec = &slotvec0; + + if (nslots <= n) + { + int n1 = n + 1; + size_t s = n1 * sizeof (struct slotvec); + if (! (0 < n1 && n1 == s / sizeof (struct slotvec))) + abort (); + if (slotvec == &slotvec0) + { + slotvec = (struct slotvec *) xmalloc (sizeof (struct slotvec)); + *slotvec = slotvec0; + } + slotvec = (struct slotvec *) xrealloc (slotvec, s); + memset (slotvec + nslots, 0, (n1 - nslots) * sizeof (struct slotvec)); + nslots = n; + } + + { + size_t size = slotvec[n].size; + char *val = slotvec[n].val; + size_t qsize = quotearg_buffer (val, size, arg, (size_t) -1, options); + + if (size <= qsize) + { + slotvec[n].size = size = qsize + 1; + slotvec[n].val = val = xrealloc (val == slot0 ? 0 : val, size); + quotearg_buffer (val, size, arg, (size_t) -1, options); + } + + return val; + } +} + +char * +quotearg_n (unsigned int n, char const *arg) +{ + return quotearg_n_options (n, arg, &default_quoting_options); +} + +char * +quotearg (char const *arg) +{ + return quotearg_n (0, arg); +} + +char * +quotearg_n_style (unsigned int n, enum quoting_style s, char const *arg) +{ + struct quoting_options o; + o.style = s; + memset (o.quote_these_too, 0, sizeof o.quote_these_too); + return quotearg_n_options (n, arg, &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, &options); +} + +char * +quotearg_colon (char const *arg) +{ + return quotearg_char (arg, ':'); +} diff --git a/src/apps/bin/grep-2.5/lib/quotearg.h b/src/apps/bin/grep-2.5/lib/quotearg.h new file mode 100644 index 0000000000..f6463b1aa3 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/quotearg.h @@ -0,0 +1,110 @@ +/* quotearg.h - quote arguments for output + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Paul Eggert */ + +/* Basic quoting styles. */ +enum quoting_style + { + literal_quoting_style, /* --quoting-style=literal */ + shell_quoting_style, /* --quoting-style=shell */ + shell_always_quoting_style, /* --quoting-style=shell-always */ + c_quoting_style, /* --quoting-style=c */ + escape_quoting_style, /* --quoting-style=escape */ + locale_quoting_style, /* --quoting-style=locale */ + clocale_quoting_style /* --quoting-style=clocale */ + }; + +/* 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; + +#ifndef PARAMS +# if defined PROTOTYPES || defined __STDC__ +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +#endif + +/* 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 + PARAMS ((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 PARAMS ((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 PARAMS ((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 PARAMS ((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 PARAMS ((char *buffer, size_t buffersize, + 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 PARAMS ((unsigned int n, char const *arg)); + +/* Equivalent to quotearg_n (0, ARG). */ +char *quotearg PARAMS ((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 PARAMS ((unsigned int n, enum quoting_style s, + char const *arg)); + +/* Equivalent to quotearg_n_style (0, S, ARG). */ +char *quotearg_style PARAMS ((enum quoting_style s, char const *arg)); + +/* Like quotearg (ARG), except also quote any instances of CH. */ +char *quotearg_char PARAMS ((char const *arg, char ch)); + +/* Equivalent to quotearg_char (ARG, ':'). */ +char *quotearg_colon PARAMS ((char const *arg)); diff --git a/src/apps/bin/grep-2.5/lib/realloc.c b/src/apps/bin/grep-2.5/lib/realloc.c new file mode 100644 index 0000000000..2eef59ca4f --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/realloc.c @@ -0,0 +1,32 @@ +/* rpl_realloc.c -- a replacement for broken realloc implementations + Copyright (C) 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include + +void * +rpl_realloc(void *ptr, size_t size) +{ + if (!ptr) + return malloc(size); + if (!size) + { + if (ptr) + free(ptr); + return malloc(size); + } + return realloc(ptr, size); +} diff --git a/src/apps/bin/grep-2.5/lib/regex.c b/src/apps/bin/grep-2.5/lib/regex.c new file mode 100644 index 0000000000..358071b0dc --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/regex.c @@ -0,0 +1,7888 @@ +/* Extended regular expression matching and search library, + version 0.12. + (Implements POSIX draft P1003.2/D11.2, except for some of the + internationalization features.) + Copyright (C) 1993-1999, 2000, 2001 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* AIX requires this to be the first thing in the file. */ +#if defined _AIX && !defined REGEX_MALLOC + #pragma alloca +#endif + +#undef _GNU_SOURCE +#define _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifndef PARAMS +# if defined __GNUC__ || (defined __STDC__ && __STDC__) +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif /* GCC. */ +#endif /* Not PARAMS. */ + +#if defined STDC_HEADERS && !defined emacs +# include +#else +/* We need this for `regex.h', and perhaps for the Emacs include files. */ +# include +#endif + +#define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC) + +/* For platform which support the ISO C amendement 1 functionality we + support user defined character classes. */ +#if defined _LIBC || WIDE_CHAR_SUPPORT +/* Solaris 2.5 has a bug: must be included before . */ +# include +# include +#endif + +/* This is for multi byte string support. */ +#ifdef MBS_SUPPORT +# define CHAR_TYPE wchar_t +# define US_CHAR_TYPE wchar_t/* unsigned character type */ +# define COMPILED_BUFFER_VAR wc_buffer +# define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */ +# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_TYPE)+1) +# define PUT_CHAR(c) \ + do { \ + if (MB_CUR_MAX == 1) \ + putchar (c); \ + else \ + printf ("%C", (wint_t) c); /* Should we use wide stream?? */ \ + } while (0) +# define TRUE 1 +# define FALSE 0 +#else +# define CHAR_TYPE char +# define US_CHAR_TYPE unsigned char /* unsigned character type */ +# define COMPILED_BUFFER_VAR bufp->buffer +# define OFFSET_ADDRESS_SIZE 2 +# define PUT_CHAR(c) putchar (c) +#endif /* MBS_SUPPORT */ + +#ifdef _LIBC +/* We have to keep the namespace clean. */ +# define regfree(preg) __regfree (preg) +# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) +# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) +# define regerror(errcode, preg, errbuf, errbuf_size) \ + __regerror(errcode, preg, errbuf, errbuf_size) +# define re_set_registers(bu, re, nu, st, en) \ + __re_set_registers (bu, re, nu, st, en) +# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ + __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) +# define re_match(bufp, string, size, pos, regs) \ + __re_match (bufp, string, size, pos, regs) +# define re_search(bufp, string, size, startpos, range, regs) \ + __re_search (bufp, string, size, startpos, range, regs) +# define re_compile_pattern(pattern, length, bufp) \ + __re_compile_pattern (pattern, length, bufp) +# define re_set_syntax(syntax) __re_set_syntax (syntax) +# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \ + __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) +# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) + +# define btowc __btowc + +/* We are also using some library internals. */ +# include +# include +# include +# include +#endif + +/* This is for other GNU distributions with internationalized messages. */ +#if HAVE_LIBINTL_H || defined _LIBC +# include +# ifdef _LIBC +# undef gettext +# define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES) +# endif +#else +# define gettext(msgid) (msgid) +#endif + +#ifndef gettext_noop +/* This define is so xgettext can find the internationalizable + strings. */ +# define gettext_noop(String) String +#endif + +/* The `emacs' switch turns on certain matching commands + that make sense only in Emacs. */ +#ifdef emacs + +# include "lisp.h" +# include "buffer.h" +# include "syntax.h" + +#else /* not emacs */ + +/* If we are not linking with Emacs proper, + we can't use the relocating allocator + even if config.h says that we can. */ +# undef REL_ALLOC + +# if defined STDC_HEADERS || defined _LIBC +# include +# else +char *malloc (); +char *realloc (); +# endif + +/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. + If nothing else has been done, use the method below. */ +# ifdef INHIBIT_STRING_HEADER +# if !(defined HAVE_BZERO && defined HAVE_BCOPY) +# if !defined bzero && !defined bcopy +# undef INHIBIT_STRING_HEADER +# endif +# endif +# endif + +/* This is the normal way of making sure we have a bcopy and a bzero. + This is used in most programs--a few other programs avoid this + by defining INHIBIT_STRING_HEADER. */ +# ifndef INHIBIT_STRING_HEADER +# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC +# include +# ifndef bzero +# ifndef _LIBC +# define bzero(s, n) (memset (s, '\0', n), (s)) +# else +# define bzero(s, n) __bzero (s, n) +# endif +# endif +# else +# include +# ifndef memcmp +# define memcmp(s1, s2, n) bcmp (s1, s2, n) +# endif +# ifndef memcpy +# define memcpy(d, s, n) (bcopy (s, d, n), (d)) +# endif +# endif +# endif + +/* Define the syntax stuff for \<, \>, etc. */ + +/* This must be nonzero for the wordchar and notwordchar pattern + commands in re_match_2. */ +# ifndef Sword +# define Sword 1 +# endif + +# ifdef SWITCH_ENUM_BUG +# define SWITCH_ENUM_CAST(x) ((int)(x)) +# else +# define SWITCH_ENUM_CAST(x) (x) +# endif + +#endif /* not emacs */ + +#if defined _LIBC || HAVE_LIMITS_H +# include +#endif + +#ifndef MB_LEN_MAX +# define MB_LEN_MAX 1 +#endif + +/* Get the interface, including the syntax bits. */ +#include + +/* isalpha etc. are used for the character classes. */ +#include + +/* Jim Meyering writes: + + "... Some ctype macros are valid only for character codes that + isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when + using /bin/cc or gcc but without giving an ansi option). So, all + ctype uses should be through macros like ISPRINT... If + STDC_HEADERS is defined, then autoconf has verified that the ctype + macros don't need to be guarded with references to isascii. ... + Defining isascii to 1 should let any compiler worth its salt + eliminate the && through constant folding." + Solaris defines some of these symbols so we must undefine them first. */ + +#undef ISASCII +#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) +# define ISASCII(c) 1 +#else +# define ISASCII(c) isascii(c) +#endif + +#ifdef isblank +# define ISBLANK(c) (ISASCII (c) && isblank (c)) +#else +# define ISBLANK(c) ((c) == ' ' || (c) == '\t') +#endif +#ifdef isgraph +# define ISGRAPH(c) (ISASCII (c) && isgraph (c)) +#else +# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) +#endif + +#undef ISPRINT +#define ISPRINT(c) (ISASCII (c) && isprint (c)) +#define ISDIGIT(c) (ISASCII (c) && isdigit (c)) +#define ISALNUM(c) (ISASCII (c) && isalnum (c)) +#define ISALPHA(c) (ISASCII (c) && isalpha (c)) +#define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) +#define ISLOWER(c) (ISASCII (c) && islower (c)) +#define ISPUNCT(c) (ISASCII (c) && ispunct (c)) +#define ISSPACE(c) (ISASCII (c) && isspace (c)) +#define ISUPPER(c) (ISASCII (c) && isupper (c)) +#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) + +#ifdef _tolower +# define TOLOWER(c) _tolower(c) +#else +# define TOLOWER(c) tolower(c) +#endif + +#ifndef NULL +# define NULL (void *)0 +#endif + +/* We remove any previous definition of `SIGN_EXTEND_CHAR', + since ours (we hope) works properly with all combinations of + machines, compilers, `char' and `unsigned char' argument types. + (Per Bothner suggested the basic approach.) */ +#undef SIGN_EXTEND_CHAR +#if __STDC__ +# define SIGN_EXTEND_CHAR(c) ((signed char) (c)) +#else /* not __STDC__ */ +/* As in Harbison and Steele. */ +# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) +#endif + +#ifndef emacs +/* How many characters in the character set. */ +# define CHAR_SET_SIZE 256 + +# ifdef SYNTAX_TABLE + +extern char *re_syntax_table; + +# else /* not SYNTAX_TABLE */ + +static char re_syntax_table[CHAR_SET_SIZE]; + +static void init_syntax_once PARAMS ((void)); + +static void +init_syntax_once () +{ + register int c; + static int done = 0; + + if (done) + return; + bzero (re_syntax_table, sizeof re_syntax_table); + + for (c = 0; c < CHAR_SET_SIZE; ++c) + if (ISALNUM (c)) + re_syntax_table[c] = Sword; + + re_syntax_table['_'] = Sword; + + done = 1; +} + +# endif /* not SYNTAX_TABLE */ + +# define SYNTAX(c) re_syntax_table[(unsigned char) (c)] + +#endif /* emacs */ + +/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we + use `alloca' instead of `malloc'. This is because using malloc in + re_search* or re_match* could cause memory leaks when C-g is used in + Emacs; also, malloc is slower and causes storage fragmentation. On + the other hand, malloc is more portable, and easier to debug. + + Because we sometimes use alloca, some routines have to be macros, + not functions -- `alloca'-allocated space disappears at the end of the + function it is called in. */ + +#ifdef REGEX_MALLOC + +# define REGEX_ALLOCATE malloc +# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) +# define REGEX_FREE free + +#else /* not REGEX_MALLOC */ + +/* Emacs already defines alloca, sometimes. */ +# ifndef alloca + +/* Make alloca work the best possible way. */ +# ifdef __GNUC__ +# define alloca __builtin_alloca +# else /* not __GNUC__ */ +# if HAVE_ALLOCA_H +# include +# endif /* HAVE_ALLOCA_H */ +# endif /* not __GNUC__ */ + +# endif /* not alloca */ + +# define REGEX_ALLOCATE alloca + +/* Assumes a `char *destination' variable. */ +# define REGEX_REALLOCATE(source, osize, nsize) \ + (destination = (char *) alloca (nsize), \ + memcpy (destination, source, osize)) + +/* No need to do anything to free, after alloca. */ +# define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ + +#endif /* not REGEX_MALLOC */ + +/* Define how to allocate the failure stack. */ + +#if defined REL_ALLOC && defined REGEX_MALLOC + +# define REGEX_ALLOCATE_STACK(size) \ + r_alloc (&failure_stack_ptr, (size)) +# define REGEX_REALLOCATE_STACK(source, osize, nsize) \ + r_re_alloc (&failure_stack_ptr, (nsize)) +# define REGEX_FREE_STACK(ptr) \ + r_alloc_free (&failure_stack_ptr) + +#else /* not using relocating allocator */ + +# ifdef REGEX_MALLOC + +# define REGEX_ALLOCATE_STACK malloc +# define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) +# define REGEX_FREE_STACK free + +# else /* not REGEX_MALLOC */ + +# define REGEX_ALLOCATE_STACK alloca + +# define REGEX_REALLOCATE_STACK(source, osize, nsize) \ + REGEX_REALLOCATE (source, osize, nsize) +/* No need to explicitly free anything. */ +# define REGEX_FREE_STACK(arg) + +# endif /* not REGEX_MALLOC */ +#endif /* not using relocating allocator */ + + +/* True if `size1' is non-NULL and PTR is pointing anywhere inside + `string1' or just past its end. This works if PTR is NULL, which is + a good thing. */ +#define FIRST_STRING_P(ptr) \ + (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) + +/* (Re)Allocate N items of type T using malloc, or fail. */ +#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) +#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) +#define RETALLOC_IF(addr, n, t) \ + if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) +#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) + +#define BYTEWIDTH 8 /* In bits. */ + +#define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) + +#undef MAX +#undef MIN +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +typedef char boolean; +#define false 0 +#define true 1 + +static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp, + const char *string1, int size1, + const char *string2, int size2, + int pos, + struct re_registers *regs, + int stop)); + +/* These are the command codes that appear in compiled regular + expressions. Some opcodes are followed by argument bytes. A + command code can specify any interpretation whatsoever for its + arguments. Zero bytes may appear in the compiled regular expression. */ + +typedef enum +{ + no_op = 0, + + /* Succeed right away--no more backtracking. */ + succeed, + + /* Followed by one byte giving n, then by n literal bytes. */ + exactn, + +#ifdef MBS_SUPPORT + /* Same as exactn, but contains binary data. */ + exactn_bin, +#endif + + /* Matches any (more or less) character. */ + anychar, + + /* Matches any one char belonging to specified set. First + following byte is number of bitmap bytes. Then come bytes + for a bitmap saying which chars are in. Bits in each byte + are ordered low-bit-first. A character is in the set if its + bit is 1. A character too large to have a bit in the map is + automatically not in the set. */ + /* ifdef MBS_SUPPORT, following element is length of character + classes, length of collating symbols, length of equivalence + classes, length of character ranges, and length of characters. + Next, character class element, collating symbols elements, + equivalence class elements, range elements, and character + elements follow. + See regex_compile function. */ + charset, + + /* Same parameters as charset, but match any character that is + not one of those specified. */ + charset_not, + + /* Start remembering the text that is matched, for storing in a + register. Followed by one byte with the register number, in + the range 0 to one less than the pattern buffer's re_nsub + field. Then followed by one byte with the number of groups + inner to this one. (This last has to be part of the + start_memory only because we need it in the on_failure_jump + of re_match_2.) */ + start_memory, + + /* Stop remembering the text that is matched and store it in a + memory register. Followed by one byte with the register + number, in the range 0 to one less than `re_nsub' in the + pattern buffer, and one byte with the number of inner groups, + just like `start_memory'. (We need the number of inner + groups here because we don't have any easy way of finding the + corresponding start_memory when we're at a stop_memory.) */ + stop_memory, + + /* Match a duplicate of something remembered. Followed by one + byte containing the register number. */ + duplicate, + + /* Fail unless at beginning of line. */ + begline, + + /* Fail unless at end of line. */ + endline, + + /* Succeeds if at beginning of buffer (if emacs) or at beginning + of string to be matched (if not). */ + begbuf, + + /* Analogously, for end of buffer/string. */ + endbuf, + + /* Followed by two byte relative address to which to jump. */ + jump, + + /* Same as jump, but marks the end of an alternative. */ + jump_past_alt, + + /* Followed by two-byte relative address of place to resume at + in case of failure. */ + /* ifdef MBS_SUPPORT, the size of address is 1. */ + on_failure_jump, + + /* Like on_failure_jump, but pushes a placeholder instead of the + current string position when executed. */ + on_failure_keep_string_jump, + + /* Throw away latest failure point and then jump to following + two-byte relative address. */ + /* ifdef MBS_SUPPORT, the size of address is 1. */ + pop_failure_jump, + + /* Change to pop_failure_jump if know won't have to backtrack to + match; otherwise change to jump. This is used to jump + back to the beginning of a repeat. If what follows this jump + clearly won't match what the repeat does, such that we can be + sure that there is no use backtracking out of repetitions + already matched, then we change it to a pop_failure_jump. + Followed by two-byte address. */ + /* ifdef MBS_SUPPORT, the size of address is 1. */ + maybe_pop_jump, + + /* Jump to following two-byte address, and push a dummy failure + point. This failure point will be thrown away if an attempt + is made to use it for a failure. A `+' construct makes this + before the first repeat. Also used as an intermediary kind + of jump when compiling an alternative. */ + /* ifdef MBS_SUPPORT, the size of address is 1. */ + dummy_failure_jump, + + /* Push a dummy failure point and continue. Used at the end of + alternatives. */ + push_dummy_failure, + + /* Followed by two-byte relative address and two-byte number n. + After matching N times, jump to the address upon failure. */ + /* ifdef MBS_SUPPORT, the size of address is 1. */ + succeed_n, + + /* Followed by two-byte relative address, and two-byte number n. + Jump to the address N times, then fail. */ + /* ifdef MBS_SUPPORT, the size of address is 1. */ + jump_n, + + /* Set the following two-byte relative address to the + subsequent two-byte number. The address *includes* the two + bytes of number. */ + /* ifdef MBS_SUPPORT, the size of address is 1. */ + set_number_at, + + wordchar, /* Matches any word-constituent character. */ + notwordchar, /* Matches any char that is not a word-constituent. */ + + wordbeg, /* Succeeds if at word beginning. */ + wordend, /* Succeeds if at word end. */ + + wordbound, /* Succeeds if at a word boundary. */ + notwordbound /* Succeeds if not at a word boundary. */ + +#ifdef emacs + ,before_dot, /* Succeeds if before point. */ + at_dot, /* Succeeds if at point. */ + after_dot, /* Succeeds if after point. */ + + /* Matches any character whose syntax is specified. Followed by + a byte which contains a syntax code, e.g., Sword. */ + syntaxspec, + + /* Matches any character whose syntax is not that specified. */ + notsyntaxspec +#endif /* emacs */ +} re_opcode_t; + +/* Common operations on the compiled pattern. */ + +/* Store NUMBER in two contiguous bytes starting at DESTINATION. */ +/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ + +#ifdef MBS_SUPPORT +# define STORE_NUMBER(destination, number) \ + do { \ + *(destination) = (US_CHAR_TYPE)(number); \ + } while (0) +#else +# define STORE_NUMBER(destination, number) \ + do { \ + (destination)[0] = (number) & 0377; \ + (destination)[1] = (number) >> 8; \ + } while (0) +#endif /* MBS_SUPPORT */ + +/* Same as STORE_NUMBER, except increment DESTINATION to + the byte after where the number is stored. Therefore, DESTINATION + must be an lvalue. */ +/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ + +#define STORE_NUMBER_AND_INCR(destination, number) \ + do { \ + STORE_NUMBER (destination, number); \ + (destination) += OFFSET_ADDRESS_SIZE; \ + } while (0) + +/* Put into DESTINATION a number stored in two contiguous bytes starting + at SOURCE. */ +/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ + +#ifdef MBS_SUPPORT +# define EXTRACT_NUMBER(destination, source) \ + do { \ + (destination) = *(source); \ + } while (0) +#else +# define EXTRACT_NUMBER(destination, source) \ + do { \ + (destination) = *(source) & 0377; \ + (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ + } while (0) +#endif + +#ifdef DEBUG +static void extract_number _RE_ARGS ((int *dest, US_CHAR_TYPE *source)); +static void +extract_number (dest, source) + int *dest; + US_CHAR_TYPE *source; +{ +#ifdef MBS_SUPPORT + *dest = *source; +#else + int temp = SIGN_EXTEND_CHAR (*(source + 1)); + *dest = *source & 0377; + *dest += temp << 8; +#endif +} + +# ifndef EXTRACT_MACROS /* To debug the macros. */ +# undef EXTRACT_NUMBER +# define EXTRACT_NUMBER(dest, src) extract_number (&dest, src) +# endif /* not EXTRACT_MACROS */ + +#endif /* DEBUG */ + +/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number. + SOURCE must be an lvalue. */ + +#define EXTRACT_NUMBER_AND_INCR(destination, source) \ + do { \ + EXTRACT_NUMBER (destination, source); \ + (source) += OFFSET_ADDRESS_SIZE; \ + } while (0) + +#ifdef DEBUG +static void extract_number_and_incr _RE_ARGS ((int *destination, + US_CHAR_TYPE **source)); +static void +extract_number_and_incr (destination, source) + int *destination; + US_CHAR_TYPE **source; +{ + extract_number (destination, *source); + *source += OFFSET_ADDRESS_SIZE; +} + +# ifndef EXTRACT_MACROS +# undef EXTRACT_NUMBER_AND_INCR +# define EXTRACT_NUMBER_AND_INCR(dest, src) \ + extract_number_and_incr (&dest, &src) +# endif /* not EXTRACT_MACROS */ + +#endif /* DEBUG */ + +/* If DEBUG is defined, Regex prints many voluminous messages about what + it is doing (if the variable `debug' is nonzero). If linked with the + main program in `iregex.c', you can enter patterns and strings + interactively. And if linked with the main program in `main.c' and + the other test files, you can run the already-written tests. */ + +#ifdef DEBUG + +/* We use standard I/O for debugging. */ +# include + +/* It is useful to test things that ``must'' be true when debugging. */ +# include + +static int debug; + +# define DEBUG_STATEMENT(e) e +# define DEBUG_PRINT1(x) if (debug) printf (x) +# define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) +# define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) +# define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) +# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ + if (debug) print_partial_compiled_pattern (s, e) +# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ + if (debug) print_double_string (w, s1, sz1, s2, sz2) + + +/* Print the fastmap in human-readable form. */ + +void +print_fastmap (fastmap) + char *fastmap; +{ + unsigned was_a_range = 0; + unsigned i = 0; + + while (i < (1 << BYTEWIDTH)) + { + if (fastmap[i++]) + { + was_a_range = 0; + putchar (i - 1); + while (i < (1 << BYTEWIDTH) && fastmap[i]) + { + was_a_range = 1; + i++; + } + if (was_a_range) + { + printf ("-"); + putchar (i - 1); + } + } + } + putchar ('\n'); +} + + +/* Print a compiled pattern string in human-readable form, starting at + the START pointer into it and ending just before the pointer END. */ + +void +print_partial_compiled_pattern (start, end) + US_CHAR_TYPE *start; + US_CHAR_TYPE *end; +{ + int mcnt, mcnt2; + US_CHAR_TYPE *p1; + US_CHAR_TYPE *p = start; + US_CHAR_TYPE *pend = end; + + if (start == NULL) + { + printf ("(null)\n"); + return; + } + + /* Loop over pattern commands. */ + while (p < pend) + { +#ifdef _LIBC + printf ("%td:\t", p - start); +#else + printf ("%ld:\t", (long int) (p - start)); +#endif + + switch ((re_opcode_t) *p++) + { + case no_op: + printf ("/no_op"); + break; + + case exactn: + mcnt = *p++; + printf ("/exactn/%d", mcnt); + do + { + putchar ('/'); + PUT_CHAR (*p++); + } + while (--mcnt); + break; + +#ifdef MBS_SUPPORT + case exactn_bin: + mcnt = *p++; + printf ("/exactn_bin/%d", mcnt); + do + { + printf("/%lx", (long int) *p++); + } + while (--mcnt); + break; +#endif /* MBS_SUPPORT */ + + case start_memory: + mcnt = *p++; + printf ("/start_memory/%d/%ld", mcnt, (long int) *p++); + break; + + case stop_memory: + mcnt = *p++; + printf ("/stop_memory/%d/%ld", mcnt, (long int) *p++); + break; + + case duplicate: + printf ("/duplicate/%ld", (long int) *p++); + break; + + case anychar: + printf ("/anychar"); + break; + + case charset: + case charset_not: + { +#ifdef MBS_SUPPORT + int i, length; + wchar_t *workp = p; + printf ("/charset [%s", + (re_opcode_t) *(workp - 1) == charset_not ? "^" : ""); + p += 5; + length = *workp++; /* the length of char_classes */ + for (i=0 ; ibuffer; + + print_partial_compiled_pattern (buffer, buffer + + bufp->used / sizeof(US_CHAR_TYPE)); + printf ("%ld bytes used/%ld bytes allocated.\n", + bufp->used, bufp->allocated); + + if (bufp->fastmap_accurate && bufp->fastmap) + { + printf ("fastmap: "); + print_fastmap (bufp->fastmap); + } + +#ifdef _LIBC + printf ("re_nsub: %Zd\t", bufp->re_nsub); +#else + printf ("re_nsub: %ld\t", (long int) bufp->re_nsub); +#endif + printf ("regs_alloc: %d\t", bufp->regs_allocated); + printf ("can_be_null: %d\t", bufp->can_be_null); + printf ("newline_anchor: %d\n", bufp->newline_anchor); + printf ("no_sub: %d\t", bufp->no_sub); + printf ("not_bol: %d\t", bufp->not_bol); + printf ("not_eol: %d\t", bufp->not_eol); + printf ("syntax: %lx\n", bufp->syntax); + /* Perhaps we should print the translate table? */ +} + + +void +print_double_string (where, string1, size1, string2, size2) + const CHAR_TYPE *where; + const CHAR_TYPE *string1; + const CHAR_TYPE *string2; + int size1; + int size2; +{ + int this_char; + + if (where == NULL) + printf ("(null)"); + else + { + if (FIRST_STRING_P (where)) + { + for (this_char = where - string1; this_char < size1; this_char++) + PUT_CHAR (string1[this_char]); + + where = string2; + } + + for (this_char = where - string2; this_char < size2; this_char++) + PUT_CHAR (string2[this_char]); + } +} + +void +printchar (c) + int c; +{ + putc (c, stderr); +} + +#else /* not DEBUG */ + +# undef assert +# define assert(e) + +# define DEBUG_STATEMENT(e) +# define DEBUG_PRINT1(x) +# define DEBUG_PRINT2(x1, x2) +# define DEBUG_PRINT3(x1, x2, x3) +# define DEBUG_PRINT4(x1, x2, x3, x4) +# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) +# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) + +#endif /* not DEBUG */ + +#ifdef MBS_SUPPORT +/* This convert a multibyte string to a wide character string. + And write their correspondances to offset_buffer(see below) + and write whether each wchar_t is binary data to is_binary. + This assume invalid multibyte sequences as binary data. + We assume offset_buffer and is_binary is already allocated + enough space. */ + +static size_t convert_mbs_to_wcs (CHAR_TYPE *dest, const unsigned char* src, + size_t len, int *offset_buffer, + char *is_binary); +static size_t +convert_mbs_to_wcs (dest, src, len, offset_buffer, is_binary) + CHAR_TYPE *dest; + const unsigned char* src; + size_t len; /* the length of multibyte string. */ + + /* It hold correspondances between src(char string) and + dest(wchar_t string) for optimization. + e.g. src = "xxxyzz" + dest = {'X', 'Y', 'Z'} + (each "xxx", "y" and "zz" represent one multibyte character + corresponding to 'X', 'Y' and 'Z'.) + offset_buffer = {0, 0+3("xxx"), 0+3+1("y"), 0+3+1+2("zz")} + = {0, 3, 4, 6} + */ + int *offset_buffer; + char *is_binary; +{ + wchar_t *pdest = dest; + const unsigned char *psrc = src; + size_t wc_count = 0; + + if (MB_CUR_MAX == 1) + { /* We don't need conversion. */ + for ( ; wc_count < len ; ++wc_count) + { + *pdest++ = *psrc++; + is_binary[wc_count] = FALSE; + offset_buffer[wc_count] = wc_count; + } + offset_buffer[wc_count] = wc_count; + } + else + { + /* We need conversion. */ + mbstate_t mbs; + int consumed; + size_t mb_remain = len; + size_t mb_count = 0; + + /* Initialize the conversion state. */ + memset (&mbs, 0, sizeof (mbstate_t)); + + offset_buffer[0] = 0; + for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed, + psrc += consumed) + { + consumed = mbrtowc (pdest, psrc, mb_remain, &mbs); + + if (consumed <= 0) + /* failed to convert. maybe src contains binary data. + So we consume 1 byte manualy. */ + { + *pdest = *psrc; + consumed = 1; + is_binary[wc_count] = TRUE; + } + else + is_binary[wc_count] = FALSE; + /* In sjis encoding, we use yen sign as escape character in + place of reverse solidus. So we convert 0x5c(yen sign in + sjis) to not 0xa5(yen sign in UCS2) but 0x5c(reverse + solidus in UCS2). */ + if (consumed == 1 && (int) *psrc == 0x5c && (int) *pdest == 0xa5) + *pdest = (wchar_t) *psrc; + + offset_buffer[wc_count + 1] = mb_count += consumed; + } + } + + return wc_count; +} + +#endif /* MBS_SUPPORT */ + +/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can + also be assigned to arbitrarily: each pattern buffer stores its own + syntax, so it can be changed between regex compilations. */ +/* This has no initializer because initialized variables in Emacs + become read-only after dumping. */ +reg_syntax_t re_syntax_options; + + +/* Specify the precise syntax of regexps for compilation. This provides + for compatibility for various utilities which historically have + different, incompatible syntaxes. + + The argument SYNTAX is a bit mask comprised of the various bits + defined in regex.h. We return the old syntax. */ + +reg_syntax_t +re_set_syntax (syntax) + reg_syntax_t syntax; +{ + reg_syntax_t ret = re_syntax_options; + + re_syntax_options = syntax; +#ifdef DEBUG + if (syntax & RE_DEBUG) + debug = 1; + else if (debug) /* was on but now is not */ + debug = 0; +#endif /* DEBUG */ + return ret; +} +#ifdef _LIBC +weak_alias (__re_set_syntax, re_set_syntax) +#endif + +/* This table gives an error message for each of the error codes listed + in regex.h. Obviously the order here has to be same as there. + POSIX doesn't require that we do anything for REG_NOERROR, + but why not be nice? */ + +static const char re_error_msgid[] = + { +#define REG_NOERROR_IDX 0 + gettext_noop ("Success") /* REG_NOERROR */ + "\0" +#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success") + gettext_noop ("No match") /* REG_NOMATCH */ + "\0" +#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match") + gettext_noop ("Invalid regular expression") /* REG_BADPAT */ + "\0" +#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression") + gettext_noop ("Invalid collation character") /* REG_ECOLLATE */ + "\0" +#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character") + gettext_noop ("Invalid character class name") /* REG_ECTYPE */ + "\0" +#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name") + gettext_noop ("Trailing backslash") /* REG_EESCAPE */ + "\0" +#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash") + gettext_noop ("Invalid back reference") /* REG_ESUBREG */ + "\0" +#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference") + gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */ + "\0" +#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^") + gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */ + "\0" +#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(") + gettext_noop ("Unmatched \\{") /* REG_EBRACE */ + "\0" +#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{") + gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */ + "\0" +#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}") + gettext_noop ("Invalid range end") /* REG_ERANGE */ + "\0" +#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end") + gettext_noop ("Memory exhausted") /* REG_ESPACE */ + "\0" +#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted") + gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */ + "\0" +#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression") + gettext_noop ("Premature end of regular expression") /* REG_EEND */ + "\0" +#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression") + gettext_noop ("Regular expression too big") /* REG_ESIZE */ + "\0" +#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big") + gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */ + }; + +static const size_t re_error_msgid_idx[] = + { + REG_NOERROR_IDX, + REG_NOMATCH_IDX, + REG_BADPAT_IDX, + REG_ECOLLATE_IDX, + REG_ECTYPE_IDX, + REG_EESCAPE_IDX, + REG_ESUBREG_IDX, + REG_EBRACK_IDX, + REG_EPAREN_IDX, + REG_EBRACE_IDX, + REG_BADBR_IDX, + REG_ERANGE_IDX, + REG_ESPACE_IDX, + REG_BADRPT_IDX, + REG_EEND_IDX, + REG_ESIZE_IDX, + REG_ERPAREN_IDX + }; + +/* Avoiding alloca during matching, to placate r_alloc. */ + +/* Define MATCH_MAY_ALLOCATE unless we need to make sure that the + searching and matching functions should not call alloca. On some + systems, alloca is implemented in terms of malloc, and if we're + using the relocating allocator routines, then malloc could cause a + relocation, which might (if the strings being searched are in the + ralloc heap) shift the data out from underneath the regexp + routines. + + Here's another reason to avoid allocation: Emacs + processes input from X in a signal handler; processing X input may + call malloc; if input arrives while a matching routine is calling + malloc, then we're scrod. But Emacs can't just block input while + calling matching routines; then we don't notice interrupts when + they come in. So, Emacs blocks input around all regexp calls + except the matching calls, which it leaves unprotected, in the + faith that they will not malloc. */ + +/* Normally, this is fine. */ +#define MATCH_MAY_ALLOCATE + +/* When using GNU C, we are not REALLY using the C alloca, no matter + what config.h may say. So don't take precautions for it. */ +#ifdef __GNUC__ +# undef C_ALLOCA +#endif + +/* The match routines may not allocate if (1) they would do it with malloc + and (2) it's not safe for them to use malloc. + Note that if REL_ALLOC is defined, matching would not use malloc for the + failure stack, but we would still use it for the register vectors; + so REL_ALLOC should not affect this. */ +#if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs +# undef MATCH_MAY_ALLOCATE +#endif + + +/* Failure stack declarations and macros; both re_compile_fastmap and + re_match_2 use a failure stack. These have to be macros because of + REGEX_ALLOCATE_STACK. */ + + +/* Number of failure points for which to initially allocate space + when matching. If this number is exceeded, we allocate more + space, so it is not a hard limit. */ +#ifndef INIT_FAILURE_ALLOC +# define INIT_FAILURE_ALLOC 5 +#endif + +/* Roughly the maximum number of failure points on the stack. Would be + exactly that if always used MAX_FAILURE_ITEMS items each time we failed. + This is a variable only so users of regex can assign to it; we never + change it ourselves. */ + +#ifdef INT_IS_16BIT + +# if defined MATCH_MAY_ALLOCATE +/* 4400 was enough to cause a crash on Alpha OSF/1, + whose default stack limit is 2mb. */ +long int re_max_failures = 4000; +# else +long int re_max_failures = 2000; +# endif + +union fail_stack_elt +{ + US_CHAR_TYPE *pointer; + long int integer; +}; + +typedef union fail_stack_elt fail_stack_elt_t; + +typedef struct +{ + fail_stack_elt_t *stack; + unsigned long int size; + unsigned long int avail; /* Offset of next open position. */ +} fail_stack_type; + +#else /* not INT_IS_16BIT */ + +# if defined MATCH_MAY_ALLOCATE +/* 4400 was enough to cause a crash on Alpha OSF/1, + whose default stack limit is 2mb. */ +int re_max_failures = 4000; +# else +int re_max_failures = 2000; +# endif + +union fail_stack_elt +{ + US_CHAR_TYPE *pointer; + int integer; +}; + +typedef union fail_stack_elt fail_stack_elt_t; + +typedef struct +{ + fail_stack_elt_t *stack; + unsigned size; + unsigned avail; /* Offset of next open position. */ +} fail_stack_type; + +#endif /* INT_IS_16BIT */ + +#define FAIL_STACK_EMPTY() (fail_stack.avail == 0) +#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) +#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) + + +/* Define macros to initialize and free the failure stack. + Do `return -2' if the alloc fails. */ + +#ifdef MATCH_MAY_ALLOCATE +# define INIT_FAIL_STACK() \ + do { \ + fail_stack.stack = (fail_stack_elt_t *) \ + REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ + \ + if (fail_stack.stack == NULL) \ + return -2; \ + \ + fail_stack.size = INIT_FAILURE_ALLOC; \ + fail_stack.avail = 0; \ + } while (0) + +# define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack) +#else +# define INIT_FAIL_STACK() \ + do { \ + fail_stack.avail = 0; \ + } while (0) + +# define RESET_FAIL_STACK() +#endif + + +/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items. + + Return 1 if succeeds, and 0 if either ran out of memory + allocating space for it or it was already too large. + + REGEX_REALLOCATE_STACK requires `destination' be declared. */ + +#define DOUBLE_FAIL_STACK(fail_stack) \ + ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \ + ? 0 \ + : ((fail_stack).stack = (fail_stack_elt_t *) \ + REGEX_REALLOCATE_STACK ((fail_stack).stack, \ + (fail_stack).size * sizeof (fail_stack_elt_t), \ + ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \ + \ + (fail_stack).stack == NULL \ + ? 0 \ + : ((fail_stack).size <<= 1, \ + 1))) + + +/* Push pointer POINTER on FAIL_STACK. + Return 1 if was able to do so and 0 if ran out of memory allocating + space to do so. */ +#define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \ + ((FAIL_STACK_FULL () \ + && !DOUBLE_FAIL_STACK (FAIL_STACK)) \ + ? 0 \ + : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \ + 1)) + +/* Push a pointer value onto the failure stack. + Assumes the variable `fail_stack'. Probably should only + be called from within `PUSH_FAILURE_POINT'. */ +#define PUSH_FAILURE_POINTER(item) \ + fail_stack.stack[fail_stack.avail++].pointer = (US_CHAR_TYPE *) (item) + +/* This pushes an integer-valued item onto the failure stack. + Assumes the variable `fail_stack'. Probably should only + be called from within `PUSH_FAILURE_POINT'. */ +#define PUSH_FAILURE_INT(item) \ + fail_stack.stack[fail_stack.avail++].integer = (item) + +/* Push a fail_stack_elt_t value onto the failure stack. + Assumes the variable `fail_stack'. Probably should only + be called from within `PUSH_FAILURE_POINT'. */ +#define PUSH_FAILURE_ELT(item) \ + fail_stack.stack[fail_stack.avail++] = (item) + +/* These three POP... operations complement the three PUSH... operations. + All assume that `fail_stack' is nonempty. */ +#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer +#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer +#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail] + +/* Used to omit pushing failure point id's when we're not debugging. */ +#ifdef DEBUG +# define DEBUG_PUSH PUSH_FAILURE_INT +# define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT () +#else +# define DEBUG_PUSH(item) +# define DEBUG_POP(item_addr) +#endif + + +/* Push the information about the state we will need + if we ever fail back to it. + + Requires variables fail_stack, regstart, regend, reg_info, and + num_regs_pushed be declared. DOUBLE_FAIL_STACK requires `destination' + be declared. + + Does `return FAILURE_CODE' if runs out of memory. */ + +#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ + do { \ + char *destination; \ + /* Must be int, so when we don't save any registers, the arithmetic \ + of 0 + -1 isn't done as unsigned. */ \ + /* Can't be int, since there is not a shred of a guarantee that int \ + is wide enough to hold a value of something to which pointer can \ + be assigned */ \ + active_reg_t this_reg; \ + \ + DEBUG_STATEMENT (failure_id++); \ + DEBUG_STATEMENT (nfailure_points_pushed++); \ + DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ + DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ + DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ + \ + DEBUG_PRINT2 (" slots needed: %ld\n", NUM_FAILURE_ITEMS); \ + DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ + \ + /* Ensure we have enough space allocated for what we will push. */ \ + while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ + { \ + if (!DOUBLE_FAIL_STACK (fail_stack)) \ + return failure_code; \ + \ + DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ + (fail_stack).size); \ + DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ + } \ + \ + /* Push the info, starting with the registers. */ \ + DEBUG_PRINT1 ("\n"); \ + \ + if (1) \ + for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ + this_reg++) \ + { \ + DEBUG_PRINT2 (" Pushing reg: %lu\n", this_reg); \ + DEBUG_STATEMENT (num_regs_pushed++); \ + \ + DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ + PUSH_FAILURE_POINTER (regstart[this_reg]); \ + \ + DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ + PUSH_FAILURE_POINTER (regend[this_reg]); \ + \ + DEBUG_PRINT2 (" info: %p\n ", \ + reg_info[this_reg].word.pointer); \ + DEBUG_PRINT2 (" match_null=%d", \ + REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ + DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ + DEBUG_PRINT2 (" matched_something=%d", \ + MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT2 (" ever_matched=%d", \ + EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT1 ("\n"); \ + PUSH_FAILURE_ELT (reg_info[this_reg].word); \ + } \ + \ + DEBUG_PRINT2 (" Pushing low active reg: %ld\n", lowest_active_reg);\ + PUSH_FAILURE_INT (lowest_active_reg); \ + \ + DEBUG_PRINT2 (" Pushing high active reg: %ld\n", highest_active_reg);\ + PUSH_FAILURE_INT (highest_active_reg); \ + \ + DEBUG_PRINT2 (" Pushing pattern %p:\n", pattern_place); \ + DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ + PUSH_FAILURE_POINTER (pattern_place); \ + \ + DEBUG_PRINT2 (" Pushing string %p: `", string_place); \ + DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ + size2); \ + DEBUG_PRINT1 ("'\n"); \ + PUSH_FAILURE_POINTER (string_place); \ + \ + DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ + DEBUG_PUSH (failure_id); \ + } while (0) + +/* This is the number of items that are pushed and popped on the stack + for each register. */ +#define NUM_REG_ITEMS 3 + +/* Individual items aside from the registers. */ +#ifdef DEBUG +# define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ +#else +# define NUM_NONREG_ITEMS 4 +#endif + +/* We push at most this many items on the stack. */ +/* We used to use (num_regs - 1), which is the number of registers + this regexp will save; but that was changed to 5 + to avoid stack overflow for a regexp with lots of parens. */ +#define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS) + +/* We actually push this many items. */ +#define NUM_FAILURE_ITEMS \ + (((0 \ + ? 0 : highest_active_reg - lowest_active_reg + 1) \ + * NUM_REG_ITEMS) \ + + NUM_NONREG_ITEMS) + +/* How many items can still be added to the stack without overflowing it. */ +#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) + + +/* Pops what PUSH_FAIL_STACK pushes. + + We restore into the parameters, all of which should be lvalues: + STR -- the saved data position. + PAT -- the saved pattern position. + LOW_REG, HIGH_REG -- the highest and lowest active registers. + REGSTART, REGEND -- arrays of string positions. + REG_INFO -- array of information about each subexpression. + + Also assumes the variables `fail_stack' and (if debugging), `bufp', + `pend', `string1', `size1', `string2', and `size2'. */ +#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ +{ \ + DEBUG_STATEMENT (unsigned failure_id;) \ + active_reg_t this_reg; \ + const US_CHAR_TYPE *string_temp; \ + \ + assert (!FAIL_STACK_EMPTY ()); \ + \ + /* Remove failure points and point to how many regs pushed. */ \ + DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ + DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ + DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ + \ + assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ + \ + DEBUG_POP (&failure_id); \ + DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ + \ + /* If the saved string location is NULL, it came from an \ + on_failure_keep_string_jump opcode, and we want to throw away the \ + saved NULL, thus retaining our current position in the string. */ \ + string_temp = POP_FAILURE_POINTER (); \ + if (string_temp != NULL) \ + str = (const CHAR_TYPE *) string_temp; \ + \ + DEBUG_PRINT2 (" Popping string %p: `", str); \ + DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ + DEBUG_PRINT1 ("'\n"); \ + \ + pat = (US_CHAR_TYPE *) POP_FAILURE_POINTER (); \ + DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \ + DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ + \ + /* Restore register info. */ \ + high_reg = (active_reg_t) POP_FAILURE_INT (); \ + DEBUG_PRINT2 (" Popping high active reg: %ld\n", high_reg); \ + \ + low_reg = (active_reg_t) POP_FAILURE_INT (); \ + DEBUG_PRINT2 (" Popping low active reg: %ld\n", low_reg); \ + \ + if (1) \ + for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ + { \ + DEBUG_PRINT2 (" Popping reg: %ld\n", this_reg); \ + \ + reg_info[this_reg].word = POP_FAILURE_ELT (); \ + DEBUG_PRINT2 (" info: %p\n", \ + reg_info[this_reg].word.pointer); \ + \ + regend[this_reg] = (const CHAR_TYPE *) POP_FAILURE_POINTER (); \ + DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ + \ + regstart[this_reg] = (const CHAR_TYPE *) POP_FAILURE_POINTER ();\ + DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ + } \ + else \ + { \ + for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \ + { \ + reg_info[this_reg].word.integer = 0; \ + regend[this_reg] = 0; \ + regstart[this_reg] = 0; \ + } \ + highest_active_reg = high_reg; \ + } \ + \ + set_regs_matched_done = 0; \ + DEBUG_STATEMENT (nfailure_points_popped++); \ +} /* POP_FAILURE_POINT */ + + +/* Structure for per-register (a.k.a. per-group) information. + Other register information, such as the + starting and ending positions (which are addresses), and the list of + inner groups (which is a bits list) are maintained in separate + variables. + + We are making a (strictly speaking) nonportable assumption here: that + the compiler will pack our bit fields into something that fits into + the type of `word', i.e., is something that fits into one item on the + failure stack. */ + + +/* Declarations and macros for re_match_2. */ + +typedef union +{ + fail_stack_elt_t word; + struct + { + /* This field is one if this group can match the empty string, + zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ +#define MATCH_NULL_UNSET_VALUE 3 + unsigned match_null_string_p : 2; + unsigned is_active : 1; + unsigned matched_something : 1; + unsigned ever_matched_something : 1; + } bits; +} register_info_type; + +#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) +#define IS_ACTIVE(R) ((R).bits.is_active) +#define MATCHED_SOMETHING(R) ((R).bits.matched_something) +#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) + + +/* Call this when have matched a real character; it sets `matched' flags + for the subexpressions which we are currently inside. Also records + that those subexprs have matched. */ +#define SET_REGS_MATCHED() \ + do \ + { \ + if (!set_regs_matched_done) \ + { \ + active_reg_t r; \ + set_regs_matched_done = 1; \ + for (r = lowest_active_reg; r <= highest_active_reg; r++) \ + { \ + MATCHED_SOMETHING (reg_info[r]) \ + = EVER_MATCHED_SOMETHING (reg_info[r]) \ + = 1; \ + } \ + } \ + } \ + while (0) + +/* Registers are set to a sentinel when they haven't yet matched. */ +static CHAR_TYPE reg_unset_dummy; +#define REG_UNSET_VALUE (®_unset_dummy) +#define REG_UNSET(e) ((e) == REG_UNSET_VALUE) + +/* Subroutine declarations and macros for regex_compile. */ + +static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size, + reg_syntax_t syntax, + struct re_pattern_buffer *bufp)); +static void store_op1 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, int arg)); +static void store_op2 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, + int arg1, int arg2)); +static void insert_op1 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, + int arg, US_CHAR_TYPE *end)); +static void insert_op2 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, + int arg1, int arg2, US_CHAR_TYPE *end)); +static boolean at_begline_loc_p _RE_ARGS ((const CHAR_TYPE *pattern, + const CHAR_TYPE *p, + reg_syntax_t syntax)); +static boolean at_endline_loc_p _RE_ARGS ((const CHAR_TYPE *p, + const CHAR_TYPE *pend, + reg_syntax_t syntax)); +#ifdef MBS_SUPPORT +static reg_errcode_t compile_range _RE_ARGS ((CHAR_TYPE range_start, + const CHAR_TYPE **p_ptr, + const CHAR_TYPE *pend, + char *translate, + reg_syntax_t syntax, + US_CHAR_TYPE *b, + CHAR_TYPE *char_set)); +static void insert_space _RE_ARGS ((int num, CHAR_TYPE *loc, CHAR_TYPE *end)); +#else +static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start, + const CHAR_TYPE **p_ptr, + const CHAR_TYPE *pend, + char *translate, + reg_syntax_t syntax, + US_CHAR_TYPE *b)); +#endif /* MBS_SUPPORT */ + +/* Fetch the next character in the uncompiled pattern---translating it + if necessary. Also cast from a signed character in the constant + string passed to us by the user to an unsigned char that we can use + as an array index (in, e.g., `translate'). */ +/* ifdef MBS_SUPPORT, we translate only if character <= 0xff, + because it is impossible to allocate 4GB array for some encodings + which have 4 byte character_set like UCS4. */ +#ifndef PATFETCH +# ifdef MBS_SUPPORT +# define PATFETCH(c) \ + do {if (p == pend) return REG_EEND; \ + c = (US_CHAR_TYPE) *p++; \ + if (translate && (c <= 0xff)) c = (US_CHAR_TYPE) translate[c]; \ + } while (0) +# else +# define PATFETCH(c) \ + do {if (p == pend) return REG_EEND; \ + c = (unsigned char) *p++; \ + if (translate) c = (unsigned char) translate[c]; \ + } while (0) +# endif /* MBS_SUPPORT */ +#endif + +/* Fetch the next character in the uncompiled pattern, with no + translation. */ +#define PATFETCH_RAW(c) \ + do {if (p == pend) return REG_EEND; \ + c = (US_CHAR_TYPE) *p++; \ + } while (0) + +/* Go backwards one character in the pattern. */ +#define PATUNFETCH p-- + + +/* If `translate' is non-null, return translate[D], else just D. We + cast the subscript to translate because some data is declared as + `char *', to avoid warnings when a string constant is passed. But + when we use a character as a subscript we must make it unsigned. */ +/* ifdef MBS_SUPPORT, we translate only if character <= 0xff, + because it is impossible to allocate 4GB array for some encodings + which have 4 byte character_set like UCS4. */ +#ifndef TRANSLATE +# ifdef MBS_SUPPORT +# define TRANSLATE(d) \ + ((translate && ((US_CHAR_TYPE) (d)) <= 0xff) \ + ? (char) translate[(unsigned char) (d)] : (d)) +#else +# define TRANSLATE(d) \ + (translate ? (char) translate[(unsigned char) (d)] : (d)) +# endif /* MBS_SUPPORT */ +#endif + + +/* Macros for outputting the compiled pattern into `buffer'. */ + +/* If the buffer isn't allocated when it comes in, use this. */ +#define INIT_BUF_SIZE (32 * sizeof(US_CHAR_TYPE)) + +/* Make sure we have at least N more bytes of space in buffer. */ +#ifdef MBS_SUPPORT +# define GET_BUFFER_SPACE(n) \ + while (((unsigned long)b - (unsigned long)COMPILED_BUFFER_VAR \ + + (n)*sizeof(CHAR_TYPE)) > bufp->allocated) \ + EXTEND_BUFFER () +#else +# define GET_BUFFER_SPACE(n) \ + while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \ + EXTEND_BUFFER () +#endif /* MBS_SUPPORT */ + +/* Make sure we have one more byte of buffer space and then add C to it. */ +#define BUF_PUSH(c) \ + do { \ + GET_BUFFER_SPACE (1); \ + *b++ = (US_CHAR_TYPE) (c); \ + } while (0) + + +/* Ensure we have two more bytes of buffer space and then append C1 and C2. */ +#define BUF_PUSH_2(c1, c2) \ + do { \ + GET_BUFFER_SPACE (2); \ + *b++ = (US_CHAR_TYPE) (c1); \ + *b++ = (US_CHAR_TYPE) (c2); \ + } while (0) + + +/* As with BUF_PUSH_2, except for three bytes. */ +#define BUF_PUSH_3(c1, c2, c3) \ + do { \ + GET_BUFFER_SPACE (3); \ + *b++ = (US_CHAR_TYPE) (c1); \ + *b++ = (US_CHAR_TYPE) (c2); \ + *b++ = (US_CHAR_TYPE) (c3); \ + } while (0) + +/* Store a jump with opcode OP at LOC to location TO. We store a + relative address offset by the three bytes the jump itself occupies. */ +#define STORE_JUMP(op, loc, to) \ + store_op1 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE))) + +/* Likewise, for a two-argument jump. */ +#define STORE_JUMP2(op, loc, to, arg) \ + store_op2 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), arg) + +/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ +#define INSERT_JUMP(op, loc, to) \ + insert_op1 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), b) + +/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ +#define INSERT_JUMP2(op, loc, to, arg) \ + insert_op2 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)),\ + arg, b) + + +/* This is not an arbitrary limit: the arguments which represent offsets + into the pattern are two bytes long. So if 2^16 bytes turns out to + be too small, many things would have to change. */ +/* Any other compiler which, like MSC, has allocation limit below 2^16 + bytes will have to use approach similar to what was done below for + MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up + reallocating to 0 bytes. Such thing is not going to work too well. + You have been warned!! */ +#if defined _MSC_VER && !defined WIN32 +/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. + The REALLOC define eliminates a flurry of conversion warnings, + but is not required. */ +# define MAX_BUF_SIZE 65500L +# define REALLOC(p,s) realloc ((p), (size_t) (s)) +#else +# define MAX_BUF_SIZE (1L << 16) +# define REALLOC(p,s) realloc ((p), (s)) +#endif + +/* Extend the buffer by twice its current size via realloc and + reset the pointers that pointed into the old block to point to the + correct places in the new one. If extending the buffer results in it + being larger than MAX_BUF_SIZE, then flag memory exhausted. */ +#if __BOUNDED_POINTERS__ +# define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated) +# define MOVE_BUFFER_POINTER(P) \ + (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr) +# define ELSE_EXTEND_BUFFER_HIGH_BOUND \ + else \ + { \ + SET_HIGH_BOUND (b); \ + SET_HIGH_BOUND (begalt); \ + if (fixup_alt_jump) \ + SET_HIGH_BOUND (fixup_alt_jump); \ + if (laststart) \ + SET_HIGH_BOUND (laststart); \ + if (pending_exact) \ + SET_HIGH_BOUND (pending_exact); \ + } +#else +# define MOVE_BUFFER_POINTER(P) (P) += incr +# define ELSE_EXTEND_BUFFER_HIGH_BOUND +#endif + +#ifdef MBS_SUPPORT +# define EXTEND_BUFFER() \ + do { \ + US_CHAR_TYPE *old_buffer = COMPILED_BUFFER_VAR; \ + int wchar_count; \ + if (bufp->allocated + sizeof(US_CHAR_TYPE) > MAX_BUF_SIZE) \ + return REG_ESIZE; \ + bufp->allocated <<= 1; \ + if (bufp->allocated > MAX_BUF_SIZE) \ + bufp->allocated = MAX_BUF_SIZE; \ + /* How many characters the new buffer can have? */ \ + wchar_count = bufp->allocated / sizeof(US_CHAR_TYPE); \ + if (wchar_count == 0) wchar_count = 1; \ + /* Truncate the buffer to CHAR_TYPE align. */ \ + bufp->allocated = wchar_count * sizeof(US_CHAR_TYPE); \ + RETALLOC (COMPILED_BUFFER_VAR, wchar_count, US_CHAR_TYPE); \ + bufp->buffer = (char*)COMPILED_BUFFER_VAR; \ + if (COMPILED_BUFFER_VAR == NULL) \ + return REG_ESPACE; \ + /* If the buffer moved, move all the pointers into it. */ \ + if (old_buffer != COMPILED_BUFFER_VAR) \ + { \ + int incr = COMPILED_BUFFER_VAR - old_buffer; \ + MOVE_BUFFER_POINTER (b); \ + MOVE_BUFFER_POINTER (begalt); \ + if (fixup_alt_jump) \ + MOVE_BUFFER_POINTER (fixup_alt_jump); \ + if (laststart) \ + MOVE_BUFFER_POINTER (laststart); \ + if (pending_exact) \ + MOVE_BUFFER_POINTER (pending_exact); \ + } \ + ELSE_EXTEND_BUFFER_HIGH_BOUND \ + } while (0) +#else +# define EXTEND_BUFFER() \ + do { \ + US_CHAR_TYPE *old_buffer = COMPILED_BUFFER_VAR; \ + if (bufp->allocated == MAX_BUF_SIZE) \ + return REG_ESIZE; \ + bufp->allocated <<= 1; \ + if (bufp->allocated > MAX_BUF_SIZE) \ + bufp->allocated = MAX_BUF_SIZE; \ + bufp->buffer = (US_CHAR_TYPE *) REALLOC (COMPILED_BUFFER_VAR, \ + bufp->allocated); \ + if (COMPILED_BUFFER_VAR == NULL) \ + return REG_ESPACE; \ + /* If the buffer moved, move all the pointers into it. */ \ + if (old_buffer != COMPILED_BUFFER_VAR) \ + { \ + int incr = COMPILED_BUFFER_VAR - old_buffer; \ + MOVE_BUFFER_POINTER (b); \ + MOVE_BUFFER_POINTER (begalt); \ + if (fixup_alt_jump) \ + MOVE_BUFFER_POINTER (fixup_alt_jump); \ + if (laststart) \ + MOVE_BUFFER_POINTER (laststart); \ + if (pending_exact) \ + MOVE_BUFFER_POINTER (pending_exact); \ + } \ + ELSE_EXTEND_BUFFER_HIGH_BOUND \ + } while (0) +#endif /* MBS_SUPPORT */ + +/* Since we have one byte reserved for the register number argument to + {start,stop}_memory, the maximum number of groups we can report + things about is what fits in that byte. */ +#define MAX_REGNUM 255 + +/* But patterns can have more than `MAX_REGNUM' registers. We just + ignore the excess. */ +typedef unsigned regnum_t; + + +/* Macros for the compile stack. */ + +/* Since offsets can go either forwards or backwards, this type needs to + be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ +/* int may be not enough when sizeof(int) == 2. */ +typedef long pattern_offset_t; + +typedef struct +{ + pattern_offset_t begalt_offset; + pattern_offset_t fixup_alt_jump; + pattern_offset_t inner_group_offset; + pattern_offset_t laststart_offset; + regnum_t regnum; +} compile_stack_elt_t; + + +typedef struct +{ + compile_stack_elt_t *stack; + unsigned size; + unsigned avail; /* Offset of next open position. */ +} compile_stack_type; + + +#define INIT_COMPILE_STACK_SIZE 32 + +#define COMPILE_STACK_EMPTY (compile_stack.avail == 0) +#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) + +/* The next available element. */ +#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) + + +/* Set the bit for character C in a list. */ +#define SET_LIST_BIT(c) \ + (b[((unsigned char) (c)) / BYTEWIDTH] \ + |= 1 << (((unsigned char) c) % BYTEWIDTH)) + + +/* Get the next unsigned number in the uncompiled pattern. */ +#define GET_UNSIGNED_NUMBER(num) \ + { \ + while (p != pend) \ + { \ + PATFETCH (c); \ + if (! ('0' <= c && c <= '9')) \ + break; \ + if (num <= RE_DUP_MAX) \ + { \ + if (num < 0) \ + num = 0; \ + num = num * 10 + c - '0'; \ + } \ + } \ + } + +#if defined _LIBC || WIDE_CHAR_SUPPORT +/* The GNU C library provides support for user-defined character classes + and the functions from ISO C amendement 1. */ +# ifdef CHARCLASS_NAME_MAX +# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX +# else +/* This shouldn't happen but some implementation might still have this + problem. Use a reasonable default value. */ +# define CHAR_CLASS_MAX_LENGTH 256 +# endif + +# ifdef _LIBC +# define IS_CHAR_CLASS(string) __wctype (string) +# else +# define IS_CHAR_CLASS(string) wctype (string) +# endif +#else +# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ + +# define IS_CHAR_CLASS(string) \ + (STREQ (string, "alpha") || STREQ (string, "upper") \ + || STREQ (string, "lower") || STREQ (string, "digit") \ + || STREQ (string, "alnum") || STREQ (string, "xdigit") \ + || STREQ (string, "space") || STREQ (string, "print") \ + || STREQ (string, "punct") || STREQ (string, "graph") \ + || STREQ (string, "cntrl") || STREQ (string, "blank")) +#endif + +#ifndef MATCH_MAY_ALLOCATE + +/* If we cannot allocate large objects within re_match_2_internal, + we make the fail stack and register vectors global. + The fail stack, we grow to the maximum size when a regexp + is compiled. + The register vectors, we adjust in size each time we + compile a regexp, according to the number of registers it needs. */ + +static fail_stack_type fail_stack; + +/* Size with which the following vectors are currently allocated. + That is so we can make them bigger as needed, + but never make them smaller. */ +static int regs_allocated_size; + +static const char ** regstart, ** regend; +static const char ** old_regstart, ** old_regend; +static const char **best_regstart, **best_regend; +static register_info_type *reg_info; +static const char **reg_dummy; +static register_info_type *reg_info_dummy; + +/* Make the register vectors big enough for NUM_REGS registers, + but don't make them smaller. */ + +static +regex_grow_registers (num_regs) + int num_regs; +{ + if (num_regs > regs_allocated_size) + { + RETALLOC_IF (regstart, num_regs, const char *); + RETALLOC_IF (regend, num_regs, const char *); + RETALLOC_IF (old_regstart, num_regs, const char *); + RETALLOC_IF (old_regend, num_regs, const char *); + RETALLOC_IF (best_regstart, num_regs, const char *); + RETALLOC_IF (best_regend, num_regs, const char *); + RETALLOC_IF (reg_info, num_regs, register_info_type); + RETALLOC_IF (reg_dummy, num_regs, const char *); + RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); + + regs_allocated_size = num_regs; + } +} + +#endif /* not MATCH_MAY_ALLOCATE */ + +static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type + compile_stack, + regnum_t regnum)); + +/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. + Returns one of error codes defined in `regex.h', or zero for success. + + Assumes the `allocated' (and perhaps `buffer') and `translate' + fields are set in BUFP on entry. + + If it succeeds, results are put in BUFP (if it returns an error, the + contents of BUFP are undefined): + `buffer' is the compiled pattern; + `syntax' is set to SYNTAX; + `used' is set to the length of the compiled pattern; + `fastmap_accurate' is zero; + `re_nsub' is the number of subexpressions in PATTERN; + `not_bol' and `not_eol' are zero; + + The `fastmap' and `newline_anchor' fields are neither + examined nor set. */ + +/* Return, freeing storage we allocated. */ +#ifdef MBS_SUPPORT +# define FREE_STACK_RETURN(value) \ + return (free(pattern), free(mbs_offset), free(is_binary), free (compile_stack.stack), value) +#else +# define FREE_STACK_RETURN(value) \ + return (free (compile_stack.stack), value) +#endif /* MBS_SUPPORT */ + +static reg_errcode_t +#ifdef MBS_SUPPORT +regex_compile (cpattern, csize, syntax, bufp) + const char *cpattern; + size_t csize; +#else +regex_compile (pattern, size, syntax, bufp) + const char *pattern; + size_t size; +#endif /* MBS_SUPPORT */ + reg_syntax_t syntax; + struct re_pattern_buffer *bufp; +{ + /* We fetch characters from PATTERN here. Even though PATTERN is + `char *' (i.e., signed), we declare these variables as unsigned, so + they can be reliably used as array indices. */ + register US_CHAR_TYPE c, c1; + +#ifdef MBS_SUPPORT + /* A temporary space to keep wchar_t pattern and compiled pattern. */ + CHAR_TYPE *pattern, *COMPILED_BUFFER_VAR; + size_t size; + /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ + int *mbs_offset = NULL; + /* It hold whether each wchar_t is binary data or not. */ + char *is_binary = NULL; + /* A flag whether exactn is handling binary data or not. */ + char is_exactn_bin = FALSE; +#endif /* MBS_SUPPORT */ + + /* A random temporary spot in PATTERN. */ + const CHAR_TYPE *p1; + + /* Points to the end of the buffer, where we should append. */ + register US_CHAR_TYPE *b; + + /* Keeps track of unclosed groups. */ + compile_stack_type compile_stack; + + /* Points to the current (ending) position in the pattern. */ +#ifdef MBS_SUPPORT + const CHAR_TYPE *p; + const CHAR_TYPE *pend; +#else + const CHAR_TYPE *p = pattern; + const CHAR_TYPE *pend = pattern + size; +#endif /* MBS_SUPPORT */ + + /* How to translate the characters in the pattern. */ + RE_TRANSLATE_TYPE translate = bufp->translate; + + /* Address of the count-byte of the most recently inserted `exactn' + command. This makes it possible to tell if a new exact-match + character can be added to that command or if the character requires + a new `exactn' command. */ + US_CHAR_TYPE *pending_exact = 0; + + /* Address of start of the most recently finished expression. + This tells, e.g., postfix * where to find the start of its + operand. Reset at the beginning of groups and alternatives. */ + US_CHAR_TYPE *laststart = 0; + + /* Address of beginning of regexp, or inside of last group. */ + US_CHAR_TYPE *begalt; + + /* Address of the place where a forward jump should go to the end of + the containing expression. Each alternative of an `or' -- except the + last -- ends with a forward jump of this sort. */ + US_CHAR_TYPE *fixup_alt_jump = 0; + + /* Counts open-groups as they are encountered. Remembered for the + matching close-group on the compile stack, so the same register + number is put in the stop_memory as the start_memory. */ + regnum_t regnum = 0; + +#ifdef MBS_SUPPORT + /* Initialize the wchar_t PATTERN and offset_buffer. */ + p = pend = pattern = TALLOC(csize + 1, CHAR_TYPE); + p[csize] = L'\0'; /* sentinel */ + mbs_offset = TALLOC(csize + 1, int); + is_binary = TALLOC(csize + 1, char); + if (pattern == NULL || mbs_offset == NULL || is_binary == NULL) + { + if (pattern) free(pattern); + if (mbs_offset) free(mbs_offset); + if (is_binary) free(is_binary); + return REG_ESPACE; + } + size = convert_mbs_to_wcs(pattern, cpattern, csize, mbs_offset, is_binary); + pend = p + size; + if (size < 0) + { + if (pattern) free(pattern); + if (mbs_offset) free(mbs_offset); + if (is_binary) free(is_binary); + return REG_BADPAT; + } +#endif + +#ifdef DEBUG + DEBUG_PRINT1 ("\nCompiling pattern: "); + if (debug) + { + unsigned debug_count; + + for (debug_count = 0; debug_count < size; debug_count++) + PUT_CHAR (pattern[debug_count]); + putchar ('\n'); + } +#endif /* DEBUG */ + + /* Initialize the compile stack. */ + compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); + if (compile_stack.stack == NULL) + { +#ifdef MBS_SUPPORT + if (pattern) free(pattern); + if (mbs_offset) free(mbs_offset); + if (is_binary) free(is_binary); +#endif + return REG_ESPACE; + } + + compile_stack.size = INIT_COMPILE_STACK_SIZE; + compile_stack.avail = 0; + + /* Initialize the pattern buffer. */ + bufp->syntax = syntax; + bufp->fastmap_accurate = 0; + bufp->not_bol = bufp->not_eol = 0; + + /* Set `used' to zero, so that if we return an error, the pattern + printer (for debugging) will think there's no pattern. We reset it + at the end. */ + bufp->used = 0; + + /* Always count groups, whether or not bufp->no_sub is set. */ + bufp->re_nsub = 0; + +#if !defined emacs && !defined SYNTAX_TABLE + /* Initialize the syntax table. */ + init_syntax_once (); +#endif + + if (bufp->allocated == 0) + { + if (bufp->buffer) + { /* If zero allocated, but buffer is non-null, try to realloc + enough space. This loses if buffer's address is bogus, but + that is the user's responsibility. */ +#ifdef MBS_SUPPORT + /* Free bufp->buffer and allocate an array for wchar_t pattern + buffer. */ + free(bufp->buffer); + COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE/sizeof(US_CHAR_TYPE), + US_CHAR_TYPE); +#else + RETALLOC (COMPILED_BUFFER_VAR, INIT_BUF_SIZE, US_CHAR_TYPE); +#endif /* MBS_SUPPORT */ + } + else + { /* Caller did not allocate a buffer. Do it for them. */ + COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE / sizeof(US_CHAR_TYPE), + US_CHAR_TYPE); + } + + if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE); +#ifdef MBS_SUPPORT + bufp->buffer = (char*)COMPILED_BUFFER_VAR; +#endif /* MBS_SUPPORT */ + bufp->allocated = INIT_BUF_SIZE; + } +#ifdef MBS_SUPPORT + else + COMPILED_BUFFER_VAR = (US_CHAR_TYPE*) bufp->buffer; +#endif + + begalt = b = COMPILED_BUFFER_VAR; + + /* Loop through the uncompiled pattern until we're at the end. */ + while (p != pend) + { + PATFETCH (c); + + switch (c) + { + case '^': + { + if ( /* If at start of pattern, it's an operator. */ + p == pattern + 1 + /* If context independent, it's an operator. */ + || syntax & RE_CONTEXT_INDEP_ANCHORS + /* Otherwise, depends on what's come before. */ + || at_begline_loc_p (pattern, p, syntax)) + BUF_PUSH (begline); + else + goto normal_char; + } + break; + + + case '$': + { + if ( /* If at end of pattern, it's an operator. */ + p == pend + /* If context independent, it's an operator. */ + || syntax & RE_CONTEXT_INDEP_ANCHORS + /* Otherwise, depends on what's next. */ + || at_endline_loc_p (p, pend, syntax)) + BUF_PUSH (endline); + else + goto normal_char; + } + break; + + + case '+': + case '?': + if ((syntax & RE_BK_PLUS_QM) + || (syntax & RE_LIMITED_OPS)) + goto normal_char; + handle_plus: + case '*': + /* If there is no previous pattern... */ + if (!laststart) + { + if (syntax & RE_CONTEXT_INVALID_OPS) + FREE_STACK_RETURN (REG_BADRPT); + else if (!(syntax & RE_CONTEXT_INDEP_OPS)) + goto normal_char; + } + + { + /* Are we optimizing this jump? */ + boolean keep_string_p = false; + + /* 1 means zero (many) matches is allowed. */ + char zero_times_ok = 0, many_times_ok = 0; + + /* If there is a sequence of repetition chars, collapse it + down to just one (the right one). We can't combine + interval operators with these because of, e.g., `a{2}*', + which should only match an even number of `a's. */ + + for (;;) + { + zero_times_ok |= c != '+'; + many_times_ok |= c != '?'; + + if (p == pend) + break; + + PATFETCH (c); + + if (c == '*' + || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) + ; + + else if (syntax & RE_BK_PLUS_QM && c == '\\') + { + if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + + PATFETCH (c1); + if (!(c1 == '+' || c1 == '?')) + { + PATUNFETCH; + PATUNFETCH; + break; + } + + c = c1; + } + else + { + PATUNFETCH; + break; + } + + /* If we get here, we found another repeat character. */ + } + + /* Star, etc. applied to an empty pattern is equivalent + to an empty pattern. */ + if (!laststart) + break; + + /* Now we know whether or not zero matches is allowed + and also whether or not two or more matches is allowed. */ + if (many_times_ok) + { /* More than one repetition is allowed, so put in at the + end a backward relative jump from `b' to before the next + jump we're going to put in below (which jumps from + laststart to after this jump). + + But if we are at the `*' in the exact sequence `.*\n', + insert an unconditional jump backwards to the ., + instead of the beginning of the loop. This way we only + push a failure point once, instead of every time + through the loop. */ + assert (p - 1 > pattern); + + /* Allocate the space for the jump. */ + GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); + + /* We know we are not at the first character of the pattern, + because laststart was nonzero. And we've already + incremented `p', by the way, to be the character after + the `*'. Do we have to do something analogous here + for null bytes, because of RE_DOT_NOT_NULL? */ + if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') + && zero_times_ok + && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') + && !(syntax & RE_DOT_NEWLINE)) + { /* We have .*\n. */ + STORE_JUMP (jump, b, laststart); + keep_string_p = true; + } + else + /* Anything else. */ + STORE_JUMP (maybe_pop_jump, b, laststart - + (1 + OFFSET_ADDRESS_SIZE)); + + /* We've added more stuff to the buffer. */ + b += 1 + OFFSET_ADDRESS_SIZE; + } + + /* On failure, jump from laststart to b + 3, which will be the + end of the buffer after this jump is inserted. */ + /* ifdef MBS_SUPPORT, 'b + 1 + OFFSET_ADDRESS_SIZE' instead of + 'b + 3'. */ + GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); + INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump + : on_failure_jump, + laststart, b + 1 + OFFSET_ADDRESS_SIZE); + pending_exact = 0; + b += 1 + OFFSET_ADDRESS_SIZE; + + if (!zero_times_ok) + { + /* At least one repetition is required, so insert a + `dummy_failure_jump' before the initial + `on_failure_jump' instruction of the loop. This + effects a skip over that instruction the first time + we hit that loop. */ + GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); + INSERT_JUMP (dummy_failure_jump, laststart, laststart + + 2 + 2 * OFFSET_ADDRESS_SIZE); + b += 1 + OFFSET_ADDRESS_SIZE; + } + } + break; + + + case '.': + laststart = b; + BUF_PUSH (anychar); + break; + + + case '[': + { + boolean had_char_class = false; +#ifdef MBS_SUPPORT + CHAR_TYPE range_start = 0xffffffff; +#else + unsigned int range_start = 0xffffffff; +#endif + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + +#ifdef MBS_SUPPORT + /* We assume a charset(_not) structure as a wchar_t array. + charset[0] = (re_opcode_t) charset(_not) + charset[1] = l (= length of char_classes) + charset[2] = m (= length of collating_symbols) + charset[3] = n (= length of equivalence_classes) + charset[4] = o (= length of char_ranges) + charset[5] = p (= length of chars) + + charset[6] = char_class (wctype_t) + charset[6+CHAR_CLASS_SIZE] = char_class (wctype_t) + ... + charset[l+5] = char_class (wctype_t) + + charset[l+6] = collating_symbol (wchar_t) + ... + charset[l+m+5] = collating_symbol (wchar_t) + ifdef _LIBC we use the index if + _NL_COLLATE_SYMB_EXTRAMB instead of + wchar_t string. + + charset[l+m+6] = equivalence_classes (wchar_t) + ... + charset[l+m+n+5] = equivalence_classes (wchar_t) + ifdef _LIBC we use the index in + _NL_COLLATE_WEIGHT instead of + wchar_t string. + + charset[l+m+n+6] = range_start + charset[l+m+n+7] = range_end + ... + charset[l+m+n+2o+4] = range_start + charset[l+m+n+2o+5] = range_end + ifdef _LIBC we use the value looked up + in _NL_COLLATE_COLLSEQ instead of + wchar_t character. + + charset[l+m+n+2o+6] = char + ... + charset[l+m+n+2o+p+5] = char + + */ + + /* We need at least 6 spaces: the opcode, the length of + char_classes, the length of collating_symbols, the length of + equivalence_classes, the length of char_ranges, the length of + chars. */ + GET_BUFFER_SPACE (6); + + /* Save b as laststart. And We use laststart as the pointer + to the first element of the charset here. + In other words, laststart[i] indicates charset[i]. */ + laststart = b; + + /* We test `*p == '^' twice, instead of using an if + statement, so we only need one BUF_PUSH. */ + BUF_PUSH (*p == '^' ? charset_not : charset); + if (*p == '^') + p++; + + /* Push the length of char_classes, the length of + collating_symbols, the length of equivalence_classes, the + length of char_ranges and the length of chars. */ + BUF_PUSH_3 (0, 0, 0); + BUF_PUSH_2 (0, 0); + + /* Remember the first position in the bracket expression. */ + p1 = p; + + /* charset_not matches newline according to a syntax bit. */ + if ((re_opcode_t) b[-6] == charset_not + && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) + { + BUF_PUSH('\n'); + laststart[5]++; /* Update the length of characters */ + } + + /* Read in characters and ranges, setting map bits. */ + for (;;) + { + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + PATFETCH (c); + + /* \ might escape characters inside [...] and [^...]. */ + if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') + { + if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + + PATFETCH (c1); + BUF_PUSH(c1); + laststart[5]++; /* Update the length of chars */ + range_start = c1; + continue; + } + + /* Could be the end of the bracket expression. If it's + not (i.e., when the bracket expression is `[]' so + far), the ']' character bit gets set way below. */ + if (c == ']' && p != p1 + 1) + break; + + /* Look ahead to see if it's a range when the last thing + was a character class. */ + if (had_char_class && c == '-' && *p != ']') + FREE_STACK_RETURN (REG_ERANGE); + + /* Look ahead to see if it's a range when the last thing + was a character: if this is a hyphen not at the + beginning or the end of a list, then it's the range + operator. */ + if (c == '-' + && !(p - 2 >= pattern && p[-2] == '[') + && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') + && *p != ']') + { + reg_errcode_t ret; + /* Allocate the space for range_start and range_end. */ + GET_BUFFER_SPACE (2); + /* Update the pointer to indicate end of buffer. */ + b += 2; + ret = compile_range (range_start, &p, pend, translate, + syntax, b, laststart); + if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); + range_start = 0xffffffff; + } + else if (p[0] == '-' && p[1] != ']') + { /* This handles ranges made up of characters only. */ + reg_errcode_t ret; + + /* Move past the `-'. */ + PATFETCH (c1); + /* Allocate the space for range_start and range_end. */ + GET_BUFFER_SPACE (2); + /* Update the pointer to indicate end of buffer. */ + b += 2; + ret = compile_range (c, &p, pend, translate, syntax, b, + laststart); + if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); + range_start = 0xffffffff; + } + + /* See if we're at the beginning of a possible character + class. */ + else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') + { /* Leave room for the null. */ + char str[CHAR_CLASS_MAX_LENGTH + 1]; + + PATFETCH (c); + c1 = 0; + + /* If pattern is `[[:'. */ + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (;;) + { + PATFETCH (c); + if ((c == ':' && *p == ']') || p == pend) + break; + if (c1 < CHAR_CLASS_MAX_LENGTH) + str[c1++] = c; + else + /* This is in any case an invalid class name. */ + str[0] = '\0'; + } + str[c1] = '\0'; + + /* If isn't a word bracketed by `[:' and `:]': + undo the ending character, the letters, and leave + the leading `:' and `[' (but store them as character). */ + if (c == ':' && *p == ']') + { + wctype_t wt; + uintptr_t alignedp; + + /* Query the character class as wctype_t. */ + wt = IS_CHAR_CLASS (str); + if (wt == 0) + FREE_STACK_RETURN (REG_ECTYPE); + + /* Throw away the ] at the end of the character + class. */ + PATFETCH (c); + + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + /* Allocate the space for character class. */ + GET_BUFFER_SPACE(CHAR_CLASS_SIZE); + /* Update the pointer to indicate end of buffer. */ + b += CHAR_CLASS_SIZE; + /* Move data which follow character classes + not to violate the data. */ + insert_space(CHAR_CLASS_SIZE, + laststart + 6 + laststart[1], + b - 1); + alignedp = ((uintptr_t)(laststart + 6 + laststart[1]) + + __alignof__(wctype_t) - 1) + & ~(uintptr_t)(__alignof__(wctype_t) - 1); + /* Store the character class. */ + *((wctype_t*)alignedp) = wt; + /* Update length of char_classes */ + laststart[1] += CHAR_CLASS_SIZE; + + had_char_class = true; + } + else + { + c1++; + while (c1--) + PATUNFETCH; + BUF_PUSH ('['); + BUF_PUSH (':'); + laststart[5] += 2; /* Update the length of characters */ + range_start = ':'; + had_char_class = false; + } + } + else if (syntax & RE_CHAR_CLASSES && c == '[' && (*p == '=' + || *p == '.')) + { + CHAR_TYPE str[128]; /* Should be large enough. */ + CHAR_TYPE delim = *p; /* '=' or '.' */ +# ifdef _LIBC + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); +# endif + PATFETCH (c); + c1 = 0; + + /* If pattern is `[[=' or '[[.'. */ + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (;;) + { + PATFETCH (c); + if ((c == delim && *p == ']') || p == pend) + break; + if (c1 < sizeof (str) - 1) + str[c1++] = c; + else + /* This is in any case an invalid class name. */ + str[0] = '\0'; + } + str[c1] = '\0'; + + if (c == delim && *p == ']' && str[0] != '\0') + { + unsigned int i, offset; + /* If we have no collation data we use the default + collation in which each character is in a class + by itself. It also means that ASCII is the + character set and therefore we cannot have character + with more than one byte in the multibyte + representation. */ + + /* If not defined _LIBC, we push the name and + `\0' for the sake of matching performance. */ + int datasize = c1 + 1; + +# ifdef _LIBC + int32_t idx = 0; + if (nrules == 0) +# endif + { + if (c1 != 1) + FREE_STACK_RETURN (REG_ECOLLATE); + } +# ifdef _LIBC + else + { + const int32_t *table; + const int32_t *weights; + const int32_t *extra; + const int32_t *indirect; + wint_t *cp; + + /* This #include defines a local function! */ +# include + + if(delim == '=') + { + /* We push the index for equivalence class. */ + cp = (wint_t*)str; + + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_TABLEWC); + weights = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_WEIGHTWC); + extra = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_EXTRAWC); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_INDIRECTWC); + + idx = findidx ((const wint_t**)&cp); + if (idx == 0 || cp < (wint_t*) str + c1) + /* This is no valid character. */ + FREE_STACK_RETURN (REG_ECOLLATE); + + str[0] = (wchar_t)idx; + } + else /* delim == '.' */ + { + /* We push collation sequence value + for collating symbol. */ + int32_t table_size; + const int32_t *symb_table; + const unsigned char *extra; + int32_t idx; + int32_t elem; + int32_t second; + int32_t hash; + char char_str[c1]; + + /* We have to convert the name to a single-byte + string. This is possible since the names + consist of ASCII characters and the internal + representation is UCS4. */ + for (i = 0; i < c1; ++i) + char_str[i] = str[i]; + + table_size = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_SYMB_HASH_SIZEMB); + symb_table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_TABLEMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_EXTRAMB); + + /* Locate the character in the hashing table. */ + hash = elem_hash (char_str, c1); + + idx = 0; + elem = hash % table_size; + second = hash % (table_size - 2); + while (symb_table[2 * elem] != 0) + { + /* First compare the hashing value. */ + if (symb_table[2 * elem] == hash + && c1 == extra[symb_table[2 * elem + 1]] + && memcmp (str, + &extra[symb_table[2 * elem + 1] + + 1], c1) == 0) + { + /* Yep, this is the entry. */ + idx = symb_table[2 * elem + 1]; + idx += 1 + extra[idx]; + break; + } + + /* Next entry. */ + elem += second; + } + + if (symb_table[2 * elem] != 0) + { + /* Compute the index of the byte sequence + in the table. */ + idx += 1 + extra[idx]; + /* Adjust for the alignment. */ + idx = (idx + 3) & ~4; + + str[0] = (wchar_t) idx + 4; + } + else if (symb_table[2 * elem] == 0 && c1 == 1) + { + /* No valid character. Match it as a + single byte character. */ + had_char_class = false; + BUF_PUSH(str[0]); + /* Update the length of characters */ + laststart[5]++; + range_start = str[0]; + + /* Throw away the ] at the end of the + collating symbol. */ + PATFETCH (c); + /* exit from the switch block. */ + continue; + } + else + FREE_STACK_RETURN (REG_ECOLLATE); + } + datasize = 1; + } +# endif + /* Throw away the ] at the end of the equivalence + class (or collating symbol). */ + PATFETCH (c); + + /* Allocate the space for the equivalence class + (or collating symbol) (and '\0' if needed). */ + GET_BUFFER_SPACE(datasize); + /* Update the pointer to indicate end of buffer. */ + b += datasize; + + if (delim == '=') + { /* equivalence class */ + /* Calculate the offset of char_ranges, + which is next to equivalence_classes. */ + offset = laststart[1] + laststart[2] + + laststart[3] +6; + /* Insert space. */ + insert_space(datasize, laststart + offset, b - 1); + + /* Write the equivalence_class and \0. */ + for (i = 0 ; i < datasize ; i++) + laststart[offset + i] = str[i]; + + /* Update the length of equivalence_classes. */ + laststart[3] += datasize; + had_char_class = true; + } + else /* delim == '.' */ + { /* collating symbol */ + /* Calculate the offset of the equivalence_classes, + which is next to collating_symbols. */ + offset = laststart[1] + laststart[2] + 6; + /* Insert space and write the collationg_symbol + and \0. */ + insert_space(datasize, laststart + offset, b-1); + for (i = 0 ; i < datasize ; i++) + laststart[offset + i] = str[i]; + + /* In re_match_2_internal if range_start < -1, we + assume -range_start is the offset of the + collating symbol which is specified as + the character of the range start. So we assign + -(laststart[1] + laststart[2] + 6) to + range_start. */ + range_start = -(laststart[1] + laststart[2] + 6); + /* Update the length of collating_symbol. */ + laststart[2] += datasize; + had_char_class = false; + } + } + else + { + c1++; + while (c1--) + PATUNFETCH; + BUF_PUSH ('['); + BUF_PUSH (delim); + laststart[5] += 2; /* Update the length of characters */ + range_start = delim; + had_char_class = false; + } + } + else + { + had_char_class = false; + BUF_PUSH(c); + laststart[5]++; /* Update the length of characters */ + range_start = c; + } + } + +#else /* not MBS_SUPPORT */ + /* Ensure that we have enough space to push a charset: the + opcode, the length count, and the bitset; 34 bytes in all. */ + GET_BUFFER_SPACE (34); + + laststart = b; + + /* We test `*p == '^' twice, instead of using an if + statement, so we only need one BUF_PUSH. */ + BUF_PUSH (*p == '^' ? charset_not : charset); + if (*p == '^') + p++; + + /* Remember the first position in the bracket expression. */ + p1 = p; + + /* Push the number of bytes in the bitmap. */ + BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); + + /* Clear the whole map. */ + bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); + + /* charset_not matches newline according to a syntax bit. */ + if ((re_opcode_t) b[-2] == charset_not + && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) + SET_LIST_BIT ('\n'); + + /* Read in characters and ranges, setting map bits. */ + for (;;) + { + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + PATFETCH (c); + + /* \ might escape characters inside [...] and [^...]. */ + if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') + { + if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + + PATFETCH (c1); + SET_LIST_BIT (c1); + range_start = c1; + continue; + } + + /* Could be the end of the bracket expression. If it's + not (i.e., when the bracket expression is `[]' so + far), the ']' character bit gets set way below. */ + if (c == ']' && p != p1 + 1) + break; + + /* Look ahead to see if it's a range when the last thing + was a character class. */ + if (had_char_class && c == '-' && *p != ']') + FREE_STACK_RETURN (REG_ERANGE); + + /* Look ahead to see if it's a range when the last thing + was a character: if this is a hyphen not at the + beginning or the end of a list, then it's the range + operator. */ + if (c == '-' + && !(p - 2 >= pattern && p[-2] == '[') + && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') + && *p != ']') + { + reg_errcode_t ret + = compile_range (range_start, &p, pend, translate, + syntax, b); + if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); + range_start = 0xffffffff; + } + + else if (p[0] == '-' && p[1] != ']') + { /* This handles ranges made up of characters only. */ + reg_errcode_t ret; + + /* Move past the `-'. */ + PATFETCH (c1); + + ret = compile_range (c, &p, pend, translate, syntax, b); + if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); + range_start = 0xffffffff; + } + + /* See if we're at the beginning of a possible character + class. */ + + else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') + { /* Leave room for the null. */ + char str[CHAR_CLASS_MAX_LENGTH + 1]; + + PATFETCH (c); + c1 = 0; + + /* If pattern is `[[:'. */ + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (;;) + { + PATFETCH (c); + if ((c == ':' && *p == ']') || p == pend) + break; + if (c1 < CHAR_CLASS_MAX_LENGTH) + str[c1++] = c; + else + /* This is in any case an invalid class name. */ + str[0] = '\0'; + } + str[c1] = '\0'; + + /* If isn't a word bracketed by `[:' and `:]': + undo the ending character, the letters, and leave + the leading `:' and `[' (but set bits for them). */ + if (c == ':' && *p == ']') + { +# if defined _LIBC || WIDE_CHAR_SUPPORT + boolean is_lower = STREQ (str, "lower"); + boolean is_upper = STREQ (str, "upper"); + wctype_t wt; + int ch; + + wt = IS_CHAR_CLASS (str); + if (wt == 0) + FREE_STACK_RETURN (REG_ECTYPE); + + /* Throw away the ] at the end of the character + class. */ + PATFETCH (c); + + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) + { +# ifdef _LIBC + if (__iswctype (__btowc (ch), wt)) + SET_LIST_BIT (ch); +# else + if (iswctype (btowc (ch), wt)) + SET_LIST_BIT (ch); +# endif + + if (translate && (is_upper || is_lower) + && (ISUPPER (ch) || ISLOWER (ch))) + SET_LIST_BIT (ch); + } + + had_char_class = true; +# else + int ch; + boolean is_alnum = STREQ (str, "alnum"); + boolean is_alpha = STREQ (str, "alpha"); + boolean is_blank = STREQ (str, "blank"); + boolean is_cntrl = STREQ (str, "cntrl"); + boolean is_digit = STREQ (str, "digit"); + boolean is_graph = STREQ (str, "graph"); + boolean is_lower = STREQ (str, "lower"); + boolean is_print = STREQ (str, "print"); + boolean is_punct = STREQ (str, "punct"); + boolean is_space = STREQ (str, "space"); + boolean is_upper = STREQ (str, "upper"); + boolean is_xdigit = STREQ (str, "xdigit"); + + if (!IS_CHAR_CLASS (str)) + FREE_STACK_RETURN (REG_ECTYPE); + + /* Throw away the ] at the end of the character + class. */ + PATFETCH (c); + + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (ch = 0; ch < 1 << BYTEWIDTH; ch++) + { + /* This was split into 3 if's to + avoid an arbitrary limit in some compiler. */ + if ( (is_alnum && ISALNUM (ch)) + || (is_alpha && ISALPHA (ch)) + || (is_blank && ISBLANK (ch)) + || (is_cntrl && ISCNTRL (ch))) + SET_LIST_BIT (ch); + if ( (is_digit && ISDIGIT (ch)) + || (is_graph && ISGRAPH (ch)) + || (is_lower && ISLOWER (ch)) + || (is_print && ISPRINT (ch))) + SET_LIST_BIT (ch); + if ( (is_punct && ISPUNCT (ch)) + || (is_space && ISSPACE (ch)) + || (is_upper && ISUPPER (ch)) + || (is_xdigit && ISXDIGIT (ch))) + SET_LIST_BIT (ch); + if ( translate && (is_upper || is_lower) + && (ISUPPER (ch) || ISLOWER (ch))) + SET_LIST_BIT (ch); + } + had_char_class = true; +# endif /* libc || wctype.h */ + } + else + { + c1++; + while (c1--) + PATUNFETCH; + SET_LIST_BIT ('['); + SET_LIST_BIT (':'); + range_start = ':'; + had_char_class = false; + } + } + else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=') + { + unsigned char str[MB_LEN_MAX + 1]; +# ifdef _LIBC + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); +# endif + + PATFETCH (c); + c1 = 0; + + /* If pattern is `[[='. */ + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (;;) + { + PATFETCH (c); + if ((c == '=' && *p == ']') || p == pend) + break; + if (c1 < MB_LEN_MAX) + str[c1++] = c; + else + /* This is in any case an invalid class name. */ + str[0] = '\0'; + } + str[c1] = '\0'; + + if (c == '=' && *p == ']' && str[0] != '\0') + { + /* If we have no collation data we use the default + collation in which each character is in a class + by itself. It also means that ASCII is the + character set and therefore we cannot have character + with more than one byte in the multibyte + representation. */ +# ifdef _LIBC + if (nrules == 0) +# endif + { + if (c1 != 1) + FREE_STACK_RETURN (REG_ECOLLATE); + + /* Throw away the ] at the end of the equivalence + class. */ + PATFETCH (c); + + /* Set the bit for the character. */ + SET_LIST_BIT (str[0]); + } +# ifdef _LIBC + else + { + /* Try to match the byte sequence in `str' against + those known to the collate implementation. + First find out whether the bytes in `str' are + actually from exactly one character. */ + const int32_t *table; + const unsigned char *weights; + const unsigned char *extra; + const int32_t *indirect; + int32_t idx; + const unsigned char *cp = str; + int ch; + + /* This #include defines a local function! */ +# include + + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); + weights = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); + + idx = findidx (&cp); + if (idx == 0 || cp < str + c1) + /* This is no valid character. */ + FREE_STACK_RETURN (REG_ECOLLATE); + + /* Throw away the ] at the end of the equivalence + class. */ + PATFETCH (c); + + /* Now we have to go throught the whole table + and find all characters which have the same + first level weight. + + XXX Note that this is not entirely correct. + we would have to match multibyte sequences + but this is not possible with the current + implementation. */ + for (ch = 1; ch < 256; ++ch) + /* XXX This test would have to be changed if we + would allow matching multibyte sequences. */ + if (table[ch] > 0) + { + int32_t idx2 = table[ch]; + size_t len = weights[idx2]; + + /* Test whether the lenghts match. */ + if (weights[idx] == len) + { + /* They do. New compare the bytes of + the weight. */ + size_t cnt = 0; + + while (cnt < len + && (weights[idx + 1 + cnt] + == weights[idx2 + 1 + cnt])) + ++cnt; + + if (cnt == len) + /* They match. Mark the character as + acceptable. */ + SET_LIST_BIT (ch); + } + } + } +# endif + had_char_class = true; + } + else + { + c1++; + while (c1--) + PATUNFETCH; + SET_LIST_BIT ('['); + SET_LIST_BIT ('='); + range_start = '='; + had_char_class = false; + } + } + else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.') + { + unsigned char str[128]; /* Should be large enough. */ +# ifdef _LIBC + uint32_t nrules = + _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); +# endif + + PATFETCH (c); + c1 = 0; + + /* If pattern is `[[.'. */ + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + + for (;;) + { + PATFETCH (c); + if ((c == '.' && *p == ']') || p == pend) + break; + if (c1 < sizeof (str)) + str[c1++] = c; + else + /* This is in any case an invalid class name. */ + str[0] = '\0'; + } + str[c1] = '\0'; + + if (c == '.' && *p == ']' && str[0] != '\0') + { + /* If we have no collation data we use the default + collation in which each character is the name + for its own class which contains only the one + character. It also means that ASCII is the + character set and therefore we cannot have character + with more than one byte in the multibyte + representation. */ +# ifdef _LIBC + if (nrules == 0) +# endif + { + if (c1 != 1) + FREE_STACK_RETURN (REG_ECOLLATE); + + /* Throw away the ] at the end of the equivalence + class. */ + PATFETCH (c); + + /* Set the bit for the character. */ + SET_LIST_BIT (str[0]); + range_start = ((const unsigned char *) str)[0]; + } +# ifdef _LIBC + else + { + /* Try to match the byte sequence in `str' against + those known to the collate implementation. + First find out whether the bytes in `str' are + actually from exactly one character. */ + int32_t table_size; + const int32_t *symb_table; + const unsigned char *extra; + int32_t idx; + int32_t elem; + int32_t second; + int32_t hash; + + table_size = + _NL_CURRENT_WORD (LC_COLLATE, + _NL_COLLATE_SYMB_HASH_SIZEMB); + symb_table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_TABLEMB); + extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_SYMB_EXTRAMB); + + /* Locate the character in the hashing table. */ + hash = elem_hash (str, c1); + + idx = 0; + elem = hash % table_size; + second = hash % (table_size - 2); + while (symb_table[2 * elem] != 0) + { + /* First compare the hashing value. */ + if (symb_table[2 * elem] == hash + && c1 == extra[symb_table[2 * elem + 1]] + && memcmp (str, + &extra[symb_table[2 * elem + 1] + + 1], + c1) == 0) + { + /* Yep, this is the entry. */ + idx = symb_table[2 * elem + 1]; + idx += 1 + extra[idx]; + break; + } + + /* Next entry. */ + elem += second; + } + + if (symb_table[2 * elem] == 0) + /* This is no valid character. */ + FREE_STACK_RETURN (REG_ECOLLATE); + + /* Throw away the ] at the end of the equivalence + class. */ + PATFETCH (c); + + /* Now add the multibyte character(s) we found + to the accept list. + + XXX Note that this is not entirely correct. + we would have to match multibyte sequences + but this is not possible with the current + implementation. Also, we have to match + collating symbols, which expand to more than + one file, as a whole and not allow the + individual bytes. */ + c1 = extra[idx++]; + if (c1 == 1) + range_start = extra[idx]; + while (c1-- > 0) + { + SET_LIST_BIT (extra[idx]); + ++idx; + } + } +# endif + had_char_class = false; + } + else + { + c1++; + while (c1--) + PATUNFETCH; + SET_LIST_BIT ('['); + SET_LIST_BIT ('.'); + range_start = '.'; + had_char_class = false; + } + } + else + { + had_char_class = false; + SET_LIST_BIT (c); + range_start = c; + } + } + + /* Discard any (non)matching list bytes that are all 0 at the + end of the map. Decrease the map-length byte too. */ + while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) + b[-1]--; + b += b[-1]; +#endif /* MBS_SUPPORT */ + } + break; + + + case '(': + if (syntax & RE_NO_BK_PARENS) + goto handle_open; + else + goto normal_char; + + + case ')': + if (syntax & RE_NO_BK_PARENS) + goto handle_close; + else + goto normal_char; + + + case '\n': + if (syntax & RE_NEWLINE_ALT) + goto handle_alt; + else + goto normal_char; + + + case '|': + if (syntax & RE_NO_BK_VBAR) + goto handle_alt; + else + goto normal_char; + + + case '{': + if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) + goto handle_interval; + else + goto normal_char; + + + case '\\': + if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + + /* Do not translate the character after the \, so that we can + distinguish, e.g., \B from \b, even if we normally would + translate, e.g., B to b. */ + PATFETCH_RAW (c); + + switch (c) + { + case '(': + if (syntax & RE_NO_BK_PARENS) + goto normal_backslash; + + handle_open: + bufp->re_nsub++; + regnum++; + + if (COMPILE_STACK_FULL) + { + RETALLOC (compile_stack.stack, compile_stack.size << 1, + compile_stack_elt_t); + if (compile_stack.stack == NULL) return REG_ESPACE; + + compile_stack.size <<= 1; + } + + /* These are the values to restore when we hit end of this + group. They are all relative offsets, so that if the + whole pattern moves because of realloc, they will still + be valid. */ + COMPILE_STACK_TOP.begalt_offset = begalt - COMPILED_BUFFER_VAR; + COMPILE_STACK_TOP.fixup_alt_jump + = fixup_alt_jump ? fixup_alt_jump - COMPILED_BUFFER_VAR + 1 : 0; + COMPILE_STACK_TOP.laststart_offset = b - COMPILED_BUFFER_VAR; + COMPILE_STACK_TOP.regnum = regnum; + + /* We will eventually replace the 0 with the number of + groups inner to this one. But do not push a + start_memory for groups beyond the last one we can + represent in the compiled pattern. */ + if (regnum <= MAX_REGNUM) + { + COMPILE_STACK_TOP.inner_group_offset = b + - COMPILED_BUFFER_VAR + 2; + BUF_PUSH_3 (start_memory, regnum, 0); + } + + compile_stack.avail++; + + fixup_alt_jump = 0; + laststart = 0; + begalt = b; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; + break; + + + case ')': + if (syntax & RE_NO_BK_PARENS) goto normal_backslash; + + if (COMPILE_STACK_EMPTY) + { + if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) + goto normal_backslash; + else + FREE_STACK_RETURN (REG_ERPAREN); + } + + handle_close: + if (fixup_alt_jump) + { /* Push a dummy failure point at the end of the + alternative for a possible future + `pop_failure_jump' to pop. See comments at + `push_dummy_failure' in `re_match_2'. */ + BUF_PUSH (push_dummy_failure); + + /* We allocated space for this jump when we assigned + to `fixup_alt_jump', in the `handle_alt' case below. */ + STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); + } + + /* See similar code for backslashed left paren above. */ + if (COMPILE_STACK_EMPTY) + { + if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) + goto normal_char; + else + FREE_STACK_RETURN (REG_ERPAREN); + } + + /* Since we just checked for an empty stack above, this + ``can't happen''. */ + assert (compile_stack.avail != 0); + { + /* We don't just want to restore into `regnum', because + later groups should continue to be numbered higher, + as in `(ab)c(de)' -- the second group is #2. */ + regnum_t this_group_regnum; + + compile_stack.avail--; + begalt = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.begalt_offset; + fixup_alt_jump + = COMPILE_STACK_TOP.fixup_alt_jump + ? COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.fixup_alt_jump - 1 + : 0; + laststart = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.laststart_offset; + this_group_regnum = COMPILE_STACK_TOP.regnum; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; + + /* We're at the end of the group, so now we know how many + groups were inside this one. */ + if (this_group_regnum <= MAX_REGNUM) + { + US_CHAR_TYPE *inner_group_loc + = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.inner_group_offset; + + *inner_group_loc = regnum - this_group_regnum; + BUF_PUSH_3 (stop_memory, this_group_regnum, + regnum - this_group_regnum); + } + } + break; + + + case '|': /* `\|'. */ + if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) + goto normal_backslash; + handle_alt: + if (syntax & RE_LIMITED_OPS) + goto normal_char; + + /* Insert before the previous alternative a jump which + jumps to this alternative if the former fails. */ + GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); + INSERT_JUMP (on_failure_jump, begalt, + b + 2 + 2 * OFFSET_ADDRESS_SIZE); + pending_exact = 0; + b += 1 + OFFSET_ADDRESS_SIZE; + + /* The alternative before this one has a jump after it + which gets executed if it gets matched. Adjust that + jump so it will jump to this alternative's analogous + jump (put in below, which in turn will jump to the next + (if any) alternative's such jump, etc.). The last such + jump jumps to the correct final destination. A picture: + _____ _____ + | | | | + | v | v + a | b | c + + If we are at `b', then fixup_alt_jump right now points to a + three-byte space after `a'. We'll put in the jump, set + fixup_alt_jump to right after `b', and leave behind three + bytes which we'll fill in when we get to after `c'. */ + + if (fixup_alt_jump) + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); + + /* Mark and leave space for a jump after this alternative, + to be filled in later either by next alternative or + when know we're at the end of a series of alternatives. */ + fixup_alt_jump = b; + GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); + b += 1 + OFFSET_ADDRESS_SIZE; + + laststart = 0; + begalt = b; + break; + + + case '{': + /* If \{ is a literal. */ + if (!(syntax & RE_INTERVALS) + /* If we're at `\{' and it's not the open-interval + operator. */ + || (syntax & RE_NO_BK_BRACES)) + goto normal_backslash; + + handle_interval: + { + /* If got here, then the syntax allows intervals. */ + + /* At least (most) this many matches must be made. */ + int lower_bound = -1, upper_bound = -1; + + /* Place in the uncompiled pattern (i.e., just after + the '{') to go back to if the interval is invalid. */ + const CHAR_TYPE *beg_interval = p; + + if (p == pend) + goto invalid_interval; + + GET_UNSIGNED_NUMBER (lower_bound); + + if (c == ',') + { + GET_UNSIGNED_NUMBER (upper_bound); + if (upper_bound < 0) + upper_bound = RE_DUP_MAX; + } + else + /* Interval such as `{1}' => match exactly once. */ + upper_bound = lower_bound; + + if (! (0 <= lower_bound && lower_bound <= upper_bound)) + goto invalid_interval; + + if (!(syntax & RE_NO_BK_BRACES)) + { + if (c != '\\' || p == pend) + goto invalid_interval; + PATFETCH (c); + } + + if (c != '}') + goto invalid_interval; + + /* If it's invalid to have no preceding re. */ + if (!laststart) + { + if (syntax & RE_CONTEXT_INVALID_OPS + && !(syntax & RE_INVALID_INTERVAL_ORD)) + FREE_STACK_RETURN (REG_BADRPT); + else if (syntax & RE_CONTEXT_INDEP_OPS) + laststart = b; + else + goto unfetch_interval; + } + + /* We just parsed a valid interval. */ + + if (RE_DUP_MAX < upper_bound) + FREE_STACK_RETURN (REG_BADBR); + + /* If the upper bound is zero, don't want to succeed at + all; jump from `laststart' to `b + 3', which will be + the end of the buffer after we insert the jump. */ + /* ifdef MBS_SUPPORT, 'b + 1 + OFFSET_ADDRESS_SIZE' + instead of 'b + 3'. */ + if (upper_bound == 0) + { + GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); + INSERT_JUMP (jump, laststart, b + 1 + + OFFSET_ADDRESS_SIZE); + b += 1 + OFFSET_ADDRESS_SIZE; + } + + /* Otherwise, we have a nontrivial interval. When + we're all done, the pattern will look like: + set_number_at + set_number_at + succeed_n + + jump_n + (The upper bound and `jump_n' are omitted if + `upper_bound' is 1, though.) */ + else + { /* If the upper bound is > 1, we need to insert + more at the end of the loop. */ + unsigned nbytes = 2 + 4 * OFFSET_ADDRESS_SIZE + + (upper_bound > 1) * (2 + 4 * OFFSET_ADDRESS_SIZE); + + GET_BUFFER_SPACE (nbytes); + + /* Initialize lower bound of the `succeed_n', even + though it will be set during matching by its + attendant `set_number_at' (inserted next), + because `re_compile_fastmap' needs to know. + Jump to the `jump_n' we might insert below. */ + INSERT_JUMP2 (succeed_n, laststart, + b + 1 + 2 * OFFSET_ADDRESS_SIZE + + (upper_bound > 1) * (1 + 2 * OFFSET_ADDRESS_SIZE) + , lower_bound); + b += 1 + 2 * OFFSET_ADDRESS_SIZE; + + /* Code to initialize the lower bound. Insert + before the `succeed_n'. The `5' is the last two + bytes of this `set_number_at', plus 3 bytes of + the following `succeed_n'. */ + /* ifdef MBS_SUPPORT, The '1+2*OFFSET_ADDRESS_SIZE' + is the 'set_number_at', plus '1+OFFSET_ADDRESS_SIZE' + of the following `succeed_n'. */ + insert_op2 (set_number_at, laststart, 1 + + 2 * OFFSET_ADDRESS_SIZE, lower_bound, b); + b += 1 + 2 * OFFSET_ADDRESS_SIZE; + + if (upper_bound > 1) + { /* More than one repetition is allowed, so + append a backward jump to the `succeed_n' + that starts this interval. + + When we've reached this during matching, + we'll have matched the interval once, so + jump back only `upper_bound - 1' times. */ + STORE_JUMP2 (jump_n, b, laststart + + 2 * OFFSET_ADDRESS_SIZE + 1, + upper_bound - 1); + b += 1 + 2 * OFFSET_ADDRESS_SIZE; + + /* The location we want to set is the second + parameter of the `jump_n'; that is `b-2' as + an absolute address. `laststart' will be + the `set_number_at' we're about to insert; + `laststart+3' the number to set, the source + for the relative address. But we are + inserting into the middle of the pattern -- + so everything is getting moved up by 5. + Conclusion: (b - 2) - (laststart + 3) + 5, + i.e., b - laststart. + + We insert this at the beginning of the loop + so that if we fail during matching, we'll + reinitialize the bounds. */ + insert_op2 (set_number_at, laststart, b - laststart, + upper_bound - 1, b); + b += 1 + 2 * OFFSET_ADDRESS_SIZE; + } + } + pending_exact = 0; + break; + + invalid_interval: + if (!(syntax & RE_INVALID_INTERVAL_ORD)) + FREE_STACK_RETURN (p == pend ? REG_EBRACE : REG_BADBR); + unfetch_interval: + /* Match the characters as literals. */ + p = beg_interval; + c = '{'; + if (syntax & RE_NO_BK_BRACES) + goto normal_char; + else + goto normal_backslash; + } + +#ifdef emacs + /* There is no way to specify the before_dot and after_dot + operators. rms says this is ok. --karl */ + case '=': + BUF_PUSH (at_dot); + break; + + case 's': + laststart = b; + PATFETCH (c); + BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); + break; + + case 'S': + laststart = b; + PATFETCH (c); + BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); + break; +#endif /* emacs */ + + + case 'w': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + laststart = b; + BUF_PUSH (wordchar); + break; + + + case 'W': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + laststart = b; + BUF_PUSH (notwordchar); + break; + + + case '<': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + BUF_PUSH (wordbeg); + break; + + case '>': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + BUF_PUSH (wordend); + break; + + case 'b': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + BUF_PUSH (wordbound); + break; + + case 'B': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + BUF_PUSH (notwordbound); + break; + + case '`': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + BUF_PUSH (begbuf); + break; + + case '\'': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + BUF_PUSH (endbuf); + break; + + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + if (syntax & RE_NO_BK_REFS) + goto normal_char; + + c1 = c - '0'; + + if (c1 > regnum) + FREE_STACK_RETURN (REG_ESUBREG); + + /* Can't back reference to a subexpression if inside of it. */ + if (group_in_compile_stack (compile_stack, (regnum_t) c1)) + goto normal_char; + + laststart = b; + BUF_PUSH_2 (duplicate, c1); + break; + + + case '+': + case '?': + if (syntax & RE_BK_PLUS_QM) + goto handle_plus; + else + goto normal_backslash; + + default: + normal_backslash: + /* You might think it would be useful for \ to mean + not to translate; but if we don't translate it + it will never match anything. */ + c = TRANSLATE (c); + goto normal_char; + } + break; + + + default: + /* Expects the character in `c'. */ + normal_char: + /* If no exactn currently being built. */ + if (!pending_exact +#ifdef MBS_SUPPORT + /* If last exactn handle binary(or character) and + new exactn handle character(or binary). */ + || is_exactn_bin != is_binary[p - 1 - pattern] +#endif /* MBS_SUPPORT */ + + /* If last exactn not at current position. */ + || pending_exact + *pending_exact + 1 != b + + /* We have only one byte following the exactn for the count. */ + || *pending_exact == (1 << BYTEWIDTH) - 1 + + /* If followed by a repetition operator. */ + || *p == '*' || *p == '^' + || ((syntax & RE_BK_PLUS_QM) + ? *p == '\\' && (p[1] == '+' || p[1] == '?') + : (*p == '+' || *p == '?')) + || ((syntax & RE_INTERVALS) + && ((syntax & RE_NO_BK_BRACES) + ? *p == '{' + : (p[0] == '\\' && p[1] == '{')))) + { + /* Start building a new exactn. */ + + laststart = b; + +#ifdef MBS_SUPPORT + /* Is this exactn binary data or character? */ + is_exactn_bin = is_binary[p - 1 - pattern]; + if (is_exactn_bin) + BUF_PUSH_2 (exactn_bin, 0); + else + BUF_PUSH_2 (exactn, 0); +#else + BUF_PUSH_2 (exactn, 0); +#endif /* MBS_SUPPORT */ + pending_exact = b - 1; + } + + BUF_PUSH (c); + (*pending_exact)++; + break; + } /* switch (c) */ + } /* while p != pend */ + + + /* Through the pattern now. */ + + if (fixup_alt_jump) + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); + + if (!COMPILE_STACK_EMPTY) + FREE_STACK_RETURN (REG_EPAREN); + + /* If we don't want backtracking, force success + the first time we reach the end of the compiled pattern. */ + if (syntax & RE_NO_POSIX_BACKTRACKING) + BUF_PUSH (succeed); + +#ifdef MBS_SUPPORT + free (pattern); + free (mbs_offset); + free (is_binary); +#endif + free (compile_stack.stack); + + /* We have succeeded; set the length of the buffer. */ +#ifdef MBS_SUPPORT + bufp->used = (uintptr_t) b - (uintptr_t) COMPILED_BUFFER_VAR; +#else + bufp->used = b - bufp->buffer; +#endif + +#ifdef DEBUG + if (debug) + { + DEBUG_PRINT1 ("\nCompiled pattern: \n"); + print_compiled_pattern (bufp); + } +#endif /* DEBUG */ + +#ifndef MATCH_MAY_ALLOCATE + /* Initialize the failure stack to the largest possible stack. This + isn't necessary unless we're trying to avoid calling alloca in + the search and match routines. */ + { + int num_regs = bufp->re_nsub + 1; + + /* Since DOUBLE_FAIL_STACK refuses to double only if the current size + is strictly greater than re_max_failures, the largest possible stack + is 2 * re_max_failures failure points. */ + if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS)) + { + fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); + +# ifdef emacs + if (! fail_stack.stack) + fail_stack.stack + = (fail_stack_elt_t *) xmalloc (fail_stack.size + * sizeof (fail_stack_elt_t)); + else + fail_stack.stack + = (fail_stack_elt_t *) xrealloc (fail_stack.stack, + (fail_stack.size + * sizeof (fail_stack_elt_t))); +# else /* not emacs */ + if (! fail_stack.stack) + fail_stack.stack + = (fail_stack_elt_t *) malloc (fail_stack.size + * sizeof (fail_stack_elt_t)); + else + fail_stack.stack + = (fail_stack_elt_t *) realloc (fail_stack.stack, + (fail_stack.size + * sizeof (fail_stack_elt_t))); +# endif /* not emacs */ + } + + regex_grow_registers (num_regs); + } +#endif /* not MATCH_MAY_ALLOCATE */ + + return REG_NOERROR; +} /* regex_compile */ + +/* Subroutines for `regex_compile'. */ + +/* Store OP at LOC followed by two-byte integer parameter ARG. */ +/* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ + +static void +store_op1 (op, loc, arg) + re_opcode_t op; + US_CHAR_TYPE *loc; + int arg; +{ + *loc = (US_CHAR_TYPE) op; + STORE_NUMBER (loc + 1, arg); +} + + +/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ +/* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ + +static void +store_op2 (op, loc, arg1, arg2) + re_opcode_t op; + US_CHAR_TYPE *loc; + int arg1, arg2; +{ + *loc = (US_CHAR_TYPE) op; + STORE_NUMBER (loc + 1, arg1); + STORE_NUMBER (loc + 1 + OFFSET_ADDRESS_SIZE, arg2); +} + + +/* Copy the bytes from LOC to END to open up three bytes of space at LOC + for OP followed by two-byte integer parameter ARG. */ +/* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ + +static void +insert_op1 (op, loc, arg, end) + re_opcode_t op; + US_CHAR_TYPE *loc; + int arg; + US_CHAR_TYPE *end; +{ + register US_CHAR_TYPE *pfrom = end; + register US_CHAR_TYPE *pto = end + 1 + OFFSET_ADDRESS_SIZE; + + while (pfrom != loc) + *--pto = *--pfrom; + + store_op1 (op, loc, arg); +} + + +/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ +/* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ + +static void +insert_op2 (op, loc, arg1, arg2, end) + re_opcode_t op; + US_CHAR_TYPE *loc; + int arg1, arg2; + US_CHAR_TYPE *end; +{ + register US_CHAR_TYPE *pfrom = end; + register US_CHAR_TYPE *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE; + + while (pfrom != loc) + *--pto = *--pfrom; + + store_op2 (op, loc, arg1, arg2); +} + + +/* P points to just after a ^ in PATTERN. Return true if that ^ comes + after an alternative or a begin-subexpression. We assume there is at + least one character before the ^. */ + +static boolean +at_begline_loc_p (pattern, p, syntax) + const CHAR_TYPE *pattern, *p; + reg_syntax_t syntax; +{ + const CHAR_TYPE *prev = p - 2; + boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; + + return + /* After a subexpression? */ + (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) + /* After an alternative? */ + || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); +} + + +/* The dual of at_begline_loc_p. This one is for $. We assume there is + at least one character after the $, i.e., `P < PEND'. */ + +static boolean +at_endline_loc_p (p, pend, syntax) + const CHAR_TYPE *p, *pend; + reg_syntax_t syntax; +{ + const CHAR_TYPE *next = p; + boolean next_backslash = *next == '\\'; + const CHAR_TYPE *next_next = p + 1 < pend ? p + 1 : 0; + + return + /* Before a subexpression? */ + (syntax & RE_NO_BK_PARENS ? *next == ')' + : next_backslash && next_next && *next_next == ')') + /* Before an alternative? */ + || (syntax & RE_NO_BK_VBAR ? *next == '|' + : next_backslash && next_next && *next_next == '|'); +} + + +/* Returns true if REGNUM is in one of COMPILE_STACK's elements and + false if it's not. */ + +static boolean +group_in_compile_stack (compile_stack, regnum) + compile_stack_type compile_stack; + regnum_t regnum; +{ + int this_element; + + for (this_element = compile_stack.avail - 1; + this_element >= 0; + this_element--) + if (compile_stack.stack[this_element].regnum == regnum) + return true; + + return false; +} + +#ifdef MBS_SUPPORT +/* This insert space, which size is "num", into the pattern at "loc". + "end" must point the end of the allocated buffer. */ +static void +insert_space (num, loc, end) + int num; + CHAR_TYPE *loc; + CHAR_TYPE *end; +{ + register CHAR_TYPE *pto = end; + register CHAR_TYPE *pfrom = end - num; + + while (pfrom >= loc) + *pto-- = *pfrom--; +} +#endif /* MBS_SUPPORT */ + +#ifdef MBS_SUPPORT +static reg_errcode_t +compile_range (range_start_char, p_ptr, pend, translate, syntax, b, + char_set) + CHAR_TYPE range_start_char; + const CHAR_TYPE **p_ptr, *pend; + CHAR_TYPE *char_set, *b; + RE_TRANSLATE_TYPE translate; + reg_syntax_t syntax; +{ + const CHAR_TYPE *p = *p_ptr; + CHAR_TYPE range_start, range_end; + reg_errcode_t ret; +# ifdef _LIBC + uint32_t nrules; + uint32_t start_val, end_val; +# endif + if (p == pend) + return REG_ERANGE; + +# ifdef _LIBC + nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + if (nrules != 0) + { + const char *collseq = (const char *) _NL_CURRENT(LC_COLLATE, + _NL_COLLATE_COLLSEQWC); + const unsigned char *extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); + + if (range_start_char < -1) + { + /* range_start is a collating symbol. */ + int32_t *wextra; + /* Retreive the index and get collation sequence value. */ + wextra = (int32_t*)(extra + char_set[-range_start_char]); + start_val = wextra[1 + *wextra]; + } + else + start_val = collseq_table_lookup(collseq, TRANSLATE(range_start_char)); + + end_val = collseq_table_lookup (collseq, TRANSLATE (p[0])); + + /* Report an error if the range is empty and the syntax prohibits + this. */ + ret = ((syntax & RE_NO_EMPTY_RANGES) + && (start_val > end_val))? REG_ERANGE : REG_NOERROR; + + /* Insert space to the end of the char_ranges. */ + insert_space(2, b - char_set[5] - 2, b - 1); + *(b - char_set[5] - 2) = (wchar_t)start_val; + *(b - char_set[5] - 1) = (wchar_t)end_val; + char_set[4]++; /* ranges_index */ + } + else +# endif + { + range_start = (range_start_char >= 0)? TRANSLATE (range_start_char): + range_start_char; + range_end = TRANSLATE (p[0]); + /* Report an error if the range is empty and the syntax prohibits + this. */ + ret = ((syntax & RE_NO_EMPTY_RANGES) + && (range_start > range_end))? REG_ERANGE : REG_NOERROR; + + /* Insert space to the end of the char_ranges. */ + insert_space(2, b - char_set[5] - 2, b - 1); + *(b - char_set[5] - 2) = range_start; + *(b - char_set[5] - 1) = range_end; + char_set[4]++; /* ranges_index */ + } + /* Have to increment the pointer into the pattern string, so the + caller isn't still at the ending character. */ + (*p_ptr)++; + + return ret; +} +#else +/* Read the ending character of a range (in a bracket expression) from the + uncompiled pattern *P_PTR (which ends at PEND). We assume the + starting character is in `P[-2]'. (`P[-1]' is the character `-'.) + Then we set the translation of all bits between the starting and + ending characters (inclusive) in the compiled pattern B. + + Return an error code. + + We use these short variable names so we can use the same macros as + `regex_compile' itself. */ + +static reg_errcode_t +compile_range (range_start_char, p_ptr, pend, translate, syntax, b) + unsigned int range_start_char; + const char **p_ptr, *pend; + RE_TRANSLATE_TYPE translate; + reg_syntax_t syntax; + unsigned char *b; +{ + unsigned this_char; + const char *p = *p_ptr; + reg_errcode_t ret; +# if _LIBC + const unsigned char *collseq; + unsigned int start_colseq; + unsigned int end_colseq; +# else + unsigned end_char; +# endif + + if (p == pend) + return REG_ERANGE; + + /* Have to increment the pointer into the pattern string, so the + caller isn't still at the ending character. */ + (*p_ptr)++; + + /* Report an error if the range is empty and the syntax prohibits this. */ + ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; + +# if _LIBC + collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE, + _NL_COLLATE_COLLSEQMB); + + start_colseq = collseq[(unsigned char) TRANSLATE (range_start_char)]; + end_colseq = collseq[(unsigned char) TRANSLATE (p[0])]; + for (this_char = 0; this_char <= (unsigned char) -1; ++this_char) + { + unsigned int this_colseq = collseq[(unsigned char) TRANSLATE (this_char)]; + + if (start_colseq <= this_colseq && this_colseq <= end_colseq) + { + SET_LIST_BIT (TRANSLATE (this_char)); + ret = REG_NOERROR; + } + } +# else + /* Here we see why `this_char' has to be larger than an `unsigned + char' -- we would otherwise go into an infinite loop, since all + characters <= 0xff. */ + range_start_char = TRANSLATE (range_start_char); + /* TRANSLATE(p[0]) is casted to char (not unsigned char) in TRANSLATE, + and some compilers cast it to int implicitly, so following for_loop + may fall to (almost) infinite loop. + e.g. If translate[p[0]] = 0xff, end_char may equals to 0xffffffff. + To avoid this, we cast p[0] to unsigned int and truncate it. */ + end_char = ((unsigned)TRANSLATE(p[0]) & ((1 << BYTEWIDTH) - 1)); + + for (this_char = range_start_char; this_char <= end_char; ++this_char) + { + SET_LIST_BIT (TRANSLATE (this_char)); + ret = REG_NOERROR; + } +# endif + + return ret; +} +#endif /* MBS_SUPPORT */ + +/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in + BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible + characters can start a string that matches the pattern. This fastmap + is used by re_search to skip quickly over impossible starting points. + + The caller must supply the address of a (1 << BYTEWIDTH)-byte data + area as BUFP->fastmap. + + We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in + the pattern buffer. + + Returns 0 if we succeed, -2 if an internal error. */ + +#ifdef MBS_SUPPORT +/* local function for re_compile_fastmap. + truncate wchar_t character to char. */ +static unsigned char truncate_wchar (CHAR_TYPE c); + +static unsigned char +truncate_wchar (c) + CHAR_TYPE c; +{ + unsigned char buf[MB_LEN_MAX]; + int retval = wctomb(buf, c); + return retval > 0 ? buf[0] : (unsigned char)c; +} +#endif /* MBS_SUPPORT */ + +int +re_compile_fastmap (bufp) + struct re_pattern_buffer *bufp; +{ + int j, k; +#ifdef MATCH_MAY_ALLOCATE + fail_stack_type fail_stack; +#endif +#ifndef REGEX_MALLOC + char *destination; +#endif + + register char *fastmap = bufp->fastmap; + +#ifdef MBS_SUPPORT + /* We need to cast pattern to (wchar_t*), because we casted this compiled + pattern to (char*) in regex_compile. */ + US_CHAR_TYPE *pattern = (US_CHAR_TYPE*)bufp->buffer; + register US_CHAR_TYPE *pend = (US_CHAR_TYPE*) (bufp->buffer + bufp->used); +#else + US_CHAR_TYPE *pattern = bufp->buffer; + register US_CHAR_TYPE *pend = pattern + bufp->used; +#endif /* MBS_SUPPORT */ + US_CHAR_TYPE *p = pattern; + +#ifdef REL_ALLOC + /* This holds the pointer to the failure stack, when + it is allocated relocatably. */ + fail_stack_elt_t *failure_stack_ptr; +#endif + + /* Assume that each path through the pattern can be null until + proven otherwise. We set this false at the bottom of switch + statement, to which we get only if a particular path doesn't + match the empty string. */ + boolean path_can_be_null = true; + + /* We aren't doing a `succeed_n' to begin with. */ + boolean succeed_n_p = false; + + assert (fastmap != NULL && p != NULL); + + INIT_FAIL_STACK (); + bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ + bufp->fastmap_accurate = 1; /* It will be when we're done. */ + bufp->can_be_null = 0; + + while (1) + { + if (p == pend || *p == succeed) + { + /* We have reached the (effective) end of pattern. */ + if (!FAIL_STACK_EMPTY ()) + { + bufp->can_be_null |= path_can_be_null; + + /* Reset for next path. */ + path_can_be_null = true; + + p = fail_stack.stack[--fail_stack.avail].pointer; + + continue; + } + else + break; + } + + /* We should never be about to go beyond the end of the pattern. */ + assert (p < pend); + + switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) + { + + /* I guess the idea here is to simply not bother with a fastmap + if a backreference is used, since it's too hard to figure out + the fastmap for the corresponding group. Setting + `can_be_null' stops `re_search_2' from using the fastmap, so + that is all we do. */ + case duplicate: + bufp->can_be_null = 1; + goto done; + + + /* Following are the cases which match a character. These end + with `break'. */ + +#ifdef MBS_SUPPORT + case exactn: + fastmap[truncate_wchar(p[1])] = 1; + break; + case exactn_bin: + fastmap[p[1]] = 1; + break; +#else + case exactn: + fastmap[p[1]] = 1; + break; +#endif /* MBS_SUPPORT */ + + +#ifdef MBS_SUPPORT + /* It is hard to distinguish fastmap from (multi byte) characters + which depends on current locale. */ + case charset: + case charset_not: + case wordchar: + case notwordchar: + bufp->can_be_null = 1; + goto done; +#else + case charset: + for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) + if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) + fastmap[j] = 1; + break; + + + case charset_not: + /* Chars beyond end of map must be allowed. */ + for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) + fastmap[j] = 1; + + for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) + if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) + fastmap[j] = 1; + break; + + + case wordchar: + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) == Sword) + fastmap[j] = 1; + break; + + + case notwordchar: + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) != Sword) + fastmap[j] = 1; + break; +#endif + + case anychar: + { + int fastmap_newline = fastmap['\n']; + + /* `.' matches anything ... */ + for (j = 0; j < (1 << BYTEWIDTH); j++) + fastmap[j] = 1; + + /* ... except perhaps newline. */ + if (!(bufp->syntax & RE_DOT_NEWLINE)) + fastmap['\n'] = fastmap_newline; + + /* Return if we have already set `can_be_null'; if we have, + then the fastmap is irrelevant. Something's wrong here. */ + else if (bufp->can_be_null) + goto done; + + /* Otherwise, have to check alternative paths. */ + break; + } + +#ifdef emacs + case syntaxspec: + k = *p++; + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) == (enum syntaxcode) k) + fastmap[j] = 1; + break; + + + case notsyntaxspec: + k = *p++; + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) != (enum syntaxcode) k) + fastmap[j] = 1; + break; + + + /* All cases after this match the empty string. These end with + `continue'. */ + + + case before_dot: + case at_dot: + case after_dot: + continue; +#endif /* emacs */ + + + case no_op: + case begline: + case endline: + case begbuf: + case endbuf: + case wordbound: + case notwordbound: + case wordbeg: + case wordend: + case push_dummy_failure: + continue; + + + case jump_n: + case pop_failure_jump: + case maybe_pop_jump: + case jump: + case jump_past_alt: + case dummy_failure_jump: + EXTRACT_NUMBER_AND_INCR (j, p); + p += j; + if (j > 0) + continue; + + /* Jump backward implies we just went through the body of a + loop and matched nothing. Opcode jumped to should be + `on_failure_jump' or `succeed_n'. Just treat it like an + ordinary jump. For a * loop, it has pushed its failure + point already; if so, discard that as redundant. */ + if ((re_opcode_t) *p != on_failure_jump + && (re_opcode_t) *p != succeed_n) + continue; + + p++; + EXTRACT_NUMBER_AND_INCR (j, p); + p += j; + + /* If what's on the stack is where we are now, pop it. */ + if (!FAIL_STACK_EMPTY () + && fail_stack.stack[fail_stack.avail - 1].pointer == p) + fail_stack.avail--; + + continue; + + + case on_failure_jump: + case on_failure_keep_string_jump: + handle_on_failure_jump: + EXTRACT_NUMBER_AND_INCR (j, p); + + /* For some patterns, e.g., `(a?)?', `p+j' here points to the + end of the pattern. We don't want to push such a point, + since when we restore it above, entering the switch will + increment `p' past the end of the pattern. We don't need + to push such a point since we obviously won't find any more + fastmap entries beyond `pend'. Such a pattern can match + the null string, though. */ + if (p + j < pend) + { + if (!PUSH_PATTERN_OP (p + j, fail_stack)) + { + RESET_FAIL_STACK (); + return -2; + } + } + else + bufp->can_be_null = 1; + + if (succeed_n_p) + { + EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ + succeed_n_p = false; + } + + continue; + + + case succeed_n: + /* Get to the number of times to succeed. */ + p += OFFSET_ADDRESS_SIZE; + + /* Increment p past the n for when k != 0. */ + EXTRACT_NUMBER_AND_INCR (k, p); + if (k == 0) + { + p -= 2 * OFFSET_ADDRESS_SIZE; + succeed_n_p = true; /* Spaghetti code alert. */ + goto handle_on_failure_jump; + } + continue; + + + case set_number_at: + p += 2 * OFFSET_ADDRESS_SIZE; + continue; + + + case start_memory: + case stop_memory: + p += 2; + continue; + + + default: + abort (); /* We have listed all the cases. */ + } /* switch *p++ */ + + /* Getting here means we have found the possible starting + characters for one path of the pattern -- and that the empty + string does not match. We need not follow this path further. + Instead, look at the next alternative (remembered on the + stack), or quit if no more. The test at the top of the loop + does these things. */ + path_can_be_null = false; + p = pend; + } /* while p */ + + /* Set `can_be_null' for the last path (also the first path, if the + pattern is empty). */ + bufp->can_be_null |= path_can_be_null; + + done: + RESET_FAIL_STACK (); + return 0; +} /* re_compile_fastmap */ +#ifdef _LIBC +weak_alias (__re_compile_fastmap, re_compile_fastmap) +#endif + +/* Set REGS to hold NUM_REGS registers, storing them in STARTS and + ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use + this memory for recording register information. STARTS and ENDS + must be allocated using the malloc library routine, and must each + be at least NUM_REGS * sizeof (regoff_t) bytes long. + + If NUM_REGS == 0, then subsequent matches should allocate their own + register data. + + Unless this function is called, the first search or match using + PATTERN_BUFFER will allocate its own register data, without + freeing the old data. */ + +void +re_set_registers (bufp, regs, num_regs, starts, ends) + struct re_pattern_buffer *bufp; + struct re_registers *regs; + unsigned num_regs; + regoff_t *starts, *ends; +{ + if (num_regs) + { + bufp->regs_allocated = REGS_REALLOCATE; + regs->num_regs = num_regs; + regs->start = starts; + regs->end = ends; + } + else + { + bufp->regs_allocated = REGS_UNALLOCATED; + regs->num_regs = 0; + regs->start = regs->end = (regoff_t *) 0; + } +} +#ifdef _LIBC +weak_alias (__re_set_registers, re_set_registers) +#endif + +/* Searching routines. */ + +/* Like re_search_2, below, but only one string is specified, and + doesn't let you say where to stop matching. */ + +int +re_search (bufp, string, size, startpos, range, regs) + struct re_pattern_buffer *bufp; + const char *string; + int size, startpos, range; + struct re_registers *regs; +{ + return re_search_2 (bufp, NULL, 0, string, size, startpos, range, + regs, size); +} +#ifdef _LIBC +weak_alias (__re_search, re_search) +#endif + + +/* Using the compiled pattern in BUFP->buffer, first tries to match the + virtual concatenation of STRING1 and STRING2, starting first at index + STARTPOS, then at STARTPOS + 1, and so on. + + STRING1 and STRING2 have length SIZE1 and SIZE2, respectively. + + RANGE is how far to scan while trying to match. RANGE = 0 means try + only at STARTPOS; in general, the last start tried is STARTPOS + + RANGE. + + In REGS, return the indices of the virtual concatenation of STRING1 + and STRING2 that matched the entire BUFP->buffer and its contained + subexpressions. + + Do not consider matching one past the index STOP in the virtual + concatenation of STRING1 and STRING2. + + We return either the position in the strings at which the match was + found, -1 if no match, or -2 if error (such as failure + stack overflow). */ + +int +re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) + struct re_pattern_buffer *bufp; + const char *string1, *string2; + int size1, size2; + int startpos; + int range; + struct re_registers *regs; + int stop; +{ + int val; + register char *fastmap = bufp->fastmap; + register RE_TRANSLATE_TYPE translate = bufp->translate; + int total_size = size1 + size2; + int endpos = startpos + range; + + /* Check for out-of-range STARTPOS. */ + if (startpos < 0 || startpos > total_size) + return -1; + + /* Fix up RANGE if it might eventually take us outside + the virtual concatenation of STRING1 and STRING2. + Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */ + if (endpos < 0) + range = 0 - startpos; + else if (endpos > total_size) + range = total_size - startpos; + + /* If the search isn't to be a backwards one, don't waste time in a + search for a pattern that must be anchored. */ + if (bufp->used > 0 && range > 0 + && ((re_opcode_t) bufp->buffer[0] == begbuf + /* `begline' is like `begbuf' if it cannot match at newlines. */ + || ((re_opcode_t) bufp->buffer[0] == begline + && !bufp->newline_anchor))) + { + if (startpos > 0) + return -1; + else + range = 1; + } + +#ifdef emacs + /* In a forward search for something that starts with \=. + don't keep searching past point. */ + if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) + { + range = PT - startpos; + if (range <= 0) + return -1; + } +#endif /* emacs */ + + /* Update the fastmap now if not correct already. */ + if (fastmap && !bufp->fastmap_accurate) + if (re_compile_fastmap (bufp) == -2) + return -2; + + /* Loop through the string, looking for a place to start matching. */ + for (;;) + { + /* If a fastmap is supplied, skip quickly over characters that + cannot be the start of a match. If the pattern can match the + null string, however, we don't need to skip characters; we want + the first null string. */ + if (fastmap && startpos < total_size && !bufp->can_be_null) + { + if (range > 0) /* Searching forwards. */ + { + register const char *d; + register int lim = 0; + int irange = range; + + if (startpos < size1 && startpos + range >= size1) + lim = range - (size1 - startpos); + + d = (startpos >= size1 ? string2 - size1 : string1) + startpos; + + /* Written out as an if-else to avoid testing `translate' + inside the loop. */ + if (translate) + while (range > lim + && !fastmap[(unsigned char) + translate[(unsigned char) *d++]]) + range--; + else + while (range > lim && !fastmap[(unsigned char) *d++]) + range--; + + startpos += irange - range; + } + else /* Searching backwards. */ + { + register CHAR_TYPE c = (size1 == 0 || startpos >= size1 + ? string2[startpos - size1] + : string1[startpos]); + + if (!fastmap[(unsigned char) TRANSLATE (c)]) + goto advance; + } + } + + /* If can't match the null string, and that's all we have left, fail. */ + if (range >= 0 && startpos == total_size && fastmap + && !bufp->can_be_null) + return -1; + + val = re_match_2_internal (bufp, string1, size1, string2, size2, + startpos, regs, stop); +#ifndef REGEX_MALLOC +# ifdef C_ALLOCA + alloca (0); +# endif +#endif + + if (val >= 0) + return startpos; + + if (val == -2) + return -2; + + advance: + if (!range) + break; + else if (range > 0) + { + range--; + startpos++; + } + else + { + range++; + startpos--; + } + } + return -1; +} /* re_search_2 */ +#ifdef _LIBC +weak_alias (__re_search_2, re_search_2) +#endif + +#ifdef MBS_SUPPORT +/* This converts PTR, a pointer into one of the search wchar_t strings + `string1' and `string2' into an multibyte string offset from the + beginning of that string. We use mbs_offset to optimize. + See convert_mbs_to_wcs. */ +# define POINTER_TO_OFFSET(ptr) \ + (FIRST_STRING_P (ptr) \ + ? ((regoff_t)(mbs_offset1 != NULL? mbs_offset1[(ptr)-string1] : 0)) \ + : ((regoff_t)((mbs_offset2 != NULL? mbs_offset2[(ptr)-string2] : 0) \ + + csize1))) +#else +/* This converts PTR, a pointer into one of the search strings `string1' + and `string2' into an offset from the beginning of that string. */ +# define POINTER_TO_OFFSET(ptr) \ + (FIRST_STRING_P (ptr) \ + ? ((regoff_t) ((ptr) - string1)) \ + : ((regoff_t) ((ptr) - string2 + size1))) +#endif /* MBS_SUPPORT */ + +/* Macros for dealing with the split strings in re_match_2. */ + +#define MATCHING_IN_FIRST_STRING (dend == end_match_1) + +/* Call before fetching a character with *d. This switches over to + string2 if necessary. */ +#define PREFETCH() \ + while (d == dend) \ + { \ + /* End of string2 => fail. */ \ + if (dend == end_match_2) \ + goto fail; \ + /* End of string1 => advance to string2. */ \ + d = string2; \ + dend = end_match_2; \ + } + + +/* Test if at very beginning or at very end of the virtual concatenation + of `string1' and `string2'. If only one string, it's `string2'. */ +#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) +#define AT_STRINGS_END(d) ((d) == end2) + + +/* Test if D points to a character which is word-constituent. We have + two special cases to check for: if past the end of string1, look at + the first character in string2; and if before the beginning of + string2, look at the last character in string1. */ +#ifdef MBS_SUPPORT +/* Use internationalized API instead of SYNTAX. */ +# define WORDCHAR_P(d) \ + (iswalnum ((wint_t)((d) == end1 ? *string2 \ + : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0) +#else +# define WORDCHAR_P(d) \ + (SYNTAX ((d) == end1 ? *string2 \ + : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ + == Sword) +#endif /* MBS_SUPPORT */ + +/* Disabled due to a compiler bug -- see comment at case wordbound */ +#if 0 +/* Test if the character before D and the one at D differ with respect + to being word-constituent. */ +#define AT_WORD_BOUNDARY(d) \ + (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ + || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) +#endif + +/* Free everything we malloc. */ +#ifdef MATCH_MAY_ALLOCATE +# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL +# ifdef MBS_SUPPORT +# define FREE_VARIABLES() \ + do { \ + REGEX_FREE_STACK (fail_stack.stack); \ + FREE_VAR (regstart); \ + FREE_VAR (regend); \ + FREE_VAR (old_regstart); \ + FREE_VAR (old_regend); \ + FREE_VAR (best_regstart); \ + FREE_VAR (best_regend); \ + FREE_VAR (reg_info); \ + FREE_VAR (reg_dummy); \ + FREE_VAR (reg_info_dummy); \ + FREE_VAR (string1); \ + FREE_VAR (string2); \ + FREE_VAR (mbs_offset1); \ + FREE_VAR (mbs_offset2); \ + } while (0) +# else /* not MBS_SUPPORT */ +# define FREE_VARIABLES() \ + do { \ + REGEX_FREE_STACK (fail_stack.stack); \ + FREE_VAR (regstart); \ + FREE_VAR (regend); \ + FREE_VAR (old_regstart); \ + FREE_VAR (old_regend); \ + FREE_VAR (best_regstart); \ + FREE_VAR (best_regend); \ + FREE_VAR (reg_info); \ + FREE_VAR (reg_dummy); \ + FREE_VAR (reg_info_dummy); \ + } while (0) +# endif /* MBS_SUPPORT */ +#else +# define FREE_VAR(var) if (var) free (var); var = NULL +# ifdef MBS_SUPPORT +# define FREE_VARIABLES() \ + do { \ + FREE_VAR (string1); \ + FREE_VAR (string2); \ + FREE_VAR (mbs_offset1); \ + FREE_VAR (mbs_offset2); \ + } while (0) +# else +# define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ +# endif /* MBS_SUPPORT */ +#endif /* not MATCH_MAY_ALLOCATE */ + +/* These values must meet several constraints. They must not be valid + register values; since we have a limit of 255 registers (because + we use only one byte in the pattern for the register number), we can + use numbers larger than 255. They must differ by 1, because of + NUM_FAILURE_ITEMS above. And the value for the lowest register must + be larger than the value for the highest register, so we do not try + to actually save any registers when none are active. */ +#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) +#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) + +/* Matching routines. */ + +#ifndef emacs /* Emacs never uses this. */ +/* re_match is like re_match_2 except it takes only a single string. */ + +int +re_match (bufp, string, size, pos, regs) + struct re_pattern_buffer *bufp; + const char *string; + int size, pos; + struct re_registers *regs; +{ + int result = re_match_2_internal (bufp, NULL, 0, string, size, + pos, regs, size); +# ifndef REGEX_MALLOC +# ifdef C_ALLOCA + alloca (0); +# endif +# endif + return result; +} +# ifdef _LIBC +weak_alias (__re_match, re_match) +# endif +#endif /* not emacs */ + +static boolean group_match_null_string_p _RE_ARGS ((US_CHAR_TYPE **p, + US_CHAR_TYPE *end, + register_info_type *reg_info)); +static boolean alt_match_null_string_p _RE_ARGS ((US_CHAR_TYPE *p, + US_CHAR_TYPE *end, + register_info_type *reg_info)); +static boolean common_op_match_null_string_p _RE_ARGS ((US_CHAR_TYPE **p, + US_CHAR_TYPE *end, + register_info_type *reg_info)); +static int bcmp_translate _RE_ARGS ((const CHAR_TYPE *s1, const CHAR_TYPE *s2, + int len, char *translate)); + +/* re_match_2 matches the compiled pattern in BUFP against the + the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 + and SIZE2, respectively). We start matching at POS, and stop + matching at STOP. + + If REGS is non-null and the `no_sub' field of BUFP is nonzero, we + store offsets for the substring each group matched in REGS. See the + documentation for exactly how many groups we fill. + + We return -1 if no match, -2 if an internal error (such as the + failure stack overflowing). Otherwise, we return the length of the + matched substring. */ + +int +re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) + struct re_pattern_buffer *bufp; + const char *string1, *string2; + int size1, size2; + int pos; + struct re_registers *regs; + int stop; +{ + int result = re_match_2_internal (bufp, string1, size1, string2, size2, + pos, regs, stop); +#ifndef REGEX_MALLOC +# ifdef C_ALLOCA + alloca (0); +# endif +#endif + return result; +} +#ifdef _LIBC +weak_alias (__re_match_2, re_match_2) +#endif + +#ifdef MBS_SUPPORT + +static int count_mbs_length PARAMS ((int *, int)); + +/* This check the substring (from 0, to length) of the multibyte string, + to which offset_buffer correspond. And count how many wchar_t_characters + the substring occupy. We use offset_buffer to optimization. + See convert_mbs_to_wcs. */ + +static int +count_mbs_length(offset_buffer, length) + int *offset_buffer; + int length; +{ + int wcs_size; + + /* Check whether the size is valid. */ + if (length < 0) + return -1; + + if (offset_buffer == NULL) + return 0; + + for (wcs_size = 0 ; offset_buffer[wcs_size] != -1 ; wcs_size++) + { + if (offset_buffer[wcs_size] == length) + return wcs_size; + if (offset_buffer[wcs_size] > length) + /* It is a fragment of a wide character. */ + return -1; + } + + /* We reached at the sentinel. */ + return -1; +} +#endif /* MBS_SUPPORT */ + +/* This is a separate function so that we can force an alloca cleanup + afterwards. */ +static int +#ifdef MBS_SUPPORT +re_match_2_internal (bufp, cstring1, csize1, cstring2, csize2, pos, regs, stop) + struct re_pattern_buffer *bufp; + const char *cstring1, *cstring2; + int csize1, csize2; +#else +re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) + struct re_pattern_buffer *bufp; + const char *string1, *string2; + int size1, size2; +#endif + int pos; + struct re_registers *regs; + int stop; +{ + /* General temporaries. */ + int mcnt; + US_CHAR_TYPE *p1; +#ifdef MBS_SUPPORT + /* We need wchar_t* buffers correspond to string1, string2. */ + CHAR_TYPE *string1 = NULL, *string2 = NULL; + /* We need the size of wchar_t buffers correspond to csize1, csize2. */ + int size1 = 0, size2 = 0; + /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ + int *mbs_offset1 = NULL, *mbs_offset2 = NULL; + /* They hold whether each wchar_t is binary data or not. */ + char *is_binary = NULL; +#endif /* MBS_SUPPORT */ + + /* Just past the end of the corresponding string. */ + const CHAR_TYPE *end1, *end2; + + /* Pointers into string1 and string2, just past the last characters in + each to consider matching. */ + const CHAR_TYPE *end_match_1, *end_match_2; + + /* Where we are in the data, and the end of the current string. */ + const CHAR_TYPE *d, *dend; + + /* Where we are in the pattern, and the end of the pattern. */ +#ifdef MBS_SUPPORT + US_CHAR_TYPE *pattern, *p; + register US_CHAR_TYPE *pend; +#else + US_CHAR_TYPE *p = bufp->buffer; + register US_CHAR_TYPE *pend = p + bufp->used; +#endif /* MBS_SUPPORT */ + + /* Mark the opcode just after a start_memory, so we can test for an + empty subpattern when we get to the stop_memory. */ + US_CHAR_TYPE *just_past_start_mem = 0; + + /* We use this to map every character in the string. */ + RE_TRANSLATE_TYPE translate = bufp->translate; + + /* Failure point stack. Each place that can handle a failure further + down the line pushes a failure point on this stack. It consists of + restart, regend, and reg_info for all registers corresponding to + the subexpressions we're currently inside, plus the number of such + registers, and, finally, two char *'s. The first char * is where + to resume scanning the pattern; the second one is where to resume + scanning the strings. If the latter is zero, the failure point is + a ``dummy''; if a failure happens and the failure point is a dummy, + it gets discarded and the next next one is tried. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ + fail_stack_type fail_stack; +#endif +#ifdef DEBUG + static unsigned failure_id; + unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; +#endif + +#ifdef REL_ALLOC + /* This holds the pointer to the failure stack, when + it is allocated relocatably. */ + fail_stack_elt_t *failure_stack_ptr; +#endif + + /* We fill all the registers internally, independent of what we + return, for use in backreferences. The number here includes + an element for register zero. */ + size_t num_regs = bufp->re_nsub + 1; + + /* The currently active registers. */ + active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG; + active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG; + + /* Information on the contents of registers. These are pointers into + the input strings; they record just what was matched (on this + attempt) by a subexpression part of the pattern, that is, the + regnum-th regstart pointer points to where in the pattern we began + matching and the regnum-th regend points to right after where we + stopped matching the regnum-th subexpression. (The zeroth register + keeps track of what the whole pattern matches.) */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const CHAR_TYPE **regstart, **regend; +#endif + + /* If a group that's operated upon by a repetition operator fails to + match anything, then the register for its start will need to be + restored because it will have been set to wherever in the string we + are when we last see its open-group operator. Similarly for a + register's end. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const CHAR_TYPE **old_regstart, **old_regend; +#endif + + /* The is_active field of reg_info helps us keep track of which (possibly + nested) subexpressions we are currently in. The matched_something + field of reg_info[reg_num] helps us tell whether or not we have + matched any of the pattern so far this time through the reg_num-th + subexpression. These two fields get reset each time through any + loop their register is in. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ + register_info_type *reg_info; +#endif + + /* The following record the register info as found in the above + variables when we find a match better than any we've seen before. + This happens as we backtrack through the failure points, which in + turn happens only if we have not yet matched the entire string. */ + unsigned best_regs_set = false; +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const CHAR_TYPE **best_regstart, **best_regend; +#endif + + /* Logically, this is `best_regend[0]'. But we don't want to have to + allocate space for that if we're not allocating space for anything + else (see below). Also, we never need info about register 0 for + any of the other register vectors, and it seems rather a kludge to + treat `best_regend' differently than the rest. So we keep track of + the end of the best match so far in a separate variable. We + initialize this to NULL so that when we backtrack the first time + and need to test it, it's not garbage. */ + const CHAR_TYPE *match_end = NULL; + + /* This helps SET_REGS_MATCHED avoid doing redundant work. */ + int set_regs_matched_done = 0; + + /* Used when we pop values we don't care about. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const CHAR_TYPE **reg_dummy; + register_info_type *reg_info_dummy; +#endif + +#ifdef DEBUG + /* Counts the total number of registers pushed. */ + unsigned num_regs_pushed = 0; +#endif + + DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); + + INIT_FAIL_STACK (); + +#ifdef MATCH_MAY_ALLOCATE + /* Do not bother to initialize all the register variables if there are + no groups in the pattern, as it takes a fair amount of time. If + there are groups, we include space for register 0 (the whole + pattern), even though we never use it, since it simplifies the + array indexing. We should fix this. */ + if (bufp->re_nsub) + { + regstart = REGEX_TALLOC (num_regs, const CHAR_TYPE *); + regend = REGEX_TALLOC (num_regs, const CHAR_TYPE *); + old_regstart = REGEX_TALLOC (num_regs, const CHAR_TYPE *); + old_regend = REGEX_TALLOC (num_regs, const CHAR_TYPE *); + best_regstart = REGEX_TALLOC (num_regs, const CHAR_TYPE *); + best_regend = REGEX_TALLOC (num_regs, const CHAR_TYPE *); + reg_info = REGEX_TALLOC (num_regs, register_info_type); + reg_dummy = REGEX_TALLOC (num_regs, const CHAR_TYPE *); + reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); + + if (!(regstart && regend && old_regstart && old_regend && reg_info + && best_regstart && best_regend && reg_dummy && reg_info_dummy)) + { + FREE_VARIABLES (); + return -2; + } + } + else + { + /* We must initialize all our variables to NULL, so that + `FREE_VARIABLES' doesn't try to free them. */ + regstart = regend = old_regstart = old_regend = best_regstart + = best_regend = reg_dummy = NULL; + reg_info = reg_info_dummy = (register_info_type *) NULL; + } +#endif /* MATCH_MAY_ALLOCATE */ + + /* The starting position is bogus. */ +#ifdef MBS_SUPPORT + if (pos < 0 || pos > csize1 + csize2) +#else + if (pos < 0 || pos > size1 + size2) +#endif + { + FREE_VARIABLES (); + return -1; + } + +#ifdef MBS_SUPPORT + /* Allocate wchar_t array for string1 and string2 and + fill them with converted string. */ + if (csize1 != 0) + { + string1 = REGEX_TALLOC (csize1 + 1, CHAR_TYPE); + mbs_offset1 = REGEX_TALLOC (csize1 + 1, int); + is_binary = REGEX_TALLOC (csize1 + 1, char); + if (!string1 || !mbs_offset1 || !is_binary) + { + FREE_VAR (string1); + FREE_VAR (mbs_offset1); + FREE_VAR (is_binary); + return -2; + } + size1 = convert_mbs_to_wcs(string1, cstring1, csize1, + mbs_offset1, is_binary); + string1[size1] = L'\0'; /* for a sentinel */ + FREE_VAR (is_binary); + } + if (csize2 != 0) + { + string2 = REGEX_TALLOC (csize2 + 1, CHAR_TYPE); + mbs_offset2 = REGEX_TALLOC (csize2 + 1, int); + is_binary = REGEX_TALLOC (csize2 + 1, char); + if (!string2 || !mbs_offset2 || !is_binary) + { + FREE_VAR (string1); + FREE_VAR (mbs_offset1); + FREE_VAR (string2); + FREE_VAR (mbs_offset2); + FREE_VAR (is_binary); + return -2; + } + size2 = convert_mbs_to_wcs(string2, cstring2, csize2, + mbs_offset2, is_binary); + string2[size2] = L'\0'; /* for a sentinel */ + FREE_VAR (is_binary); + } + + /* We need to cast pattern to (wchar_t*), because we casted this compiled + pattern to (char*) in regex_compile. */ + p = pattern = (CHAR_TYPE*)bufp->buffer; + pend = (CHAR_TYPE*)(bufp->buffer + bufp->used); + +#endif /* MBS_SUPPORT */ + + /* Initialize subexpression text positions to -1 to mark ones that no + start_memory/stop_memory has been seen for. Also initialize the + register information struct. */ + for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) + { + regstart[mcnt] = regend[mcnt] + = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; + + REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; + IS_ACTIVE (reg_info[mcnt]) = 0; + MATCHED_SOMETHING (reg_info[mcnt]) = 0; + EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; + } + + /* We move `string1' into `string2' if the latter's empty -- but not if + `string1' is null. */ + if (size2 == 0 && string1 != NULL) + { + string2 = string1; + size2 = size1; + string1 = 0; + size1 = 0; + } + end1 = string1 + size1; + end2 = string2 + size2; + + /* Compute where to stop matching, within the two strings. */ +#ifdef MBS_SUPPORT + if (stop <= csize1) + { + mcnt = count_mbs_length(mbs_offset1, stop); + end_match_1 = string1 + mcnt; + end_match_2 = string2; + } + else + { + end_match_1 = end1; + mcnt = count_mbs_length(mbs_offset2, stop-csize1); + end_match_2 = string2 + mcnt; + } + if (mcnt < 0) + { /* count_mbs_length return error. */ + FREE_VARIABLES (); + return -1; + } +#else + if (stop <= size1) + { + end_match_1 = string1 + stop; + end_match_2 = string2; + } + else + { + end_match_1 = end1; + end_match_2 = string2 + stop - size1; + } +#endif /* MBS_SUPPORT */ + + /* `p' scans through the pattern as `d' scans through the data. + `dend' is the end of the input string that `d' points within. `d' + is advanced into the following input string whenever necessary, but + this happens before fetching; therefore, at the beginning of the + loop, `d' can be pointing at the end of a string, but it cannot + equal `string2'. */ +#ifdef MBS_SUPPORT + if (size1 > 0 && pos <= csize1) + { + mcnt = count_mbs_length(mbs_offset1, pos); + d = string1 + mcnt; + dend = end_match_1; + } + else + { + mcnt = count_mbs_length(mbs_offset2, pos-csize1); + d = string2 + mcnt; + dend = end_match_2; + } + + if (mcnt < 0) + { /* count_mbs_length return error. */ + FREE_VARIABLES (); + return -1; + } +#else + if (size1 > 0 && pos <= size1) + { + d = string1 + pos; + dend = end_match_1; + } + else + { + d = string2 + pos - size1; + dend = end_match_2; + } +#endif /* MBS_SUPPORT */ + + DEBUG_PRINT1 ("The compiled pattern is:\n"); + DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); + DEBUG_PRINT1 ("The string to match is: `"); + DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); + DEBUG_PRINT1 ("'\n"); + + /* This loops over pattern commands. It exits by returning from the + function if the match is complete, or it drops through if the match + fails at this starting point in the input data. */ + for (;;) + { +#ifdef _LIBC + DEBUG_PRINT2 ("\n%p: ", p); +#else + DEBUG_PRINT2 ("\n0x%x: ", p); +#endif + + if (p == pend) + { /* End of pattern means we might have succeeded. */ + DEBUG_PRINT1 ("end of pattern ... "); + + /* If we haven't matched the entire string, and we want the + longest match, try backtracking. */ + if (d != end_match_2) + { + /* 1 if this match ends in the same string (string1 or string2) + as the best previous match. */ + boolean same_str_p = (FIRST_STRING_P (match_end) + == MATCHING_IN_FIRST_STRING); + /* 1 if this match is the best seen so far. */ + boolean best_match_p; + + /* AIX compiler got confused when this was combined + with the previous declaration. */ + if (same_str_p) + best_match_p = d > match_end; + else + best_match_p = !MATCHING_IN_FIRST_STRING; + + DEBUG_PRINT1 ("backtracking.\n"); + + if (!FAIL_STACK_EMPTY ()) + { /* More failure points to try. */ + + /* If exceeds best match so far, save it. */ + if (!best_regs_set || best_match_p) + { + best_regs_set = true; + match_end = d; + + DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); + + for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) + { + best_regstart[mcnt] = regstart[mcnt]; + best_regend[mcnt] = regend[mcnt]; + } + } + goto fail; + } + + /* If no failure points, don't restore garbage. And if + last match is real best match, don't restore second + best one. */ + else if (best_regs_set && !best_match_p) + { + restore_best_regs: + /* Restore best match. It may happen that `dend == + end_match_1' while the restored d is in string2. + For example, the pattern `x.*y.*z' against the + strings `x-' and `y-z-', if the two strings are + not consecutive in memory. */ + DEBUG_PRINT1 ("Restoring best registers.\n"); + + d = match_end; + dend = ((d >= string1 && d <= end1) + ? end_match_1 : end_match_2); + + for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) + { + regstart[mcnt] = best_regstart[mcnt]; + regend[mcnt] = best_regend[mcnt]; + } + } + } /* d != end_match_2 */ + + succeed_label: + DEBUG_PRINT1 ("Accepting match.\n"); + /* If caller wants register contents data back, do it. */ + if (regs && !bufp->no_sub) + { + /* Have the register data arrays been allocated? */ + if (bufp->regs_allocated == REGS_UNALLOCATED) + { /* No. So allocate them with malloc. We need one + extra element beyond `num_regs' for the `-1' marker + GNU code uses. */ + regs->num_regs = MAX (RE_NREGS, num_regs + 1); + regs->start = TALLOC (regs->num_regs, regoff_t); + regs->end = TALLOC (regs->num_regs, regoff_t); + if (regs->start == NULL || regs->end == NULL) + { + FREE_VARIABLES (); + return -2; + } + bufp->regs_allocated = REGS_REALLOCATE; + } + else if (bufp->regs_allocated == REGS_REALLOCATE) + { /* Yes. If we need more elements than were already + allocated, reallocate them. If we need fewer, just + leave it alone. */ + if (regs->num_regs < num_regs + 1) + { + regs->num_regs = num_regs + 1; + RETALLOC (regs->start, regs->num_regs, regoff_t); + RETALLOC (regs->end, regs->num_regs, regoff_t); + if (regs->start == NULL || regs->end == NULL) + { + FREE_VARIABLES (); + return -2; + } + } + } + else + { + /* These braces fend off a "empty body in an else-statement" + warning under GCC when assert expands to nothing. */ + assert (bufp->regs_allocated == REGS_FIXED); + } + + /* Convert the pointer data in `regstart' and `regend' to + indices. Register zero has to be set differently, + since we haven't kept track of any info for it. */ + if (regs->num_regs > 0) + { + regs->start[0] = pos; +#ifdef MBS_SUPPORT + if (MATCHING_IN_FIRST_STRING) + regs->end[0] = mbs_offset1 != NULL ? + mbs_offset1[d-string1] : 0; + else + regs->end[0] = csize1 + (mbs_offset2 != NULL ? + mbs_offset2[d-string2] : 0); +#else + regs->end[0] = (MATCHING_IN_FIRST_STRING + ? ((regoff_t) (d - string1)) + : ((regoff_t) (d - string2 + size1))); +#endif /* MBS_SUPPORT */ + } + + /* Go through the first `min (num_regs, regs->num_regs)' + registers, since that is all we initialized. */ + for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs); + mcnt++) + { + if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) + regs->start[mcnt] = regs->end[mcnt] = -1; + else + { + regs->start[mcnt] + = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]); + regs->end[mcnt] + = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); + } + } + + /* If the regs structure we return has more elements than + were in the pattern, set the extra elements to -1. If + we (re)allocated the registers, this is the case, + because we always allocate enough to have at least one + -1 at the end. */ + for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++) + regs->start[mcnt] = regs->end[mcnt] = -1; + } /* regs && !bufp->no_sub */ + + DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", + nfailure_points_pushed, nfailure_points_popped, + nfailure_points_pushed - nfailure_points_popped); + DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); + +#ifdef MBS_SUPPORT + if (MATCHING_IN_FIRST_STRING) + mcnt = mbs_offset1 != NULL ? mbs_offset1[d-string1] : 0; + else + mcnt = (mbs_offset2 != NULL ? mbs_offset2[d-string2] : 0) + + csize1; + mcnt -= pos; +#else + mcnt = d - pos - (MATCHING_IN_FIRST_STRING + ? string1 + : string2 - size1); +#endif /* MBS_SUPPORT */ + + DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); + + FREE_VARIABLES (); + return mcnt; + } + + /* Otherwise match next pattern command. */ + switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) + { + /* Ignore these. Used to ignore the n of succeed_n's which + currently have n == 0. */ + case no_op: + DEBUG_PRINT1 ("EXECUTING no_op.\n"); + break; + + case succeed: + DEBUG_PRINT1 ("EXECUTING succeed.\n"); + goto succeed_label; + + /* Match the next n pattern characters exactly. The following + byte in the pattern defines n, and the n bytes after that + are the characters to match. */ + case exactn: +#ifdef MBS_SUPPORT + case exactn_bin: +#endif + mcnt = *p++; + DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); + + /* This is written out as an if-else so we don't waste time + testing `translate' inside the loop. */ + if (translate) + { + do + { + PREFETCH (); +#ifdef MBS_SUPPORT + if (*d <= 0xff) + { + if ((US_CHAR_TYPE) translate[(unsigned char) *d++] + != (US_CHAR_TYPE) *p++) + goto fail; + } + else + { + if (*d++ != (CHAR_TYPE) *p++) + goto fail; + } +#else + if ((US_CHAR_TYPE) translate[(unsigned char) *d++] + != (US_CHAR_TYPE) *p++) + goto fail; +#endif /* MBS_SUPPORT */ + } + while (--mcnt); + } + else + { + do + { + PREFETCH (); + if (*d++ != (CHAR_TYPE) *p++) goto fail; + } + while (--mcnt); + } + SET_REGS_MATCHED (); + break; + + + /* Match any character except possibly a newline or a null. */ + case anychar: + DEBUG_PRINT1 ("EXECUTING anychar.\n"); + + PREFETCH (); + + if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') + || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) + goto fail; + + SET_REGS_MATCHED (); + DEBUG_PRINT2 (" Matched `%ld'.\n", (long int) *d); + d++; + break; + + + case charset: + case charset_not: + { + register US_CHAR_TYPE c; +#ifdef MBS_SUPPORT + unsigned int i, char_class_length, coll_symbol_length, + equiv_class_length, ranges_length, chars_length, length; + CHAR_TYPE *workp, *workp2, *charset_top; +#define WORK_BUFFER_SIZE 128 + CHAR_TYPE str_buf[WORK_BUFFER_SIZE]; +# ifdef _LIBC + uint32_t nrules; +# endif /* _LIBC */ +#endif /* MBS_SUPPORT */ + boolean not = (re_opcode_t) *(p - 1) == charset_not; + + DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); + PREFETCH (); + c = TRANSLATE (*d); /* The character to match. */ +#ifdef MBS_SUPPORT +# ifdef _LIBC + nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); +# endif /* _LIBC */ + charset_top = p - 1; + char_class_length = *p++; + coll_symbol_length = *p++; + equiv_class_length = *p++; + ranges_length = *p++; + chars_length = *p++; + /* p points charset[6], so the address of the next instruction + (charset[l+m+n+2o+k+p']) equals p[l+m+n+2*o+p'], + where l=length of char_classes, m=length of collating_symbol, + n=equivalence_class, o=length of char_range, + p'=length of character. */ + workp = p; + /* Update p to indicate the next instruction. */ + p += char_class_length + coll_symbol_length+ equiv_class_length + + 2*ranges_length + chars_length; + + /* match with char_class? */ + for (i = 0; i < char_class_length ; i += CHAR_CLASS_SIZE) + { + wctype_t wctype; + uintptr_t alignedp = ((uintptr_t)workp + + __alignof__(wctype_t) - 1) + & ~(uintptr_t)(__alignof__(wctype_t) - 1); + wctype = *((wctype_t*)alignedp); + workp += CHAR_CLASS_SIZE; + if (iswctype((wint_t)c, wctype)) + goto char_set_matched; + } + + /* match with collating_symbol? */ +# ifdef _LIBC + if (nrules != 0) + { + const unsigned char *extra = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); + + for (workp2 = workp + coll_symbol_length ; workp < workp2 ; + workp++) + { + int32_t *wextra; + wextra = (int32_t*)(extra + *workp++); + for (i = 0; i < *wextra; ++i) + if (TRANSLATE(d[i]) != wextra[1 + i]) + break; + + if (i == *wextra) + { + /* Update d, however d will be incremented at + char_set_matched:, we decrement d here. */ + d += i - 1; + goto char_set_matched; + } + } + } + else /* (nrules == 0) */ +# endif + /* If we can't look up collation data, we use wcscoll + instead. */ + { + for (workp2 = workp + coll_symbol_length ; workp < workp2 ;) + { + const CHAR_TYPE *backup_d = d, *backup_dend = dend; + length = wcslen(workp); + + /* If wcscoll(the collating symbol, whole string) > 0, + any substring of the string never match with the + collating symbol. */ + if (wcscoll(workp, d) > 0) + { + workp += length + 1; + continue; + } + + /* First, we compare the collating symbol with + the first character of the string. + If it don't match, we add the next character to + the compare buffer in turn. */ + for (i = 0 ; i < WORK_BUFFER_SIZE-1 ; i++, d++) + { + int match; + if (d == dend) + { + if (dend == end_match_2) + break; + d = string2; + dend = end_match_2; + } + + /* add next character to the compare buffer. */ + str_buf[i] = TRANSLATE(*d); + str_buf[i+1] = '\0'; + + match = wcscoll(workp, str_buf); + if (match == 0) + goto char_set_matched; + + if (match < 0) + /* (str_buf > workp) indicate (str_buf + X > workp), + because for all X (str_buf + X > str_buf). + So we don't need continue this loop. */ + break; + + /* Otherwise(str_buf < workp), + (str_buf+next_character) may equals (workp). + So we continue this loop. */ + } + /* not matched */ + d = backup_d; + dend = backup_dend; + workp += length + 1; + } + } + /* match with equivalence_class? */ +# ifdef _LIBC + if (nrules != 0) + { + const CHAR_TYPE *backup_d = d, *backup_dend = dend; + /* Try to match the equivalence class against + those known to the collate implementation. */ + const int32_t *table; + const int32_t *weights; + const int32_t *extra; + const int32_t *indirect; + int32_t idx, idx2; + wint_t *cp; + size_t len; + + /* This #include defines a local function! */ +# include + + table = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC); + weights = (const wint_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC); + extra = (const wint_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC); + indirect = (const int32_t *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC); + + /* Write 1 collating element to str_buf, and + get its index. */ + idx2 = 0; + + for (i = 0 ; idx2 == 0 && i < WORK_BUFFER_SIZE - 1; i++) + { + cp = (wint_t*)str_buf; + if (d == dend) + { + if (dend == end_match_2) + break; + d = string2; + dend = end_match_2; + } + str_buf[i] = TRANSLATE(*(d+i)); + str_buf[i+1] = '\0'; /* sentinel */ + idx2 = findidx ((const wint_t**)&cp); + } + + /* Update d, however d will be incremented at + char_set_matched:, we decrement d here. */ + d = backup_d + ((wchar_t*)cp - (wchar_t*)str_buf - 1); + if (d >= dend) + { + if (dend == end_match_2) + d = dend; + else + { + d = string2; + dend = end_match_2; + } + } + + len = weights[idx2]; + + for (workp2 = workp + equiv_class_length ; workp < workp2 ; + workp++) + { + idx = (int32_t)*workp; + /* We already checked idx != 0 in regex_compile. */ + + if (idx2 != 0 && len == weights[idx]) + { + int cnt = 0; + while (cnt < len && (weights[idx + 1 + cnt] + == weights[idx2 + 1 + cnt])) + ++cnt; + + if (cnt == len) + goto char_set_matched; + } + } + /* not matched */ + d = backup_d; + dend = backup_dend; + } + else /* (nrules == 0) */ +# endif + /* If we can't look up collation data, we use wcscoll + instead. */ + { + for (workp2 = workp + equiv_class_length ; workp < workp2 ;) + { + const CHAR_TYPE *backup_d = d, *backup_dend = dend; + length = wcslen(workp); + + /* If wcscoll(the collating symbol, whole string) > 0, + any substring of the string never match with the + collating symbol. */ + if (wcscoll(workp, d) > 0) + { + workp += length + 1; + break; + } + + /* First, we compare the equivalence class with + the first character of the string. + If it don't match, we add the next character to + the compare buffer in turn. */ + for (i = 0 ; i < WORK_BUFFER_SIZE - 1 ; i++, d++) + { + int match; + if (d == dend) + { + if (dend == end_match_2) + break; + d = string2; + dend = end_match_2; + } + + /* add next character to the compare buffer. */ + str_buf[i] = TRANSLATE(*d); + str_buf[i+1] = '\0'; + + match = wcscoll(workp, str_buf); + + if (match == 0) + goto char_set_matched; + + if (match < 0) + /* (str_buf > workp) indicate (str_buf + X > workp), + because for all X (str_buf + X > str_buf). + So we don't need continue this loop. */ + break; + + /* Otherwise(str_buf < workp), + (str_buf+next_character) may equals (workp). + So we continue this loop. */ + } + /* not matched */ + d = backup_d; + dend = backup_dend; + workp += length + 1; + } + } + + /* match with char_range? */ +#ifdef _LIBC + if (nrules != 0) + { + uint32_t collseqval; + const char *collseq = (const char *) + _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); + + collseqval = collseq_table_lookup (collseq, c); + + for (; workp < p - chars_length ;) + { + uint32_t start_val, end_val; + + /* We already compute the collation sequence value + of the characters (or collating symbols). */ + start_val = (uint32_t) *workp++; /* range_start */ + end_val = (uint32_t) *workp++; /* range_end */ + + if (start_val <= collseqval && collseqval <= end_val) + goto char_set_matched; + } + } + else +#endif + { + /* We set range_start_char at str_buf[0], range_end_char + at str_buf[4], and compared char at str_buf[2]. */ + str_buf[1] = 0; + str_buf[2] = c; + str_buf[3] = 0; + str_buf[5] = 0; + for (; workp < p - chars_length ;) + { + wchar_t *range_start_char, *range_end_char; + + /* match if (range_start_char <= c <= range_end_char). */ + + /* If range_start(or end) < 0, we assume -range_start(end) + is the offset of the collating symbol which is specified + as the character of the range start(end). */ + + /* range_start */ + if (*workp < 0) + range_start_char = charset_top - (*workp++); + else + { + str_buf[0] = *workp++; + range_start_char = str_buf; + } + + /* range_end */ + if (*workp < 0) + range_end_char = charset_top - (*workp++); + else + { + str_buf[4] = *workp++; + range_end_char = str_buf + 4; + } + + if (wcscoll(range_start_char, str_buf+2) <= 0 && + wcscoll(str_buf+2, range_end_char) <= 0) + + goto char_set_matched; + } + } + + /* match with char? */ + for (; workp < p ; workp++) + if (c == *workp) + goto char_set_matched; + + not = !not; + + char_set_matched: + if (not) goto fail; +#else + /* Cast to `unsigned' instead of `unsigned char' in case the + bit list is a full 32 bytes long. */ + if (c < (unsigned) (*p * BYTEWIDTH) + && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) + not = !not; + + p += 1 + *p; + + if (!not) goto fail; +#undef WORK_BUFFER_SIZE +#endif /* MBS_SUPPORT */ + SET_REGS_MATCHED (); + d++; + break; + } + + + /* The beginning of a group is represented by start_memory. + The arguments are the register number in the next byte, and the + number of groups inner to this one in the next. The text + matched within the group is recorded (in the internal + registers data structure) under the register number. */ + case start_memory: + DEBUG_PRINT3 ("EXECUTING start_memory %ld (%ld):\n", + (long int) *p, (long int) p[1]); + + /* Find out if this group can match the empty string. */ + p1 = p; /* To send to group_match_null_string_p. */ + + if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) + REG_MATCH_NULL_STRING_P (reg_info[*p]) + = group_match_null_string_p (&p1, pend, reg_info); + + /* Save the position in the string where we were the last time + we were at this open-group operator in case the group is + operated upon by a repetition operator, e.g., with `(a*)*b' + against `ab'; then we want to ignore where we are now in + the string in case this attempt to match fails. */ + old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) + ? REG_UNSET (regstart[*p]) ? d : regstart[*p] + : regstart[*p]; + DEBUG_PRINT2 (" old_regstart: %d\n", + POINTER_TO_OFFSET (old_regstart[*p])); + + regstart[*p] = d; + DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p])); + + IS_ACTIVE (reg_info[*p]) = 1; + MATCHED_SOMETHING (reg_info[*p]) = 0; + + /* Clear this whenever we change the register activity status. */ + set_regs_matched_done = 0; + + /* This is the new highest active register. */ + highest_active_reg = *p; + + /* If nothing was active before, this is the new lowest active + register. */ + if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) + lowest_active_reg = *p; + + /* Move past the register number and inner group count. */ + p += 2; + just_past_start_mem = p; + + break; + + + /* The stop_memory opcode represents the end of a group. Its + arguments are the same as start_memory's: the register + number, and the number of inner groups. */ + case stop_memory: + DEBUG_PRINT3 ("EXECUTING stop_memory %ld (%ld):\n", + (long int) *p, (long int) p[1]); + + /* We need to save the string position the last time we were at + this close-group operator in case the group is operated + upon by a repetition operator, e.g., with `((a*)*(b*)*)*' + against `aba'; then we want to ignore where we are now in + the string in case this attempt to match fails. */ + old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) + ? REG_UNSET (regend[*p]) ? d : regend[*p] + : regend[*p]; + DEBUG_PRINT2 (" old_regend: %d\n", + POINTER_TO_OFFSET (old_regend[*p])); + + regend[*p] = d; + DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p])); + + /* This register isn't active anymore. */ + IS_ACTIVE (reg_info[*p]) = 0; + + /* Clear this whenever we change the register activity status. */ + set_regs_matched_done = 0; + + /* If this was the only register active, nothing is active + anymore. */ + if (lowest_active_reg == highest_active_reg) + { + lowest_active_reg = NO_LOWEST_ACTIVE_REG; + highest_active_reg = NO_HIGHEST_ACTIVE_REG; + } + else + { /* We must scan for the new highest active register, since + it isn't necessarily one less than now: consider + (a(b)c(d(e)f)g). When group 3 ends, after the f), the + new highest active register is 1. */ + US_CHAR_TYPE r = *p - 1; + while (r > 0 && !IS_ACTIVE (reg_info[r])) + r--; + + /* If we end up at register zero, that means that we saved + the registers as the result of an `on_failure_jump', not + a `start_memory', and we jumped to past the innermost + `stop_memory'. For example, in ((.)*) we save + registers 1 and 2 as a result of the *, but when we pop + back to the second ), we are at the stop_memory 1. + Thus, nothing is active. */ + if (r == 0) + { + lowest_active_reg = NO_LOWEST_ACTIVE_REG; + highest_active_reg = NO_HIGHEST_ACTIVE_REG; + } + else + highest_active_reg = r; + } + + /* If just failed to match something this time around with a + group that's operated on by a repetition operator, try to + force exit from the ``loop'', and restore the register + information for this group that we had before trying this + last match. */ + if ((!MATCHED_SOMETHING (reg_info[*p]) + || just_past_start_mem == p - 1) + && (p + 2) < pend) + { + boolean is_a_jump_n = false; + + p1 = p + 2; + mcnt = 0; + switch ((re_opcode_t) *p1++) + { + case jump_n: + is_a_jump_n = true; + case pop_failure_jump: + case maybe_pop_jump: + case jump: + case dummy_failure_jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + if (is_a_jump_n) + p1 += OFFSET_ADDRESS_SIZE; + break; + + default: + /* do nothing */ ; + } + p1 += mcnt; + + /* If the next operation is a jump backwards in the pattern + to an on_failure_jump right before the start_memory + corresponding to this stop_memory, exit from the loop + by forcing a failure after pushing on the stack the + on_failure_jump's jump in the pattern, and d. */ + if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump + && (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == start_memory + && p1[2+OFFSET_ADDRESS_SIZE] == *p) + { + /* If this group ever matched anything, then restore + what its registers were before trying this last + failed match, e.g., with `(a*)*b' against `ab' for + regstart[1], and, e.g., with `((a*)*(b*)*)*' + against `aba' for regend[3]. + + Also restore the registers for inner groups for, + e.g., `((a*)(b*))*' against `aba' (register 3 would + otherwise get trashed). */ + + if (EVER_MATCHED_SOMETHING (reg_info[*p])) + { + unsigned r; + + EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; + + /* Restore this and inner groups' (if any) registers. */ + for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1); + r++) + { + regstart[r] = old_regstart[r]; + + /* xx why this test? */ + if (old_regend[r] >= regstart[r]) + regend[r] = old_regend[r]; + } + } + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + PUSH_FAILURE_POINT (p1 + mcnt, d, -2); + + goto fail; + } + } + + /* Move past the register number and the inner group count. */ + p += 2; + break; + + + /* \ has been turned into a `duplicate' command which is + followed by the numeric value of as the register number. */ + case duplicate: + { + register const CHAR_TYPE *d2, *dend2; + int regno = *p++; /* Get which register to match against. */ + DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); + + /* Can't back reference a group which we've never matched. */ + if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) + goto fail; + + /* Where in input to try to start matching. */ + d2 = regstart[regno]; + + /* Where to stop matching; if both the place to start and + the place to stop matching are in the same string, then + set to the place to stop, otherwise, for now have to use + the end of the first string. */ + + dend2 = ((FIRST_STRING_P (regstart[regno]) + == FIRST_STRING_P (regend[regno])) + ? regend[regno] : end_match_1); + for (;;) + { + /* If necessary, advance to next segment in register + contents. */ + while (d2 == dend2) + { + if (dend2 == end_match_2) break; + if (dend2 == regend[regno]) break; + + /* End of string1 => advance to string2. */ + d2 = string2; + dend2 = regend[regno]; + } + /* At end of register contents => success */ + if (d2 == dend2) break; + + /* If necessary, advance to next segment in data. */ + PREFETCH (); + + /* How many characters left in this segment to match. */ + mcnt = dend - d; + + /* Want how many consecutive characters we can match in + one shot, so, if necessary, adjust the count. */ + if (mcnt > dend2 - d2) + mcnt = dend2 - d2; + + /* Compare that many; failure if mismatch, else move + past them. */ + if (translate + ? bcmp_translate (d, d2, mcnt, translate) + : memcmp (d, d2, mcnt*sizeof(US_CHAR_TYPE))) + goto fail; + d += mcnt, d2 += mcnt; + + /* Do this because we've match some characters. */ + SET_REGS_MATCHED (); + } + } + break; + + + /* begline matches the empty string at the beginning of the string + (unless `not_bol' is set in `bufp'), and, if + `newline_anchor' is set, after newlines. */ + case begline: + DEBUG_PRINT1 ("EXECUTING begline.\n"); + + if (AT_STRINGS_BEG (d)) + { + if (!bufp->not_bol) break; + } + else if (d[-1] == '\n' && bufp->newline_anchor) + { + break; + } + /* In all other cases, we fail. */ + goto fail; + + + /* endline is the dual of begline. */ + case endline: + DEBUG_PRINT1 ("EXECUTING endline.\n"); + + if (AT_STRINGS_END (d)) + { + if (!bufp->not_eol) break; + } + + /* We have to ``prefetch'' the next character. */ + else if ((d == end1 ? *string2 : *d) == '\n' + && bufp->newline_anchor) + { + break; + } + goto fail; + + + /* Match at the very beginning of the data. */ + case begbuf: + DEBUG_PRINT1 ("EXECUTING begbuf.\n"); + if (AT_STRINGS_BEG (d)) + break; + goto fail; + + + /* Match at the very end of the data. */ + case endbuf: + DEBUG_PRINT1 ("EXECUTING endbuf.\n"); + if (AT_STRINGS_END (d)) + break; + goto fail; + + + /* on_failure_keep_string_jump is used to optimize `.*\n'. It + pushes NULL as the value for the string on the stack. Then + `pop_failure_point' will keep the current value for the + string, instead of restoring it. To see why, consider + matching `foo\nbar' against `.*\n'. The .* matches the foo; + then the . fails against the \n. But the next thing we want + to do is match the \n against the \n; if we restored the + string value, we would be back at the foo. + + Because this is used only in specific cases, we don't need to + check all the things that `on_failure_jump' does, to make + sure the right things get saved on the stack. Hence we don't + share its code. The only reason to push anything on the + stack at all is that otherwise we would have to change + `anychar's code to do something besides goto fail in this + case; that seems worse than this. */ + case on_failure_keep_string_jump: + DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); + + EXTRACT_NUMBER_AND_INCR (mcnt, p); +#ifdef _LIBC + DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt); +#else + DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); +#endif + + PUSH_FAILURE_POINT (p + mcnt, NULL, -2); + break; + + + /* Uses of on_failure_jump: + + Each alternative starts with an on_failure_jump that points + to the beginning of the next alternative. Each alternative + except the last ends with a jump that in effect jumps past + the rest of the alternatives. (They really jump to the + ending jump of the following alternative, because tensioning + these jumps is a hassle.) + + Repeats start with an on_failure_jump that points past both + the repetition text and either the following jump or + pop_failure_jump back to this on_failure_jump. */ + case on_failure_jump: + on_failure: + DEBUG_PRINT1 ("EXECUTING on_failure_jump"); + + EXTRACT_NUMBER_AND_INCR (mcnt, p); +#ifdef _LIBC + DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt); +#else + DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); +#endif + + /* If this on_failure_jump comes right before a group (i.e., + the original * applied to a group), save the information + for that group and all inner ones, so that if we fail back + to this point, the group's information will be correct. + For example, in \(a*\)*\1, we need the preceding group, + and in \(zz\(a*\)b*\)\2, we need the inner group. */ + + /* We can't use `p' to check ahead because we push + a failure point to `p + mcnt' after we do this. */ + p1 = p; + + /* We need to skip no_op's before we look for the + start_memory in case this on_failure_jump is happening as + the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 + against aba. */ + while (p1 < pend && (re_opcode_t) *p1 == no_op) + p1++; + + if (p1 < pend && (re_opcode_t) *p1 == start_memory) + { + /* We have a new highest active register now. This will + get reset at the start_memory we are about to get to, + but we will have saved all the registers relevant to + this repetition op, as described above. */ + highest_active_reg = *(p1 + 1) + *(p1 + 2); + if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) + lowest_active_reg = *(p1 + 1); + } + + DEBUG_PRINT1 (":\n"); + PUSH_FAILURE_POINT (p + mcnt, d, -2); + break; + + + /* A smart repeat ends with `maybe_pop_jump'. + We change it to either `pop_failure_jump' or `jump'. */ + case maybe_pop_jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); + { + register US_CHAR_TYPE *p2 = p; + + /* Compare the beginning of the repeat with what in the + pattern follows its end. If we can establish that there + is nothing that they would both match, i.e., that we + would have to backtrack because of (as in, e.g., `a*a') + then we can change to pop_failure_jump, because we'll + never have to backtrack. + + This is not true in the case of alternatives: in + `(a|ab)*' we do need to backtrack to the `ab' alternative + (e.g., if the string was `ab'). But instead of trying to + detect that here, the alternative has put on a dummy + failure point which is what we will end up popping. */ + + /* Skip over open/close-group commands. + If what follows this loop is a ...+ construct, + look at what begins its body, since we will have to + match at least one of that. */ + while (1) + { + if (p2 + 2 < pend + && ((re_opcode_t) *p2 == stop_memory + || (re_opcode_t) *p2 == start_memory)) + p2 += 3; + else if (p2 + 2 + 2 * OFFSET_ADDRESS_SIZE < pend + && (re_opcode_t) *p2 == dummy_failure_jump) + p2 += 2 + 2 * OFFSET_ADDRESS_SIZE; + else + break; + } + + p1 = p + mcnt; + /* p1[0] ... p1[2] are the `on_failure_jump' corresponding + to the `maybe_finalize_jump' of this case. Examine what + follows. */ + + /* If we're at the end of the pattern, we can change. */ + if (p2 == pend) + { + /* Consider what happens when matching ":\(.*\)" + against ":/". I don't really understand this code + yet. */ + p[-(1+OFFSET_ADDRESS_SIZE)] = (US_CHAR_TYPE) + pop_failure_jump; + DEBUG_PRINT1 + (" End of pattern: change to `pop_failure_jump'.\n"); + } + + else if ((re_opcode_t) *p2 == exactn +#ifdef MBS_SUPPORT + || (re_opcode_t) *p2 == exactn_bin +#endif + || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) + { + register US_CHAR_TYPE c + = *p2 == (US_CHAR_TYPE) endline ? '\n' : p2[2]; + + if (((re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn +#ifdef MBS_SUPPORT + || (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn_bin +#endif + ) && p1[3+OFFSET_ADDRESS_SIZE] != c) + { + p[-(1+OFFSET_ADDRESS_SIZE)] = (US_CHAR_TYPE) + pop_failure_jump; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX != 1) + DEBUG_PRINT3 (" %C != %C => pop_failure_jump.\n", + (wint_t) c, + (wint_t) p1[3+OFFSET_ADDRESS_SIZE]); + else +#endif + DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", + (char) c, + (char) p1[3+OFFSET_ADDRESS_SIZE]); + } + +#ifndef MBS_SUPPORT + else if ((re_opcode_t) p1[3] == charset + || (re_opcode_t) p1[3] == charset_not) + { + int not = (re_opcode_t) p1[3] == charset_not; + + if (c < (unsigned) (p1[4] * BYTEWIDTH) + && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) + not = !not; + + /* `not' is equal to 1 if c would match, which means + that we can't change to pop_failure_jump. */ + if (!not) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } +#endif /* not MBS_SUPPORT */ + } +#ifndef MBS_SUPPORT + else if ((re_opcode_t) *p2 == charset) + { + /* We win if the first character of the loop is not part + of the charset. */ + if ((re_opcode_t) p1[3] == exactn + && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5] + && (p2[2 + p1[5] / BYTEWIDTH] + & (1 << (p1[5] % BYTEWIDTH))))) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + + else if ((re_opcode_t) p1[3] == charset_not) + { + int idx; + /* We win if the charset_not inside the loop + lists every character listed in the charset after. */ + for (idx = 0; idx < (int) p2[1]; idx++) + if (! (p2[2 + idx] == 0 + || (idx < (int) p1[4] + && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) + break; + + if (idx == p2[1]) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } + else if ((re_opcode_t) p1[3] == charset) + { + int idx; + /* We win if the charset inside the loop + has no overlap with the one after the loop. */ + for (idx = 0; + idx < (int) p2[1] && idx < (int) p1[4]; + idx++) + if ((p2[2 + idx] & p1[5 + idx]) != 0) + break; + + if (idx == p2[1] || idx == p1[4]) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } + } +#endif /* not MBS_SUPPORT */ + } + p -= OFFSET_ADDRESS_SIZE; /* Point at relative address again. */ + if ((re_opcode_t) p[-1] != pop_failure_jump) + { + p[-1] = (US_CHAR_TYPE) jump; + DEBUG_PRINT1 (" Match => jump.\n"); + goto unconditional_jump; + } + /* Note fall through. */ + + + /* The end of a simple repeat has a pop_failure_jump back to + its matching on_failure_jump, where the latter will push a + failure point. The pop_failure_jump takes off failure + points put on by this pop_failure_jump's matching + on_failure_jump; we got through the pattern to here from the + matching on_failure_jump, so didn't fail. */ + case pop_failure_jump: + { + /* We need to pass separate storage for the lowest and + highest registers, even though we don't care about the + actual values. Otherwise, we will restore only one + register from the stack, since lowest will == highest in + `pop_failure_point'. */ + active_reg_t dummy_low_reg, dummy_high_reg; + US_CHAR_TYPE *pdummy = NULL; + const CHAR_TYPE *sdummy = NULL; + + DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); + POP_FAILURE_POINT (sdummy, pdummy, + dummy_low_reg, dummy_high_reg, + reg_dummy, reg_dummy, reg_info_dummy); + } + /* Note fall through. */ + + unconditional_jump: +#ifdef _LIBC + DEBUG_PRINT2 ("\n%p: ", p); +#else + DEBUG_PRINT2 ("\n0x%x: ", p); +#endif + /* Note fall through. */ + + /* Unconditionally jump (without popping any failure points). */ + case jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ + DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); + p += mcnt; /* Do the jump. */ +#ifdef _LIBC + DEBUG_PRINT2 ("(to %p).\n", p); +#else + DEBUG_PRINT2 ("(to 0x%x).\n", p); +#endif + break; + + + /* We need this opcode so we can detect where alternatives end + in `group_match_null_string_p' et al. */ + case jump_past_alt: + DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); + goto unconditional_jump; + + + /* Normally, the on_failure_jump pushes a failure point, which + then gets popped at pop_failure_jump. We will end up at + pop_failure_jump, also, and with a pattern of, say, `a+', we + are skipping over the on_failure_jump, so we have to push + something meaningless for pop_failure_jump to pop. */ + case dummy_failure_jump: + DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); + /* It doesn't matter what we push for the string here. What + the code at `fail' tests is the value for the pattern. */ + PUSH_FAILURE_POINT (NULL, NULL, -2); + goto unconditional_jump; + + + /* At the end of an alternative, we need to push a dummy failure + point in case we are followed by a `pop_failure_jump', because + we don't want the failure point for the alternative to be + popped. For example, matching `(a|ab)*' against `aab' + requires that we match the `ab' alternative. */ + case push_dummy_failure: + DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); + /* See comments just above at `dummy_failure_jump' about the + two zeroes. */ + PUSH_FAILURE_POINT (NULL, NULL, -2); + break; + + /* Have to succeed matching what follows at least n times. + After that, handle like `on_failure_jump'. */ + case succeed_n: + EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE); + DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); + + assert (mcnt >= 0); + /* Originally, this is how many times we HAVE to succeed. */ + if (mcnt > 0) + { + mcnt--; + p += OFFSET_ADDRESS_SIZE; + STORE_NUMBER_AND_INCR (p, mcnt); +#ifdef _LIBC + DEBUG_PRINT3 (" Setting %p to %d.\n", p - OFFSET_ADDRESS_SIZE + , mcnt); +#else + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - OFFSET_ADDRESS_SIZE + , mcnt); +#endif + } + else if (mcnt == 0) + { +#ifdef _LIBC + DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", + p + OFFSET_ADDRESS_SIZE); +#else + DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", + p + OFFSET_ADDRESS_SIZE); +#endif /* _LIBC */ + +#ifdef MBS_SUPPORT + p[1] = (US_CHAR_TYPE) no_op; +#else + p[2] = (US_CHAR_TYPE) no_op; + p[3] = (US_CHAR_TYPE) no_op; +#endif /* MBS_SUPPORT */ + goto on_failure; + } + break; + + case jump_n: + EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE); + DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); + + /* Originally, this is how many times we CAN jump. */ + if (mcnt) + { + mcnt--; + STORE_NUMBER (p + OFFSET_ADDRESS_SIZE, mcnt); + +#ifdef _LIBC + DEBUG_PRINT3 (" Setting %p to %d.\n", p + OFFSET_ADDRESS_SIZE, + mcnt); +#else + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + OFFSET_ADDRESS_SIZE, + mcnt); +#endif /* _LIBC */ + goto unconditional_jump; + } + /* If don't have to jump any more, skip over the rest of command. */ + else + p += 2 * OFFSET_ADDRESS_SIZE; + break; + + case set_number_at: + { + DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); + + EXTRACT_NUMBER_AND_INCR (mcnt, p); + p1 = p + mcnt; + EXTRACT_NUMBER_AND_INCR (mcnt, p); +#ifdef _LIBC + DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt); +#else + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); +#endif + STORE_NUMBER (p1, mcnt); + break; + } + +#if 0 + /* The DEC Alpha C compiler 3.x generates incorrect code for the + test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of + AT_WORD_BOUNDARY, so this code is disabled. Expanding the + macro and introducing temporary variables works around the bug. */ + + case wordbound: + DEBUG_PRINT1 ("EXECUTING wordbound.\n"); + if (AT_WORD_BOUNDARY (d)) + break; + goto fail; + + case notwordbound: + DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); + if (AT_WORD_BOUNDARY (d)) + goto fail; + break; +#else + case wordbound: + { + boolean prevchar, thischar; + + DEBUG_PRINT1 ("EXECUTING wordbound.\n"); + if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) + break; + + prevchar = WORDCHAR_P (d - 1); + thischar = WORDCHAR_P (d); + if (prevchar != thischar) + break; + goto fail; + } + + case notwordbound: + { + boolean prevchar, thischar; + + DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); + if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) + goto fail; + + prevchar = WORDCHAR_P (d - 1); + thischar = WORDCHAR_P (d); + if (prevchar != thischar) + goto fail; + break; + } +#endif + + case wordbeg: + DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); + if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) + break; + goto fail; + + case wordend: + DEBUG_PRINT1 ("EXECUTING wordend.\n"); + if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) + && (!WORDCHAR_P (d) || AT_STRINGS_END (d))) + break; + goto fail; + +#ifdef emacs + case before_dot: + DEBUG_PRINT1 ("EXECUTING before_dot.\n"); + if (PTR_CHAR_POS ((unsigned char *) d) >= point) + goto fail; + break; + + case at_dot: + DEBUG_PRINT1 ("EXECUTING at_dot.\n"); + if (PTR_CHAR_POS ((unsigned char *) d) != point) + goto fail; + break; + + case after_dot: + DEBUG_PRINT1 ("EXECUTING after_dot.\n"); + if (PTR_CHAR_POS ((unsigned char *) d) <= point) + goto fail; + break; + + case syntaxspec: + DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); + mcnt = *p++; + goto matchsyntax; + + case wordchar: + DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); + mcnt = (int) Sword; + matchsyntax: + PREFETCH (); + /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ + d++; + if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt) + goto fail; + SET_REGS_MATCHED (); + break; + + case notsyntaxspec: + DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); + mcnt = *p++; + goto matchnotsyntax; + + case notwordchar: + DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); + mcnt = (int) Sword; + matchnotsyntax: + PREFETCH (); + /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ + d++; + if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt) + goto fail; + SET_REGS_MATCHED (); + break; + +#else /* not emacs */ + case wordchar: + DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); + PREFETCH (); + if (!WORDCHAR_P (d)) + goto fail; + SET_REGS_MATCHED (); + d++; + break; + + case notwordchar: + DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); + PREFETCH (); + if (WORDCHAR_P (d)) + goto fail; + SET_REGS_MATCHED (); + d++; + break; +#endif /* not emacs */ + + default: + abort (); + } + continue; /* Successfully executed one pattern command; keep going. */ + + + /* We goto here if a matching operation fails. */ + fail: + if (!FAIL_STACK_EMPTY ()) + { /* A restart point is known. Restore to that state. */ + DEBUG_PRINT1 ("\nFAIL:\n"); + POP_FAILURE_POINT (d, p, + lowest_active_reg, highest_active_reg, + regstart, regend, reg_info); + + /* If this failure point is a dummy, try the next one. */ + if (!p) + goto fail; + + /* If we failed to the end of the pattern, don't examine *p. */ + assert (p <= pend); + if (p < pend) + { + boolean is_a_jump_n = false; + + /* If failed to a backwards jump that's part of a repetition + loop, need to pop this failure point and use the next one. */ + switch ((re_opcode_t) *p) + { + case jump_n: + is_a_jump_n = true; + case maybe_pop_jump: + case pop_failure_jump: + case jump: + p1 = p + 1; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + p1 += mcnt; + + if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n) + || (!is_a_jump_n + && (re_opcode_t) *p1 == on_failure_jump)) + goto fail; + break; + default: + /* do nothing */ ; + } + } + + if (d >= string1 && d <= end1) + dend = end_match_1; + } + else + break; /* Matching at this starting point really fails. */ + } /* for (;;) */ + + if (best_regs_set) + goto restore_best_regs; + + FREE_VARIABLES (); + + return -1; /* Failure to match. */ +} /* re_match_2 */ + +/* Subroutine definitions for re_match_2. */ + + +/* We are passed P pointing to a register number after a start_memory. + + Return true if the pattern up to the corresponding stop_memory can + match the empty string, and false otherwise. + + If we find the matching stop_memory, sets P to point to one past its number. + Otherwise, sets P to an undefined byte less than or equal to END. + + We don't handle duplicates properly (yet). */ + +static boolean +group_match_null_string_p (p, end, reg_info) + US_CHAR_TYPE **p, *end; + register_info_type *reg_info; +{ + int mcnt; + /* Point to after the args to the start_memory. */ + US_CHAR_TYPE *p1 = *p + 2; + + while (p1 < end) + { + /* Skip over opcodes that can match nothing, and return true or + false, as appropriate, when we get to one that can't, or to the + matching stop_memory. */ + + switch ((re_opcode_t) *p1) + { + /* Could be either a loop or a series of alternatives. */ + case on_failure_jump: + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + + /* If the next operation is not a jump backwards in the + pattern. */ + + if (mcnt >= 0) + { + /* Go through the on_failure_jumps of the alternatives, + seeing if any of the alternatives cannot match nothing. + The last alternative starts with only a jump, + whereas the rest start with on_failure_jump and end + with a jump, e.g., here is the pattern for `a|b|c': + + /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6 + /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3 + /exactn/1/c + + So, we have to first go through the first (n-1) + alternatives and then deal with the last one separately. */ + + + /* Deal with the first (n-1) alternatives, which start + with an on_failure_jump (see above) that jumps to right + past a jump_past_alt. */ + + while ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] == + jump_past_alt) + { + /* `mcnt' holds how many bytes long the alternative + is, including the ending `jump_past_alt' and + its number. */ + + if (!alt_match_null_string_p (p1, p1 + mcnt - + (1 + OFFSET_ADDRESS_SIZE), + reg_info)) + return false; + + /* Move to right after this alternative, including the + jump_past_alt. */ + p1 += mcnt; + + /* Break if it's the beginning of an n-th alternative + that doesn't begin with an on_failure_jump. */ + if ((re_opcode_t) *p1 != on_failure_jump) + break; + + /* Still have to check that it's not an n-th + alternative that starts with an on_failure_jump. */ + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + if ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] != + jump_past_alt) + { + /* Get to the beginning of the n-th alternative. */ + p1 -= 1 + OFFSET_ADDRESS_SIZE; + break; + } + } + + /* Deal with the last alternative: go back and get number + of the `jump_past_alt' just before it. `mcnt' contains + the length of the alternative. */ + EXTRACT_NUMBER (mcnt, p1 - OFFSET_ADDRESS_SIZE); + + if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info)) + return false; + + p1 += mcnt; /* Get past the n-th alternative. */ + } /* if mcnt > 0 */ + break; + + + case stop_memory: + assert (p1[1] == **p); + *p = p1 + 2; + return true; + + + default: + if (!common_op_match_null_string_p (&p1, end, reg_info)) + return false; + } + } /* while p1 < end */ + + return false; +} /* group_match_null_string_p */ + + +/* Similar to group_match_null_string_p, but doesn't deal with alternatives: + It expects P to be the first byte of a single alternative and END one + byte past the last. The alternative can contain groups. */ + +static boolean +alt_match_null_string_p (p, end, reg_info) + US_CHAR_TYPE *p, *end; + register_info_type *reg_info; +{ + int mcnt; + US_CHAR_TYPE *p1 = p; + + while (p1 < end) + { + /* Skip over opcodes that can match nothing, and break when we get + to one that can't. */ + + switch ((re_opcode_t) *p1) + { + /* It's a loop. */ + case on_failure_jump: + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + p1 += mcnt; + break; + + default: + if (!common_op_match_null_string_p (&p1, end, reg_info)) + return false; + } + } /* while p1 < end */ + + return true; +} /* alt_match_null_string_p */ + + +/* Deals with the ops common to group_match_null_string_p and + alt_match_null_string_p. + + Sets P to one after the op and its arguments, if any. */ + +static boolean +common_op_match_null_string_p (p, end, reg_info) + US_CHAR_TYPE **p, *end; + register_info_type *reg_info; +{ + int mcnt; + boolean ret; + int reg_no; + US_CHAR_TYPE *p1 = *p; + + switch ((re_opcode_t) *p1++) + { + case no_op: + case begline: + case endline: + case begbuf: + case endbuf: + case wordbeg: + case wordend: + case wordbound: + case notwordbound: +#ifdef emacs + case before_dot: + case at_dot: + case after_dot: +#endif + break; + + case start_memory: + reg_no = *p1; + assert (reg_no > 0 && reg_no <= MAX_REGNUM); + ret = group_match_null_string_p (&p1, end, reg_info); + + /* Have to set this here in case we're checking a group which + contains a group and a back reference to it. */ + + if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE) + REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret; + + if (!ret) + return false; + break; + + /* If this is an optimized succeed_n for zero times, make the jump. */ + case jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + if (mcnt >= 0) + p1 += mcnt; + else + return false; + break; + + case succeed_n: + /* Get to the number of times to succeed. */ + p1 += OFFSET_ADDRESS_SIZE; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + + if (mcnt == 0) + { + p1 -= 2 * OFFSET_ADDRESS_SIZE; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + p1 += mcnt; + } + else + return false; + break; + + case duplicate: + if (!REG_MATCH_NULL_STRING_P (reg_info[*p1])) + return false; + break; + + case set_number_at: + p1 += 2 * OFFSET_ADDRESS_SIZE; + + default: + /* All other opcodes mean we cannot match the empty string. */ + return false; + } + + *p = p1; + return true; +} /* common_op_match_null_string_p */ + + +/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN + bytes; nonzero otherwise. */ + +static int +bcmp_translate (s1, s2, len, translate) + const CHAR_TYPE *s1, *s2; + register int len; + RE_TRANSLATE_TYPE translate; +{ + register const US_CHAR_TYPE *p1 = (const US_CHAR_TYPE *) s1; + register const US_CHAR_TYPE *p2 = (const US_CHAR_TYPE *) s2; + while (len) + { +#ifdef MBS_SUPPORT + if (((*p1<=0xff)?translate[*p1++]:*p1++) + != ((*p2<=0xff)?translate[*p2++]:*p2++)) + return 1; +#else + if (translate[*p1++] != translate[*p2++]) return 1; +#endif /* MBS_SUPPORT */ + len--; + } + return 0; +} + +/* Entry points for GNU code. */ + +/* re_compile_pattern is the GNU regular expression compiler: it + compiles PATTERN (of length SIZE) and puts the result in BUFP. + Returns 0 if the pattern was valid, otherwise an error string. + + Assumes the `allocated' (and perhaps `buffer') and `translate' fields + are set in BUFP on entry. + + We call regex_compile to do the actual compilation. */ + +const char * +re_compile_pattern (pattern, length, bufp) + const char *pattern; + size_t length; + struct re_pattern_buffer *bufp; +{ + reg_errcode_t ret; + + /* GNU code is written to assume at least RE_NREGS registers will be set + (and at least one extra will be -1). */ + bufp->regs_allocated = REGS_UNALLOCATED; + + /* And GNU code determines whether or not to get register information + by passing null for the REGS argument to re_match, etc., not by + setting no_sub. */ + bufp->no_sub = 0; + + /* Match anchors at newline. */ + bufp->newline_anchor = 1; + + ret = regex_compile (pattern, length, re_syntax_options, bufp); + + if (!ret) + return NULL; + return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]); +} +#ifdef _LIBC +weak_alias (__re_compile_pattern, re_compile_pattern) +#endif + +/* Entry points compatible with 4.2 BSD regex library. We don't define + them unless specifically requested. */ + +#if defined _REGEX_RE_COMP || defined _LIBC + +/* BSD has one and only one pattern buffer. */ +static struct re_pattern_buffer re_comp_buf; + +char * +#ifdef _LIBC +/* Make these definitions weak in libc, so POSIX programs can redefine + these names if they don't use our functions, and still use + regcomp/regexec below without link errors. */ +weak_function +#endif +re_comp (s) + const char *s; +{ + reg_errcode_t ret; + + if (!s) + { + if (!re_comp_buf.buffer) + return gettext ("No previous regular expression"); + return 0; + } + + if (!re_comp_buf.buffer) + { + re_comp_buf.buffer = (unsigned char *) malloc (200); + if (re_comp_buf.buffer == NULL) + return (char *) gettext (re_error_msgid + + re_error_msgid_idx[(int) REG_ESPACE]); + re_comp_buf.allocated = 200; + + re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); + if (re_comp_buf.fastmap == NULL) + return (char *) gettext (re_error_msgid + + re_error_msgid_idx[(int) REG_ESPACE]); + } + + /* Since `re_exec' always passes NULL for the `regs' argument, we + don't need to initialize the pattern buffer fields which affect it. */ + + /* Match anchors at newlines. */ + re_comp_buf.newline_anchor = 1; + + ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); + + if (!ret) + return NULL; + + /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ + return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]); +} + + +int +#ifdef _LIBC +weak_function +#endif +re_exec (s) + const char *s; +{ + const int len = strlen (s); + return + 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); +} + +#endif /* _REGEX_RE_COMP */ + +/* POSIX.2 functions. Don't define these for Emacs. */ + +#ifndef emacs + +/* regcomp takes a regular expression as a string and compiles it. + + PREG is a regex_t *. We do not expect any fields to be initialized, + since POSIX says we shouldn't. Thus, we set + + `buffer' to the compiled pattern; + `used' to the length of the compiled pattern; + `syntax' to RE_SYNTAX_POSIX_EXTENDED if the + REG_EXTENDED bit in CFLAGS is set; otherwise, to + RE_SYNTAX_POSIX_BASIC; + `newline_anchor' to REG_NEWLINE being set in CFLAGS; + `fastmap' to an allocated space for the fastmap; + `fastmap_accurate' to zero; + `re_nsub' to the number of subexpressions in PATTERN. + + PATTERN is the address of the pattern string. + + CFLAGS is a series of bits which affect compilation. + + If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we + use POSIX basic syntax. + + If REG_NEWLINE is set, then . and [^...] don't match newline. + Also, regexec will try a match beginning after every newline. + + If REG_ICASE is set, then we considers upper- and lowercase + versions of letters to be equivalent when matching. + + If REG_NOSUB is set, then when PREG is passed to regexec, that + routine will report only success or failure, and nothing about the + registers. + + It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for + the return codes and their meanings.) */ + +int +regcomp (preg, pattern, cflags) + regex_t *preg; + const char *pattern; + int cflags; +{ + reg_errcode_t ret; + reg_syntax_t syntax + = (cflags & REG_EXTENDED) ? + RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC; + + /* regex_compile will allocate the space for the compiled pattern. */ + preg->buffer = 0; + preg->allocated = 0; + preg->used = 0; + + /* Try to allocate space for the fastmap. */ + preg->fastmap = (char *) malloc (1 << BYTEWIDTH); + + if (cflags & REG_ICASE) + { + unsigned i; + + preg->translate + = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE + * sizeof (*(RE_TRANSLATE_TYPE)0)); + if (preg->translate == NULL) + return (int) REG_ESPACE; + + /* Map uppercase characters to corresponding lowercase ones. */ + for (i = 0; i < CHAR_SET_SIZE; i++) + preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i; + } + else + preg->translate = NULL; + + /* If REG_NEWLINE is set, newlines are treated differently. */ + if (cflags & REG_NEWLINE) + { /* REG_NEWLINE implies neither . nor [^...] match newline. */ + syntax &= ~RE_DOT_NEWLINE; + syntax |= RE_HAT_LISTS_NOT_NEWLINE; + /* It also changes the matching behavior. */ + preg->newline_anchor = 1; + } + else + preg->newline_anchor = 0; + + preg->no_sub = !!(cflags & REG_NOSUB); + + /* POSIX says a null character in the pattern terminates it, so we + can use strlen here in compiling the pattern. */ + ret = regex_compile (pattern, strlen (pattern), syntax, preg); + + /* POSIX doesn't distinguish between an unmatched open-group and an + unmatched close-group: both are REG_EPAREN. */ + if (ret == REG_ERPAREN) ret = REG_EPAREN; + + if (ret == REG_NOERROR && preg->fastmap) + { + /* Compute the fastmap now, since regexec cannot modify the pattern + buffer. */ + if (re_compile_fastmap (preg) == -2) + { + /* Some error occurred while computing the fastmap, just forget + about it. */ + free (preg->fastmap); + preg->fastmap = NULL; + } + } + + return (int) ret; +} +#ifdef _LIBC +weak_alias (__regcomp, regcomp) +#endif + + +/* regexec searches for a given pattern, specified by PREG, in the + string STRING. + + If NMATCH is zero or REG_NOSUB was set in the cflags argument to + `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at + least NMATCH elements, and we set them to the offsets of the + corresponding matched substrings. + + EFLAGS specifies `execution flags' which affect matching: if + REG_NOTBOL is set, then ^ does not match at the beginning of the + string; if REG_NOTEOL is set, then $ does not match at the end. + + We return 0 if we find a match and REG_NOMATCH if not. */ + +int +regexec (preg, string, nmatch, pmatch, eflags) + const regex_t *preg; + const char *string; + size_t nmatch; + regmatch_t pmatch[]; + int eflags; +{ + int ret; + struct re_registers regs; + regex_t private_preg; + int len = strlen (string); + boolean want_reg_info = !preg->no_sub && nmatch > 0; + + private_preg = *preg; + + private_preg.not_bol = !!(eflags & REG_NOTBOL); + private_preg.not_eol = !!(eflags & REG_NOTEOL); + + /* The user has told us exactly how many registers to return + information about, via `nmatch'. We have to pass that on to the + matching routines. */ + private_preg.regs_allocated = REGS_FIXED; + + if (want_reg_info) + { + regs.num_regs = nmatch; + regs.start = TALLOC (nmatch * 2, regoff_t); + if (regs.start == NULL) + return (int) REG_NOMATCH; + regs.end = regs.start + nmatch; + } + + /* Perform the searching operation. */ + ret = re_search (&private_preg, string, len, + /* start: */ 0, /* range: */ len, + want_reg_info ? ®s : (struct re_registers *) 0); + + /* Copy the register information to the POSIX structure. */ + if (want_reg_info) + { + if (ret >= 0) + { + unsigned r; + + for (r = 0; r < nmatch; r++) + { + pmatch[r].rm_so = regs.start[r]; + pmatch[r].rm_eo = regs.end[r]; + } + } + + /* If we needed the temporary register info, free the space now. */ + free (regs.start); + } + + /* We want zero return to mean success, unlike `re_search'. */ + return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH; +} +#ifdef _LIBC +weak_alias (__regexec, regexec) +#endif + + +/* Returns a message corresponding to an error code, ERRCODE, returned + from either regcomp or regexec. We don't use PREG here. */ + +size_t +regerror (errcode, preg, errbuf, errbuf_size) + int errcode; + const regex_t *preg; + char *errbuf; + size_t errbuf_size; +{ + const char *msg; + size_t msg_size; + + if (errcode < 0 + || errcode >= (int) (sizeof (re_error_msgid_idx) + / sizeof (re_error_msgid_idx[0]))) + /* Only error codes returned by the rest of the code should be passed + to this routine. If we are given anything else, or if other regex + code generates an invalid error code, then the program has a bug. + Dump core so we can fix it. */ + abort (); + + msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]); + + msg_size = strlen (msg) + 1; /* Includes the null. */ + + if (errbuf_size != 0) + { + if (msg_size > errbuf_size) + { +#if defined HAVE_MEMPCPY || defined _LIBC + *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; +#else + memcpy (errbuf, msg, errbuf_size - 1); + errbuf[errbuf_size - 1] = 0; +#endif + } + else + memcpy (errbuf, msg, msg_size); + } + + return msg_size; +} +#ifdef _LIBC +weak_alias (__regerror, regerror) +#endif + + +/* Free dynamically allocated space used by PREG. */ + +void +regfree (preg) + regex_t *preg; +{ + if (preg->buffer != NULL) + free (preg->buffer); + preg->buffer = NULL; + + preg->allocated = 0; + preg->used = 0; + + if (preg->fastmap != NULL) + free (preg->fastmap); + preg->fastmap = NULL; + preg->fastmap_accurate = 0; + + if (preg->translate != NULL) + free (preg->translate); + preg->translate = NULL; +} +#ifdef _LIBC +weak_alias (__regfree, regfree) +#endif + +#endif /* not emacs */ diff --git a/src/apps/bin/grep-2.5/lib/regex.h b/src/apps/bin/grep-2.5/lib/regex.h new file mode 100644 index 0000000000..81789be897 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/regex.h @@ -0,0 +1,46 @@ +#ifndef _REGEX_H +#include + +/* Document internal interfaces. */ +extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); + +extern const char *__re_compile_pattern + _RE_ARGS ((const char *pattern, size_t length, + struct re_pattern_buffer *buffer)); + +extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); + +extern int __re_search + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, int range, struct re_registers *regs)); + +extern int __re_search_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, int range, struct re_registers *regs, int stop)); + +extern int __re_match + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, struct re_registers *regs)); + +extern int __re_match_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, struct re_registers *regs, int stop)); + +extern void __re_set_registers + _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, + unsigned num_regs, regoff_t *starts, regoff_t *ends)); + +extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern, + int __cflags)); + +extern int __regexec _RE_ARGS ((const regex_t *__preg, + const char *__string, size_t __nmatch, + regmatch_t __pmatch[], int __eflags)); + +extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg, + char *__errbuf, size_t __errbuf_size)); + +extern void __regfree _RE_ARGS ((regex_t *__preg)); +#endif diff --git a/src/apps/bin/grep-2.5/lib/savedir.c b/src/apps/bin/grep-2.5/lib/savedir.c new file mode 100644 index 0000000000..9357cada9d --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/savedir.c @@ -0,0 +1,179 @@ +/* savedir.c -- save the list of files in a directory in a string + Copyright (C) 1990, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by David MacKenzie . */ + +#if HAVE_CONFIG_H +# include +#endif + +#include + +#if HAVE_UNISTD_H +# include +#endif + +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#ifdef CLOSEDIR_VOID +/* Fake a return value. */ +# define CLOSEDIR(d) (closedir (d), 0) +#else +# define CLOSEDIR(d) closedir (d) +#endif + +#ifdef STDC_HEADERS +# include +# include +#else +char *malloc (); +char *realloc (); +#endif +#ifndef NULL +# define NULL 0 +#endif + +#ifndef stpcpy +char *stpcpy (); +#endif + +#include +#include "savedir.h" + +char *path; +size_t pathlen; + +static int +isdir1 (const char *dir, const char *file) +{ + int status; + int slash; + size_t dirlen = strlen (dir); + size_t filelen = strlen (file); + if ((dirlen + filelen + 2) > pathlen) + { + path = calloc (dirlen + 1 + filelen + 1, sizeof (*path)); + pathlen = dirlen + filelen + 2; + } + strcpy (path, dir); + slash = (path[dirlen] != '/'); + path[dirlen] = '/'; + strcpy (path + dirlen + slash , file); + status = isdir (path); + return status; +} + +/* Return a freshly allocated string containing the filenames + in directory DIR, separated by '\0' characters; + the end is marked by two '\0' characters in a row. + NAME_SIZE is the number of bytes to initially allocate + for the string; it will be enlarged as needed. + Return NULL if DIR cannot be opened or if out of memory. */ +char * +savedir (const char *dir, off_t name_size, struct exclude *included_patterns, + struct exclude *excluded_patterns) +{ + DIR *dirp; + struct dirent *dp; + char *name_space; + char *namep; + + dirp = opendir (dir); + if (dirp == NULL) + return NULL; + + /* Be sure name_size is at least `1' so there's room for + the final NUL byte. */ + if (name_size <= 0) + name_size = 1; + + name_space = (char *) malloc (name_size); + if (name_space == NULL) + { + closedir (dirp); + return NULL; + } + namep = name_space; + + while ((dp = readdir (dirp)) != NULL) + { + /* Skip "." and ".." (some NFS filesystems' directories lack them). */ + if (dp->d_name[0] != '.' + || (dp->d_name[1] != '\0' + && (dp->d_name[1] != '.' || dp->d_name[2] != '\0'))) + { + off_t size_needed = (namep - name_space) + NAMLEN (dp) + 2; + + if ((included_patterns || excluded_patterns) + && !isdir1 (dir, dp->d_name)) + { + if (included_patterns + && !excluded_filename (included_patterns, dp->d_name, 0)) + continue; + if (excluded_patterns + && excluded_filename (excluded_patterns, dp->d_name, 0)) + continue; + } + + if (size_needed > name_size) + { + char *new_name_space; + + while (size_needed > name_size) + name_size += 1024; + + new_name_space = realloc (name_space, name_size); + if (new_name_space == NULL) + { + closedir (dirp); + return NULL; + } + namep += new_name_space - name_space; + name_space = new_name_space; + } + namep = stpcpy (namep, dp->d_name) + 1; + } + } + *namep = '\0'; + if (CLOSEDIR (dirp)) + { + free (name_space); + return NULL; + } + if (path) + { + free (path); + path = NULL; + pathlen = 0; + } + return name_space; +} diff --git a/src/apps/bin/grep-2.5/lib/savedir.h b/src/apps/bin/grep-2.5/lib/savedir.h new file mode 100644 index 0000000000..49c331b587 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/savedir.h @@ -0,0 +1,18 @@ +#if !defined SAVEDIR_H_ +# define SAVEDIR_H_ + +#include "exclude.h" + +# ifndef PARAMS +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +# endif + +extern char * +savedir PARAMS ((const char *dir, off_t name_size, + struct exclude *, struct exclude *)); + +#endif diff --git a/src/apps/bin/grep-2.5/lib/stpcpy.c b/src/apps/bin/grep-2.5/lib/stpcpy.c new file mode 100644 index 0000000000..a01636cd1c --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/stpcpy.c @@ -0,0 +1,50 @@ +/* stpcpy.c -- copy a string and return pointer to end of new string + Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#undef __stpcpy +#undef stpcpy + +#ifndef weak_alias +# define __stpcpy stpcpy +#endif + +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +char * +__stpcpy (char *dest, const char *src) +{ + register char *d = dest; + register const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} +#ifdef weak_alias +weak_alias (__stpcpy, stpcpy) +#endif diff --git a/src/apps/bin/grep-2.5/lib/strtol.c b/src/apps/bin/grep-2.5/lib/strtol.c new file mode 100644 index 0000000000..a62db47444 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/strtol.c @@ -0,0 +1,476 @@ +/* Convert string representation of a number into an integer value. + Copyright (C) 1991, 92, 94, 95, 96, 97, 98, 99, 01 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@gnu.org. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define USE_NUMBER_GROUPING +# define STDC_HEADERS +# define HAVE_LIMITS_H +#endif + +#include +#include +#ifndef errno +extern int errno; +#endif +#ifndef __set_errno +# define __set_errno(Val) errno = (Val) +#endif + +#ifdef HAVE_LIMITS_H +# include +#endif + +#ifdef STDC_HEADERS +# include +# include +# include +#else +# ifndef NULL +# define NULL 0 +# endif +#endif + +#ifdef USE_NUMBER_GROUPING +# include "../locale/localeinfo.h" +#endif + +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +/* Nonzero if we are defining `strtoul' or `strtoull', operating on + unsigned integers. */ +#ifndef UNSIGNED +# define UNSIGNED 0 +# define INT LONG int +#else +# define INT unsigned LONG int +#endif + +/* Determine the name. */ +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# if UNSIGNED +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol __wcstoull_l +# else +# define strtol __wcstoul_l +# endif +# else +# ifdef QUAD +# define strtol __strtoull_l +# else +# define strtol __strtoul_l +# endif +# endif +# else +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol __wcstoll_l +# else +# define strtol __wcstol_l +# endif +# else +# ifdef QUAD +# define strtol __strtoll_l +# else +# define strtol __strtol_l +# endif +# endif +# endif +#else +# if UNSIGNED +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol wcstoull +# else +# define strtol wcstoul +# endif +# else +# ifdef QUAD +# define strtol strtoull +# else +# define strtol strtoul +# endif +# endif +# else +# ifdef USE_WIDE_CHAR +# ifdef QUAD +# define strtol wcstoll +# else +# define strtol wcstol +# endif +# else +# ifdef QUAD +# define strtol strtoll +# endif +# endif +# endif +#endif + +/* If QUAD is defined, we are defining `strtoll' or `strtoull', + operating on `long long int's. */ +#ifdef QUAD +# define LONG long long +# define STRTOL_LONG_MIN LONG_LONG_MIN +# define STRTOL_LONG_MAX LONG_LONG_MAX +# define STRTOL_ULONG_MAX ULONG_LONG_MAX + +/* The extra casts work around common compiler bugs, + e.g. Cray C 5.0.3.0 when t == time_t. */ +# ifndef TYPE_SIGNED +# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +# endif +# ifndef TYPE_MINIMUM +# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ + : (t) 0)) +# endif +# ifndef TYPE_MAXIMUM +# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) +# endif + +# ifndef ULONG_LONG_MAX +# define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long) +# endif +# ifndef LONG_LONG_MAX +# define LONG_LONG_MAX TYPE_MAXIMUM (long long int) +# endif +# ifndef LONG_LONG_MIN +# define LONG_LONG_MIN TYPE_MINIMUM (long long int) +# endif + +# if __GNUC__ == 2 && __GNUC_MINOR__ < 7 + /* Work around gcc bug with using this constant. */ + static const unsigned long long int maxquad = ULONG_LONG_MAX; +# undef STRTOL_ULONG_MAX +# define STRTOL_ULONG_MAX maxquad +# endif +#else +# define LONG long + +# ifndef ULONG_MAX +# define ULONG_MAX ((unsigned long) ~(unsigned long) 0) +# endif +# ifndef LONG_MAX +# define LONG_MAX ((long int) (ULONG_MAX >> 1)) +# endif +# define STRTOL_LONG_MIN LONG_MIN +# define STRTOL_LONG_MAX LONG_MAX +# define STRTOL_ULONG_MAX ULONG_MAX +#endif + + +/* We use this code also for the extended locale handling where the + function gets as an additional argument the locale which has to be + used. To access the values we have to redefine the _NL_CURRENT + macro. */ +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# undef _NL_CURRENT +# define _NL_CURRENT(category, item) \ + (current->values[_NL_ITEM_INDEX (item)].string) +# define LOCALE_PARAM , loc +# define LOCALE_PARAM_DECL __locale_t loc; +#else +# define LOCALE_PARAM +# define LOCALE_PARAM_DECL +#endif + +#if defined _LIBC || defined HAVE_WCHAR_H +# include +#endif + +#ifdef USE_WIDE_CHAR +# include +# define L_(Ch) L##Ch +# define UCHAR_TYPE wint_t +# define STRING_TYPE wchar_t +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define ISSPACE(Ch) __iswspace_l ((Ch), loc) +# define ISALPHA(Ch) __iswalpha_l ((Ch), loc) +# define TOUPPER(Ch) __towupper_l ((Ch), loc) +# else +# define ISSPACE(Ch) iswspace (Ch) +# define ISALPHA(Ch) iswalpha (Ch) +# define TOUPPER(Ch) towupper (Ch) +# endif +#else +# if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) +# define IN_CTYPE_DOMAIN(c) 1 +# else +# define IN_CTYPE_DOMAIN(c) isascii(c) +# endif +# define L_(Ch) Ch +# define UCHAR_TYPE unsigned char +# define STRING_TYPE char +# ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define ISSPACE(Ch) __isspace_l ((Ch), loc) +# define ISALPHA(Ch) __isalpha_l ((Ch), loc) +# define TOUPPER(Ch) __toupper_l ((Ch), loc) +# else +# define ISSPACE(Ch) (IN_CTYPE_DOMAIN (Ch) && isspace (Ch)) +# define ISALPHA(Ch) (IN_CTYPE_DOMAIN (Ch) && isalpha (Ch)) +# define TOUPPER(Ch) (IN_CTYPE_DOMAIN (Ch) ? toupper (Ch) : (Ch)) +# endif +#endif + +/* For compilers which are ansi but don't define __STDC__, like SGI + Irix-4.0.5 cc, also check whether PROTOTYPES is defined. */ +#if defined (__STDC__) || defined (PROTOTYPES) +# define INTERNAL(X) INTERNAL1(X) +# define INTERNAL1(X) __##X##_internal +# define WEAKNAME(X) WEAKNAME1(X) +#else +# define INTERNAL(X) __/**/X/**/_internal +#endif + +#ifdef USE_NUMBER_GROUPING +/* This file defines a function to check for correct grouping. */ +# include "grouping.h" +#endif + + + +/* Convert NPTR to an `unsigned long int' or `long int' in base BASE. + If BASE is 0 the base is determined by the presence of a leading + zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. + If BASE is < 2 or > 36, it is reset to 10. + If ENDPTR is not NULL, a pointer to the character after the last + one converted is stored in *ENDPTR. */ + +INT +INTERNAL (strtol) (nptr, endptr, base, group LOCALE_PARAM) + const STRING_TYPE *nptr; + STRING_TYPE **endptr; + int base; + int group; + LOCALE_PARAM_DECL +{ + int negative; + register unsigned LONG int cutoff; + register unsigned int cutlim; + register unsigned LONG int i; + register const STRING_TYPE *s; + register UCHAR_TYPE c; + const STRING_TYPE *save, *end; + int overflow; + +#ifdef USE_NUMBER_GROUPING +# ifdef USE_IN_EXTENDED_LOCALE_MODEL + struct locale_data *current = loc->__locales[LC_NUMERIC]; +# endif + /* The thousands character of the current locale. */ + wchar_t thousands = L'\0'; + /* The numeric grouping specification of the current locale, + in the format described in . */ + const char *grouping; + + if (group) + { + grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); + if (*grouping <= 0 || *grouping == CHAR_MAX) + grouping = NULL; + else + { + /* Figure out the thousands separator character. */ +# if defined _LIBC || defined _HAVE_BTOWC + thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); + if (thousands == WEOF) + thousands = L'\0'; +# endif + if (thousands == L'\0') + grouping = NULL; + } + } + else + grouping = NULL; +#endif + + if (base < 0 || base == 1 || base > 36) + { + __set_errno (EINVAL); + return 0; + } + + save = s = nptr; + + /* Skip white space. */ + while (ISSPACE (*s)) + ++s; + if (*s == L_('\0')) + goto noconv; + + /* Check for a sign. */ + if (*s == L_('-')) + { + negative = 1; + ++s; + } + else if (*s == L_('+')) + { + negative = 0; + ++s; + } + else + negative = 0; + + /* Recognize number prefix and if BASE is zero, figure it out ourselves. */ + if (*s == L_('0')) + { + if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X')) + { + s += 2; + base = 16; + } + else if (base == 0) + base = 8; + } + else if (base == 0) + base = 10; + + /* Save the pointer so we can check later if anything happened. */ + save = s; + +#ifdef USE_NUMBER_GROUPING + if (group) + { + /* Find the end of the digit string and check its grouping. */ + end = s; + for (c = *end; c != L_('\0'); c = *++end) + if ((wchar_t) c != thousands + && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9')) + && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base)) + break; + if (*s == thousands) + end = s; + else + end = correctly_grouped_prefix (s, end, thousands, grouping); + } + else +#endif + end = NULL; + + cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base; + cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base; + + overflow = 0; + i = 0; + for (c = *s; c != L_('\0'); c = *++s) + { + if (s == end) + break; + if (c >= L_('0') && c <= L_('9')) + c -= L_('0'); + else if (ISALPHA (c)) + c = TOUPPER (c) - L_('A') + 10; + else + break; + if ((int) c >= base) + break; + /* Check for overflow. */ + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + i *= (unsigned LONG int) base; + i += c; + } + } + + /* Check if anything actually happened. */ + if (s == save) + goto noconv; + + /* Store in ENDPTR the address of one character + past the last character we converted. */ + if (endptr != NULL) + *endptr = (STRING_TYPE *) s; + +#if !UNSIGNED + /* Check for a value that is within the range of + `unsigned LONG int', but outside the range of `LONG int'. */ + if (overflow == 0 + && i > (negative + ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 + : (unsigned LONG int) STRTOL_LONG_MAX)) + overflow = 1; +#endif + + if (overflow) + { + __set_errno (ERANGE); +#if UNSIGNED + return STRTOL_ULONG_MAX; +#else + return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX; +#endif + } + + /* Return the result of the appropriate sign. */ + return negative ? -i : i; + +noconv: + /* We must handle a special case here: the base is 0 or 16 and the + first two characters are '0' and 'x', but the rest are no + hexadecimal digits. This is no error case. We return 0 and + ENDPTR points to the `x`. */ + if (endptr != NULL) + { + if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X') + && save[-2] == L_('0')) + *endptr = (STRING_TYPE *) &save[-1]; + else + /* There was no number to convert. */ + *endptr = (STRING_TYPE *) nptr; + } + + return 0L; +} + +/* External user entry point. */ + +#if _LIBC - 0 == 0 +# undef PARAMS +# if defined (__STDC__) && __STDC__ +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif + +/* Prototype. */ +INT strtol PARAMS ((const STRING_TYPE *nptr, STRING_TYPE **endptr, int base)); +#endif + + +INT +#ifdef weak_function +weak_function +#endif +strtol (nptr, endptr, base LOCALE_PARAM) + const STRING_TYPE *nptr; + STRING_TYPE **endptr; + int base; + LOCALE_PARAM_DECL +{ + return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM); +} diff --git a/src/apps/bin/grep-2.5/lib/strtoul.c b/src/apps/bin/grep-2.5/lib/strtoul.c new file mode 100644 index 0000000000..298ae9eab8 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/strtoul.c @@ -0,0 +1,22 @@ +/* Copyright (C) 1991, 1999 Free Software Foundation, Inc. + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define UNSIGNED 1 + +#include diff --git a/src/apps/bin/grep-2.5/lib/strtoull.c b/src/apps/bin/grep-2.5/lib/strtoull.c new file mode 100644 index 0000000000..d6aa1f8059 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/strtoull.c @@ -0,0 +1,27 @@ +/* Function to parse an `unsigned long long int' from text. + Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@gnu.org. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define QUAD 1 + +#include "strtoul.c" + +#ifdef _LIBC +strong_alias (__strtoull_internal, __strtouq_internal) +weak_alias (strtoull, strtouq) +#endif diff --git a/src/apps/bin/grep-2.5/lib/strtoumax.c b/src/apps/bin/grep-2.5/lib/strtoumax.c new file mode 100644 index 0000000000..a147604ad2 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/strtoumax.c @@ -0,0 +1,81 @@ +/* Convert string representation of a number into an uintmax_t value. + Copyright 1999 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Paul Eggert. */ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_INTTYPES_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#ifndef PARAMS +# if defined PROTOTYPES || defined __STDC__ +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +#endif + +#ifndef HAVE_DECL_STRTOUL +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_STRTOUL +unsigned long strtoul PARAMS ((char const *, char **, int)); +#endif + +#ifndef HAVE_DECL_STRTOULL +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG +unsigned long long strtoull PARAMS ((char const *, char **, int)); +#endif + +uintmax_t +strtoumax (char const *ptr, char **endptr, int base) +{ +#define USE_IF_EQUIVALENT(function) \ + if (sizeof (uintmax_t) == sizeof function (ptr, endptr, base)) \ + return function (ptr, endptr, base); + +#if HAVE_UNSIGNED_LONG_LONG + USE_IF_EQUIVALENT (strtoull) +#endif + + USE_IF_EQUIVALENT (strtoul) + + abort (); +} + +#ifdef TESTING +# include +int +main () +{ + char *p, *endptr; + printf ("sizeof uintmax_t: %d\n", sizeof (uintmax_t)); + printf ("sizeof strtoull(): %d\n", sizeof strtoull(p, &endptr, 10)); + printf ("sizeof strtoul(): %d\n", sizeof strtoul(p, &endptr, 10)); + exit (0); +} +#endif diff --git a/src/apps/bin/grep-2.5/lib/xalloc.h b/src/apps/bin/grep-2.5/lib/xalloc.h new file mode 100644 index 0000000000..098a6c2e07 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/xalloc.h @@ -0,0 +1,87 @@ +/* xalloc.h -- malloc with out-of-memory checking + Copyright (C) 1990-1998, 1999, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef XALLOC_H_ +# define XALLOC_H_ + +# ifndef PARAMS +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +# endif + +# ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +# endif + +# ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +# endif + +/* Exit value when the requested amount of memory is not available. + It is initialized to EXIT_FAILURE, but the caller may set it to + some other value. */ +extern int xalloc_exit_failure; + +/* If this pointer is non-zero, run the specified function upon each + allocation failure. It is initialized to zero. */ +extern void (*xalloc_fail_func) PARAMS ((void)); + +/* If XALLOC_FAIL_FUNC is undefined or a function that returns, this + message is output. It is translated via gettext. + Its value is "memory exhausted". */ +extern char const xalloc_msg_memory_exhausted[]; + +/* This function is always triggered when memory is exhausted. It is + in charge of honoring the three previous items. This is the + function to call when one wants the program to die because of a + memory allocation failure. */ +extern void xalloc_die PARAMS ((void)) ATTRIBUTE_NORETURN; + +void *xmalloc PARAMS ((size_t n)); +void *xcalloc PARAMS ((size_t n, size_t s)); +void *xrealloc PARAMS ((void *p, size_t n)); +char *xstrdup PARAMS ((const char *str)); + +# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) +# define XCALLOC(Type, N_items) ((Type *) xcalloc (sizeof (Type), (N_items))) +# define XREALLOC(Ptr, Type, N_items) \ + ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) + +/* Declare and alloc memory for VAR of type TYPE. */ +# define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1) + +/* Free VAR only if non NULL. */ +# define XFREE(Var) \ + do { \ + if (Var) \ + free (Var); \ + } while (0) + +/* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */ +# define CCLONE(Src, Num) \ + (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num))) + +/* Return a malloc'ed copy of SRC. */ +# define CLONE(Src) CCLONE (Src, 1) + + +#endif /* !XALLOC_H_ */ diff --git a/src/apps/bin/grep-2.5/lib/xmalloc.c b/src/apps/bin/grep-2.5/lib/xmalloc.c new file mode 100644 index 0000000000..2f103d6049 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/xmalloc.c @@ -0,0 +1,116 @@ +/* xmalloc.c -- malloc with out of memory checking + Copyright (C) 1990-1999, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +#include + +#if STDC_HEADERS +# include +#else +void *calloc (); +void *malloc (); +void *realloc (); +void free (); +#endif + +#if ENABLE_NLS +# include +# define _(Text) gettext (Text) +#else +# define textdomain(Domain) +# define _(Text) Text +#endif +#define N_(Text) Text + +#include "error.h" +#include "xalloc.h" + +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#ifndef HAVE_DONE_WORKING_MALLOC_CHECK +"you must run the autoconf test for a properly working malloc -- see malloc.m4" +#endif + +#ifndef HAVE_DONE_WORKING_REALLOC_CHECK +"you must run the autoconf test for a properly working realloc --see realloc.m4" +#endif + +/* Exit value when the requested amount of memory is not available. + The caller may set it to some other value. */ +int xalloc_exit_failure = EXIT_FAILURE; + +/* If non NULL, call this function when memory is exhausted. */ +void (*xalloc_fail_func) PARAMS ((void)) = 0; + +/* If XALLOC_FAIL_FUNC is NULL, or does return, display this message + before exiting when memory is exhausted. Goes through gettext. */ +char const xalloc_msg_memory_exhausted[] = N_("memory exhausted"); + +void +xalloc_die (void) +{ + if (xalloc_fail_func) + (*xalloc_fail_func) (); + error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted)); + /* The `noreturn' cannot be given to error, since it may return if + its first argument is 0. To help compilers understand the + xalloc_die does terminate, call exit. */ + exit (EXIT_FAILURE); +} + +/* Allocate N bytes of memory dynamically, with error checking. */ + +void * +xmalloc (size_t n) +{ + void *p; + + p = malloc (n); + if (p == 0) + xalloc_die (); + return p; +} + +/* Change the size of an allocated block of memory P to N bytes, + with error checking. */ + +void * +xrealloc (void *p, size_t n) +{ + p = realloc (p, n); + if (p == 0) + xalloc_die (); + return p; +} + +/* Allocate memory for N elements of S bytes, with error checking. */ + +void * +xcalloc (size_t n, size_t s) +{ + void *p; + + p = calloc (n, s); + if (p == 0) + xalloc_die (); + return p; +} diff --git a/src/apps/bin/grep-2.5/lib/xstrtol.c b/src/apps/bin/grep-2.5/lib/xstrtol.c new file mode 100644 index 0000000000..07023d9ffd --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/xstrtol.c @@ -0,0 +1,282 @@ +/* A more useful interface to strtol. + Copyright (C) 1995, 1996, 1998-2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Jim Meyering. */ + +#if HAVE_CONFIG_H +# include +#endif + +#ifndef __strtol +# define __strtol strtol +# define __strtol_t long int +# define __xstrtol xstrtol +#endif + +/* Some pre-ANSI implementations (e.g. SunOS 4) + need stderr defined if assertion checking is enabled. */ +#include + +#if STDC_HEADERS +# include +#endif + +#if HAVE_STRING_H +# include +#else +# include +# ifndef strchr +# define strchr index +# endif +#endif + +#include +#include + +#include +#ifndef errno +extern int errno; +#endif + +#if HAVE_LIMITS_H +# include +#endif + +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +/* The extra casts work around common compiler bugs. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +/* The outer cast is needed to work around a bug in Cray C 5.0.3.0. + It is necessary at least when t == time_t. */ +#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)) +#define TYPE_MAXIMUM(t) (~ (t) 0 - TYPE_MINIMUM (t)) + +#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) +# define IN_CTYPE_DOMAIN(c) 1 +#else +# define IN_CTYPE_DOMAIN(c) isascii(c) +#endif + +#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) + +#include "xstrtol.h" + +#ifndef strtol +long int strtol (); +#endif + +#ifndef strtoul +unsigned long int strtoul (); +#endif + +#ifndef strtoumax +uintmax_t strtoumax (); +#endif + +static int +bkm_scale (__strtol_t *x, int scale_factor) +{ + __strtol_t product = *x * scale_factor; + if (*x != product / scale_factor) + return 1; + *x = product; + return 0; +} + +static int +bkm_scale_by_power (__strtol_t *x, int base, int power) +{ + while (power--) + if (bkm_scale (x, base)) + return 1; + + return 0; +} + +/* FIXME: comment. */ + +strtol_error +__xstrtol (const char *s, char **ptr, int strtol_base, + __strtol_t *val, const char *valid_suffixes) +{ + char *t_ptr; + char **p; + __strtol_t tmp; + + assert (0 <= strtol_base && strtol_base <= 36); + + p = (ptr ? ptr : &t_ptr); + + if (! TYPE_SIGNED (__strtol_t)) + { + const char *q = s; + while (ISSPACE ((unsigned char) *q)) + ++q; + if (*q == '-') + return LONGINT_INVALID; + } + + errno = 0; + tmp = __strtol (s, p, strtol_base); + if (errno != 0) + return LONGINT_OVERFLOW; + if (*p == s) + return LONGINT_INVALID; + + /* Let valid_suffixes == NULL mean `allow any suffix'. */ + /* FIXME: update all callers except the ones that allow suffixes + after the number, changing last parameter NULL to `""'. */ + if (!valid_suffixes) + { + *val = tmp; + return LONGINT_OK; + } + + if (**p != '\0') + { + int base = 1024; + int suffixes = 1; + int overflow; + + if (!strchr (valid_suffixes, **p)) + { + *val = tmp; + return LONGINT_INVALID_SUFFIX_CHAR; + } + + if (strchr (valid_suffixes, '0')) + { + /* The ``valid suffix'' '0' is a special flag meaning that + an optional second suffix is allowed, which can change + the base, e.g. "100MD" for 100 megabytes decimal. */ + + switch (p[0][1]) + { + case 'B': + suffixes++; + break; + + case 'D': + base = 1000; + suffixes++; + break; + } + } + + switch (**p) + { + case 'b': + overflow = bkm_scale (&tmp, 512); + break; + + case 'B': + overflow = bkm_scale (&tmp, 1024); + break; + + case 'c': + overflow = 0; + break; + + case 'E': /* Exa */ + overflow = bkm_scale_by_power (&tmp, base, 6); + break; + + case 'G': /* Giga */ + overflow = bkm_scale_by_power (&tmp, base, 3); + break; + + case 'k': /* kilo */ + overflow = bkm_scale_by_power (&tmp, base, 1); + break; + + case 'M': /* Mega */ + case 'm': /* 'm' is undocumented; for backward compatibility only */ + overflow = bkm_scale_by_power (&tmp, base, 2); + break; + + case 'P': /* Peta */ + overflow = bkm_scale_by_power (&tmp, base, 5); + break; + + case 'T': /* Tera */ + overflow = bkm_scale_by_power (&tmp, base, 4); + break; + + case 'w': + overflow = bkm_scale (&tmp, 2); + break; + + case 'Y': /* Yotta */ + overflow = bkm_scale_by_power (&tmp, base, 8); + break; + + case 'Z': /* Zetta */ + overflow = bkm_scale_by_power (&tmp, base, 7); + break; + + default: + *val = tmp; + return LONGINT_INVALID_SUFFIX_CHAR; + break; + } + + if (overflow) + return LONGINT_OVERFLOW; + + (*p) += suffixes; + } + + *val = tmp; + return LONGINT_OK; +} + +#ifdef TESTING_XSTRTO + +# include +# include "error.h" + +char *program_name; + +int +main (int argc, char** argv) +{ + strtol_error s_err; + int i; + + program_name = argv[0]; + for (i=1; i%lu (%s)\n", argv[i], val, p); + } + else + { + STRTOL_FATAL_ERROR (argv[i], "arg", s_err); + } + } + exit (0); +} + +#endif /* TESTING_XSTRTO */ diff --git a/src/apps/bin/grep-2.5/lib/xstrtol.h b/src/apps/bin/grep-2.5/lib/xstrtol.h new file mode 100644 index 0000000000..7a9a024457 --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/xstrtol.h @@ -0,0 +1,64 @@ +#ifndef XSTRTOL_H_ +# define XSTRTOL_H_ 1 + +# if HAVE_INTTYPES_H +# include /* for uintmax_t */ +# endif + +# ifndef PARAMS +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +# endif + +# ifndef _STRTOL_ERROR +enum strtol_error + { + LONGINT_OK, LONGINT_INVALID, LONGINT_INVALID_SUFFIX_CHAR, LONGINT_OVERFLOW + }; +typedef enum strtol_error strtol_error; +# endif + +# define _DECLARE_XSTRTOL(name, type) \ + strtol_error \ + name PARAMS ((const char *s, char **ptr, int base, \ + type *val, const char *valid_suffixes)); +_DECLARE_XSTRTOL (xstrtol, long int) +_DECLARE_XSTRTOL (xstrtoul, unsigned long int) +_DECLARE_XSTRTOL (xstrtoumax, uintmax_t) + +# define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err) \ + do \ + { \ + switch ((Err)) \ + { \ + case LONGINT_OK: \ + abort (); \ + \ + case LONGINT_INVALID: \ + error ((Exit_code), 0, "invalid %s `%s'", \ + (Argument_type_string), (Str)); \ + break; \ + \ + case LONGINT_INVALID_SUFFIX_CHAR: \ + error ((Exit_code), 0, "invalid character following %s `%s'", \ + (Argument_type_string), (Str)); \ + break; \ + \ + case LONGINT_OVERFLOW: \ + error ((Exit_code), 0, "%s `%s' too large", \ + (Argument_type_string), (Str)); \ + break; \ + } \ + } \ + while (0) + +# define STRTOL_FATAL_ERROR(Str, Argument_type_string, Err) \ + _STRTOL_ERROR (2, Str, Argument_type_string, Err) + +# define STRTOL_FAIL_WARN(Str, Argument_type_string, Err) \ + _STRTOL_ERROR (0, Str, Argument_type_string, Err) + +#endif /* not XSTRTOL_H_ */ diff --git a/src/apps/bin/grep-2.5/lib/xstrtoumax.c b/src/apps/bin/grep-2.5/lib/xstrtoumax.c new file mode 100644 index 0000000000..04d7cf98ae --- /dev/null +++ b/src/apps/bin/grep-2.5/lib/xstrtoumax.c @@ -0,0 +1,31 @@ +/* xstrtoumax.c -- A more useful interface to strtoumax. + Copyright 1999 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Written by Paul Eggert. */ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_INTTYPES_H +# include +#endif + +#define __strtol strtoumax +#define __strtol_t uintmax_t +#define __xstrtol xstrtoumax +#include "xstrtol.c" diff --git a/src/apps/bin/grep-2.5/m4/Makefile b/src/apps/bin/grep-2.5/m4/Makefile new file mode 100644 index 0000000000..a334159024 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/Makefile @@ -0,0 +1,246 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/grep +pkglibdir = $(libdir)/grep +pkgincludedir = $(includedir)/grep +top_builddir = .. + +ACLOCAL = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal +AUTOCONF = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf +AUTOMAKE = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake +AUTOHEADER = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader + +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i586-pc-beos +AMTAR = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar +AWK = gawk +BUILD_INCLUDED_LIBINTL = yes +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +CC = gcc +CPP = gcc -E +DATADIRNAME = share +DEPDIR = .deps +EXEEXT = +GENCAT = gencat +GETCONF = +GLIBC21 = no +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +GMSGFMT = : +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INSTOBJEXT = .mo +INTLBISON = bison +INTLLIBS = $(top_builddir)/intl/libintl.a +INTLOBJS = $(GETTOBJS) +INTL_LIBTOOL_SUFFIX_PREFIX = +LIBICONV = +MKINSTALLDIRS = ./mkinstalldirs +MSGFMT = : +OBJEXT = o +PACKAGE = grep +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +POSUB = po +RANLIB = ranlib +SEP = : +SYMLINK = ln -s +SYMLINKFROM = grep +U = +USE_INCLUDED_LIBINTL = yes +USE_NLS = yes +VERSION = 2.5 +am__include = include +am__quote = +install_sh = /boot/home/Development/current/src/apps/bin/grep-2.5/install-sh + +AUTOMAKE_OPTIONS = no-dependencies + +EXTRA_DIST = decl.m4 \ + djgpp.m4 \ + dosfile.m4 \ + envsep.m4 \ + error.m4 \ + gettext.m4 \ + glibc.m4 \ + header.m4 \ + init.m4 \ + install.m4 \ + inttypes_h.m4 \ + isc-posix.m4 \ + largefile.m4 \ + lcmessage.m4 \ + malloc.m4 \ + mbstate_t.m4 \ + missing.m4 \ + progtest.m4 \ + realloc.m4 \ + regex.m4 \ + sanity.m4 \ + strerror_r.m4 \ + uintmax_t.m4 \ + ulonglong.m4 \ + xstrtoumax.m4 + +subdir = m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu m4/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/m4/Makefile.am b/src/apps/bin/grep-2.5/m4/Makefile.am new file mode 100644 index 0000000000..28438a457d --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/Makefile.am @@ -0,0 +1,28 @@ +## Process this file with automake to create Makefile.in +AUTOMAKE_OPTIONS = no-dependencies + +EXTRA_DIST = decl.m4 \ + djgpp.m4 \ + dosfile.m4 \ + envsep.m4 \ + error.m4 \ + gettext.m4 \ + glibc.m4 \ + header.m4 \ + init.m4 \ + install.m4 \ + inttypes_h.m4 \ + isc-posix.m4 \ + largefile.m4 \ + lcmessage.m4 \ + malloc.m4 \ + mbstate_t.m4 \ + missing.m4 \ + progtest.m4 \ + realloc.m4 \ + regex.m4 \ + sanity.m4 \ + strerror_r.m4 \ + uintmax_t.m4 \ + ulonglong.m4 \ + xstrtoumax.m4 diff --git a/src/apps/bin/grep-2.5/m4/Makefile.in b/src/apps/bin/grep-2.5/m4/Makefile.in new file mode 100644 index 0000000000..c639109973 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/Makefile.in @@ -0,0 +1,246 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GETCONF = @GETCONF@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SEP = @SEP@ +SYMLINK = @SYMLINK@ +SYMLINKFROM = @SYMLINKFROM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AUTOMAKE_OPTIONS = no-dependencies + +EXTRA_DIST = decl.m4 \ + djgpp.m4 \ + dosfile.m4 \ + envsep.m4 \ + error.m4 \ + gettext.m4 \ + glibc.m4 \ + header.m4 \ + init.m4 \ + install.m4 \ + inttypes_h.m4 \ + isc-posix.m4 \ + largefile.m4 \ + lcmessage.m4 \ + malloc.m4 \ + mbstate_t.m4 \ + missing.m4 \ + progtest.m4 \ + realloc.m4 \ + regex.m4 \ + sanity.m4 \ + strerror_r.m4 \ + uintmax_t.m4 \ + ulonglong.m4 \ + xstrtoumax.m4 + +subdir = m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu m4/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/m4/codeset.m4 b/src/apps/bin/grep-2.5/m4/codeset.m4 new file mode 100644 index 0000000000..863c9cfa7e --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/codeset.m4 @@ -0,0 +1,17 @@ +#serial AM1 + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi +]) diff --git a/src/apps/bin/grep-2.5/m4/decl.m4 b/src/apps/bin/grep-2.5/m4/decl.m4 new file mode 100644 index 0000000000..7d20e38b59 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/decl.m4 @@ -0,0 +1,37 @@ +#serial 5 + +AC_DEFUN(jm_CHECK_DECLARATION, +[ + AC_MSG_CHECKING([whether $1 is declared]) + AC_CACHE_VAL(jm_cv_func_decl_$1, + [AC_TRY_COMPILE([$2], + [ +#ifndef $1 +char *(*pfn) = (char *(*)) $1 +#endif + ], + eval "jm_cv_func_decl_$1=yes", + eval "jm_cv_func_decl_$1=no")]) + + if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$3], , :, [$3]) + else + AC_MSG_RESULT(no) + ifelse([$4], , , [$4 +])dnl + fi +])dnl + +dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED +dnl [, ACTION-IF-NOT-DECLARED]]) +AC_DEFUN(jm_CHECK_DECLARATIONS, +[ + for jm_func in $2 + do + jm_CHECK_DECLARATION($jm_func, [$1], + [ + jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + AC_DEFINE_UNQUOTED($jm_tr_func, 1, [Define if your system declares $1]) $3], [$4])dnl + done +]) diff --git a/src/apps/bin/grep-2.5/m4/djgpp.m4 b/src/apps/bin/grep-2.5/m4/djgpp.m4 new file mode 100644 index 0000000000..607c8e59bf --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/djgpp.m4 @@ -0,0 +1,9 @@ +dnl Check for DJGPP. we use DJ_GPP as the variable +dnl EXEEXXT +AC_DEFUN(AC_DJGPP, +[AC_CACHE_CHECK(for DJGPP environment, ac_cv_djgpp, +[AC_TRY_COMPILE(,[ return __DJGPP__;], +ac_cv_djgpp=yes, ac_cv_djgpp=no) +rm -f conftest*]) +DJ_GPP= +test "$ac_cv_djgpp" = yes && DJ_GPP=yes]) diff --git a/src/apps/bin/grep-2.5/m4/dosfile.m4 b/src/apps/bin/grep-2.5/m4/dosfile.m4 new file mode 100644 index 0000000000..5616eea4d1 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/dosfile.m4 @@ -0,0 +1,21 @@ +# Check to see if we use dir\file name conventtion +# If so, set macro HAVE_DOS_FILE_NAMES +# Also set the macro HAVE_DOS_FILE_CONTENTS for now, +# since don't know of a good way to independently check this. +dnl AC_DOSFILE() +AC_DEFUN(AC_DOSFILE, +[ + AC_CACHE_CHECK([for dos file convention], ac_cv_dosfile, + [if test -d ".\."; then + ac_cv_dosfile=yes + else + ac_cv_dosfile=no + fi + ]) + + if test $ac_cv_dosfile = yes; then + AC_DEFINE(HAVE_DOS_FILE_NAMES, 1, [Define if your OS uses backslashes as directory separators]) + AC_DEFINE(HAVE_DOS_FILE_CONTENTS, 1, + [Define if text file lines end in CRLF.]) + fi +]) diff --git a/src/apps/bin/grep-2.5/m4/envsep.m4 b/src/apps/bin/grep-2.5/m4/envsep.m4 new file mode 100644 index 0000000000..8a3d2687cc --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/envsep.m4 @@ -0,0 +1,20 @@ +# Check to see the separator for the environment variables +# and set SEP to ";" or default ":" + +dnl AM_SEP() +dnl SEP +AC_DEFUN(AM_SEP, +[AC_REQUIRE([AC_CYGWIN]) +AC_REQUIRE([AC_MINGW32]) +AC_REQUIRE([AC_DJGPP]) +AC_MSG_CHECKING([for environ variable separator]) +AC_CACHE_VAL(ac_cv_sep, +[if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$DJ_GPP" = yes ; then + ac_cv_sep=yes +else + ac_cv_sep=no +fi]) +SEP=":" +test x"$ac_cv_sep" = xyes && SEP=";" +AC_MSG_RESULT(${SEP}) +AC_SUBST(SEP)]) diff --git a/src/apps/bin/grep-2.5/m4/error.m4 b/src/apps/bin/grep-2.5/m4/error.m4 new file mode 100644 index 0000000000..eb0f776bba --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/error.m4 @@ -0,0 +1,11 @@ +#serial 1 + +dnl FIXME: put these prerequisite-only *.m4 files in a separate +dnl directory -- otherwise, they'll conflict with existing files. + +dnl These are the prerequisite macros for GNU's error.c file. +AC_DEFUN(jm_PREREQ_ERROR, +[ + AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt) + AC_HEADER_STDC +]) diff --git a/src/apps/bin/grep-2.5/m4/gettext.m4 b/src/apps/bin/grep-2.5/m4/gettext.m4 new file mode 100644 index 0000000000..e4d524cf0f --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/gettext.m4 @@ -0,0 +1,370 @@ +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 10 + +dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]). +dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). Otherwise, a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. +dnl LIBDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_WITH_NLS], + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + INTLLIBS= + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + CATOBJEXT=NONE + + dnl Add a version number to the cache macros. + define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc]) + define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl]) + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_TRY_LINK([#include +extern int _nl_msg_cat_cntr;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], + gt_cv_func_gnugettext_libc=yes, + gt_cv_func_gnugettext_libc=no)]) + + if test "$gt_cv_func_gnugettext_libc" != "yes"; then + AC_CACHE_CHECK([for GNU gettext in libintl], + gt_cv_func_gnugettext_libintl, + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $LIBICONV" + AC_TRY_LINK([#include +extern int _nl_msg_cat_cntr;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], + gt_cv_func_gnugettext_libintl=yes, + gt_cv_func_gnugettext_libintl=no) + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if test "$gt_cv_func_gnugettext_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + dnl If iconv() is in a separate libiconv library, then anyone + dnl linking with libintl{.a,.so} also needs to link with + dnl libiconv. + INTLLIBS="-lintl $LIBICONV" + fi + + gt_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + LIBS="$gt_save_LIBS" + + dnl Search for GNU msgfmt in the PATH. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext in the PATH. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + + CATOBJEXT=.gmo + fi + ]) + + if test "$CATOBJEXT" = "NONE"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + AC_SUBST(MSGFMT) + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU msgfmt. + if test "$GMSGFMT" != ":"; then + dnl If it is no GNU msgfmt we define it as : so that the + dnl Makefiles still can work. + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then + : ; + else + AC_MSG_RESULT( + [found msgfmt program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + AC_OUTPUT_COMMANDS( + [for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done]) + + + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl intl/plural.c is generated from intl/plural.y. It requires bison, + dnl because plural.y uses bison specific features. It requires at least + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) +changequote(<<,>>)dnl + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) +changequote([,])dnl + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(GMOFILES) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + ]) + +dnl Usage: Just like AM_WITH_NLS, which see. +AC_DEFUN([AM_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([jm_GLIBC21])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h]) + AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \ +getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ +strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) + + AM_ICONV + AM_LANGINFO_CODESET + AM_LC_MESSAGES + AM_WITH_NLS([$1],[$2],[$3]) + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but $(top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], []) + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) diff --git a/src/apps/bin/grep-2.5/m4/glibc.m4 b/src/apps/bin/grep-2.5/m4/glibc.m4 new file mode 100644 index 0000000000..802b233192 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/glibc.m4 @@ -0,0 +1,33 @@ +dnl From Gordon Matzigkeit. +dnl Test for the GNU C Library. +dnl FIXME: this should migrate into libit. + +AC_DEFUN(AM_GLIBC, + [ + AC_CACHE_CHECK(whether we are using the GNU C Library, + ac_cv_gnu_library, + [AC_EGREP_CPP([Thanks for using GNU], + [ +#include +#ifdef __GNU_LIBRARY__ + Thanks for using GNU +#endif + ], + ac_cv_gnu_library=yes, + ac_cv_gnu_library=no) + ] + ) + AC_CACHE_CHECK(for version 2 of the GNU C Library, + ac_cv_glibc, + [AC_EGREP_CPP([Thanks for using GNU too], + [ +#include +#ifdef __GLIBC__ + Thanks for using GNU too +#endif + ], + ac_cv_glibc=yes, ac_cv_glibc=no) + ] + ) + ] +) diff --git a/src/apps/bin/grep-2.5/m4/glibc21.m4 b/src/apps/bin/grep-2.5/m4/glibc21.m4 new file mode 100644 index 0000000000..5b88ef231c --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/glibc21.m4 @@ -0,0 +1,26 @@ +#serial 2 + +# Test for the GNU C Library, version 2.1 or newer. +# From Bruno Haible. + +AC_DEFUN([jm_GLIBC21], + [ + AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, + ac_cv_gnu_library_2_1, + [AC_EGREP_CPP([Lucky GNU user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + ], + ac_cv_gnu_library_2_1=yes, + ac_cv_gnu_library_2_1=no) + ] + ) + AC_SUBST(GLIBC21) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) diff --git a/src/apps/bin/grep-2.5/m4/header.m4 b/src/apps/bin/grep-2.5/m4/header.m4 new file mode 100644 index 0000000000..f8e065fed3 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/header.m4 @@ -0,0 +1,66 @@ +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +# serial 3 + +# 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. We must strip everything past the first ":", +# and everything past the last "/". + +AC_PREREQ([2.12]) + +AC_DEFUN([AM_CONFIG_HEADER], +[ifdef([AC_FOREACH],dnl + [dnl init our file count if it isn't already + m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0])) + dnl prepare to store our destination file list for use in config.status + AC_FOREACH([_AM_File], [$1], + [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*])) + m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index)) + dnl and add it to the list of files AC keeps track of, along + dnl with our hook + AC_CONFIG_HEADERS(_AM_File, +dnl COMMANDS, [, INIT-CMDS] +[# update the timestamp +echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" +][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS + m4_popdef([_AM_Dest])])],dnl +[AC_CONFIG_HEADER([$1]) + AC_OUTPUT_COMMANDS( + ifelse(patsubst([$1], [[^ ]], []), + [], + [test -z "$CONFIG_HEADERS" || echo timestamp >dnl + patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl +[am_indx=1 +for am_file in $1; do + case " \$CONFIG_HEADERS " in + *" \$am_file "*) + am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\` + if test -n "\$am_dir"; then + am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\` + for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do + am_tmpdir=\$am_tmpdir\$am_subdir/ + if test ! -d \$am_tmpdir; then + mkdir \$am_tmpdir + fi + done + fi + echo timestamp > "\$am_dir"stamp-h\$am_indx + ;; + esac + am_indx=\`expr \$am_indx + 1\` +done]) +])]) # AM_CONFIG_HEADER + +# _AM_DIRNAME(PATH) +# ----------------- +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(m4_regexp([$1], [^/.*]), -1, + [.], + m4_patsubst([$1], [^\(/\).*], [\1])), + m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +]) # _AM_DIRNAME diff --git a/src/apps/bin/grep-2.5/m4/iconv.m4 b/src/apps/bin/grep-2.5/m4/iconv.m4 new file mode 100644 index 0000000000..17237344af --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/iconv.m4 @@ -0,0 +1,69 @@ +#serial AM2 + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + AC_ARG_WITH([libiconv-prefix], +[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + ]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi + LIBICONV= + if test "$am_cv_lib_iconv" = yes; then + LIBICONV="-liconv" + fi + AC_SUBST(LIBICONV) +]) diff --git a/src/apps/bin/grep-2.5/m4/init.m4 b/src/apps/bin/grep-2.5/m4/init.m4 new file mode 100644 index 0000000000..724fbc7ab1 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/init.m4 @@ -0,0 +1,89 @@ +# Do all the work for Automake. 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. + +# serial 5 + +# 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... + + +# We require 2.13 because we rely on SHELL being computed by configure. +AC_PREREQ([2.13]) + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. +# The purpose of this macro is to provide the user with a means to +# check macros which are provided without letting her know how the +# information is coded. +# If this macro is not defined by Autoconf, define it here. +ifdef([AC_PROVIDE_IFELSE], + [], + [define([AC_PROVIDE_IFELSE], + [ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) +# ---------------------------------------------- +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first]) +fi + +# Define the identity of the package. +PACKAGE=$1 +AC_SUBST(PACKAGE)dnl +VERSION=$2 +AC_SUBST(VERSION)dnl +ifelse([$3],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +ifdef([m4_pattern_allow], + [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl + +# Autoconf 2.50 always computes EXEEXT. However we need to be +# compatible with 2.13, for now. So we always define EXEEXT, but we +# don't compute it. +AC_SUBST(EXEEXT) +# Similar for OBJEXT -- only we only use OBJEXT if the user actually +# requests that it be used. This is a bit dumb. +: ${OBJEXT=o} +AC_SUBST(OBJEXT) + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# 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_DEP_TRACK])dnl +AC_REQUIRE([AM_SET_DEPDIR])dnl +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 +]) diff --git a/src/apps/bin/grep-2.5/m4/install.m4 b/src/apps/bin/grep-2.5/m4/install.m4 new file mode 100644 index 0000000000..b0c3feacda --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/install.m4 @@ -0,0 +1,13 @@ +## --------------------------------------------------------- ## +## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ## +## substitution. ## +## From Franc,ois Pinard ## +## --------------------------------------------------------- ## + +# serial 1 + +AC_DEFUN([AM_PROG_INSTALL], +[AC_REQUIRE([AC_PROG_INSTALL]) +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +AC_SUBST(INSTALL_SCRIPT)dnl +]) diff --git a/src/apps/bin/grep-2.5/m4/inttypes_h.m4 b/src/apps/bin/grep-2.5/m4/inttypes_h.m4 new file mode 100644 index 0000000000..750639d6fd --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/inttypes_h.m4 @@ -0,0 +1,22 @@ +#serial 3 + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN(jm_AC_HEADER_INTTYPES_H, +[ + AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1;], + jm_ac_cv_header_inttypes_h=yes, + jm_ac_cv_header_inttypes_h=no)]) + if test $jm_ac_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, +[Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/src/apps/bin/grep-2.5/m4/isc-posix.m4 b/src/apps/bin/grep-2.5/m4/isc-posix.m4 new file mode 100644 index 0000000000..99c899ce59 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/isc-posix.m4 @@ -0,0 +1,17 @@ +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) diff --git a/src/apps/bin/grep-2.5/m4/largefile.m4 b/src/apps/bin/grep-2.5/m4/largefile.m4 new file mode 100644 index 0000000000..8501908382 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/largefile.m4 @@ -0,0 +1,129 @@ +#serial 6 + +dnl By default, many hosts won't let programs access large files; +dnl one must use special compiler options to get large-file access to work. +dnl For more details about this brain damage please see: +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html + +dnl Written by Paul Eggert . + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME) +AC_DEFUN([AC_SYS_LARGEFILE_FLAGS], + [AC_CACHE_CHECK([for $1 value to request large file support], + ac_cv_sys_largefile_$1, + [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2 + then + ac_cv_sys_largefile_$1=`cat conftest.1` + else + ac_cv_sys_largefile_$1=no + ifelse($1, CFLAGS, + [case "$host_os" in + # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1. +changequote(, )dnl + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) +changequote([, ])dnl + if test "$GCC" = yes; then + ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ + fi + ;; + # IRIX 6.2 and later require cc -n32. +changequote(, )dnl + irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) +changequote([, ])dnl + if test "$GCC" != yes; then + ac_cv_sys_largefile_CFLAGS=-n32 + fi + esac + if test "$ac_cv_sys_largefile_CFLAGS" != no; then + ac_save_CC="$CC" + CC="$CC $ac_cv_sys_largefile_CFLAGS" + AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) + CC="$ac_save_CC" + fi]) + fi + rm -f conftest*])]) + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL) +AC_DEFUN([AC_SYS_LARGEFILE_SPACE_APPEND], + [case $2 in + no) ;; + ?*) + case "[$]$1" in + '') $1=$2 ;; + *) $1=[$]$1' '$2 ;; + esac ;; + esac]) + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) +AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE], + [AC_CACHE_CHECK([for $1], $2, + [$2=no +changequote(, )dnl + $4 + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + -D$1) + $2=1 ;; + -D$1=*) + $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; + esac + done +changequote([, ])dnl + ]) + if test "[$]$2" != no; then + AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) + fi]) + +AC_DEFUN([AC_SYS_LARGEFILE], + [AC_REQUIRE([AC_CANONICAL_HOST]) + AC_ARG_ENABLE(largefile, + [ --disable-largefile omit support for large files]) + if test "$enable_largefile" != no; then + AC_CHECK_TOOL(GETCONF, getconf) + AC_SYS_LARGEFILE_FLAGS(CFLAGS) + AC_SYS_LARGEFILE_FLAGS(LDFLAGS) + AC_SYS_LARGEFILE_FLAGS(LIBS) + + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + no) ;; + -D_FILE_OFFSET_BITS=*) ;; + -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; + -D_LARGE_FILES | -D_LARGE_FILES=*) ;; + -D?* | -I?*) + AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; + *) + AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; + esac + done + AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") + AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") + AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + [case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_file_offset_bits=64 ;; + esac]) + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, + ac_cv_sys_largefile_source, + [Define to make fseeko etc. visible, on some hosts.], + [case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_largefile_source=1 ;; + esac]) + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + [case "$host_os" in + # AIX 4.2 and later + aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) + ac_cv_sys_large_files=1 ;; + esac]) + fi + ]) diff --git a/src/apps/bin/grep-2.5/m4/lcmessage.m4 b/src/apps/bin/grep-2.5/m4/lcmessage.m4 new file mode 100644 index 0000000000..18d47a94f7 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/lcmessage.m4 @@ -0,0 +1,24 @@ +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 2 + +AC_DEFUN([AM_LC_MESSAGES], + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) diff --git a/src/apps/bin/grep-2.5/m4/malloc.m4 b/src/apps/bin/grep-2.5/m4/malloc.m4 new file mode 100644 index 0000000000..2f00142d28 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/malloc.m4 @@ -0,0 +1,34 @@ +#serial 3 + +dnl From Jim Meyering. +dnl Determine whether malloc accepts 0 as its argument. +dnl If it doesn't, arrange to use the replacement function. +dnl + +AC_DEFUN(jm_FUNC_MALLOC, +[ + dnl xmalloc.c requires that this symbol be defined so it doesn't + dnl mistakenly use a broken malloc -- as it might if this test were omitted. + AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1, + [Define if the malloc check has been performed. ]) + + AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc, + [AC_TRY_RUN([ + char *malloc (); + int + main () + { + exit (malloc (0) ? 0 : 1); + } + ], + jm_cv_func_working_malloc=yes, + jm_cv_func_working_malloc=no, + dnl When crosscompiling, assume malloc is broken. + jm_cv_func_working_malloc=no) + ]) + if test $jm_cv_func_working_malloc = no; then + AC_LIBOBJ(malloc) + AC_DEFINE_UNQUOTED(malloc, rpl_malloc, + [Define to rpl_malloc if the replacement function should be used.]) + fi +]) diff --git a/src/apps/bin/grep-2.5/m4/mbstate_t.m4 b/src/apps/bin/grep-2.5/m4/mbstate_t.m4 new file mode 100644 index 0000000000..a185a7dbcf --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/mbstate_t.m4 @@ -0,0 +1,29 @@ +# serial 8 + +# From Paul Eggert. + +# BeOS 5 has but does not define mbstate_t, +# so you can't declare an object of that type. +# Check for this incompatibility with Standard C. + +# Include stdlib.h first, because otherwise this test would fail on Linux +# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits +# a syntax error in wchar.h due to the use of undefined __int32_t. + +AC_DEFUN(AC_MBSTATE_T, + [ + AC_CHECK_HEADERS(stdlib.h) + + AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, + [AC_TRY_COMPILE([ +#if HAVE_STDLIB_H +# include +#endif +#include ], + [mbstate_t x; return sizeof x;], + ac_cv_type_mbstate_t=yes, + ac_cv_type_mbstate_t=no)]) + if test $ac_cv_type_mbstate_t = no; then + AC_DEFINE(mbstate_t, int, + [Define to a type if does not define.]) + fi]) diff --git a/src/apps/bin/grep-2.5/m4/missing.m4 b/src/apps/bin/grep-2.5/m4/missing.m4 new file mode 100644 index 0000000000..868aa6b6c3 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/missing.m4 @@ -0,0 +1,30 @@ +## --------------------------------------------------------- ## +## Fake the existence of programs that GNU maintainers use. ## +## --------------------------------------------------------- ## + +# serial 2 + +# 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= + am_backtick='`' + AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) +fi +]) diff --git a/src/apps/bin/grep-2.5/m4/progtest.m4 b/src/apps/bin/grep-2.5/m4/progtest.m4 new file mode 100644 index 0000000000..35dc3da1f7 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/progtest.m4 @@ -0,0 +1,51 @@ +# Search path for a program which passes the given test. +# Ulrich Drepper , 1996. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 2 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) diff --git a/src/apps/bin/grep-2.5/m4/realloc.m4 b/src/apps/bin/grep-2.5/m4/realloc.m4 new file mode 100644 index 0000000000..ff250463c7 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/realloc.m4 @@ -0,0 +1,34 @@ +#serial 3 + +dnl From Jim Meyering. +dnl Determine whether realloc works when both arguments are 0. +dnl If it doesn't, arrange to use the replacement function. +dnl + +AC_DEFUN(jm_FUNC_REALLOC, +[ + dnl xmalloc.c requires that this symbol be defined so it doesn't + dnl mistakenly use a broken realloc -- as it might if this test were omitted. + AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1, + [Define if the realloc check has been performed. ]) + + AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc, + [AC_TRY_RUN([ + char *realloc (); + int + main () + { + exit (realloc (0, 0) ? 0 : 1); + } + ], + jm_cv_func_working_realloc=yes, + jm_cv_func_working_realloc=no, + dnl When crosscompiling, assume realloc is broken. + jm_cv_func_working_realloc=no) + ]) + if test $jm_cv_func_working_realloc = no; then + AC_LIBOBJ(realloc) + AC_DEFINE_UNQUOTED(realloc, rpl_realloc, + [Define to rpl_realloc if the replacement function should be used.]) + fi +]) diff --git a/src/apps/bin/grep-2.5/m4/regex.m4 b/src/apps/bin/grep-2.5/m4/regex.m4 new file mode 100644 index 0000000000..56df3186bc --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/regex.m4 @@ -0,0 +1,74 @@ +#serial 5001 + +dnl Initially derived from code in GNU grep. +dnl Mostly written by Jim Meyering. + +dnl Usage: jm_INCLUDED_REGEX([lib/regex.c]) +dnl +AC_DEFUN(jm_INCLUDED_REGEX, + [ + dnl Even packages that don't use regex.c can use this macro. + dnl Of course, for them it doesn't do anything. + + # Assume we'll default to using the included regex.c. + ac_use_included_regex=yes + + # However, if the system regex support is good enough that it passes the + # the following run test, then default to *not* using the included regex.c. + # If cross compiling, assume the test would fail and use the included + # regex.c. The first failing regular expression is from `Spencer ere + # test #75' in grep-2.3. + AC_CACHE_CHECK([for working re_compile_pattern], + jm_cv_func_working_re_compile_pattern, + AC_TRY_RUN( + changequote(<<, >>)dnl + << +#include +#include + int + main () + { + static struct re_pattern_buffer regex; + const char *s; + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + /* Add this third left square bracket, [, to balance the + three right ones below. Otherwise autoconf-2.14 chokes. */ + s = re_compile_pattern ("a[[:]:]]b\n", 9, ®ex); + /* This should fail with _Invalid character class name_ error. */ + if (!s) + exit (1); + + /* This should succeed, but doesn't for e.g. glibc-2.1.3. */ + s = re_compile_pattern ("{1", 2, ®ex); + + exit (s ? 1 : 0); + } + >>, + changequote([, ])dnl + + jm_cv_func_working_re_compile_pattern=yes, + jm_cv_func_working_re_compile_pattern=no, + dnl When crosscompiling, assume it's broken. + jm_cv_func_working_re_compile_pattern=no)) + if test $jm_cv_func_working_re_compile_pattern = yes; then + ac_use_included_regex=no + fi + + test -n "$1" || AC_MSG_ERROR([missing argument]) + syscmd([test -f $1]) + ifelse(sysval, 0, + [ + + AC_ARG_WITH(included-regex, + [ --without-included-regex don't compile regex; this is the default on + systems with version 2 of the GNU C library + (use with caution on other system)], + jm_with_regex=$withval, + jm_with_regex=$ac_use_included_regex) + if test "$jm_with_regex" = yes; then + AC_LIBOBJ(regex) + fi + ], + ) + ] +) diff --git a/src/apps/bin/grep-2.5/m4/sanity.m4 b/src/apps/bin/grep-2.5/m4/sanity.m4 new file mode 100644 index 0000000000..4259aec9dd --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/sanity.m4 @@ -0,0 +1,46 @@ +# +# Check to make sure that the build environment is sane. +# + +# serial 3 + +# 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)]) diff --git a/src/apps/bin/grep-2.5/m4/strerror_r.m4 b/src/apps/bin/grep-2.5/m4/strerror_r.m4 new file mode 100644 index 0000000000..60832623b6 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/strerror_r.m4 @@ -0,0 +1,69 @@ +#serial 1002, but ported to autoconf 2.13 by eggert +# Experimental replacement for the function in the latest CVS autoconf. +# If the compile-test says strerror_r doesn't work, then resort to a +# `run'-test that works on BeOS and segfaults on DEC Unix. +# Use with the error.c file in ../lib. + +undefine([AC_FUNC_STRERROR_R]) + +# AC_FUNC_STRERROR_R +# ------------------ +AC_DEFUN([AC_FUNC_STRERROR_R], +[jm_CHECK_DECLARATION(strerror_r, [#include ]) +test $jm_cv_func_decl_strerror_r != yes +AC_DEFINE_UNQUOTED(HAVE_DECL_STRERROR_R, $?, + [Define to 1 if strerror_r is declared.]) +AC_CHECK_FUNCS([strerror_r]) +if test $ac_cv_func_strerror_r = yes; then + AC_CHECK_HEADERS(string.h) + AC_CACHE_CHECK([for working strerror_r], + ac_cv_func_strerror_r_works, + [ + AC_TRY_COMPILE( + [ +# include +# if HAVE_STRING_H +# include +# endif + ], + [ + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + ], + ac_cv_func_strerror_r_works=yes, + ac_cv_func_strerror_r_works=no + ) + if test $ac_cv_func_strerror_r_works = no; then + # strerror_r seems not to work, but now we have to choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns int. + # This test should segfault on the DEC system. + AC_TRY_RUN( + [ +# include +# include +# include + + extern char *strerror_r (); + + int + main () + { + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + exit (!isalpha (x)); + } + ], + ac_cv_func_strerror_r_works=yes, + ac_cv_func_strerror_r_works=no, + ac_cv_func_strerror_r_works=no) + fi + ]) + if test $ac_cv_func_strerror_r_works = yes; then + AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1, + [Define to 1 if strerror_r returns a string.]) + fi +fi +])# AC_FUNC_STRERROR_R diff --git a/src/apps/bin/grep-2.5/m4/uintmax_t.m4 b/src/apps/bin/grep-2.5/m4/uintmax_t.m4 new file mode 100644 index 0000000000..222beffab9 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/uintmax_t.m4 @@ -0,0 +1,22 @@ +#serial 5 + +dnl From Paul Eggert. + +AC_PREREQ(2.13) + +# Define uintmax_t to `unsigned long' or `unsigned long long' +# if does not exist. + +AC_DEFUN(jm_AC_TYPE_UINTMAX_T, +[ + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + if test $jm_ac_cv_header_inttypes_h = no; then + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, +[ Define to unsigned long or unsigned long long + if doesn't define.]) + fi +]) diff --git a/src/apps/bin/grep-2.5/m4/ulonglong.m4 b/src/apps/bin/grep-2.5/m4/ulonglong.m4 new file mode 100644 index 0000000000..e2fbb55261 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/ulonglong.m4 @@ -0,0 +1,17 @@ +#serial 2 + +dnl From Paul Eggert. + +AC_DEFUN(jm_AC_TYPE_UNSIGNED_LONG_LONG, +[ + AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, + [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], + [unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull;], + ac_cv_type_unsigned_long_long=yes, + ac_cv_type_unsigned_long_long=no)]) + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, + [Define if you have the unsigned long long type.]) + fi +]) diff --git a/src/apps/bin/grep-2.5/m4/xstrtoumax.m4 b/src/apps/bin/grep-2.5/m4/xstrtoumax.m4 new file mode 100644 index 0000000000..f6e3199683 --- /dev/null +++ b/src/apps/bin/grep-2.5/m4/xstrtoumax.m4 @@ -0,0 +1,34 @@ +#serial 2 + +# autoconf tests required for use of xstrtoumax.c + +AC_DEFUN(jm_AC_PREREQ_XSTRTOUMAX, +[ + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + AC_CHECK_HEADERS(stdlib.h) + + AC_CACHE_CHECK([whether defines strtoumax as a macro], + jm_cv_func_strtoumax_macro, + AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include +#ifdef strtoumax + inttypes_h_defines_strtoumax +#endif], + jm_cv_func_strtoumax_macro=yes, + jm_cv_func_strtoumax_macro=no)) + + if test "$jm_cv_func_strtoumax_macro" != yes; then + AC_REPLACE_FUNCS(strtoumax) + fi + + dnl We don't need (and can't compile) the replacement strtoull + dnl unless the type `unsigned long long' exists. + dnl Also, only the replacement strtoumax invokes strtoull, + dnl so we need the replacement strtoull only if strtoumax does not exist. + case "$ac_cv_type_unsigned_long_long,$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in + yes,no,no) + AC_REPLACE_FUNCS(strtoull) + ;; + esac + +]) diff --git a/src/apps/bin/grep-2.5/missing b/src/apps/bin/grep-2.5/missing new file mode 100755 index 0000000000..0a7fb5a2ac --- /dev/null +++ b/src/apps/bin/grep-2.5/missing @@ -0,0 +1,283 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.3 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar ${1+"$@"} && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar ${1+"$@"} && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/src/apps/bin/grep-2.5/mkinstalldirs b/src/apps/bin/grep-2.5/mkinstalldirs new file mode 100755 index 0000000000..43725abfef --- /dev/null +++ b/src/apps/bin/grep-2.5/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2004/03/02 02:37:04 michaelphipps Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/src/apps/bin/grep-2.5/po/ChangeLog b/src/apps/bin/grep-2.5/po/ChangeLog new file mode 100644 index 0000000000..0873b63491 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/ChangeLog @@ -0,0 +1,7 @@ +1999-02-10 Alain Magloire + + * update from ftp.iro.umontreal. + +--------- + * got a basic set of *.po from Franc,ois Pinard + ftp.iro.umontreal.ca diff --git a/src/apps/bin/grep-2.5/po/Makefile b/src/apps/bin/grep-2.5/po/Makefile new file mode 100644 index 0000000000..1cbfe215e0 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/Makefile @@ -0,0 +1,257 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +PACKAGE = grep +VERSION = 2.5 + +SHELL = /bin/sh + + +srcdir = . +top_srcdir = .. + + +prefix = /usr/local +exec_prefix = ${prefix} +datadir = $(prefix)/share +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext/po +subdir = po + +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +MKINSTALLDIRS = $(top_srcdir)/./mkinstalldirs + +CC = gcc +GENCAT = gencat +GMSGFMT = PATH=../src:$$PATH : +MSGFMT = : +XGETTEXT = PATH=../src:$$PATH : +MSGMERGE = PATH=../src:$$PATH msgmerge + +DEFS = -DHAVE_CONFIG_H +CFLAGS = -g -O2 +CPPFLAGS = + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + ../src/dfa.c \ + ../src/kwset.c \ + ../src/grep.c \ + ../src/search.c \ + ../lib/error.c \ + ../lib/getopt.c \ + ../lib/getopt1.c \ + ../lib/obstack.c \ + ../lib/quotearg.c + +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +INSTOBJEXT = .mo + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: all-yes + +all-yes: cat-id-tbl.c $(CATALOGS) +all-no: + +$(srcdir)/$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in \ + && test ! -f $(PACKAGE).po \ + || ( rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) + +$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: +$(srcdir)/stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp + if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: install-data-yes +install-data-no: all +install-data-yes: all + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(datadir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \ + fi + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + case "$$cat" in \ + *.gmo) destdir=$(gnulocaledir);; \ + *) destdir=$(localedir);; \ + esac; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $$dir; \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ + fi; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi; \ + if test -r $$cat.m; then \ + $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + if test -r $(srcdir)/$$cat.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$cat.m \ + $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + true; \ + fi; \ + fi; \ + done + if test "$(PACKAGE)" = "gettext"; then \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(gettextsrcdir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + fi; \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +dvi info tags TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: update-po $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + PATH=`pwd`/../src:$$PATH; \ + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + echo "$$lang:"; \ + if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "msgmerge for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + rm -f $@-t $@ \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/po/Makefile.in b/src/apps/bin/grep-2.5/po/Makefile.in new file mode 100644 index 0000000000..e7aaae7a64 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/Makefile.in @@ -0,0 +1,248 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +PACKAGE = grep +VERSION = 2.5 + +SHELL = /bin/sh + + +srcdir = . +top_srcdir = .. + + +prefix = /usr/local +exec_prefix = ${prefix} +datadir = $(prefix)/share +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext/po +subdir = po + +INSTALL = /bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +MKINSTALLDIRS = $(top_srcdir)/./mkinstalldirs + +CC = gcc +GENCAT = gencat +GMSGFMT = PATH=../src:$$PATH : +MSGFMT = : +XGETTEXT = PATH=../src:$$PATH : +MSGMERGE = PATH=../src:$$PATH msgmerge + +DEFS = -DHAVE_CONFIG_H +CFLAGS = -g -O2 +CPPFLAGS = + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +INSTOBJEXT = .mo + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: all-yes + +all-yes: cat-id-tbl.c $(CATALOGS) +all-no: + +$(srcdir)/$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in \ + && test ! -f $(PACKAGE).po \ + || ( rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) + +$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: +$(srcdir)/stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp + if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: install-data-yes +install-data-no: all +install-data-yes: all + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(datadir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \ + fi + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + case "$$cat" in \ + *.gmo) destdir=$(gnulocaledir);; \ + *) destdir=$(localedir);; \ + esac; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $$dir; \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ + fi; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi; \ + if test -r $$cat.m; then \ + $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + if test -r $(srcdir)/$$cat.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$cat.m \ + $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + true; \ + fi; \ + fi; \ + done + if test "$(PACKAGE)" = "gettext"; then \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(gettextsrcdir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + fi; \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +dvi info tags TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: update-po $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + PATH=`pwd`/../src:$$PATH; \ + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + echo "$$lang:"; \ + if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "msgmerge for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + rm -f $@-t $@ \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/po/Makefile.in.in b/src/apps/bin/grep-2.5/po/Makefile.in.in new file mode 100644 index 0000000000..111b40fcbb --- /dev/null +++ b/src/apps/bin/grep-2.5/po/Makefile.in.in @@ -0,0 +1,248 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext/po +subdir = po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ + +CC = @CC@ +GENCAT = @GENCAT@ +GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ +MSGMERGE = PATH=../src:$$PATH msgmerge + +DEFS = @DEFS@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +INSTOBJEXT = @INSTOBJEXT@ + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: cat-id-tbl.c $(CATALOGS) +all-no: + +$(srcdir)/$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in \ + && test ! -f $(PACKAGE).po \ + || ( rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) + +$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: +$(srcdir)/stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp + if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(datadir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \ + fi + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + case "$$cat" in \ + *.gmo) destdir=$(gnulocaledir);; \ + *) destdir=$(localedir);; \ + esac; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $$dir; \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ + fi; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi; \ + if test -r $$cat.m; then \ + $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + if test -r $(srcdir)/$$cat.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$cat.m \ + $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + true; \ + fi; \ + fi; \ + done + if test "$(PACKAGE)" = "gettext"; then \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(gettextsrcdir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + fi; \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +dvi info tags TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: update-po $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + PATH=`pwd`/../src:$$PATH; \ + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + echo "$$lang:"; \ + if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "msgmerge for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + rm -f $@-t $@ \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/apps/bin/grep-2.5/po/POTFILES b/src/apps/bin/grep-2.5/po/POTFILES new file mode 100644 index 0000000000..138c2b780c --- /dev/null +++ b/src/apps/bin/grep-2.5/po/POTFILES @@ -0,0 +1,9 @@ + ../src/dfa.c \ + ../src/kwset.c \ + ../src/grep.c \ + ../src/search.c \ + ../lib/error.c \ + ../lib/getopt.c \ + ../lib/getopt1.c \ + ../lib/obstack.c \ + ../lib/quotearg.c diff --git a/src/apps/bin/grep-2.5/po/POTFILES.in b/src/apps/bin/grep-2.5/po/POTFILES.in new file mode 100644 index 0000000000..8e3bf2c1cd --- /dev/null +++ b/src/apps/bin/grep-2.5/po/POTFILES.in @@ -0,0 +1,13 @@ +# List of files which containing translatable strings. + +src/dfa.c +src/kwset.c +src/grep.c +src/search.c + +# Library files +lib/error.c +lib/getopt.c +lib/getopt1.c +lib/obstack.c +lib/quotearg.c diff --git a/src/apps/bin/grep-2.5/po/bg.po b/src/apps/bin/grep-2.5/po/bg.po new file mode 100644 index 0000000000..4fc05e06b2 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/bg.po @@ -0,0 +1,403 @@ +# GNU grep messages translated in Bulgarian language. +# Copyright (C) 2002 Free Software Foundation, Inc. +# Pavel Mihaylov , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-09 02:00+0200\n" +"Last-Translator: Pavel Mihaylov \n" +"Language-Team: Bulgarian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Паметта е изчерпана" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "ÐебаланÑирана [" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Ðезавършена \\ поÑледователноÑÑ‚" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "незавършен брой повторениÑ" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "грешно зададен брой повторениÑ" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "ÐебаланÑирана (" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Ðе е зададен ÑинтакÑиÑ" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr "ÐебаланÑирана )" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "недоÑтатъчна памет" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "паметта е изчерпана" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "невалиден размер на контекÑта" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "входните данни Ñа прекалено големи за да бъдат преброени" + +#: src/grep.c:597 +msgid "writing output" +msgstr "запиÑване на изходните данни" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Двоичен файл %s Ñъвпада\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(Ñтандартен вход)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "предупреждение: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "рекурÑивна обработка на директориите" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Употреба: %s [ОПЦИЯ]... ТЕКСТ [ФÐЙЛ]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Вижте `%s --help' за повече информациÑ.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Употреба: %s [ОПЦИЯ]... ТЕКСТ [ФÐЙЛ]...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"ТърÑи ТЕКСТ във вÑеки ФÐЙЛ или в ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð¸Ñ Ð²Ñ…Ð¾Ð´.\n" +"Пример: %s -i 'hello world' menu.h main.c\n" +"\n" +"Избор на типа регулÑрен израз и интерпретациÑ:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp ТЕКСТ е разширен регулÑрен израз\n" +" -F, --fixed-regexp ТЕКСТ е фикÑиран низ, отделен Ñ Ð½Ð¾Ð²Ð¸ редове\n" +" -G, --basic-regexp ТЕКСТ е проÑÑ‚ регулÑрен израз\n" +" -P, --perl-regexp ТЕКСТ е Perl регулÑрен израз\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=ТЕКСТ използва ТЕКСТ като регулÑрен израз\n" +" -f, --file=ФÐЙЛ получава ТЕКСТ от ФÐЙЛ\n" +" -i, --ignore-case игнорира различието в малки и главни букви\n" +" -w, --word-regexp ТЕКСТ ще Ñъвпада Ñамо Ñ Ñ†ÐµÐ»Ð¸ думи\n" +" -x, --line-regexp ТЕКСТ ще Ñъвпада Ñамо Ñ Ñ†ÐµÐ»Ð¸ редове\n" +" -z, --null-data редовете във ФÐЙЛ завършват Ñ 0 (NULL),\n" +" а не ÑÑŠÑ Ñимвол за нов ред (LF)\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Разни:\n" +" -s, --no-messages не извежда ÑÑŠÐ¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð·Ð° грешки\n" +" -v, --revert-match избира неÑъвпадащи редове\n" +" -V, --version извежда Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° верÑиÑта и излиза\n" +" --help показва помощна Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¸ излиза\n" +" --mmap използва memory-mapped вход ако е възможно\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Опции контролиращи форматирането на резултата:\n" +" -m, --max-count=БРОЙ Ñпира Ñлед БРОЙ резултата\n" +" -b, --byte-offset извежда отмеÑтването в байтове за вÑеки ред\n" +" -n, --line-number извежда номера на реда за вÑеки ред\n" +" --line-buffered извежда резултата по цÑл ред наведнъж\n" +" -H, --with-filename извежда името на файла за вÑÑко Ñъвпадение\n" +" -h, --no-filename не извежда името на файла за вÑÑко Ñъвпадение\n" +" --label=ЕТИКЕТ извежда ЕТИКЕТ като име на файл за ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´\n" +" -o, --only-matching извежда Ñамо чаÑтта от реда, коÑто Ñъвпада Ñ Ð¢Ð•ÐšÐ¡Ð¢\n" +" -q, --quiet, --silent не извежда никакъв резултат при нормална работа\n" +" --binary-files=ТИП задава типа на двоичните файлове\n" +" ТИП може да 'binary' (двоичен), 'text' (текÑтов),\n" +" или 'without-match' (без Ñъвпадение).\n" +" -a, --text Ñъщо като --binary-files=text\n" +" -I Ñъщо като --binary-files=without-match\n" +" -d, --directories=МЕТОД задава метод на дейÑтвие при директориите\n" +" МЕТОД може да е \"read\" (прочети), \"recurse\"\n" +" (претърÑи рекурÑивно), или \"skip\" (пропуÑни).\n" +" -D, --devices=МЕТОД как да Ñе обработват Ñпециалните файлове,\n" +" FIFO и Ñокети. МЕТОД може да е \"read\" (чети)\n" +" или \"skip\" (пропуÑни)\n" +" -R, -r, --recursive Ñъщо като --directories=recurse.\n" +" --include=ТЕКСТ файлове Ñъвпадащи Ñ Ð¢Ð•ÐšÐ¡Ð¢ ще бъдат\n" +" използвани за Ñъвпадане\n" +" --exclude=ТЕКСТ файлове Ñъвпадащи Ñ Ð¢Ð•ÐšÐ¡Ð¢ ще бъдат пропуÑнати.\n" +" --exclude-from=ФÐЙЛ файлове Ñъвпадащи Ñ Ð¢Ð•ÐšÐ¡Ð¢ във ФÐЙЛ\n" +" ще бъдат пропуÑнати.\n" +" -L, --files-without-match извежда Ñамо имена на файлове,\n" +" в които нÑма Ñъвпадение\n" +" -l, --files-with-matches извежда Ñамо имена на файлове,\n" +" в които има Ñъвпадение\n" +" -c, --count извежда Ñамо Ð±Ñ€Ð¾Ñ Ð½Ð° Ñъвпадащите редове\n" +" за вÑеки файл\n" +" -Z, --null извежда Ñимвол NULL Ñлед вÑÑко име на файл\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Контрол върху контекÑта:\n" +" -B, --before-context=N извежда N реда от Ð¿Ñ€ÐµÐ´Ñ…Ð¾Ð¶Ð´Ð°Ñ‰Ð¸Ñ ÐºÐ¾Ð½Ñ‚ÐµÐºÑÑ‚\n" +" -A, --after-context=N извежда N реда от ÑÐ»ÐµÐ´Ð²Ð°Ñ‰Ð¸Ñ ÐºÐ¾Ð½Ñ‚ÐµÐºÑÑ‚\n" +" -C, --context=N извежда N реда от Ð¸Ð·Ñ…Ð¾Ð´Ð½Ð¸Ñ ÐºÐ¾Ð½Ñ‚ÐµÐºÑÑ‚\n" +" -ЧИСЛО Ñъщо като --context=N\n" +" --color, --colour използва маркери за различаване на Ñъвпадащите низове\n" +" -U, --binary не филтрира CR Ñимволи в ÐºÑ€Ð°Ñ Ð½Ð° реда (MSDOS)\n" +" -u, --unix-byte-offsets Ñъобщава отмеÑтваниÑта вÑе едно, че Ñимволите CR\n" +" липÑват (MSDOS)\n" +"\n" +"`egrep' означава `grep -E'. `fgrep' означава `grep -F'.\n" +"Без да е зададен ФÐЙЛ, или когато ФÐЙЛ е - Ñе чете ÑÑ‚Ð°Ð½Ð´Ð°Ñ€Ñ‚Ð½Ð¸Ñ Ð²Ñ…Ð¾Ð´.\n" +"Ðко Ñа зададени по-малко от два ФÐЙЛа Ñе предполага -h.\n" +"При изход grep връща 0 ако има Ñъвпадение, 1 ако нÑма и 2 при грешка.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"За програмни грешки Ñъобщавайте на .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "зададените изрази за Ñъвпадение Ñа в конфликт" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "неизвеÑтен метод за обработка на Ñпециалните файлове" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "неизвеÑтен метод за обработка на директориите" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "невалиден макÑимален брой" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "непознат тип двоичен файл" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Това е Ñвободно доÑтъпен Ñофтуер, вижте изходните файлове за уÑловиÑта на\n" +"разпроÑтранение. ÐÑма ÐИКÐКВРгаранциÑ, дори за ТЪРГОВСКРСТОЙÐОСТ или\n" +"ПРИГОДИМОСТ ЗРДÐДЕÐРЦЕЛ.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "ÐžÐ¿Ñ†Ð¸Ñ -P не Ñе поддържа" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Опциите -P и -z не могат да бъдат комбинирани" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "ÐеизвеÑтна ÑиÑтемна грешка" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: Ð¾Ð¿Ñ†Ð¸Ñ `%s' не е еднозначна\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: Ð¾Ð¿Ñ†Ð¸Ñ `--%s' Ñе използва без аргумент\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: Ð¾Ð¿Ñ†Ð¸Ñ `%c%s' Ñе използва без аргумент\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: Ð¾Ð¿Ñ†Ð¸Ñ `%s' изиÑква аргумент\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: непозната Ð¾Ð¿Ñ†Ð¸Ñ `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: непозната Ð¾Ð¿Ñ†Ð¸Ñ `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: грешна Ð¾Ð¿Ñ†Ð¸Ñ -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: невалидна Ð¾Ð¿Ñ†Ð¸Ñ -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Ð¾Ð¿Ñ†Ð¸Ñ Ð¸Ð·Ð¸Ñкваща аргумент -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: Ð¾Ð¿Ñ†Ð¸Ñ `-W %s' не е еднозначна\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: Ð¾Ð¿Ñ†Ð¸Ñ `-W %s' Ñе използва без аргумент\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "\"" diff --git a/src/apps/bin/grep-2.5/po/ca.po b/src/apps/bin/grep-2.5/po/ca.po new file mode 100644 index 0000000000..54840586bb --- /dev/null +++ b/src/apps/bin/grep-2.5/po/ca.po @@ -0,0 +1,410 @@ +# Traducció missatges de GNU grep al català. +# Copyright (C) 2002 Free Software Foundation, Inc. +# Enric Alberola Rosell , 2002. +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-11 15:46+0100\n" +"Last-Translator: Enric Alberola Rosell \n" +"Language-Team: Catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Memòria exhaurida" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "[ desaparellat" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Codi d'escapada \\ inacabat" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "comptador de repetició inacabat" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "comptador de repetició defectuós" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "( desaparellat" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "No s'ha especificat cap sintaxi" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr ") desaparellat" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "sense memòria" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "memòria exhaurida" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "longitud del context invàlida" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "l'entrada és massa llarga per a comptar" + +#: src/grep.c:597 +msgid "writing output" +msgstr "escrivint eixida" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Concidència en el fitxer binari %s\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(entrada estàndard)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "avís: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "bucle de directori recursiu" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Ús: %s [OPCIÓ]... PATRÓ [FITXER] ...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Proveu amb \"%s --help\" per a obtenir més informació.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Ús: %s [OPCIÓ]... PATRÓ [FITXER] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Cerca PATRÓ en cada FITXER o en l'entrada estàndard.\n" +"Exemple: %s -i \"hola món\" menu.h main.c\n" +"\n" +"Selecció i interpretació de l'expressió regular:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp PATRÓ és una expressió regular extesa\n" +" -F, --fixed-strings PATRÓ és un conjunt de cadenes separades per \n" +" caràcters de nova línia\n" +" -G, --basic-regexp PATRÓ és un expressió regular bàsica\n" +" -P, --perl-regexp PATRÓ és un expressió regular de Perl\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=PATRÓ utilitza el PATRÓ com a expressió regular\n" +" -f, --file=FITXER obté el PATRÓ del FITXER\n" +" -i, --ignore-case no té en compte majúscules i minúscules\n" +" -w, --word-regexp força la concordança del PATRÓ amb paraules\n" +" completes\n" +" -x, --line-regexp força la concordança del PATRÓ amb línies\n" +" completes\n" +" -z, --null-data considera que una línia de dades acaba amb el\n" +" byte 0 i no amb el caràcter de nova línia\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Miscel·lanis:\n" +" -s, --no-messages suprimeix els missatges d'error\n" +" -v, --invert-match selecciona les línies que no coincideixen\n" +" -V, --version mostra la informació sobre la versió i acaba\n" +" --help mostra aquesta ajuda i acaba\n" +" --mmap si és possible utilitza com a entrada la\n" +" memòria assignada\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Control d'eixida:\n" +" -m, --max-count=NOMBRE s'atura després de NOMBRE coincidències\n" +" -b, --byte-offset mostra el desplaçament en bytes en les línies\n" +" d'eixida\n" +" -n, --line-number mostra el número de línia en les línies\n" +" d'eixida\n" +" --line-buffered descarrega el resultat per a cada línia\n" +" -H, --with-filename mostra el nom del fitxer per a cada coincidència\n" +" -h, --no-filename elimina els noms de fitxer en l'eixida\n" +" --label=ETIQUETA mostra ETIQUETA com a nom de fitxer per\n" +" a l'entrada estàndard\n" +" -o, --only-matching mostra només la part de la línia que coincideix\n" +" amb PATRÓ\n" +" -q, --quiet, --silent elimina tota l'eixida normal\n" +" --binary-files=TIPUS indica el TIPUS dels fitxers binaris, que pot \n" +" ser \"binary\", \"text\" o \"without-match\"\n" +" -a, --text equival a --binary-files=text\n" +" -I equival a --binary-files=without-match\n" +" -d, --directories=ACCIÓ indica com tractar els directoris. ACCIÓ pot\n" +" ser \"read\", \"recurse\" o \"skip\"\n" +" -D, --devices=ACCIÓ indica com manegar els dispositius, els FIFO i\n" +" els sockets. ACCIÓ pot ser \"read\" o \"skip\"\n" +" -R, -r, --recursive equival a --directories=recurse\n" +" --include=PATRÓ examina els fitxers que contenen PATRÓ\n" +" --exclude=PATRÓ exclou els fitxers que contenen PATRÓ\n" +" --exclude-from=FITXER exclou els fitxers que tenen coincidències amb\n" +" els patrons del FITXER\n" +" -L, --files-without-match només mostra els fitxers que no tenen\n" +" coincidències\n" +" -l, --files-with-matches només mostra els fitxers que tenen coincidències\n" +" -c, --count només compta les línies que coincideixen\n" +" per fitxer\n" +" -Z, --null imprimeix un byte 0 després del nom del fitxer\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Control del context:\n" +" -B, --before-context=NOMBRE mostra NOMBRE línies del context anterior\n" +" -A, --after-context=NOMBRE mostra NOMBRE línies del context posterior\n" +" -C, --context=NOMBRE mostra NOMBRE línies del context\n" +" -NUM el mateix que --context=NUM\n" +" --color[=QUAN],\n" +" --colour[=QUAN] ressalta amb marcadors la cadena que\n" +" coincideix. QUAN pot ser: \"always\",\n" +" \"never\" o \"auto\".\n" +" -U, --binary no elimina els caràcteres de retorn de carro\n" +" finals de línia (MSDOS)\n" +" -u, --unix-byte-offsets compta els desplaçaments como si no hi hagués\n" +" retorns de carro (MSDOS)\n" +"\n" +"\"egrep\" significa \"grep -E\". \"fgrep\" significa \"grep -F\".\n" +"Si no s'especifica cap FITXER, o quan és -, llegeix l'entrada estàndard.\n" +"Si són menys de dos fitxers, assumeix -h. El resultat en acabar és 0 si\n" +"s'han trobat coincidències, 1 si no hi han i 2 en cas d'haver tingut algun\n" +"problema.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Podeu notificar els errors del programa a .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "s'han especificat expressions conflictives" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "mètode de dispositius desconegut" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "mètode de directoris desconegut" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "comptador màxim invàlid" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "tipus de fitxer binari desconegut" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Això és programari lliure; vegeu el codi font per a conéixer les condicions\n" +"de còpia. No hi ha CAP garantia; ni tan sols sobre la COMERCIABILITAT o\n" +"l'ADEQUACIÓ PER A UN PROPÒSIT CONCRET.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "L'opció -P no està suportada" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "No es poden combinar les opcions -P i -z" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Error desconegut del sistema" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: l'opció \"%s\" és ambigua\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: l'opció \"--%s\" no permet un argument\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: l'opció \"%c%s\" no permet un argument\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: l'opció \"%s\" necessita un argument\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opció desconeguda \"--%s\"\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opció desconeguda \"%c%s\"\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opció il·legal -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opció invàlida -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'opció necessita un argument -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: l'opció \"-W %s\" és ambigua\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: l'opció \"-W %s\" no permet un argument\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "\"" diff --git a/src/apps/bin/grep-2.5/po/cat-id-tbl.c b/src/apps/bin/grep-2.5/po/cat-id-tbl.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/apps/bin/grep-2.5/po/cs.po b/src/apps/bin/grep-2.5/po/cs.po new file mode 100644 index 0000000000..473efc293d --- /dev/null +++ b/src/apps/bin/grep-2.5/po/cs.po @@ -0,0 +1,394 @@ +# Czech message catalog for grep. +# Copyright (C) 1998 Free Software Foundation, Inc. +# Vladimir Michl , 1998. +# +# Thanks to: Stanislav Brabec +# Note: 2 messages untranslated, it's OK. +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.5e\n" +"POT-Creation-Date: 2001-03-07 00:02-0500\n" +"PO-Revision-Date: 2001-08-04 12:01+02:00\n" +"Last-Translator: Vladimir Michl \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/grep.c:944 src/search.c:706 +msgid "Memory exhausted" +msgstr "Pame» vyèerpána" + +#: src/dfa.c:486 src/dfa.c:489 src/dfa.c:507 src/dfa.c:518 src/dfa.c:542 +#: src/dfa.c:601 src/dfa.c:606 src/dfa.c:619 src/dfa.c:620 src/dfa.c:998 +#: src/dfa.c:1001 src/dfa.c:1025 src/dfa.c:1029 src/dfa.c:1030 src/dfa.c:1033 +#: src/dfa.c:1045 src/dfa.c:1046 +msgid "Unbalanced [" +msgstr "Lichý poèet [" + +#: src/dfa.c:738 +msgid "Unfinished \\ escape" +msgstr "Za \\ chybí znak" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:871 src/dfa.c:877 src/dfa.c:887 src/dfa.c:895 src/dfa.c:910 +msgid "unfinished repeat count" +msgstr "neukonèený zápis poètu opakování" + +#: src/dfa.c:884 src/dfa.c:901 src/dfa.c:909 src/dfa.c:913 +msgid "malformed repeat count" +msgstr "deformovaný zápis poètu opakování" + +#: src/dfa.c:1232 +msgid "Unbalanced (" +msgstr "Lichý poèet (" + +# ? Není zadaná syntaxe +#: src/dfa.c:1357 +msgid "No syntax specified" +msgstr "Syntaxe není urèena" + +#: src/dfa.c:1365 +msgid "Unbalanced )" +msgstr "Lichý poèet )" + +#: src/dfa.c:2933 +msgid "out of memory" +msgstr "nedostatek volné pamìti" + +#: lib/obstack.c:471 src/grep.c:343 src/kwset.c:171 src/kwset.c:177 +#: src/search.c:103 src/search.c:223 src/search.c:307 +msgid "memory exhausted" +msgstr "pamì» vyèerpána" + +#: src/grep.c:191 +msgid "invalid context length argument" +msgstr "neplatný argument délky kontextu" + +#: src/grep.c:466 +msgid "input is too large to count" +msgstr "poèet vstupních øádkù nelze spoèítat (je jich hodnì)" + +#: src/grep.c:539 +msgid "writing output" +msgstr "zapisuje se výstup" + +#: src/grep.c:812 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Binární soubor %s odpovídá\n" + +#: src/grep.c:826 +msgid "(standard input)" +msgstr "(standardní vstup)" + +#: src/grep.c:931 +#, c-format +msgid "warning: %s: %s\n" +msgstr "varování: %s: %s\n" + +#: src/grep.c:932 +msgid "recursive directory loop" +msgstr "smyèka pro rekurzivní prùchod" + +#: src/grep.c:980 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Pou¾ití: %s [PØEPÍNAÈ]... VZOREK [SOUBOR]...\n" + +#: src/grep.c:982 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Více informací získáte pøíkazem `%s --help'.\n" + +#: src/grep.c:987 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Pou¾ití: %s [PØEPÍNAÈ]... VZOREK [SOUBOR]...\n" + +#: src/grep.c:988 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +" Hledá øádky, jejich¾ nìkteré èásti vyhovují VZORKu. Øádky jsou èteny postupnì\n" +"ze v¹ech zadaných SOUBORù nebo ze standardního vstupu.\n" +"Pøíklad: %s -i 'hello world' menu.h main.c\n" +"\n" +"Výbìr a interpretace regulárního výrazu:\n" + +#: src/grep.c:993 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp VZOREK je roz¹íøený regulární výraz\n" +" -F, --fixed-strings VZOREK je mno¾ina øetìzcù, ka¾dý na jednom øádku\n" +" -G, --basic-regexp VZOREK je základní regulární výraz\n" +" -P, --perl-regexp VZOREK je regulární výraz Perlu\n" + +#: src/grep.c:998 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=VZOREK pou¾ije VZOREK jako regulární výraz\n" +" -f, --file=SOUBOR naète VZOREK ze SOUBORu\n" +" -i, --ignore-case ignoruje rozdíl mezi velikostí písmen\n" +" -w, --word-regexp VZOREK bude aplikován pouze na celá slova\n" +" -x, --line-regexp VZOREK bude aplikován pouze na celé øádky\n" +" -z, --null-data øádek konèí nulovým bajtem místo znaku nového øádku\n" + +#: src/grep.c:1005 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Rùzné:\n" +" -s, --no-messages potlaèí chybové zprávy\n" +" -v, --invert-match vypí¹e øádky, které VZORKu nevyhovují\n" +" -V, --version vypí¹e oznaèení verze a skonèí\n" +" --help vypí¹e tuto nápovìdu a skonèí\n" +" --mmap kdy¾ to jde, namapuje vstup do pamìti\n" + +#: src/grep.c:1013 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examine\n" +" --exclude=PATTERN files that match PATTERN will be skip.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skip.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Øízení výstupu:\n" +" -m, --max-count=ÈÍSLO skonèí, pokud najde ÈÍSLO výrazù\n" +" -b, --byte-offset s ka¾dým výstupním øádkem vypí¹e jeho pozici\n" +" v souboru\n" +" -n, --line-number s ka¾dým výstupním øádkem vypí¹e jeho èíslo øádku\n" +" --line-buffered vyprázdní výstup po ka¾dém øádku\n" +" -H, --with-filename s ka¾dým výstupním øádkem vypí¹e jméno souboru\n" +" -h, --no-filename potlaèí vypisování jména souboru s výst. øádkem\n" +" -q, --quiet, --silent potlaèí obvyklý výstup\n" +" --binary-files=TYP definuje typ binárních souborù\n" +" TYP mù¾e být: 'binary', 'text' nebo 'without-match'\n" +" -a, --text jako --binary-files=text\n" +" -I jako --binary-files=without-match\n" +" -d, --directories=AKCE jak zpracovávat adresáøe. AKCE mù¾e být:\n" +" `read', `recurse', `skip'\n" +" -R, -r, --recursive jako --directories=recurse\n" +" --include=VZOREK soubory které vyhovují vzorku, budou zpracovány\n" +" --exclude=VZOREK soubory které vyhovují vzorku, budou pøeskoèeny\n" +" --exclude-from=SOUBOR soubory které vyhovují vzorkùm ze SOUBORu, budou\n" +" pøeskoèeny\n" +" -L, --files-without-match vypí¹e pouze jména souborù, ve kterých nebyl\n" +" VZOREK nalezen\n" +" -l, --files-with-matches vypí¹e pouze jména souborù, ve kterých byl VZOREK\n" +" nalezen\n" +" -c, --count vypí¹e pouze poèet vyhovujících øádkù na SOUBOR\n" +" -Z, --null vypí¹e nulový bajt za jménem SOUBORu\n" + +#: src/grep.c:1037 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color, --colour use markers to distinguish the matching string\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Øízení kontextu:\n" +" -B, --before-context=POÈET vypí¹e POÈET øádkù pøed vyhovujícím\n" +" -A, --after-context=POÈET vypí¹e POÈET øádkù za vyhovujícím\n" +" -C, --context=[POÈET] vypí¹e POÈET (2) øádkù kontextu (pøed\n" +" i za vyhovujícím). Je potlaèeno pøepínaèi -A a -B\n" +" -POÈET stejné se zadáním --context=NUM\n" +" --color, --colour pou¾ije barev k rozli¹ení vyhovujících øetìzcù\n" +" -U, --binary neodstraòuje znak CR na konci øádku (MSDOS)\n" +" -u, --unix-byte-offsets vypisuje pozici jako by CR nebyly v souboru (MSDOS)\n" +"\n" +" Jestli¾e není zadán ¾ádný z pøepínaèù -[GEF], pak `egrep' pracuje jako\n" +"`grep -E', `fgrep' jako `grep -F' a `grep' jako `grep -G'. Jestli¾e SOUBOR\n" +"není zadán, nebo je -, je èten standardní vstup. Jestli¾e jsou zadány\n" +"ménì ne¾ dva SOUBORy, pak je implicitní parametr -h.\n" +" Návratový kód je 0 pøi nalezení, 1 nevyhovoval-li ¾ádný øádek a 2 pøi\n" +"syntaktické nebo systémové chybì.\n" + +#: src/grep.c:1052 +msgid "\nReport bugs to .\n" +msgstr "" +"\n" +" Chyby v programu oznamujte na adrese (pouze\n" +"anglicky), pøipomínky k pøekladu zasílejte na adresu (èesky).\n" + +#: src/grep.c:1062 +msgid "conflicting matchers specified" +msgstr "zadány kolidující vzorky" + +#: src/grep.c:1355 +msgid "unknown directories method" +msgstr "neznámá obsluha adresáøù" + +#: src/grep.c:1422 +msgid "invalid max count" +msgstr "neplatný maximální poèet" + +#: src/grep.c:1472 +msgid "unknown binary-files type" +msgstr "neznámý typ binárního souboru" + +#: src/grep.c:1543 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1545 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1547 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +" Toto je volné programové vybavení; podmínky pro kopírování a roz¹iøování\n" +"naleznete ve zdrojových textech. Toto programové vybavení je zcela BEZ ZÁRUKY,\n" +"a to i bez záruky PRODEJNOSTI nebo VHODNOSTI PRO NÌJAKÝ KONKRÉTNÍ ÚÈEL.\n" + +#: src/search.c:623 +msgid "The -P option is not supported" +msgstr "Pøepínaè -P není podporován" + +#: src/search.c:636 +msgid "The -P and -z options cannot be combined" +msgstr "Pøepínaèe -P a -z nemohou být kombinovány" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Neznámá systémová chyba" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: pøepínaè `%s' není jednoznaèný\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: pøepínaè `--%s' musí být zadán bez argumentu\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: pøepínaè `%c%s' musí být zadán bez argumentu\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: pøepínaè `%s' vy¾aduje argument\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: neznámý pøepínaè `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: neznámý pøepínaè `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: neznámý pøepínaè -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: neznámý pøepínaè -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: pøepínaè vy¾aduje argument -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: pøepínaè `-W %s' není jednoznaèný\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: pøepínaè `-W %s' musí být zadán bez argumentu\n" + +#. 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. +#: lib/quotearg.c:265 +msgid "`" +msgstr "" + +#: lib/quotearg.c:266 +msgid "'" +msgstr "" diff --git a/src/apps/bin/grep-2.5/po/da.po b/src/apps/bin/grep-2.5/po/da.po new file mode 100644 index 0000000000..9bbe1b8d11 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/da.po @@ -0,0 +1,324 @@ +# Danish messages for GNU Grep version 2.4f. +# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +# Kenneth Christiansen , 1999. +# Keld Simonsen , 2000 +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.4f.da.po\n" +"POT-Creation-Date: 2000-02-02 01:04-0500\n" +"PO-Revision-Date: 2000-10-14 02:04+02:00\n" +"Last-Translator: Birger Langkjer \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:163 src/dfa.c:174 src/dfa.c:185 src/grep.c:902 +msgid "Memory exhausted" +msgstr "Hukommelse opbrugt" + +#: src/dfa.c:448 +msgid "Unfinished \\ escape" +msgstr "Ufærdig \\-beskyttelse" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:581 src/dfa.c:587 src/dfa.c:597 src/dfa.c:605 src/dfa.c:620 +msgid "unfinished repeat count" +msgstr "ufærdigt gentagelsesantal" + +#: src/dfa.c:594 src/dfa.c:611 src/dfa.c:619 src/dfa.c:623 +msgid "malformed repeat count" +msgstr "ugyldigt gentagelsesantal" + +#: src/dfa.c:688 src/dfa.c:691 src/dfa.c:718 src/dfa.c:722 src/dfa.c:723 +#: src/dfa.c:726 src/dfa.c:739 src/dfa.c:740 +msgid "Unbalanced [" +msgstr "Ubalanceret [" + +#: src/dfa.c:886 +msgid "Unbalanced (" +msgstr "Ubalanceret (" + +#: src/dfa.c:1000 +msgid "No syntax specified" +msgstr "Ingen syntaks angivet" + +#: src/dfa.c:1008 +msgid "Unbalanced )" +msgstr "Ubalanceret )" + +#: src/dfa.c:1994 +msgid "out of memory" +msgstr "ikke nok hukommelse" + +#: src/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: flaget '%s' er flertydigt\n" + +#: src/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: flaget '--%s' tillader ikke argumenter\n" + +#: src/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: flaget '%c%s' tillader ikke argumenter\n" + +#: src/getopt.c:723 src/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: flaget '%s' kræver et argument\n" + +#. --option +#: src/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ukendt flag '--%s'\n" + +#. +option or -option +#: src/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ukendt flag '%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ulovligt flag -- %c\n" + +#: src/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ugyldigt flag -- %c\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:815 src/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flaget kræver et argument -- %c\n" + +#: src/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: flaget '-W %s' er flertydigt\n" + +#: src/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: flaget '-W %s' tillader ikke argumenter\n" + +#: src/grep.c:185 src/grep.c:200 src/grep.c:293 src/grep.c:399 src/kwset.c:180 +#: src/kwset.c:186 src/obstack.c:471 +msgid "memory exhausted" +msgstr "hukommelse opbrugt" + +#: src/grep.c:550 src/grep.c:1441 +msgid "writing output" +msgstr "skriver uddata" + +#: src/grep.c:777 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Binær fil %s stemmer\n" + +#: src/grep.c:791 +msgid "(standard input)" +msgstr "(standard inddata)" + +#: src/grep.c:887 +#, c-format +msgid "%s: warning: %s: %s\n" +msgstr "%s: advarsel: %s: %s\n" + +#: src/grep.c:888 +msgid "recursive directory loop" +msgstr "rekursiv katalogsløjfe" + +#: src/grep.c:938 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Brug: %s [FLAG]... MØNSTER [FIL]...\n" + +#: src/grep.c:939 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Prøv '%s --help' for mere information.\n" + +#: src/grep.c:943 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Brug: %s [FLAG]... MØNSTER [FIL] ...\n" + +#: src/grep.c:944 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Søg efter MØNSTER i hver en FIL eller i standard inddata.\n" +"Eksempel: %s -i 'hello verden' menu.h main.c\n" +"\n" +"Regexp tilvalg og betydning:\n" + +#: src/grep.c:949 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +msgstr "" +" -E, --extended-regexp MØNSTER er et udvidet regulært udtryk\n" +" -F, --fixed-strings MØNSTER er et sæt af nylinje-separerede strenge\n" +" -G, --basic-regexp MØNSTER er et basalt regulært udtryk\n" + +#: src/grep.c:953 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=MØNSTER brug MØNSTER som et regulært udtryk\n" +" -f, --file=FIL tag MØNSTER fra FIL\n" +" -i, --ignore-case ignorér forskelle mellem store og små bogstaver\n" +" -w, --word-regexp få MØNSTER til at passe kun på hele ord\n" +" -x, --line-regexp få MØNSTER til at passe kun på hele linjer\n" +" -z, --null-data en datalinje slutter med en 0 byte, ikke ny linje\n" + +#: src/grep.c:960 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Forskelligt:\n" +" -s, --no-messages undertryk fejlmeddelser\n" +" -v, --invert-match vælg linjer der ikke passer\n" +" -V, --version udskriv versionsinformation og afslut\n" +" --help vis denne hjælpetekst og afslut\n" +" --mmap brug inddata via hukommelse om muligt\n" + +#: src/grep.c:968 +msgid "" +"\n" +"Output control:\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'.\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'.\n" +" -r, --recursive equivalent to --directories=recurse.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Output control:\n" +" -b, --byte-offset udskriv byte afsættet i uddatalinjer\n" +" -n, --line-number udskriv linjenummer i uddatalinjer\n" +" -H, --with-filename udskriv filnavn for hver træffer\n" +" -h, --no-filename undgå indledende filnavn i uddata\n" +" -q, --quiet, --silent undgå al normal uddata\n" +" --binary-files=TYPE antag at binære filer er TYPE\n" +" TYPE er 'binary', 'text', eller 'without-match'.\n" +" -a, --text det samme som --binary-files=text\n" +" -I det samme som --binary-files=without-match\n" +" -d, --directories=HANDLING hvordan kataloger skal behandles\n" +" HANDLING er 'read', 'recurse', eller 'skip'.\n" +" -r, --recursive det samme som --directories=recurse.\n" +" -L, --files-without-match udskriv kun FIL navne der ikke indeholder træffere match\n" +" -l, --files-with-matches udskriv kun FIL navne der indeholder træffere\n" +" -c, --count udskriv kun antal af linjer med træffere per FIL\n" +" -Z, --null udskriv en 0 byte efter FIL navn\n" + +#: src/grep.c:987 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context[=NUM] print NUM (default 2) lines of output context\n" +" unless overridden by -A or -B\n" +" -NUM same as --context=NUM\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Kontekst bestemmelse:\n" +" -B, --before-context=NUM udskriv NUM linjer med foregående tekst\n" +" -A, --after-context=NUM udskriv NUM linjer med efterfølgende tekst\n" +" -C, --context[=NUM] udskriv NUM (forvalgt 2) linjer af omgivende tekst\n" +" medmindre andet angivet med -A eller -B\n" +" -NUM det samme som --context=NUM\n" +" -U, --binary fjern ikke CR tegn ved linieslut (MSDOS)\n" +" -u, --unix-byte-offsets rapportér afsæt som om CR tegn ikke var der (MSDOS)\n" +"\n" +"`egrep' betyder `grep -E'. `fgrep' betyder `grep -F'.\n" +"Uden en FIL, eller hvis FIL er -, læs standard inddata. Hvis mindre end\n" +"to FILer er angivet, antag -h. Afslutningsstatus er 0 ved træffer, 1 ved ingen træffer,\n" +"og 2 ved problemer.\n" + +#: src/grep.c:1002 +msgid "\nReport bugs to .\n" +msgstr "\nRapportér fejl til .\n" + +#: src/grep.c:1012 +msgid "conflicting matchers specified" +msgstr "konfliktende søgeudtryk angivet" + +#: src/grep.c:1203 src/grep.c:1210 src/grep.c:1219 +msgid "invalid context length argument" +msgstr "ugyldigt kontekstlængdeargument" + +#: src/grep.c:1273 +msgid "unknown directories method" +msgstr "ukendt katalogmetode" + +#: src/grep.c:1358 +msgid "unknown binary-files type" +msgstr "ukendt binær filtype" + +#: src/grep.c:1378 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1380 +msgid "Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" +msgstr "Ophavsret 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" + +#: src/grep.c:1382 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Dette er frit programmel, se kildekoden for kopieringsbetingelser. Der\n" +"er INGEN garanti, ikke engang for SALGBARHED eller EGNETHED FOR NOGET \n" +"SPECIELT FORMÅL.\n" diff --git a/src/apps/bin/grep-2.5/po/de.po b/src/apps/bin/grep-2.5/po/de.po new file mode 100644 index 0000000000..e7ae84d585 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/de.po @@ -0,0 +1,403 @@ +# German messages for GNU grep +# Copyright (C) 1997-99, 2000, 2001, 2002 Free Software Foundation, Inc. +# Martin von Löwis , 1997-99, 2000, 2001, 2002 +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-09 01:27+0100\n" +"Last-Translator: Martin von Löwis \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Virtueller Speicher erschöpft." + +# Is this message used only for [ without matching ], +# or for ] without [ as well? +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "Öffnende [ ohne schließende." + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Unbeendete \\-Escape-Sequenz." + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "Unbeendeter Wiederholungszähler." + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "Unförmiger Wiederholungszähler." + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "Öffnende ( ohne schließende." + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Keine Syntax angegeben." + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr "Schließende ) ohne öffnende." + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "Speicher ist alle." + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "Virtueller Speicher erschöpft." + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "Ungültige Kontextlänge." + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "Eingabe ist zu groß, um gezählt zu werden." + +#: src/grep.c:597 +msgid "writing output" +msgstr "Politik, " + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Ãœbereinstimmungen in Binärdatei %s.\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(Standardeingabe)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "Warnung: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "Rekursive Verzeichnisschleife." + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Aufruf: %s [OPTION]... MUSTER [DATEI]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "»%s --help« gibt Ihnen mehr Informationen.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Aufruf: %s [OPTION]... MUSTER [DATEI] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Suche nach MUSTER in jeder DATEI oder der Standardeingabe.\n" +"Beispiel: %s -i 'Hallo Welt' menu.h main.c\n" +"\n" +"Auswahl und Interpretation regulärer Ausdrücke:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp MUSTER ist ein erweiterter regulärer Ausdruck.\n" +" -F, --fixed-strings MUSTER ist eine Menge Newline-getrennter \n" +" Zeichenketten.\n" +" -G, --basic-regexp MUSTER ist ein regulärer Standardausdruck.\n" +" -P, --perl-regexp MUSTER ist ein regulärer Ausdruck, \n" +" wie Perl ihn akzeptiert.\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=MUSTER MUSTER als regulären Ausdruck verwenden.\n" +" -f, --file=FILE MUSTER aus DATEI lesen.\n" +" -i, --ignore-case Unterschied zwischen Groß- und Kleinschreibung\n" +" ignorieren.\n" +" -w, --word-regexp MUSTER paßt nur auf ganze Wörter.\n" +" -x, --line-regexp MUSTER paßt nur auf ganze Zeilen.\n" +" -z, --null-data Eine Zeile endet mit Nullbyte, nicht Newline.\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Verschiedenes:\n" +" -s, --no-messages Fehlermeldungen unterdrücken.\n" +" -v, --revert-match Nicht-passende Zeilen anzeigen.\n" +" -V, --version Versionsnummer ausgeben und beenden.\n" +" --help Diese Hilfe ausgeben und beenden.\n" +" --mmap Wenn möglich, Eingabe in den Speicher mappen.\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Ausgabekontrolle:\n" +" -m, --max-count=ZAHL Nach ZAHL Ãœbereinstimmungen abbrechen.\n" +" -b, --byte-offset Byte-Offset anzeigen.\n" +" -n, --line-number Zeilennummer anzeigen.\n" +" --line-buffered Jede Zeile einzeln (ungepuffert) ausgeben.\n" +" -H, --with-filename Dateinamen bei jeder Ãœbereinstimmung anzeigen.\n" +" -h, --no-filename Dateinamen nicht anzeigen.\n" +" --label=TEXT TEXT als Dateiname für Standardeingabe ausgeben.\n" +" -o, --only-matching Nur den Teil der Zeile anzeigen, die mit MUSTER\n" +" übereinstimmt.\n" +" -q, --quiet, --silent Alle normalen Ausgaben unterdrücken.\n" +" --binary-files=TYP Binärdateien als TYP annehmen. TYP kann \n" +" »binary«, »text« oder »without-match« sein.\n" +" -a, --text Entspricht --binary-files=text.\n" +" -I Entspricht --binary-files=without-match.\n" +" -d, --directories=AKTION Verarbeitung von Verzeichnissen festlegen.\n" +" AKTION ist 'read', 'recurse', oder 'skip'.\n" +" -D, --devices=AKTION Verarbeitung von Gerätedateien, FIFOs und\n" +" Sockets festlegt. AKTION ist »read« oder »write«.\n" +" -R, -r, --recursive Äquivalent zu --directories=recurse.\n" +" --include=MUSTER Dateien untersuchen, die auf MUSTER passen.\n" +" --exclude=MUSTER Dateien überspringen, die auf MUSTER passen.\n" +" --exclude-from=DATEI Dateien überspringen, die auf ein Muster \n" +" in DATEI passen.\n" +" -L, --files-without-match Nur Namen von Dateien ausgeben, die keine\n" +" Ãœbereinstimmung enthalten.\n" +" -l, --files-with-matches Nur Dateinamen mit Ãœbereinstimmungen ausgeben.\n" +" -c, --count Nur Zahl der passenden Zeilen pro Datei ausgeben.\n" +" -Z, --null Null-Byte nach jedem Dateinamen ausgeben.\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Kontextkontrolle:\n" +" -B, --before-context=ZAHL ZAHL Zeilen von vorausgehendem Kontext anzeigen.\n" +" -A, --after-context=ZAHL ZAHL Zeilen von folgendem Kontext anzeigen.\n" +" -C, --context=ZAHL ZAHL Zeilen Kontext anzeigen,\n" +" -ZAHL Wie --context=ZAHL.\n" +" --color[=WENN], \n" +" --colour=[WENN] Passende Textfragmente markieren.\n" +" WENN kann »always«, »never« oder »auto« sein.\n" +" -U, --binary CR-Zeichen am Zeilenende belassen (MSDOS).\n" +" -u, --unix-byte-offsets Offsets ausgeben, als fehlten CR-Zeichen (MSDOS).\n" +"\n" +"»egrep« bedeutet »grep -E«. »fgrep« bedeutet »grep -F«.\n" +"Wenn DATEI fehlt oder »-« ist, wird die Standardeingabe gelesen.\n" +"Weniger als zwei DATEIen implizieren -h. Status ist 0 bei \n" +"Ãœbereinstimmungen, 1 ohne, 2 bei Problemen.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Fehlerberichte bitte an .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "Festgelegte Vergleicher widersprechen einander." + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "Unbekannte Methode für Gerätedateien." + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "Unbekannte Methode für Verzeichnisse." + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "Unbeendeter Maximalzähler." + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "Unbekannter Typ für »--binary-files«." + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Dies ist freie Software; in den Quellen befinden sich die Lizenzbedingungen.\n" +"Es gibt KEINERLEI Garantie; nicht einmal für die TAUGLICHKEIT oder\n" +"VERWENDBARKEIT FÃœR EINEN BESTIMMTEN ZWECK.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "Die Option -P ist nicht unterstützt." + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Die Optionen -P und -z können nicht kombiniert werden." + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Unbekannter Systemfehler." + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: Die Option »%s« ist mehrdeutig.\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: Die Option »%s« erlaubt keinen Parameter.\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: Die Option »%c%s« erlaubt keinen Parameter.\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: Die Option »%s« verlangt einen Parameter.\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: Nicht erkannte Option »--%s«\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: Nicht erkannte Option »%c%s«.\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: Ungültige Option -- %c.\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: Ungültige Option -- %c.\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Option verlangt einen Parameter -- %c.\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: Option »-W %s« ist zweideutig.\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: Option »-W %s« erlaubt keinen Parameter.\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "»" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "«" diff --git a/src/apps/bin/grep-2.5/po/el.po b/src/apps/bin/grep-2.5/po/el.po new file mode 100644 index 0000000000..44cf9ede63 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/el.po @@ -0,0 +1,533 @@ +# Greek messages for GNU grep-2.5e. +# Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +# Simos Xenitellis , 1998, 1999, 2000, 2001. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5e\n" +"POT-Creation-Date: 2001-03-07 00:02-0500\n" +"PO-Revision-Date: 2001-05-07 00:02+0000\n" +"Last-Translator: Simos Xenitellis \n" +"Language-Team: Greek \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-7\n" +"Content-Transfer-Encoding: 8-bit\n" + +# src/dfa.c:147 src/dfa.c:159 src/dfa.c:172 +# src/dfa.c:155 src/dfa.c:167 src/dfa.c:180 src/grep.c:827 +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/grep.c:944 src/search.c:706 +msgid "Memory exhausted" +msgstr "Ç ìíÞìç åîáíôëÞèçêå" + +# src/dfa.c:652 src/dfa.c:655 src/dfa.c:682 src/dfa.c:686 src/dfa.c:687 +# src/dfa.c:690 src/dfa.c:703 src/dfa.c:704 +# src/dfa.c:660 src/dfa.c:663 src/dfa.c:690 src/dfa.c:694 src/dfa.c:695 +# src/dfa.c:698 src/dfa.c:711 src/dfa.c:712 +#: src/dfa.c:486 src/dfa.c:489 src/dfa.c:507 src/dfa.c:518 src/dfa.c:542 +#: src/dfa.c:601 src/dfa.c:606 src/dfa.c:619 src/dfa.c:620 src/dfa.c:998 +#: src/dfa.c:1001 src/dfa.c:1025 src/dfa.c:1029 src/dfa.c:1030 src/dfa.c:1033 +#: src/dfa.c:1045 src/dfa.c:1046 +msgid "Unbalanced [" +msgstr "Ìç éóóïñïðçìÝíï [" + +# src/dfa.c:444 +# src/dfa.c:452 +#: src/dfa.c:738 +msgid "Unfinished \\ escape" +msgstr "Ìç ôåñìáôéóìÝíïò ÷áñáêôÞñáò äéáöõãÞò \\" + +# src/dfa.c:556 src/dfa.c:562 src/dfa.c:573 src/dfa.c:584 +# src/dfa.c:564 src/dfa.c:570 src/dfa.c:581 src/dfa.c:592 +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:871 src/dfa.c:877 src/dfa.c:887 src/dfa.c:895 src/dfa.c:910 +msgid "unfinished repeat count" +msgstr "ìç ôåñìáôéóìÝíïò ìåôñçôÞò åðáíÜëçøçò" + +# src/dfa.c:569 src/dfa.c:583 src/dfa.c:587 +# src/dfa.c:577 src/dfa.c:591 src/dfa.c:595 +#: src/dfa.c:884 src/dfa.c:901 src/dfa.c:909 src/dfa.c:913 +msgid "malformed repeat count" +msgstr "êáêïó÷çìáôéóìÝíïò ìåôñçôÞò åðáíÜëçøçò" + +# src/dfa.c:841 +# src/dfa.c:849 +#: src/dfa.c:1232 +msgid "Unbalanced (" +msgstr "Ìç éóïññïðçìÝíï (" + +# src/dfa.c:962 +# src/dfa.c:970 +#: src/dfa.c:1357 +msgid "No syntax specified" +msgstr "Äåí ïñßóôçêå óõíôáêôéêü" + +# src/dfa.c:970 +# src/dfa.c:978 +#: src/dfa.c:1365 +msgid "Unbalanced )" +msgstr "Ìç éóïññïðçìÝíï )" + +# src/dfa.c:1990 +# src/dfa.c:1998 +#: src/dfa.c:2933 +msgid "out of memory" +msgstr "åîáíôëÞèçêå ç ìíÞìç" + +# src/grep.c:144 src/grep.c:161 src/grep.c:222 src/grep.c:263 src/kwset.c:184 +# src/kwset.c:190 +# src/grep.c:164 src/grep.c:181 src/grep.c:283 src/grep.c:338 src/kwset.c:184 +# src/kwset.c:190 +#: lib/obstack.c:471 src/grep.c:343 src/kwset.c:171 src/kwset.c:177 +#: src/search.c:103 src/search.c:223 src/search.c:307 +msgid "memory exhausted" +msgstr "ç ìíÞìç åîáíôëÞèçêå" + +# src/grep.c:785 src/grep.c:792 +# src/grep.c:1060 src/grep.c:1067 src/grep.c:1076 +#: src/grep.c:191 +msgid "invalid context length argument" +msgstr "ìç Ýãêõñï üñéóìá ìÞêïõò ðåñéå÷ïìÝíïõ" + +#: src/grep.c:466 +msgid "input is too large to count" +msgstr "" + +# src/grep.c:392 src/grep.c:1034 +# src/grep.c:487 src/grep.c:1284 +#: src/grep.c:539 +msgid "writing output" +msgstr "åããñáöÞ áðïôåëÝóìáôïò" + +# src/grep.c:715 +#: src/grep.c:812 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Äõáäéêü áñ÷åßï %s ôáéñéÜóìáôá\n" + +# src/grep.c:964 src/grep.c:1015 +# src/grep.c:730 +#: src/grep.c:826 +msgid "(standard input)" +msgstr "(óôÜíôáñô åßóïäïò)" + +# src/grep.c:293 +# src/grep.c:366 +#: src/grep.c:931 +#, fuzzy, c-format +msgid "warning: %s: %s\n" +msgstr "%s: ðñïåéäïðïßçóç: %s: %s\n" + +# src/grep.c:844 +#: src/grep.c:932 +msgid "recursive directory loop" +msgstr "áíáäñïìéêÞ áëëçëïäéáäï÷Þ êáôáëüãùí" + +# src/grep.c:597 +# src/grep.c:862 +#: src/grep.c:980 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "×ñÞóç: %s [ÅÐÉËÏÃÇ]... Ó×ÇÌÁÔÉÓÌÏÓ [ÁÑ×ÅÉÏ]...\n" + +# src/grep.c:598 +# src/grep.c:863 +#: src/grep.c:982 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "ÄïêéìÜóôå `%s --help' ãéá ðåñéóóüôåñåò ðëçñïöïñßåò.\n" + +# src/grep.c:602 +# src/grep.c:867 +#: src/grep.c:987 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "×ñÞóç: %s [ÅÐÉËÏÃÇ]... Ó×ÇÌÁÔÉÓÌÏÓ [ÁÑ×ÅÉÏ] ...\n" + +#: src/grep.c:988 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" + +#: src/grep.c:993 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" + +# src/grep.c:603 +# src/grep.c:868 +#: src/grep.c:998 +#, fuzzy +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +"ÁíáæÞôçóç ãéá Ó×ÇÌÁÔÉÓÌÏ óå êÜèå ÁÑ×ÅÉÏ Þ óôç óôÜíôáñô åßóïäï.\n" +"\n" +"ÅðéëïãÝò Þ regexp êáé åîÞãçóç:\n" +" -E, --extended-regexp Ó×ÇÌÁÔÉÓÌÏÓ åßíáé ìéá åêôåôáìÝíç êáíïíéêÞ Ýêöñáóç\n" +" -F, --fixed-regexp Ó×ÇÌÁÔÉÓÌÏÓ åßíáé óôáôéêü áëöáñéèìçôéêü äéá÷ùñé-\n" +" æüìåíï ìå ÷áñáêôÞñåò áëëáãÞò ãñáììÞò\n" +" -G, --basic-regexp Ó×ÇÌÁÔÉÓÌÏÓ åßíáé áðëÞ êáíïíéêÞ Ýêöñáóç\n" +" -e, --regexp=Ó×ÇÌÁÔÉÓÌÏÓ ÷ñÞóç Ó×ÇÌÁÔÉÓÌÏÕ ãéá êáíïíéêÞ Ýêöñáóç\n" +" -f, --file=ÁÑ×ÅÉÏ ëÞøç Ó×ÇÌÁÔÉÓÌÏÕ áðü ôï áñ÷åßï ÁÑ×ÅÉÏ\n" +" -i, --ignore-case áãíüçóå äéáöïñÝò ðåæþí/êåöáëáßùí\n" +" -w, --word-regexp åðéâïëÞ ôïõ Ó×ÇÌÁÔÉÓÌÏÕ íá ôáéñéÜæåé ìüíï\n" +" ïëüêëçñåò ëÝîåéò\n" +" -x, --line-regexp åðéâïëÞ ôïõ Ó×ÇÌÁÔÉÓÌÏÕ íá ôáéñéÜæåé ìüíï\n" +" ïëüêëçñåò ãñáììÝò\n" + +# src/grep.c:615 +# src/grep.c:880 +#: src/grep.c:1005 +#, fuzzy +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"ËïéðÜ:\n" +" -s, --no-messages áðïöõãÞ åìöÜíéóçò ìõíçìÜôùí óöáëìÜôùí\n" +" -v, --revert-match åðéëïãÞ ãñáììþí ðïõ äåí ôáéñéÜæïõí\n" +" -V, --version åìöÜíéóçò ðëçñïöïñéþí Ýêäïóçò êáé Ýîïäïò\n" +" --help åìöÜíéóçò áõôÞò ôçò âïÞèåéáò êáé Ýîïäïò\n" + +# src/grep.c:622 +# src/grep.c:887 +#: src/grep.c:1013 +#, fuzzy +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examine\n" +" --exclude=PATTERN files that match PATTERN will be skip.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skip.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"¸ëåã÷ïò åîüäïõ:\n" +" -b, --byte-offset åìöÜíéóç ó÷åôéêÞò èÝóçò ôïõ byte ìå ôéò ãñáììÝò\n" +" åîüäïõ\n" +" -n, --line-number åìöÜíéóç áñéèìþí ãñáììÞò ìå ôéò ãñáììÝò åîüäïõ\n" +" -H, --with-filename åìöÜíéóç ïíüìáôïò áñ÷åßïõ ìå êÜèå ôáßñéáóìá\n" +" -h, --no-filename áðïöõãÞ åìöÜíéóçò ôïõ ïíüìáôïò ôïõ áñ÷åßïõ óôçí\n" +" áñ÷Þ ôçò åîüäïõ\n" +" -q, --quiet, --silent áðïöõãÞ åìöÜíéóçò üëçò ôçò êáíïíéêÞò åîüäïõ\n" +" -a, --text íá ìçí áðïöåõ÷èåß ç Ýîïäïò äõáäéêþí äåäïìÝíùí\n" +" -d, --directories=ÅÍÅÑÃÅÉÁ ôñüðïò ÷ñÞóçò ôùí êáôáëüãùí\n" +" Ç ÅÍÅÑÃÅÉÁ åßíáé 'read', 'recurse' Þ 'skip'.\n" +" (Ãéá áíÜãíùóç, áíáäñïìÞ êáé ðáñÜêáìøç áíôßóôïé÷á).\n" +" -r, --recursive éóïäýíáìï ìå --directories=recurse.\n" +" -L, --files-without-match åìöÜíéóç ìüíï ôá ïíüìáôá ÁÑ×ÅÉÙÍ ðïõ äåí\n" +" ðåñéÝ÷ïõí ôáéñéÜóìáôá\n" +" -l, --files-with-matches åìöÜíéóç ìüíï ôá ïíüìáôá ÁÑ×ÅÉÙÍ ìå ôáéñéÜóìáôá\n" +" -c, --count åìöÜíéóç ìüíï ôïí áñéèìü ôùí ãñáììþí ìå\n" +" ôáéñéÜóìáôá ãéá êÜèå ÁÑ×ÅÉÏ\n" + +# src/grep.c:633 +# src/grep.c:902 +#: src/grep.c:1037 +#, fuzzy +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color, --colour use markers to distinguish the matching string\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"¸ëåã÷ïò âÜóç ôïõ ðåñéå÷ïìÝíïõ:\n" +" -B, --before-context=ÁÑÉÈÌÏÓ åìöÜíéóç ÁÑÉÈÌÏÓ ãñáììþí ìå áêïëïõèïýìåíï\n" +" ðåñéå÷üìåíï\n" +" -A, --after-context=ÁÑÉÈÌÏÓ åìöÜíéóç ÁÑÉÈÌÏÓ ãñáììþí ìå ðñïðïñåõüìåíï\n" +" ðåñéå÷üìåíï\n" +" -C, --context[=ÁÑÉÈÌÏÓ] åìöÜíéóç ÁÑÉÈÌÏÓ (åî ïñéóìïý 2) ãñáììþí ìå\n" +" ðåñéå÷üìåíï åîüäïõ\n" +" åêôüò êé áí áíáéñåèåß ìå -A Þ -B\n" +" -NUM ôï ßäéï ìå --context=ÁÑÉÈÌÏÓ\n" +" -U, --binary íá ìçí áðáëåßöïíôáé ÷áñáêôÞñåò CR óôï EOL (MSDOS)\n" +" -u, --unix-byte-offsets áíáöïñÜ ó÷åôéêþí èÝóåùí óá íá ìçí õðÞñ÷áí\n" +" ÷áñáêôÞñåò CR (MSDOS)\n" +"\n" +"Áí äåí õðÜñ÷åé -[GEF], ôüôå ç `egrep' èåùñåß -E, ç `fgrep' -F áëëéþò -G.\n" +"×ùñßò ÁÑ×ÅÉÏ Þ üôáí ôï ÁÑ×ÅÉÏ åßíáé -, áíÜãíùóç áðü óôÜíôáñô åßóïäï.\n" +"Áí äßíïíôáé ëéãüôåñá áðü äýï ÁÑ×ÅÉÁ, èåþñçóå üôé äßíåôáé -h. ¸îïäïò ìå 0\n" +"üôáí õðÜñ÷åé ôáßñéáóìá, äéáöïñåôéêÜ ìå 1. ¸îïäïò ìå 2 óôçí ðåñßðôùóç\n" +"óõíôáêôéêþí óöáëìÜôùí Þ óöáëìÜôùí óõóôÞìáôïò.\n" + +# src/grep.c:647 +# src/grep.c:917 +#: src/grep.c:1052 +msgid "\nReport bugs to .\n" +msgstr "\nÓôåßëôå áíáöïñÝò óöáëìÜôùí óôï .\n" + +# src/grep.c:829 +# src/grep.c:1112 +#: src/grep.c:1062 +#, fuzzy +msgid "conflicting matchers specified" +msgstr "ôï óôïé÷åßï ðïõ ðñüêåéôáé íá áíáæçôçèåß, Ý÷åé Þäç ïñéóôåß" + +# src/grep.c:1133 +#: src/grep.c:1355 +msgid "unknown directories method" +msgstr "Üãíùóôç ìÝèïäïò êáôáëüãùí" + +# src/dfa.c:556 src/dfa.c:562 src/dfa.c:573 src/dfa.c:584 +# src/dfa.c:564 src/dfa.c:570 src/dfa.c:581 src/dfa.c:592 +#: src/grep.c:1422 +#, fuzzy +msgid "invalid max count" +msgstr "ìç ôåñìáôéóìÝíïò ìåôñçôÞò åðáíÜëçøçò" + +#: src/grep.c:1472 +msgid "unknown binary-files type" +msgstr "" + +# src/grep.c:915 +# src/grep.c:1219 +#: src/grep.c:1543 +#, fuzzy, c-format +msgid "%s (GNU grep) %s\n" +msgstr "grep (GNU grep) %s\n" + +# src/grep.c:917 +# src/grep.c:1221 +#: src/grep.c:1545 +#, fuzzy +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright (C) 1988, 1992-1997, Free Software Foundation, Inc.\n" + +# src/grep.c:919 +# src/grep.c:1223 +#: src/grep.c:1547 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Áõôü åßíáé åëåýèåñï ëïãéóìéêü, äåßôå ôï ðçãáßï êþäéêá ãéá ôïõò êáíüíåò\n" +"áíôéãñáöÞò. ÄÅÍ õðÜñ÷åé åããýçóç, ïýôå áêüìá ãéá ×ÑÇÓÉÌÏÔÇÔÁ Þ ÊÁÔÁËËÇËÏÔÇÔÁ\n" +"ÃÉÁ ÅÍÁ ÓÕÃÊÅÊÑÉÌÅÍÏ ÓÊÏÐÏ.\n" + +#: src/search.c:623 +msgid "The -P option is not supported" +msgstr "" + +#: src/search.c:636 +msgid "The -P and -z options cannot be combined" +msgstr "" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "" + +# src/getopt.c:628 +# src/getopt.c:628 +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: ç åðéëïãÞ `%s' åßíáé äéöïñïýìåíç\n" + +# src/getopt.c:652 +# src/getopt.c:652 +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: ç åðéëïãÞ `--%s' äåí åðéôñÝðåé ïñßóìáôá\n" + +# src/getopt.c:657 +# src/getopt.c:657 +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: ç åðéëïãÞ `%c%s' äåí åðéôñÝðåé ïñßóìáôá\n" + +# src/getopt.c:674 src/getopt.c:847 +# src/getopt.c:674 src/getopt.c:847 +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: ç åðéëïãÞ `%s' áðáéôåß üñéóìá\n" + +# src/getopt.c:703 +# src/getopt.c:703 +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ìç áíáãíùñßóéìç åðéëïãÞ `--%s'\n" + +# src/getopt.c:707 +# src/getopt.c:707 +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ìç áíáãíùñßóéìç åðéëïãÞ `%c%s'\n" + +# src/getopt.c:733 +# src/getopt.c:733 +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ìç áðïäåêôÞ åðéëïãÞ -- %c\n" + +# src/getopt.c:736 +# src/getopt.c:736 +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ìç Ýãêõñç åðéëïãÞ -- %c\n" + +# src/getopt.c:766 src/getopt.c:896 +# src/getopt.c:766 src/getopt.c:896 +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: ç åðéëïãÞ áðáéôåß Ýíá üñéóìá -- %c\n" + +# src/getopt.c:813 +# src/getopt.c:813 +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: ç åðéëïãÞ `-W %s' åßíáé äéöïñïýìåíç\n" + +# src/getopt.c:831 +# src/getopt.c:831 +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: ç åðéëïãÞ `-W %s' äåí äÝ÷åôáé ïñßóìáôá\n" + +#. 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. +#: lib/quotearg.c:265 +msgid "`" +msgstr "" + +#: lib/quotearg.c:266 +msgid "'" +msgstr "" + +#~ # src/getopt1.c:132 +#~ # src/getopt1.c:132 +#~ msgid "option %s" +#~ msgstr "åðéëïãÞ %s" + +#~ # src/getopt1.c:134 +#~ # src/getopt1.c:134 +#~ msgid " with arg %s" +#~ msgstr " ìå üñéóìá %s" + +#~ # src/getopt1.c:149 +#~ # src/getopt1.c:149 +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "õðÜñ÷ïõí øçößá óå äýï äéáöïñåôéêÜ argv-óôïé÷åßá.\n" + +#~ # src/getopt1.c:151 +#~ # src/getopt1.c:151 +#~ msgid "option %c\n" +#~ msgstr "åðéëïãÞ %c\n" + +#~ # src/getopt1.c:155 +#~ # src/getopt1.c:155 +#~ msgid "option a\n" +#~ msgstr "åðéëïãÞ á\n" + +#~ # src/getopt1.c:159 +#~ # src/getopt1.c:159 +#~ msgid "option b\n" +#~ msgstr "åðéëïãÞ â\n" + +#~ # src/getopt1.c:163 +#~ # src/getopt1.c:163 +#~ msgid "option c with value `%s'\n" +#~ msgstr "åðéëïãÞ ã ìå ôéìÞ `%s'\n" + +#~ # src/getopt1.c:167 +#~ # src/getopt1.c:167 +#~ msgid "option d with value `%s'\n" +#~ msgstr "åðéëïãÞ ä ìå ôéìÞ `%s'\n" + +#~ # src/getopt1.c:174 +#~ # src/getopt1.c:174 +#~ msgid "?? getopt returned character code 0%o ??\n" +#~ msgstr "?? ç getopt åðÝóôñåøå áëöáâçôéêü êùäéêü 0%o ??\n" + +#~ # src/getopt1.c:180 +#~ # src/getopt1.c:180 +#~ msgid "non-option ARGV-elements: " +#~ msgstr "ARGV-óôïé÷åßá ðïõ äåí åßíáé åðéëïãÝò: " + +#~ # src/grep.c:800 src/grep.c:805 src/grep.c:810 +#~ # src/grep.c:1083 src/grep.c:1088 src/grep.c:1093 +#~ msgid "you may specify only one of -E, -F, or -G" +#~ msgstr "ìðïñåßôå íá ïñßóåôå ìüíï Ýíá áðü ôá-E, -F Þ -G" + +#~ # src/obstack.c:467 +#~ # src/obstack.c:467 +#~ msgid "memory exhausted\n" +#~ msgstr "ç ìíÞìç åîáíôëÞèçêå\n" + +#~ # src/grep.c:1027 src/grep.c:1030 +#~ msgid "(standard input)\n" +#~ msgstr "(êáíïíéêÞ åßóïäïò)\n" diff --git a/src/apps/bin/grep-2.5/po/eo.po b/src/apps/bin/grep-2.5/po/eo.po new file mode 100644 index 0000000000..d5751dcf46 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/eo.po @@ -0,0 +1,379 @@ +# La teksto por la mesaøoj de la "grep" programo. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. +# D. Dale Gulledge , 1999. +# Edmund GRIMLEY EVANS , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5e\n" +"POT-Creation-Date: 2001-03-07 00:02-0500\n" +"PO-Revision-Date: 2001-05-13 14:30+01:00\n" +"Last-Translator: Edmund GRIMLEY EVANS \n" +"Language-Team: Esperanto \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-3\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/grep.c:944 src/search.c:706 +msgid "Memory exhausted" +msgstr "Memoro elæerpita" + +#: src/dfa.c:486 src/dfa.c:489 src/dfa.c:507 src/dfa.c:518 src/dfa.c:542 +#: src/dfa.c:601 src/dfa.c:606 src/dfa.c:619 src/dfa.c:620 src/dfa.c:998 +#: src/dfa.c:1001 src/dfa.c:1025 src/dfa.c:1029 src/dfa.c:1030 src/dfa.c:1033 +#: src/dfa.c:1045 src/dfa.c:1046 +msgid "Unbalanced [" +msgstr "Senpara [" + +#: src/dfa.c:738 +msgid "Unfinished \\ escape" +msgstr "Nefinita \\-eskapo" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:871 src/dfa.c:877 src/dfa.c:887 src/dfa.c:895 src/dfa.c:910 +msgid "unfinished repeat count" +msgstr "nefinita ripetonombro" + +#: src/dfa.c:884 src/dfa.c:901 src/dfa.c:909 src/dfa.c:913 +msgid "malformed repeat count" +msgstr "misformita ripetonombro" + +#: src/dfa.c:1232 +msgid "Unbalanced (" +msgstr "Senpara (" + +#: src/dfa.c:1357 +msgid "No syntax specified" +msgstr "Mankas sintakso" + +#: src/dfa.c:1365 +msgid "Unbalanced )" +msgstr "Senpara )" + +#: src/dfa.c:2933 +msgid "out of memory" +msgstr "memoro elæerpita" + +#: lib/obstack.c:471 src/grep.c:343 src/kwset.c:171 src/kwset.c:177 +#: src/search.c:103 src/search.c:223 src/search.c:307 +msgid "memory exhausted" +msgstr "memoro elæerpita" + +#: src/grep.c:191 +msgid "invalid context length argument" +msgstr "nevalida argumento por kunteksto-longo" + +#: src/grep.c:466 +msgid "input is too large to count" +msgstr "enigo estas tro granda por nombrado" + +#: src/grep.c:539 +msgid "writing output" +msgstr "skribas eligon" + +#: src/grep.c:812 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Binara dosiero %s kongruas\n" + +#: src/grep.c:826 +msgid "(standard input)" +msgstr "(normala enigo)" + +#: src/grep.c:931 +#, c-format +msgid "warning: %s: %s\n" +msgstr "averto: %s: %s\n" + +#: src/grep.c:932 +msgid "recursive directory loop" +msgstr "rekursa dosieruja ciklo" + +#: src/grep.c:980 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Uzado: %s [OPCIO]... ÞABLONO [DOSIERO]...\n" + +#: src/grep.c:982 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Provu `%s --help' por pliaj informoj.\n" + +#: src/grep.c:987 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Uzado: %s [OPCIO]... ÞABLONO [DOSIERO] ...\n" + +#: src/grep.c:988 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Seræi pri ÞABLONO en æiu DOSIERO aý la normala enigo.\n" +"Ekzemplo: %s -i 'saluton mondo' menu.h main.c\n" +"\n" +"Elekto kaj interpreto de regulaj esprimoj:\n" + +#: src/grep.c:993 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp ÞABLONO estas etendita regula esprimo\n" +" -F, --fixed-strings ÞABLONO estas aro da æenoj apartigitaj de linifinoj\n" +" -G, --basic-regexp ÞABLONO estas simpla regula esprimo\n" +" -P, --perl-regexp ÞABLONO estas regula esprimo de Perl\n" + +#: src/grep.c:998 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=ÞABLONO uzi ÞABLONOn kiel regulan esprimon\n" +" -f, --file=DOSIERO akiri la þablonon el DOSIERO\n" +" -i, --ignore-case ignori diferencojn de uskleco\n" +" -w, --word-regexp devigi al ÞABLONO kongrui nur al tutaj vortoj\n" +" -x, --line-regexp devigi al ÞABLONO kongrui nur al tutaj linioj\n" +" -z, --null-data datenlinio finiøas per bitoko 0, ne per linifino\n" + +#: src/grep.c:1005 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Miscellaneous:\\n\"\n" +" -s, --no-messages subpremi eraromesaøojn\n" +" -v, --invert-match elekti la nekongruajn liniojn\n" +" -V, --version eltajpi versio-informojn kaj fini\n" +" --help montri æi tiun helpon kaj fini\n" +" --mmap uzi memoromapon por la enigo, se eble\n" + +#: src/grep.c:1013 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examine\n" +" --exclude=PATTERN files that match PATTERN will be skip.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skip.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Regado de la eligo:\n" +" -m, --max-count==NOMBRO halti post NOMBRO da trafoj\n" +" -b, --byte-offset presi la bitoknumeron kun eligataj linioj\n" +" -n, --line-number presi la lininumeron kun eligataj linioj\n" +" --line-buffered peli la eligon post æiu linio\n" +" -H, --with-filename presi la dosiernomon por æiu trafo\n" +" -h, --no-filename subpremi la prefiksan dosiernomon æe eligo\n" +" -q, --quiet, --silent subpremi æian normalan eligadon\n" +" --binary-files=SPECO supozi, ke binaraj dosieroj estas de SPECO\n" +" SPECO estas 'binary', 'text', aý 'without-match'\n" +" -a, --text same kiel --binary-files=text\n" +" -I same kiel --binary-files=without-match\n" +" -d, --directories=AGO kiel trakti dosierujojn; AGO estas 'read' (legi),\n" +" 'recurse' (rekurse), aý 'skip' (ignori).\n" +" -R, -r, --recursive same kiel --directories=recurse.\n" +" --include=ÞABLONO ekzameni dosierojn, kiuj kongruas kun ÞABLONO\n" +" --exclude=ÞABLONO ignori dosierojn, kiuj kongruas kun ÞABLONO\n" +" --exclude-from=DOS ignori dosierojn, kiuj kongruas kun þablono en DOS\n" +" -L, --files-without-match presi nur dosiernomojn sen trafo\n" +" -l, --files-with-matches presi nur dosiernomojn kun trafoj\n" +" -c, --count presi nur nombron de kongruaj linioj en æiu dosiero\n" +" -Z, --null presi la bitokon 0 post dosiernomo\n" + +#: src/grep.c:1037 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color, --colour use markers to distinguish the matching string\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Regado de la kunteksto:\n" +" -B, --before-context=NOM presi NOM liniojn da antaýa kunteksto\n" +" -A, --after-context=NOM presi NOM liniojn da posta kunteksto\n" +" -C, --context=NOM presi NOM liniojn da kunteksto\n" +" -NOM same kiel --context=NOM\n" +" --color, --colour uzi markilojn por distingi la kongruan æenon\n" +" -U, --binary ne forigi \\r-signojn æe linifino (MSDOS)\n" +" -u, --unix-byte-offsets doni bitoknumerojn, kvazaý \\r-signoj mankus (MSDOS)\n" +"\n" +"'egrep' signifas 'grep -E'. 'fgrep' signifas 'grep -F'.\n" +"Kiam DOSIERO mankas, aý DOSIERO estas -, legi la normalan enigon. Se malpli\n" +"ol du DOSIEROj estas donitaj, supozi -h. Finvaloro estas 0, se estis trafo,\n" +"1, se ne estis, kaj 2 æe eraro.\n" + +#: src/grep.c:1052 +msgid "\nReport bugs to .\n" +msgstr "\nRaportu cimojn al .\n" + +#: src/grep.c:1062 +msgid "conflicting matchers specified" +msgstr "malkongruaj kompariloj estas indikitaj" + +#: src/grep.c:1355 +msgid "unknown directories method" +msgstr "nekonata dosieruja metodo" + +#: src/grep.c:1422 +msgid "invalid max count" +msgstr "nevalida maksimuma nombro" + +#: src/grep.c:1472 +msgid "unknown binary-files type" +msgstr "nekonata speco de binara dosiero" + +#: src/grep.c:1543 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1545 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Kopirajto 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1547 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Æi tiu estas libera programo; vidu la fonton por kopikondiæoj. Estas\n" +"NENIA GARANTIO, eæ ne pri KOMERCA KVALITO aý ADEKVATECO POR DIFINITA CELO.\n" + +#: src/search.c:623 +msgid "The -P option is not supported" +msgstr "La opcio -P ne estas disponata" + +#: src/search.c:636 +msgid "The -P and -z options cannot be combined" +msgstr "Ne eblas kombini la opciojn -P kaj -z" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Nekonata sistemeraro" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: opcio `%s' estas plursenca\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: opcio `--%s' ne akceptas argumenton\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: opcio `%c%s' ne akceptas argumenton\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: opcio `%s' bezonas argumenton\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: nekonata opcio `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: nekonata opcio `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: malpermesata opcio -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: nevalida opcio -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opcio bezonas argumenton -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: opcio `-W %s' estas plursenca\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: opcio `-W %s' ne akceptas argumenton\n" + +#. 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. +#: lib/quotearg.c:265 +msgid "`" +msgstr "'" + +#: lib/quotearg.c:266 +msgid "'" +msgstr "'" diff --git a/src/apps/bin/grep-2.5/po/es.po b/src/apps/bin/grep-2.5/po/es.po new file mode 100644 index 0000000000..9dab6ff46d --- /dev/null +++ b/src/apps/bin/grep-2.5/po/es.po @@ -0,0 +1,469 @@ +# Mensajes en español para GNU grep. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Enrique Melero Gómez , 1996. +# Santiago Vila Doncel , 1997, 1998, 1999, 2000, 2001, 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-10 13:49+0100\n" +"Last-Translator: Santiago Vila Doncel \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Memoria agotada" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "[ desemparejado" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Secuencia de escape \\ sin terminar" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "contador de repetición sin terminar" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "contador de repetición erróneo" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "( desemparejado" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "No se ha especificado ninguna sintaxis" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr ") desemparejado" + +# FIXME. Comunicar al autor que esto es repetición... +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "memoria agotada" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "memoria agotada" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "longitud de contexto inválida" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "la entrada es demasiado grande para contar" + +#: src/grep.c:597 +msgid "writing output" +msgstr "escribiendo el resultado" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Coincidencia en el fichero binario %s\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(entrada estándar)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "atención: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "bucle de directorio recursivo" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Modo de empleo: %s [OPCIÓN]... PATRÓN [FICHERO]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Pruebe `%s --help' para más información.\n" + +# FIXME: Dice [FILE] ... en vez de [FILE]... ¿Será un error? +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Modo de empleo: %s [OPCIÓN]... PATRÓN [FICHERO] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Busca PATRÓN en cada FICHERO o en la entrada estándar.\n" +"Ejemplo: %s -i 'hello world' menu.h main.c\n" +"\n" +"Selección e interpretación de Expreg:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp PATRÓN es una expresión regular extendida\n" +" -F, --fixed-strings PATRÓN es un conjunto de cadenas separadas por\n" +" caracteres de nueva línea\n" +" -G, --basic-regexp PATRÓN es una expresión regular básica\n" +" -P, --perl-regexp PATRÓN es una expresión regular en Perl\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=PATRÓN utiliza PATRÓN como expresión regular\n" +" -f, --file=FICHERO obtiene PATRÓN de FICHERO\n" +" -i, --ignore-case considera iguales mayúsculas y minúsculas\n" +" -w, --word-regexp obliga a que PATRÓN coincida solamente\n" +" con palabras completas\n" +" -x, --line-regexp obliga a que PATRÓN coincida solamente\n" +" con líneas completas\n" +" -z, --null-data una línea de datos termina en un byte 0, no\n" +" en un carácter de nueva línea\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Variadas:\n" +" -s, --no-messages suprime los mensajes de error\n" +" -v, --invert-match selecciona las líneas que no coinciden\n" +" -V, --version muestra la versión y finaliza\n" +" --help muestra esta ayuda y finaliza\n" +" --mmap utiliza entrada asignada en memoria si es posible\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Control del resultado:\n" +" -m, --max-count=NÚM se detiene después de NÚM coincidencias\n" +" -b, --byte-offset muestra el desplazamiento en bytes junto\n" +" con las líneas de salida\n" +" -n, --line-number muestra el número de línea junto con\n" +" las líneas de salida\n" +" --line-buffered descarga el resultado para cada línea\n" +" -H, --with-filename muestra el nombre del fichero para cada\n" +" coincidencia\n" +" -h, --no-filename suprime los nombres de los ficheros en\n" +" el resultado\n" +" --label=ETIQUETA muestra ETIQUETA como nombre de fichero para la\n" +" entrada estándar\n" +" -o, --only-matching muestra solamente la parte de una línea que\n" +" encaja con PATRÓN\n" +" -q, --quiet, --silent suprime todo el resultado normal\n" +" --binary-files=TIPO supone que los ficheros binarios son TIPO\n" +" TIPO es `binary', `text', o `without-match'\n" +" -a, --text equivalente a --binary-files=text\n" +" -I equivalente a --binary-files=without-match\n" +" -d, --directories=ACCIÓN especifica cómo manejar los directorios\n" +" ACCIÓN es 'read', 'recurse', o 'skip'\n" +" -D, --devices=ACCIÓN especifica cómo manejar dispositivos, FIFOs y\n" +" `sockets', puede ser 'read' o 'skip'\n" +" -R, -r, --recursive equivalente a --directories=recurse\n" +" --include=PATRÓN examina los ficheros que encajan con PATRÓN\n" +" --exclude=PATRÓN se salta los ficheros que encajan con PATRÓN\n" +" --exclude-from=FICHERO se salta los ficheros que encajan con los patrones\n" +" de FICHERO\n" +" -L, --files-without-match muestra solamente los nombres de FICHEROs\n" +" que no contienen ninguna coincidencia\n" +" -l, --files-with-matches muestra solamente los nombres de FICHEROs\n" +" que contienen alguna coincidencia\n" +" -c, --count muestra solamente el total de líneas que coinciden\n" +" por cada FICHERO\n" +" -Z, --null imprime un byte 0 después del nombre del FICHERO\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Control del contexto:\n" +" -B, --before-context=NÚM muestra NÚM líneas de contexto anterior\n" +" -A, --after-context=NÚM muestra NÚM líneas de contexto posterior\n" +" -C, --context=NÚM muestra NÚM líneas de contexto\n" +" -NÚM lo mismo que --context=NÚM\n" +" --color[=CUÁNDO],\n" +" --colour[=CUÁNDO] distingue con marcadores la cadena que encaja\n" +" CUÁNDO puede ser `always', `never' o `auto'.\n" +" -U, --binary no elimina los caracteres de retorno de carro\n" +" finales de línea (MSDOS)\n" +" -u, --unix-byte-offsets cuenta los desplazamientos como si no hubiera\n" +" retornos de carro (MSDOS)\n" +"\n" +"`egrep' significa `grep -E'. `fgrep' significa `grep -F'.\n" +"Si no se especifica ningún FICHERO, o cuando es -, lee la entrada estándar.\n" +"Si se dan menos de dos FICHEROs, se supone -h. La salida es 0 si hay\n" +"coincidencias, 1 si no las hay, y 2 en caso de problema\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Comunicar bichos a .\n" + +# viendo los fuentes , hay varias opciones +# que hay sin documentar. O quizá es que getopt() lo he entendido mal +# Son las opciones X ( requiere argumento ) , switchs -c, -b, -L e -y +# grep.c:622 -> +# opt = getopt(argc, argv, "0123456789A:B:CEFGVX:bce:f:hiLlnqsvwxy" +# grep --help -> +# usage: grep [-[[AB] ]] [-[CEFGVchilnqsvwx]] [-[ef]] [] +# La opción -X es a la que corresponde esta línea. +# +# No me gusta nada lo de opción "a buscar". +# Se admiten sugerencias. sv +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "se han especificado expresiones conflictivas" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "método de dispositivos desconocido" + +# Nota: Se refiere a la opción --directories=ACCIÓN cuando ACCIÓN +# no es `read', `recurse' o `skip'. +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "método de directorios desconocido" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "contador máximo inválido" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "tipo binary-files desconocido" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Esto es software libre; vea el código fuente para las condiciones de copia.\n" +"No hay NINGUNA garantía; ni siquiera de COMERCIABILIDAD o IDONEIDAD PARA UN\n" +"FIN DETERMINADO.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "La opción -P no está admitida" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Las opciones -P y -z no se pueden combinar" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Error del sistema desconocido" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: la opción `%s' es ambigua\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: la opción `--%s' no admite ningún argumento\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: la opción `%c%s' no admite ningún argumento\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: la opción `%s' requiere un argumento\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opción no reconocida `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opción no reconocida `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opción ilegal -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opción inválida -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: la opción requiere un argumento -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: la opción `-W %s' es ambigua\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: la opción `-W %s' no admite ningún argumento\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "'" + +#~ msgid "option %s" +#~ msgstr "opción %s" + +#~ msgid " with arg %s" +#~ msgstr " con argumento %s" + +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "aparecen dígitos en dos elementos de argv diferentes.\n" + +#~ msgid "option %c\n" +#~ msgstr "opción %c\n" + +#~ msgid "option a\n" +#~ msgstr "opción a\n" + +#~ msgid "option b\n" +#~ msgstr "opción b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "la opción c tiene el valor `%s'\n" + +#~ msgid "option d with value `%s'\n" +#~ msgstr "la opción d tiene el valor `%s'\n" + +#~ msgid "?? getopt returned character code 0%o ??\n" +#~ msgstr "?? getopt ha devuelto el carácter código 0%o ??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "elementos de ARGV que no son opciones: " + +#~ msgid "you may specify only one of -E, -F, or -G" +#~ msgstr "sólo se puede especificar una de las opciones -E, -F, o -G" + +# Prefiero dejarlo en solamente un patrón +# Pero entonces no queda claro que *debe haber uno*, y parece que +# es uno como máximo (siendo el mínimo 0). sv +#~ msgid "There should be one and only one PATTERN, `-e PATTERN' or `-f FILE'.\n" +#~ msgstr "Debe haber un y solamente un PATRÓN, `-e PATRÓN', o `-f FICHERO'.\n" + +#~ msgid "If no -[GEF], then -G is assumed.\n" +#~ msgstr "Si no se especifica ninguna de las opciones -[GEF], se supone -G.\n" diff --git a/src/apps/bin/grep-2.5/po/et.po b/src/apps/bin/grep-2.5/po/et.po new file mode 100644 index 0000000000..06a5984421 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/et.po @@ -0,0 +1,395 @@ +# Estonian translations for grep +# Copyright (C) 2000 Free Software Foundation, Inc. +# Toomas Soome , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-07 13:09+0200\n" +"Last-Translator: Toomas Soome \n" +"Language-Team: Estonian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-15\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Mälu on otsas" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "Balanseerimata [" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Lõpetamata \\ paojada" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "lõpetamata korduste arv" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "vigane korduste arv" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "Balanseerimata (" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Süntaksit pole määratud" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr "Balanseerimata )" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "mälu on otsas" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "mälu on otsas" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "vigane konteksti pikkuse argument" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "sisend on loendamiseks liiga suur" + +#: src/grep.c:597 +msgid "writing output" +msgstr "kirjutan väljundit" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Kahendfail %s sobib\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(standardsisend)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "hoiatus: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "rekursiivne kataloogipuu tsükkel" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Kasuta: %s [VÕTI]... MUSTER [FAIL] ...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Lisainfo saamiseks proovige võtit `%s --help'.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Kasuta: %s [VÕTI]... MUSTER [FAIL] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Otsi MUSTRIT igast FAIList või standardsisendist.\n" +"Näiteks: %s -i 'tere kõik' menu.h main.c\n" +"\n" +"Regulaaravaldise valik ja interpreteerimine:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp MUSTER on laiendatud regulaaravaldis\n" +" -F, --fixed-strings MUSTER on hulk reavahetustega eraldatud sõnesid\n" +" -G, --basic-regexp MUSTER on lihtne regulaaravaldis\n" +" -P, --perl-regexp MUSTER on Perl regulaaravaldis\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=MUSTER kasuta regulaaravaldisena\n" +" -f, --file=FAIL loe MUSTER failist FAIL\n" +" -i, --ignore-case ignoreeri suur- ja väiketähtede erinevusi\n" +" -w, --word-regexp kasuta MUSTRIT sõnade leidmiseks\n" +" -x, --line-regexp kasuta MUSTRIT ridade leidmiseks\n" +" -z, --null-data andmerida lõppeb baidil 0, mitte reavahetusel\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Muud:\n" +" -s, --no-messages blokeeri veateated\n" +" -v, --invert-match vali mitte-sobivad read\n" +" -V, --version esita versiooniinfo ja lõpeta töö\n" +" --help esita see abiinfo ja lõpeta töö\n" +" --mmap kasuta kui võimalik sisendi mällu laadimist\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Väljundi kontroll:\n" +" -m, --max-count=NUM lõpeta peale NUM leidu\n" +" -b, --byte-offset trüki baidi aadress väljundreale\n" +" -n, --line-number trüki rea number väljundreale\n" +" --line-buffered väljasta käik peale iga rida\n" +" -H, --with-filename trüki iga leiu failinimi\n" +" -h, --no-filename keela väljundis prefiks failinimi\n" +" -q, --quiet, --silent keela kogu tavapärane väljund\n" +" --binary-files=TÜÜP eeldab kahendfailide TÜÜPi\n" +" TÜÜP on 'binary', 'text' või 'without-match'\n" +" -a, --text sama, kui --binary-files=text\n" +" -I sama, kui --binary-files=without-match\n" +" -d, --directories=TEGEVUS kuidas käsitleda katalooge\n" +" TEGEVUS on 'read', 'recurse' või 'skip'\n" +" -D, --devices=TEGEVUS kuidas käsitleda seadmeid, FIFO ja pistik faile\n" +" TEGEVUS on 'read' või 'skip'\n" +" -R, -r, --recursive sama, kui --directories=recurse\n" +" --include=MUSTER vaadeldakse mustrile MUSTER vastavaid faile\n" +" --exclude=MUSTER mustrile MUSTER vastavad failid jäetakse vahele\n" +" --exclude-from=FAIL mustrile failist FAIL vastavad failid\n" +" jäetakse vahele\n" +" -L, --files-without-match trüki ainult failinimed, kus mustrit ei leitud\n" +" -l, --files-with-matches trüki ainult failinimed, kus muster leiti\n" +" -c, --count trüki ainult leitud ridade arv faili kaupa\n" +" -Z, --null trüki peale filinime bait 0\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Konteksti kontroll:\n" +" -B, --before-context=NUM trüki NUM rida eelnevat konteksti\n" +" -A, --after-context=NUM trüki NUM rida järgnevat konteksti\n" +" -C, --context[=NUM] trüki NUM rida väljund konteksti\n" +" -NUM sama, kui --context=NUM\n" +" --color[=MILLAL],\n" +" --colour[=MILLAL] kasuta otsitava sõne eristamiseks markereid\n" +" MILLAL võib olla `always', `never' või `auto'.\n" +" -U, --binary ära eemalda rea lõpust CR sümboleid (MSDOS)\n" +" -u, --unix-byte-offsets teata aadressid CR sümboleid arvestamata (MSDOS)\n" +"\n" +"`egrep' tähendab `grep -E'. `fgrep' tähendab `grep -F'.\n" +"Kui FAIL pole antud või kui FAIL väärtus on -, loeb standardsisendit. Kui on\n" +"antud vähem kui kaks faili, eeldatakse võtit -h. Kui muster leitakse,\n" +"lõpetab programm töö koodiga 0, kui ei leita, siis koodiga 1 ja\n" +"kui oli mingi muu probleem, siis koodiga 2.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Teatage palun vigadest aadressil .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "määrati konfliktsed otsijad" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "tundmatu seadmete meetod" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "tundmatu kataloogide meetod" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "vigane maksimum" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "tundmatu kahendfailide tüüp" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Autoriõigus 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"See on vaba tarkvara; kopeerimistingimused leiate lähtetekstidest. Garantii\n" +"PUUDUB; ka müügiks või mingil eesmärgil kasutamiseks, vastavalt seadustega\n" +"lubatud piiridele.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "Võtit -P ei toetata" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Võtmeid -P ja -z ei saa koos kasutada" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Tundmatu süsteemi viga" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: võti `%s' on segane\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: võti `--%s' ei luba argumenti\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: võti `%c%s' ei luba argumenti\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: võti `%s' nõuab argumenti\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: tundmatu võti `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: tundmatu võti `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: lubamatu võti -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: vigane võti -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: võti nõuab argumenti -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: võti `-W %s' on segane\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: võti `-W %s' ei luba argumenti\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "'" diff --git a/src/apps/bin/grep-2.5/po/fr.po b/src/apps/bin/grep-2.5/po/fr.po new file mode 100644 index 0000000000..d7dd249865 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/fr.po @@ -0,0 +1,573 @@ +# Messages français pour GNU concernant grep. +# Copyright (C) 1996 Free Software Foundation, Inc. +# Michel Robitaille , 1996. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-10 08:00-0500\n" +"Last-Translator: Michel Robitaille \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Mémoire épuisée." + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "[ non pairé" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "séquence d'échappement \\ non terminée." + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "décompte de répétition non terminé." + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "décompte de répétition mal formé." + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "( non pairé" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Aucune syntaxe spécifié" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr ") non pairé" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "Mémoire épuisée." + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "Mémoire épuisée." + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "paramètre de contexte de longueur invalide" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "ce qui est en entrée est trop grand pour être compté" + +#: src/grep.c:597 +msgid "writing output" +msgstr "Génération du résultat." + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Fichier binaire %s concorde\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(entrée standard)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "AVERTISSEMENT: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "boucle récursive sur le répertoire" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Usage: %s [OPTION]... PATRON [FICHIER]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Pour en savoir davantage, faites: «%s --help».\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Usage: %s [OPTION]... PATRON [FICHIER] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Recherche du PATRON dans chaque FICHIER ou sur l'entrée standard.\n" +"Exemple: %s -i 'hello world» menu.h main.c\n" +"\n" +"Sélection et interprétation de l'expression régulière:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp PATRON est une expression regulière étendue\n" +" -F, --fixed-regexp PATRON est une chaîne fixe séparée par des retour de chariot\n" +" -G, --basic-regexp PATRON est une expression régulière de base\n" +" -P, --perl-regexp PATRON est une expression régulière en Perl\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=PATTERN utiliser le PATRON comme expression régulière\n" +" -f, --file=FILE obtenir le PATRON du FICHIER\n" +" -i, --ignore-case ignorer la distrinction de la casse\n" +" -w, --word-regexp forcer l'appariement du PATRON que sur des mots complets\n" +" -x, --line-regexp forcer l'appariement du PATRON que sur des lignes entières\n" +" -z, --null-data terminer la ligne de données par ZÉRO et\n" +" non pas par un retour de chariot\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Divers:\n" +" -s, --no-messages supprimer les messages d'erreur\n" +" -v, --revert-match sélectionner les lignes sans concordances\n" +" -V, --version afficher le nom et la version du logiciel\n" +" --help afficher l'aide et quitter\n" +" --mmap utiliser la table de mémoire à l'entrée si possible\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Contrôle de sortie:\n" +" -m, --max-count=N arrêter après N concordances\n" +" -b, --byte-offset afficher les adresses relatives des\n" +" lignes traitées\n" +" -n, --line-number afficher les numéros de lignes des\n" +" lignes traitées\n" +" --line-buffered vider la sortie pour chaque ligne\n" +" -H, --with-filename afficher le nom de fichier pour\n" +" chaque concordance\n" +" -h, --no-filename supprimer le préfixe du nom de fichier\n" +" sur la sortie\n" +" --label=ETIQUETTE afficher l'ÉTIQUETTE comme un nom de\n" +" fichier sur l'entrée standard\n" +" -o, --only-matching afficher la partie d'une ligne concordant avec le PATRON\n" +" -q, --quiet, --silent supprimer tout affichage en sortie\n" +" --binary-files=TYPE assumer que les fichiers binaires sont de\n" +" TYPE soit «binary», «text», ou «without-match»,\n" +" -a, --text ne pas supprimer la sortie binaire\n" +" -I équivalent à --binary-files=without-match\n" +" -d, --directories=ACTION traiter les répertoires selon l'ACTION\n" +" «read» (lecture), «recurse» (récursivité),\n" +" ou «skip» (escamotage).\n" +" -R, -r, --recursive équivalent à --directories=recurse\n" +" --include=PATRON fichiers concordant au PATRON seront examinés\n" +" --exclude=PATRON fichiers concordant au PATRON ne seront pas examinés\n" +" --exclude-from=FICHIER fichiers dont le PATRON concorde dans le fichierseront escamotés\n" +" -L, --files-without-match afficher seulement les noms des fichiers\n" +" ne contenant pas de concordance\n" +" -l, --files-with-matches afficher seulement les noms des fichiers\n" +" contenant des concordances\n" +" -c, --count afficher seulement le décompte des lignes\n" +" concordantes par fichier\n" +" -Z, --null afficher l'octet ZÉRO après le nom du fichier\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Contrôle du contexte:\n" +" -B, --before-context=N imprimer N lignes du contexte d'en-tête\n" +" -A, --after-context=N imprimer N lignes du contexte finale\n" +" -C, --context[=N] imprimer N lignes (2 par défaut) du contexte\n" +" à moins que -A ou -B ne soit spécifié\n" +" -N identique à --context=N\n" +" --color[=DATE],\n" +" --colour[=DATE] utiliser des marqueurs pour distinguer les\n" +" chaînes concordantes\n" +" -U, --binary ne pas enlever les caractères CR sur \n" +" les fins de lignes (MS-DOS)\n" +" -u, --unix-byte-offsets afficher les adresses relatives comme si\n" +" aucun CR n'était présent (MS-DOS)\n" +"\n" +"«egrep» est équivalent à «grep -E». «fgrep» est équivalent à «grep -F».\n" +"Sans FICHIER, ou si - est utilisé comme nom de FICHIER, la lecture\n" +"se fait de l'entrée standard. S'il y a moins de 2 FICHIERS, l'option -h\n" +"est implicite. Termine avec 0 s'il y a concordance avec 1 si aucune.\n" +"Termine avec 2 s'il y a des erreurs de syntaxe ou de système.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Rapporter toutes anomalies à .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "opérateurs de concordance spécifiés en conflit" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "méthode inconnue pour les périphérique" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "méthode inconnue des répertoires" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "décompte maximal invalide." + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "type de fichier binaire inconnu" + +# msgid "GNU grep version %s" +# msgstr "«grep» de GNU version %s" +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (grep de GNU) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Ce logiciel est libre; voir les sources pour les conditions de\n" +"reproduction. AUCUNE garantie n'est donnée; tant pour des raisons\n" +"COMMERCIALES que pour RÉPONDRE À UN BESOIN PARTICULIER.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "L'option -P n'est pas supportée." + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Les options -P et -z ne peuvent être combinées." + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Erreur système inconnue" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: l'option «%s» est ambiguë.\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: l'option «--%s» ne permet pas de paramètre.\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: l'option «%c%s» ne permet pas de paramètre.\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: l'option «%s» requiert un paramètre.\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: l'option «--%s» n'est pas reconnue.\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: l'option «%c%s» n'est pas reconnue.\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: l'option -- %c est illégale.\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: l'option -- %c est invalide.\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'option -- %c requiert un paramètre.\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: l'option «-W %s» est ambiguë.\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: l'option «-W %s» ne permet pas de paramètre.\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "'" + +#~ msgid "option %s" +#~ msgstr "option %s" + +#~ msgid " with arg %s" +#~ msgstr " avec le paramètre %s" + +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "Des chiffres apparaissent dans 2 paramètres différents.\n" + +#~ msgid "option %c\n" +#~ msgstr "option %c\n" + +#~ msgid "option a\n" +#~ msgstr "option a\n" + +#~ msgid "option b\n" +#~ msgstr "option b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "option c ayant pour valeur `%s'\n" + +#~ msgid "option d with value `%s'\n" +#~ msgstr "option d ayant pour valeur `%s'\n" + +#~ msgid "?? getopt returned character code 0%o ??\n" +#~ msgstr "?? getopt() a retourné le code de caractère 0%o ??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "Des élément ARGV qui ne sont pas des options: " + +#~ msgid "memory exhausted\n" +#~ msgstr "Mémoire épuisée.\n" + +#~ msgid "you may specify only one of -E, -F, or -G" +#~ msgstr "Un seul des paramètres suivants peut être spécifié -E, -F ou -G" + +#~ msgid "(standard input)\n" +#~ msgstr "(entrée standard)\n" + +#~ msgid "Regexp selection and interpretation:\n" +#~ msgstr "Sélection de l'EXP_RÉGULIÈRE et interprétation:\n" + +#~ msgid " -E, --extended-regexp PATTERN is an extended regular expression\n" +#~ msgstr " -E, --extended-regexp PATRON est une expression régulière étendue\n" + +#~ msgid " -F, --fixed-strings PATTERN is a fixed string separated by newlines\n" +#~ msgstr "" +#~ " -F, --fixed-strings PATRON est une chaîne de longueur fixe\n" +#~ " séparée par des sauts de ligne\n" + +#~ msgid " -G, --basic-regexp PATTERN is a basic regular expression\n" +#~ msgstr " -G, --basic-regexp PATRON est une expression régulière de base\n" + +#~ msgid " -e, --regexp=PATTERN use PATTERN as a regular expression\n" +#~ msgstr "" +#~ " -e, --regexp=PATRON utiliser le PATRON comme une \n" +#~ " expression régulière\n" + +#~ msgid " -f, --file=FILE obtain PATTERN from FILE\n" +#~ msgstr " -f, --file=FICHIER lire le PATRON à partir du FICHIER\n" + +#~ msgid " -i, --ignore-case ignore case distinctions\n" +#~ msgstr " -i, --ignore-case ignorer la distinction de la casse\n" + +#~ msgid " -w, --word-regexp force PATTERN to match only whole words\n" +#~ msgstr "" +#~ " -w, --word-regexp forcer le PATRON à établir des\n" +#~ " concordances que pour des mots complets\n" + +#~ msgid " -x, --line-regexp force PATTERN to match only whole lines\n" +#~ msgstr "" +#~ " -x, --line-regexp forcer le PATRON à établir des\n" +#~ " concordances que pour des lignes entières\n" + +#~ msgid "Miscellaneous:\n" +#~ msgstr "Divers:\n" + +#~ msgid " -s, --no-messages suppress error messages\n" +#~ msgstr " -s, --no-messages supprimer les messages d'erreur\n" + +#~ msgid " -v, --revert-match select non-matching lines\n" +#~ msgstr " -v, --revert-match sélectionner les lignes sans concordance\n" + +#~ msgid " -V, --version print version information and exit\n" +#~ msgstr " -V, --version afficher le nom et la version du logiciel\n" + +#~ msgid " --help display this help and exit\n" +#~ msgstr " --help afficher l'aide et quitter\n" + +#~ msgid "Output control:\n" +#~ msgstr "Contrôle de sortie:\n" + +#~ msgid " -b, --byte-offset print the byte offset with output lines\n" +#~ msgstr "" +#~ " -b, --byte-offset afficher les adresses relatives avec\n" +#~ " les lignes traitées\n" + +#~ msgid " -n, --line-number print line number with output lines\n" +#~ msgstr "" +#~ " -n, --line-number afficher les numéros de lignes\n" +#~ " avec les lignes traitées\n" + +#~ msgid " -H, --with-filename print the filename for each match\n" +#~ msgstr "" +#~ " -H, --with-filename afficher le nom de fichier pour\n" +#~ " chaque concordance\n" + +#~ msgid " -h, --no-filename suppress the prefixing filename on ouput\n" +#~ msgstr "" +#~ " -h, --no-filename supprimer le préfixe du nom de fichier\n" +#~ " sur la sortie\n" + +#~ msgid " -q, --quiet, --silent suppress all normal output\n" +#~ msgstr " -q, --quiet, --silent supprimer tout affichage en sortie\n" + +#~ msgid " -L, --files-without-match only print FILE names containing no match\n" +#~ msgstr "" +#~ " -L, --files-without-match afficher seulement les noms des fichiers\n" +#~ " ne contenant pas de concordance\n" + +#~ msgid " -l, --files-with-matches only print FILE names containing matches\n" +#~ msgstr "" +#~ " -l, --files-with-matches afficher seulement les noms des fichiers\n" +#~ " contenant des concordances\n" + +#~ msgid " -c, --count only print a count of matching lines per FILE\n" +#~ msgstr "" +#~ " -c, --count afficher seulement le décompte des lignes\n" +#~ " concordantes par fichier\n" + +#~ msgid "Context control:\n" +#~ msgstr "Contrôle du contexte:\n" + +#~ msgid " -B, --before-context=NUM print NUM lines of leading context\n" +#~ msgstr " -B, --before-context=N imprimer N lignes du contexte d'en-tête\n" + +#~ msgid " -A, --after-context=NUM print NUM lines of trailing context\n" +#~ msgstr " -A, --after-context=N imprimer N lignes du contexte finale\n" + +#~ msgid " -NUM same as both -B NUM and -A NUM\n" +#~ msgstr " -NUM identique à -B NUM et -A NUM\n" + +#~ msgid " -C, --context same as -2\n" +#~ msgstr " -C, --context identique à -2\n" + +#~ msgid " -U, --binary do not strip CR characters at EOL\n" +#~ msgstr " -U, --binary ne pas enlever les caractères CR sur les fins de lignes\n" + +#~ msgid " -u, --unix-byte-offsets report offsets as if CRs were not there\n" +#~ msgstr "" +#~ " -u, --unix-byte-offsets afficher les adresses relatives comme si\n" +#~ " aucun CR n'était présent\n" + +#~ msgid "There should be one and only one PATTERN, `-e PATTERN' or `-f FILE'.\n" +#~ msgstr "Il ne devrait y avoir qu'un seul PATRON, -e PATRON ou -f FICHIER.\n" + +#~ msgid "If call as `egrep', this implies -E and `fgrep' for -F.\n" +#~ msgstr "Si appelé via egrep, les options -E et `fgrep' pour -F sont implicites.\n" + +#~ msgid "If no -[GEF], then -G is assumed.\n" +#~ msgstr "" +#~ "Si aucune des options -[GEF] alors -G est implicite.\n" +#~ "Si aucune des options -[GEF] n'est utilisé, l'option -G est implicite.\n" diff --git a/src/apps/bin/grep-2.5/po/gl.po b/src/apps/bin/grep-2.5/po/gl.po new file mode 100644 index 0000000000..8ca37bf611 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/gl.po @@ -0,0 +1,436 @@ +# Galician Translation of grep +# Copyright (C) 2001 Free Software Foundation, Inc. +# Jacobo Tarrío Barreiro , 2001. +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-12 15:58+0100\n" +"Last-Translator: Jacobo Tarrío Barreiro \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Memoria esgotada" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "[ sen emparellar" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Escape \\ sen rematar" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "conta de repeticións sen rematar" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "conta de repeticións mal formulada" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "( sen emparellar" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Sintaxe sen especificar" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr ") sen emparellar" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "memoria esgotada" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "memoria esgotada" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "argumento de lonxitude do contexto non válido" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "a entrada é longa de máis para contala" + +#: src/grep.c:597 +msgid "writing output" +msgstr "escribindo na saída" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Arquivo binario %s aparicións\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(entrada estándar)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "aviso: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "ciclo de directorios recursivo" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Emprego: %s [OPCIÓN]... PATRÓN [FICHEIRO]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Escriba `%s --help' para máis información.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Emprego: %s [OPCIÓN]... PATRÓN [FICHEIRO] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Busca o PATRÓN en cada FICHEIRO ou na entrada estándar.\n" +"Exemplo: %s -i 'ola mundo' menu.h main.c\n" +"\n" +"Selección e interpretación de expresións regulares:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp o PATRÓN é unha expresión regular extendida\n" +" -F, --fixed-strings o PATRÓN é un conxunto de cadeas en distintas liñas\n" +" -G, --basic-regexp o PATRÓN é unha expresión regular básica\n" +" -P, --perl-regexp o PATRÓN é unha expresión regular de Perl\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=PATRÓN usa o PATRÓN coma unha expresión regular\n" +" -f, --file=FICHEIRO obtén o PATRÓN no FICHEIRO\n" +" -i, --ignore-case ignora a distinción entre maiúsculas e minúsculas\n" +" -w, --word-regexp obliga ó PATRON a encaixar con palabras completas\n" +" -x, --line-regexp obliga ó PATRON a encaixar con liñas completas\n" +" -z, --null-data as liñas de datos rematan nun bit 0\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Variadas:\n" +" -s, --no-messages suprime as mensaxes de erro\n" +" -v, --invert-match selecciona as liñas que non encaixan\n" +" -V, --version amosa a información da versión e sae\n" +" --help amosa esta axuda e sae\n" +" --mmap emprega entrada mapeada en memoria se se pode\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Control de saída:\n" +" -m, --max-count=NÚM parar tras NÚM aparicións\n" +" -b, --byte-offset amosa o desprazamento do byte coas liñas de saída\n" +" -n, --line-number amosa o numero de liña coas liñas de saída\n" +" --line-buffered baleira-lo buffer de saída con cada liña\n" +" -H, --with-filename amosa o nome do ficheiro de cada aparición\n" +" -h, --no-filename suprime o prefixo de nome de ficheiro na saída\n" +" --label=ETIQUETA amosa-la ETIQUETA coma o nome da entrada estándar\n" +" -o, --only-matching amosar só a parte da liña que encaixa co PATRÓN\n" +" -q, --quiet, --silent suprime toda a saída normal\n" +" --binary-files=TIPO supoñer que os ficheiros binarios son TIPO\n" +" TIPO é 'binary', 'text' ou 'without-match'\n" +" ('binario', 'texto', ou 'sen aparicións')\n" +" -a, --text equivalente a --binary-files=text\n" +" -I equivalente a --binary-files=without-match\n" +" -d, --directories=ACCION como trata-los directorios\n" +" ACCION é 'read', 'recurse', ou 'skip'.\n" +" ('ler', 'ascender recursivamente', ou 'omitir')\n" +" -D, --devices=ACCIÓN como trata-los dispositivos, FIFOs e sockets\n" +" ACCIÓN é 'read' ou 'skip' ('ler' ou 'omitir')\n" +" -R, -r, --recursive equivalente a --directories=recurse.\n" +" --include=PATRÓN hanse examina-los ficheiros que encaixen no PATRÓN\n" +" --exclude=PATRÓN hanse omiti-los ficheiros que encaixen no PATRÓN\n" +" --exclude-from=FICH hanse omiti-los ficheiros que encaixen nos patróns\n" +" armacenados no FICHeiro\n" +" -L, --files-without-match só amosa os FICHEIROS sen aparicións\n" +" -l, --files-with-matches só amosa os FICHEIROS con aparicións\n" +" -c, --count só amosa o núm. de liñas coincidentes por FICHEIRO\n" +" -Z, --null producir un byte 0 tralo nome do FICHEIRO\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Control de contexto:\n" +" -B, --before-context=NUM amosa NUM liñas de contexto previo\n" +" -A, --after-context=NUM amosa NUM liñas de contexto posterior\n" +" -C, --context=NUM amosa NUM liñas de contexto na saída\n" +" -NUM o mesmo que --context=NUM\n" +" --color[=CANDO],\n" +" --colour[=CANDO] empregar marcadores para distingui-la cadea\n" +" coincidente. CANDO pode ser `always', `never' ou\n" +" `auto' (`sempre', `nunca' ou `auto').\n" +" -U, --binary non elimina os caracteres CR na fin de liña (MSDOS)\n" +" -u, --unix-byte-offsets amosa-los desprazamentos coma se os CR non\n" +" estiveran aí (MSDOS)\n" +"\n" +"`egrep' significa `grep -E'. `fgrep' significa `grep -F'.\n" +"Se non se indica un FICHEIRO, ou cando o FICHEIRO é -, lese da entrada\n" +"estándar. Se se dan menos de dous FICHEIROs, suponse -h. O estado de saída é\n" +"0 se hai aparicións, 1 se non hai, e 2 se o que hai son problemas.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Informe dos erros no programa a .\n" +"Informe dos erros na traducción a .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "especificáronse patróns conflictivos" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "método de dispositivos descoñecido" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "método de directorios descoñecido" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "valor máximo non válido" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "tipo de ficheiros binarios descoñecido" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Isto é software libre; vexa o código funte polas condicións de copia. NON HAI\n" +"garantía; nin sequera de COMERCIABILIDADE ou APTITUDE PARA UN FIN PARTICULAR.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "A opción -P non está soportada" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "As opcións -P e -z non se poden combinar" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Erro do sistema descoñecido" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: a opción `%s' é ambigua\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: a opción `--%s' non admite un argumento\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: a opción `%c%s' non admite un argumento\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: a opción `%s' precisa dun argumento\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opción non recoñecida `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opción non recoñecida `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opción non permitida -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opción non válida -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: a opción precisa dun argumento --%c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: a opción `-W %s' é ambigua\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: a opción `-W %s' non admite un argumento\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "\"" + +#~ msgid "option %s" +#~ msgstr "opción %s" + +#~ msgid " with arg %s" +#~ msgstr " con arg %s" + +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "dixitos aparecen en dous argv-elementos diferentes.\n" + +#~ msgid "option %c\n" +#~ msgstr "opción %c\n" + +#~ msgid "option a\n" +#~ msgstr "opción a\n" + +#~ msgid "option b\n" +#~ msgstr "opción b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "opción c con valor `%s'\n" + +#~ msgid "option d with value `%s'\n" +#~ msgstr "opción d con valor `%s'\n" + +#~ msgid "?? getopt returned character code 0%o ??\n" +#~ msgstr "?? getopt devolveu o código de caracter 0%o ??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "ARGV-elementos no-opción: " + +#~ msgid "you may specify only one of -E, -F, or -G" +#~ msgstr "Debes especificar só un de -E, -F, ou -G" + +#~ msgid "memory exhausted\n" +#~ msgstr "memoria esgotada\n" diff --git a/src/apps/bin/grep-2.5/po/grep.pot b/src/apps/bin/grep-2.5/po/grep.pot new file mode 100644 index 0000000000..89cb2e0e78 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/grep.pot @@ -0,0 +1,333 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-03-13 15:14+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 +#: src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 +#: src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 +#: src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr "" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "" + +#: src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 +#: src/search.c:293 lib/obstack.c:471 +msgid "memory exhausted" +msgstr "" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "" + +#: src/grep.c:479 +msgid "input is too large to count" +msgstr "" + +#: src/grep.c:601 +msgid "writing output" +msgstr "" + +#: src/grep.c:874 +#, c-format +msgid "Binary file %s matches\n" +msgstr "" + +#: src/grep.c:888 +msgid "(standard input)" +msgstr "" + +#: src/grep.c:993 +#, c-format +msgid "warning: %s: %s\n" +msgstr "" + +#: src/grep.c:994 +msgid "recursive directory loop" +msgstr "" + +#: src/grep.c:1042 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "" + +#: src/grep.c:1044 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "" + +#: src/grep.c:1049 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "" + +#: src/grep.c:1050 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" + +#: src/grep.c:1055 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" + +#: src/grep.c:1060 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" + +#: src/grep.c:1067 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" + +#: src/grep.c:1075 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be " +"skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" + +#: src/grep.c:1103 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" + +#: src/grep.c:1120 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" + +#: src/grep.c:1130 +msgid "conflicting matchers specified" +msgstr "" + +#: src/grep.c:1367 +msgid "unknown devices method" +msgstr "" + +#: src/grep.c:1434 +msgid "unknown directories method" +msgstr "" + +#: src/grep.c:1501 +msgid "invalid max count" +msgstr "" + +#: src/grep.c:1555 +msgid "unknown binary-files type" +msgstr "" + +#: src/grep.c:1650 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "" + +#: src/grep.c:1652 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "" + +#: src/grep.c:1654 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "" diff --git a/src/apps/bin/grep-2.5/po/hr.po b/src/apps/bin/grep-2.5/po/hr.po new file mode 100644 index 0000000000..066ba4bdb6 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/hr.po @@ -0,0 +1,351 @@ +# The Croatian translation of grep. +# Copyright (C) 1999 Free Software Foundation, Inc. +# Matej Vela , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.2f\n" +"POT-Creation-Date: 1999-02-03 13:09-0500\n" +"PO-Revision-Date: 1999-07-15 12:34+0200\n" +"Last-Translator: Matej Vela \n" +"Language-Team: Croatian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/dfa.c:155 src/dfa.c:167 src/dfa.c:180 src/grep.c:858 +msgid "Memory exhausted" +msgstr "Memorija iscrpljena" + +#: src/dfa.c:452 +msgid "Unfinished \\ escape" +msgstr "\\ escape nedovr¹en" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {,M} - 0 through M +#. {M,N} - M through N +#: src/dfa.c:564 src/dfa.c:570 src/dfa.c:581 src/dfa.c:592 +msgid "unfinished repeat count" +msgstr "broj ponavljanja nedovr¹en" + +#: src/dfa.c:577 src/dfa.c:591 src/dfa.c:595 +msgid "malformed repeat count" +msgstr "broj ponavljanja neispravan" + +#: src/dfa.c:660 src/dfa.c:663 src/dfa.c:690 src/dfa.c:694 src/dfa.c:695 +#: src/dfa.c:698 src/dfa.c:711 src/dfa.c:712 +msgid "Unbalanced [" +msgstr "[ bez para" + +#: src/dfa.c:849 +msgid "Unbalanced (" +msgstr "( bez para" + +#: src/dfa.c:970 +msgid "No syntax specified" +msgstr "Nije zadana sintaksa" + +#: src/dfa.c:978 +msgid "Unbalanced )" +msgstr ") bez para" + +#: src/dfa.c:1998 +msgid "out of memory" +msgstr "ponestalo memorije" + +#: src/getopt.c:628 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: opcija `%s' je dvosmislena\n" + +#: src/getopt.c:652 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: opcija `--%s' ne dopu¹ta argument\n" + +#: src/getopt.c:657 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: opcija `%c%s' ne dopu¹ta argument\n" + +#: src/getopt.c:674 src/getopt.c:847 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: opcija `%s' zahtijeva argument\n" + +#. --option +#: src/getopt.c:703 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opcija `--%s' neprepoznata\n" + +#. +option or -option +#: src/getopt.c:707 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opcija `%c%s' neprepoznata\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:733 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: neispravna opcija -- %c\n" + +#: src/getopt.c:736 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: neispravna opcija -- %c\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:766 src/getopt.c:896 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opcija zahtijeva argument -- %c\n" + +#: src/getopt.c:813 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: opcija `-W %s' je dvosmislena\n" + +#: src/getopt.c:831 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: opcija `-W %s' ne dopu¹ta argument\n" + +#: src/getopt1.c:132 +#, c-format +msgid "option %s" +msgstr "opcija %s" + +#: src/getopt1.c:134 +#, c-format +msgid " with arg %s" +msgstr " s argumentom %s" + +#: src/getopt1.c:149 +msgid "digits occur in two different argv-elements.\n" +msgstr "znamenke se pojavljuju u dva razlièita elementa argv\n" + +#: src/getopt1.c:151 +#, c-format +msgid "option %c\n" +msgstr "opcija %c\n" + +#: src/getopt1.c:155 +msgid "option a\n" +msgstr "opcija a\n" + +#: src/getopt1.c:159 +msgid "option b\n" +msgstr "opcija b\n" + +#: src/getopt1.c:163 +#, c-format +msgid "option c with value `%s'\n" +msgstr "opcija c s vrijedno¹æu `%s'\n" + +#: src/getopt1.c:167 +#, c-format +msgid "option d with value `%s'\n" +msgstr "opcija d s vrijedno¹æu `%s'\n" + +#: src/getopt1.c:174 +#, c-format +msgid "?? getopt returned character code 0%o ??\n" +msgstr "?? getopt vratio znak 0%o ??\n" + +#: src/getopt1.c:180 +msgid "non-option ARGV-elements: " +msgstr "elementi ARGV-a koji nisu opcije: " + +#: src/grep.c:169 src/grep.c:186 src/grep.c:288 src/grep.c:344 src/kwset.c:184 +#: src/kwset.c:190 +msgid "memory exhausted" +msgstr "memorija iscrpljena" + +#: src/grep.c:372 src/grep.c:843 +#, c-format +msgid "%s: warning: %s: %s\n" +msgstr "%s: upozorenje: %s: %s\n" + +#: src/grep.c:497 src/grep.c:1318 +msgid "writing output" +msgstr "pi¹em izlaz" + +#: src/grep.c:726 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Binarna datoteka %s se podudara\n" + +#: src/grep.c:742 +msgid "(standard input)" +msgstr "(standardni ulaz)" + +#: src/grep.c:844 +msgid "recursive directory loop" +msgstr "petlja u rekurziji direktorijima" + +#: src/grep.c:895 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Kori¹tenje: %s [OPCIJA]... UZORAK [DATOTEKA]...\n" + +#: src/grep.c:896 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Za vi¹e informacija pokrenite `%s --help'.\n" + +#: src/grep.c:900 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Kori¹tenje: %s [OPCIJA]... UZORAK [DATOTEKA] ...\n" + +#: src/grep.c:901 +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"\n" +"Regexp selection and interpretation:\n" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-regexp PATTERN is a fixed string separated by newlines\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +msgstr "" +"Tra¾i UZORAK u svakoj DATOTECI ili standardnom ulazu.\n" +"\n" +"Odabir i tumaèenje regularnih izraza:\n" +" -E, --extended-regexp UZORAK je pro¹ireni regularni izraz\n" +" -F, --fixed-regexp UZORAK je fiksni string razdvojen novim redovima\n" +" -G, --basic-regexp UZORAK je jednostavni regularni izraz\n" +" -e, --regexp=UZORAK koristi UZORAK kao regularni izraz\n" +" -f, --file=DATOTEKA UZORAK pribavi iz DATOTEKE\n" +" -i, --ignore-case zanemaruj razlike izmeðu velikih i malih slova\n" +" -w, --word-regexp UZORAK mo¾e odgovarati samo potpunim rijeèima\n" +" -x, --line-regexp UZORAK mo¾e odgovarati samo potpunim redovima\n" + +#: src/grep.c:913 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --revert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +msgstr "" +"\n" +"Sporedno:\n" +" -s, --no-messages izostavi poruke o gre¹kama\n" +" -v, --revert-match odabiri redove koji ne odgovaraju\n" +" -V, --version ispi¹i informacije o verziji i zavr¹i\n" +" --help prika¾i ovu pomoæ i zavr¹i\n" + +#: src/grep.c:920 +msgid "" +"\n" +"Output control:\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" -a, --text do not suppress binary output\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'.\n" +" -r, --recursive equivalent to --directories=recurse.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +msgstr "" +"\n" +"Kontrola izlaza:\n" +" -b, --byte-offset uz ispisane redove ispisuj polo¾aj bajta\n" +" -n, --line-number uz ispisane redove ispisuj broj reda\n" +" -H, --with-filename za svako podudaranje ispi¹i ime datoteke\n" +" -h, --no-filename u ispisu izostavi imena datoteka\n" +" -q, --quiet, --silent izostavi sav normalni ispis\n" +" -a, --text ne izostavljaj binarni ispis\n" +" -d, --directories=RADNJA kako se nositi s direktorijima:\n" +" RADNJA je 'read', 'recurse', or 'skip'.\n" +" -r, --recursive isto ¹to i --directories=recurse.\n" +" -L, --files-without-match ispisuj samo imena DATOTEKA bez podudaranja\n" +" -l, --files-with-matches ispisuj samo imena DATOTEKA s podudaranjima\n" +" -c, --count ispisuj samo broj podudarajuæih redova po datoteci\n" + +#: src/grep.c:935 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context[=NUM] print NUM (default 2) lines of output context\n" +" unless overriden by -A or -B\n" +" -NUM same as --context=NUM\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"If no -[GEF], then `egrep' assumes -E, `fgrep' -F, else -G.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit with 0 if matches, with 1 if none.\n" +"Exit with 2 if syntax errors or system errors.\n" +msgstr "" +"\n" +"Kontrola konteksta:\n" +" -B, --before-context=BR ispisuj BR redova prethodeæeg konteksta\n" +" -A, --after-context=BR ispisuj BR redova sljedeæeg konteksta\n" +" -C, --context[=BR] ispisuj BR (podrazumijevano 2) redova konteksta\n" +" osim ako je drukèije odreðeno pomoæu -A ili -B\n" +" -BR isto ¹to i --context=BR\n" +" -U, --binary ne uklanjaj CR znakove na kraju reda (MSDOS)\n" +" -u, --unix-byte-offsets prikazuj polo¾aje kao da CR-ova nema (MSDOS)\n" +"\n" +"Ako nije zadano -[GEF], onda `egrep' podrazumijeva -E, `fgrep' -F, a inaèe\n" +"-G. Ako DATOTEKA nije zadana, ili ako je DATOTEKA -, èitaj standardni ulaz.\n" +"Ako su zadane manje od dvije DATOTEKE, pretpostavi -h. Zavr¹i uz 0 ako ima\n" +"podudaranja, uz 1 ako nema. Zavr¹i uz 2 ako bude gre¹aka u sintaksi ili u\n" +"sustavu.\n" + +#: src/grep.c:950 +msgid "\nReport bugs to .\n" +msgstr "\nBugove prijavljujte na .\n" + +#: src/grep.c:1093 src/grep.c:1100 src/grep.c:1109 +msgid "invalid context length argument" +msgstr "neispravan argument duljine konteksta" + +#: src/grep.c:1116 src/grep.c:1121 src/grep.c:1126 +msgid "you may specify only one of -E, -F, or -G" +msgstr "mo¾ete navesti samo jedno od -E, -F ili -G" + +#: src/grep.c:1145 +msgid "matcher already specified" +msgstr "izraz veæ zadan" + +#: src/grep.c:1166 +msgid "unknown directories method" +msgstr "nepoznata metoda za direktorije" + +#: src/grep.c:1252 +#, c-format +msgid "grep (GNU grep) %s\n" +msgstr "grep (GNU grep) %s\n" + +#: src/grep.c:1254 +msgid "Copyright (C) 1988, 1992-1997, 1998 Free Software Foundation, Inc.\n" +msgstr "Copyright (C) 1988, 1992-1997, 1998 Free Software Foundation, Inc.\n" + +#: src/grep.c:1256 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Ovo je slobodan program; za uvjete kopiranja pogledajte izvorni kod. NEMA\n" +"jamstva; èak ni za TRGOVINSKU PRIKLADNOST ili ODGOVARANJE ODREÐENOJ SVRSI.\n" + +#: src/obstack.c:467 +msgid "memory exhausted\n" +msgstr "memorija iscrpljena\n" diff --git a/src/apps/bin/grep-2.5/po/id.po b/src/apps/bin/grep-2.5/po/id.po new file mode 100644 index 0000000000..8975a3800f --- /dev/null +++ b/src/apps/bin/grep-2.5/po/id.po @@ -0,0 +1,358 @@ +# grep-2.3f (Indonesian). +# Copyright (C) 1999 Free Software Foundation, Inc. +# Tedi Heriyanto , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.3f.id.po\n" +"POT-Creation-Date: 1999-10-05 22:33-0400\n" +"PO-Revision-Date: 1999-10-29 16:04+07:00\n" +"Last-Translator: Tedi Heriyanto \n" +"Language-Team: Indonesian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/dfa.c:155 src/dfa.c:167 src/dfa.c:180 src/grep.c:898 +msgid "Memory exhausted" +msgstr "Memori habis" + +#: src/dfa.c:457 +msgid "Unfinished \\ escape" +msgstr "escape \\\\ tidak selesai" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:590 src/dfa.c:596 src/dfa.c:606 src/dfa.c:614 src/dfa.c:629 +msgid "unfinished repeat count" +msgstr "perulangan count tidak selesai" + +#: src/dfa.c:603 src/dfa.c:620 src/dfa.c:628 src/dfa.c:632 +msgid "malformed repeat count" +msgstr "perulangan count salah bentuk" + +#: src/dfa.c:697 src/dfa.c:700 src/dfa.c:727 src/dfa.c:731 src/dfa.c:732 +#: src/dfa.c:735 src/dfa.c:748 src/dfa.c:749 +msgid "Unbalanced [" +msgstr "[ tidak seimbang" + +#: src/dfa.c:886 +msgid "Unbalanced (" +msgstr "( tidak seimbang" + +#: src/dfa.c:1007 +msgid "No syntax specified" +msgstr "Tidak ada syntax dispesifikasikan" + +#: src/dfa.c:1015 +msgid "Unbalanced )" +msgstr ") tidak seimbang" + +#: src/dfa.c:2036 +msgid "out of memory" +msgstr "memori habis" + +#: src/getopt.c:628 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: opsi `%s' rancu\n" + +#: src/getopt.c:652 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: opsi `--%s' tidak mengijinkan argumen\n" + +#: src/getopt.c:657 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: opsi `%c%s' tidak mengijinkan argumen\n" + +#: src/getopt.c:674 src/getopt.c:847 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: opsi `%s' membutuhkan sebuah argumen\n" + +#. --option +#: src/getopt.c:703 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opsi tidak dikenal `--%s'\n" + +#. +option or -option +#: src/getopt.c:707 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opsi tidak dikenal `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:733 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opsi ilegal -- %c\n" + +#: src/getopt.c:736 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opsi tidak valid -- %c\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:766 src/getopt.c:896 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opsi membutuhkan sebuah argumen -- %c\n" + +#: src/getopt.c:813 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: opsi `-W %s' rancu\n" + +#: src/getopt.c:831 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: opsi `-W %s' tidak mengijinkan sebuah argumen\n" + +#: src/getopt1.c:132 +#, c-format +msgid "option %s" +msgstr "opsi %s" + +#: src/getopt1.c:134 +#, c-format +msgid " with arg %s" +msgstr " dengan arg %s" + +#: src/getopt1.c:149 +msgid "digits occur in two different argv-elements.\n" +msgstr "digit muncul dalam dua argv-elemen yang berbeda.\n" + +#: src/getopt1.c:151 +#, c-format +msgid "option %c\n" +msgstr "opsi %c\n" + +#: src/getopt1.c:155 +msgid "option a\n" +msgstr "opsi a\n" + +#: src/getopt1.c:159 +msgid "option b\n" +msgstr "opsi b\n" + +#: src/getopt1.c:163 +#, c-format +msgid "option c with value `%s'\n" +msgstr "opsi c dengan nilai `%s'\n" + +#: src/getopt1.c:167 +#, c-format +msgid "option d with value `%s'\n" +msgstr "opsi d dengan nilai `%s'\n" + +#: src/getopt1.c:174 +#, c-format +msgid "?? getopt returned character code 0%o ??\n" +msgstr "?? getopt mengembalikan kode karakter 0%o ??\n" + +#: src/getopt1.c:180 +msgid "non-option ARGV-elements: " +msgstr "elemen-ARGV bukan opsi: " + +#: src/grep.c:179 src/grep.c:196 src/grep.c:292 src/grep.c:387 src/kwset.c:184 +#: src/kwset.c:190 +msgid "memory exhausted" +msgstr "memori habis" + +#: src/grep.c:418 src/grep.c:883 +#, c-format +msgid "%s: warning: %s: %s\n" +msgstr "%s: peringatan: %s: %s\n" + +#: src/grep.c:543 src/grep.c:1429 +msgid "writing output" +msgstr "menulis output" + +#: src/grep.c:775 +#, c-format +msgid "Binary file %s matches\n" +msgstr "File biner %s cocok\n" + +#: src/grep.c:791 +msgid "(standard input)" +msgstr "(input standar)" + +#: src/grep.c:884 +msgid "recursive directory loop" +msgstr "perulangan direktori rekursif" + +#: src/grep.c:935 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Pemakaian: %s [OPSI]... POLA [FILE]...\n" + +#: src/grep.c:936 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Coba `%s --help' untuk informasi lebih lanjut.\n" + +#: src/grep.c:940 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Pemakaian: %s [OPSI]... POLA [FILE] ...\n" + +#: src/grep.c:941 +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Mencari POLA dalams setiap FILE atau input standar.\n" +"\n" +"Seleksi dan interpretasi regexp:\n" + +#: src/grep.c:945 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-regexp PATTERN is a fixed string separated by newlines\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +msgstr "" +" -E, --extended-regexp POLA adalah ekspresi reguler ekstended\n" +" -F, --fixed-regexp POLA adalah string tetap yang dipisah oleh newline\n" +" -G, --basic-regexp POLA adalah ekspresi reguler dasar\n" + +#: src/grep.c:949 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=POLA gunakan POLA sebagai ekspresi reguler\n" +" -f, --file=FILE dapatkan pola dari FILE\n" +" -i, --ignore-case abaikan perbedaan case\n" +" -w, --word-regexp paksa POLA hanya cocok dengan keseluruhan kata\n" +" -x, --line-regexp paksa POLA hanya cocok dengan keseluruhan baris\n" +" -z, --null-data baris data berakhir dalam 0 byte, bukan newline\n" +"\n" + +#: src/grep.c:956 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +msgstr "" +"\n" +"Lain-lain:\n" +" -s, --no-messages tiadakan pesan kesalahan\n" +" -v, --invert-match pilih baris-baris yang tidak sesuai\n" +" -V, --version tampilkan informasi versi dan keluar\n" +" --help tampilkan bantuan ini dan keluar\n" + +#: src/grep.c:963 +msgid "" +"\n" +"Output control:\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" -a, --text do not suppress binary output\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'.\n" +" -r, --recursive equivalent to --directories=recurse.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Kendali output:\n" +" -b, --byte-offset cetak offset byte dengan baris output\n" +" -n, --line-number cetak nomor baris dengan baris output\n" +" -H, --with-filename cetak namafile untuk setiap kecocokan\n" +" -h, --no-filename tiadakan namafile di output\n" +" -q, --quiet, --silent tiadakan seluruh output normal\n" +" -a, --text jangan tiadakan output biner\n" +" -d, --directories=AKSI bagaimana menangani direktori\n" +" AKSI adalah 'read', 'recurse', atau 'skip'.\n" +" -r, --recursive ekivalen dengan --directories=recurse.\n" +" -L, --files-without-match hanya mencetak nama FILE yang tidak ada kecocokan\n" +" -l, --files-with-match hanya mencetak nama FILE yang ada kecocokan\n" +" -c, --count hanya mencetak jumlah baris yang cocok per FILE\n" +" -Z, --null mencetak byte 0 setelah nama FILE\n" + +#: src/grep.c:979 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context[=NUM] print NUM (default 2) lines of output context\n" +" unless overriden by -A or -B\n" +" -NUM same as --context=NUM\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit with 0 if matches, with 1 if none.\n" +"Exit with 2 if syntax errors or system errors.\n" +msgstr "" +"\n" +"Kendali Konteks:\n" +" -B, --before-context=NUM mencetak NUM baris leading context\n" +" -A, --after-context=NUM mencetak NUM baris trailing context\n" +" -C, --context[=NUM] mencetak NUM (baku 2) baris konteks output \n" +" kecuali di-override dengan -A atau -B\n" +" -NUM sama seperti --context=NUM\n" +" -U, --binary jangan hapus karakter CR di EOL (MSDOS)\n" +" -u, --unix-byte-offsets laporkan offset seperti bila CR tidak ada (MSDOS)\n" +"\n" +"`egrep' berarti `grep -E'. `fgrep' berarti `grep -F'.\n" +"Dengan tanpa FILE, atau ketika FILE adalah -, baca input standar. Jika diberi \n" +"kurang dari dua file, asumsikan -h. Keluar dengan 0 jika cocok, dengan 1 jika\n" +"tidak. Keluar dengan 2 jika terjadi syntax atau system error.\n" + +#: src/grep.c:994 +msgid "\nReport bugs to .\n" +msgstr "\nLaporkan kesalahan ke .\n" + +#: src/grep.c:1005 +msgid "conflicting matchers specified" +msgstr "dispesifikasikan matcher yang konflik" + +#: src/grep.c:1204 src/grep.c:1211 src/grep.c:1220 +msgid "invalid context length argument" +msgstr "argumen panjang konteks tidak valid" + +#: src/grep.c:1271 +msgid "unknown directories method" +msgstr "metode direktori tidak dikenal" + +#: src/grep.c:1366 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1368 +msgid "Copyright (C) 1988, 1992-1998, 1999 Free Software Foundation, Inc.\n" +msgstr "Hak Cipta (C) 1988, 1992-1998, 1999 Free Software Foundation, Inc.\n" + +#: src/grep.c:1370 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Ini adalah free software; lihat sumber untuk syarat penyalinan. Tidak ada\n" +"jaminan; sekalipun untuk PENJUALAN atau KESESUAIAN UNTUK TUJUAN TERTENTU.\n" + +#: src/obstack.c:467 +msgid "memory exhausted\n" +msgstr "memori habis\n" diff --git a/src/apps/bin/grep-2.5/po/it.po b/src/apps/bin/grep-2.5/po/it.po new file mode 100644 index 0000000000..02e7e09570 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/it.po @@ -0,0 +1,400 @@ +# traduzione di grep +# Copyright (C) 1999, 2001 Free Software Foundation, Inc. +# Marco d'Itri , 1999, 2001. +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-08 00:20+0100\n" +"Last-Translator: Marco d'Itri \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Memoria esaurita" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "[ non bilanciata" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Escape \\ incompleto" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "numero di ripetizioni incompleto" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "numero di ripetizioni malformato" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "( non bilanciata" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Nessuna sintassi specificata" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr ") non bilanciata" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "memoria esaurita" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "memoria esaurita" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "argomento della lunghezza del contesto non valido" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "l'input è troppo grande per essere contato" + +#: src/grep.c:597 +msgid "writing output" +msgstr "scrittura dell'output" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Il file binario %s corrisponde\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(standard input)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "attenzione: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "loop ricorsivo di directory" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Uso: %s [OPZIONE]... MODELLO [FILE]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Usare `%s --help' per ulteriori informazioni.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Uso: %s [OPZIONE]... MODELLO [FILE] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Cerca il MODELLO in ogni FILE o nello standard input.\n" +"Esempio: %s -i 'hello world' menu.h main.c\n" +"\n" +"Selezione ed interpretazione delle regexp:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp il MODELLO è una regular expression estesa\n" +" -F, --fixed-strings il MODELLO è un insieme di stringhe separate da\n" +" newline\n" +" -G, --basic-regexp il MODELLO è una regular expression semplice\n" +" -P, --perl-regexp il MODELLO è una regular expression del perl\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=MODELLO usa MODELLO come espressione regolare\n" +" -f, --file=FILE prende il MODELLO dal FILE\n" +" -i, --ignore-case ignora la distinzione tra maiuscole e minuscole\n" +" -w, --word-regexp forza MODELLO a corrispondere solo a parole intere\n" +" -x, --line-regexp forza MODELLO a corrispondere solo a righe intere\n" +" -z, --null-data una riga di dati termina con \\0 invece che newline\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Varie:\n" +" -s, --no-messages elimina i messaggi di errore\n" +" -v, --invert-match seleziona le righe che non corrispondono\n" +" -V, --version stampa le informazioni sulla versione ed esce\n" +" --help mostra questo aiuto ed esce\n" +" --mmap se possibile mappa in memoria l'input\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Controllo dell'output:\n" +" -m, --max-count=NUM si ferma dopo NUM corrispondenze\n" +" -b, --byte-offset stampa l'offset del byte con le righe di output\n" +" -n, --line-number stampa il numero della riga con le righe di output\n" +" --line-buffered fa il flush dell'output dopo ogni riga\n" +" -H, --with-filename stampa il nome del file per ogni corrispondenza\n" +" -h, --no-filename elimina il nome del file davanti all'output\n" +" --label=LABEL stampa LABEL al posto del nome del file per stdin\n" +" -o, --only-matching mostra solo la parte della riga corrispondente al\n" +" MODELLO\n" +" -q, --quiet, --silent elimina tutto il normale output\n" +" --binary-files=TIPO suppone che i file binari siano di TIPO 'binary',\n" +" 'text' oppure 'without-match'.\n" +" -a, --text equivalente a --binary-files=text\n" +" -I equivalente a --binary-files=without-match\n" +" -d, --directories=AZIONE come gestire le directory: AZIONE è 'read' (legge),\n" +" 'recurse' (ricorsivo) o 'skip' (salta)\n" +" -D, --devices=AZIONE come gestire device, FIFO e socket: AZIONE è\n" +" 'read' (legge) o 'skip' (salta) \n" +" -r, --recursive equivalente a --directories=recurse\n" +" --include=MODELLO esamina i file corrispondenti al MODELLO\n" +" --exclude=MODELLO salta i file corrispondenti al MODELLO\n" +" --exclude-from=FILE salta i file corrispondenti ai modelli nel FILE\n" +" -L, --files-without-match stampa solo i nomi dei FILE senza occorrenze\n" +" -l, --files-with-matches stampa solo i nomi dei FILE contenenti occorrenze\n" +" -c, --count stampa solo il conto delle righe occorrenti in ogni FILE\n" +" -Z, --null stampa il byte 0 dopo ogni nome di FILE\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Controllo del contesto:\n" +" -B, --before-context=NUM stampa NUM righe di contesto precedente\n" +" -A, --after-context=NUM stampa NUM righe di contesto seguente\n" +" -C, --context=NUM stampa NUM righe di contesto dell'output\n" +" -NUM come --context=NUM\n" +" --color[=QUANDO]\n" +" --colour[=QUANDO] usa i colori per distinguere la stringa corrispond.\n" +" QUANDO può essere 'always', 'never' o 'auto'.\n" +" -U, --binary non rimuove i caratteri CR all'EOL (MSDOS)\n" +" -u, --unix-byte-offsets segnala gli offset come se non ci fossero CR (MSDOS)\n" +"\n" +"`egrep' significa `grep -E'. `fgrep' significa `grep -F'.\n" +"Se non c'è un FILE, o il FILE è -, legge lo standard input. Se sono stati\n" +"specificati meno di due file presume -h. Esce con 0 se corrisponde, con 1 se\n" +"non corrisponde o con 2 se ci sono problemi.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Segnalare i bug a .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "specificate corrispondenze in conflitto" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "metodo per i dispositivi sconosciuto" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "metodo per le directory sconosciuto" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "numero massimo non valido" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "tipo di file binario sconosciuto" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (grep GNU) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +"\n" +"Questo è software libero; si veda il sorgente per le condizioni di copiatura.\n" +"NON c'è garanzia; neppure di COMMERCIABILITÀ o IDONEITÀ AD UN PARTICOLARE\n" +"SCOPO.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "L'opzione -P non è gestita" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Le opzioni -P e -z non possono essere combinate" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Errore di sistema sconosciuto" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: l'opzione `%s' è ambigua\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: l'opzione `--%s' non accetta argomenti\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: l'opzione `%c%s' non accetta argomenti\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: l'opzione `%s' richiede un argomento\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opzione `--%s' non riconosciuta\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opzione `%c%s' non riconosciuta\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opzione illegale -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opzione non valida -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'opzione richiede un argomento -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: l'opzione `-W %s' è ambigua\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: l'opzione `-W %s' non accetta argomenti\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "'" diff --git a/src/apps/bin/grep-2.5/po/ja.po b/src/apps/bin/grep-2.5/po/ja.po new file mode 100644 index 0000000000..4c7d5e88fb --- /dev/null +++ b/src/apps/bin/grep-2.5/po/ja.po @@ -0,0 +1,387 @@ +# Japanese messages for GNU grep +# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. +# IIDA Yosiaki , 1999, 2000, 2001. +# This file is distributed under the same license as the GNU grep package. +# Contributed by +# Yasuyuki Furukawa , 1997 +# and taken over on 1999-09-24 by IIDA. +# Special thanks to +# Daisuke Yamashita , 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5e\n" +"POT-Creation-Date: 2001-03-07 00:02-0500\n" +"PO-Revision-Date: 2002-02-08 22:15+0900\n" +"Last-Translator: IIDA Yosiaki \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-JP\n" +"Content-Transfer-Encoding: 8bit\n" +"Comments: This file is part of GNU grep.\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/grep.c:944 src/search.c:706 +msgid "Memory exhausted" +msgstr "¥á¥â¥ê¡¼¤¬Â­¤ê¤Þ¤»¤ó" + +#: src/dfa.c:486 src/dfa.c:489 src/dfa.c:507 src/dfa.c:518 src/dfa.c:542 +#: src/dfa.c:601 src/dfa.c:606 src/dfa.c:619 src/dfa.c:620 src/dfa.c:998 +#: src/dfa.c:1001 src/dfa.c:1025 src/dfa.c:1029 src/dfa.c:1030 src/dfa.c:1033 +#: src/dfa.c:1045 src/dfa.c:1046 +msgid "Unbalanced [" +msgstr "[ ¤¬Äà¤ê¹ç¤¤¤Þ¤»¤ó" + +#: src/dfa.c:738 +msgid "Unfinished \\ escape" +msgstr "\\ ¥¨¥¹¥±¡¼¥×¤¬½ªÎ»¤·¤Æ¤¤¤Þ¤»¤ó" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:871 src/dfa.c:877 src/dfa.c:887 src/dfa.c:895 src/dfa.c:910 +msgid "unfinished repeat count" +msgstr "·«ÊÖ¤·¥«¥¦¥ó¥È¤¬½ªÎ»¤·¤Þ¤»¤ó" + +#: src/dfa.c:884 src/dfa.c:901 src/dfa.c:909 src/dfa.c:913 +msgid "malformed repeat count" +msgstr "·«ÊÖ¤·¥«¥¦¥ó¥È¤¬°Û¾ï¤Ç¤¹" + +#: src/dfa.c:1232 +msgid "Unbalanced (" +msgstr "( ¤¬Äà¤ê¹ç¤¤¤Þ¤»¤ó" + +#: src/dfa.c:1357 +msgid "No syntax specified" +msgstr "¹½Ê¸¤¬ÆÃÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó" + +#: src/dfa.c:1365 +msgid "Unbalanced )" +msgstr ") ¤¬Äà¤ê¹ç¤¤¤Þ¤»¤ó" + +#: src/dfa.c:2933 +msgid "out of memory" +msgstr "¥á¥â¥ê¡¼¤¬¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿" + +#: lib/obstack.c:471 src/grep.c:343 src/kwset.c:171 src/kwset.c:177 +#: src/search.c:103 src/search.c:223 src/search.c:307 +msgid "memory exhausted" +msgstr "¥á¥â¥ê¡¼¤¬Â­¤ê¤Þ¤»¤ó" + +#: src/grep.c:191 +msgid "invalid context length argument" +msgstr "¹Ô¿ô¤Î»ØÄ꤬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹" + +#: src/grep.c:466 +msgid "input is too large to count" +msgstr "ÆþÎϤ¬Â礭¤¹¤®¤Æ¿ô¤¨¤é¤ì¤Þ¤»¤ó" + +#: src/grep.c:539 +msgid "writing output" +msgstr "½ÐÎϤνñ¹þ¤ß" + +#: src/grep.c:812 +#, c-format +msgid "Binary file %s matches\n" +msgstr "¥Ð¥¤¥Ê¥ê¡¼¡¦¥Õ¥¡¥¤¥ë%s¤Ï°ìÃפ·¤Þ¤·¤¿\n" + +#: src/grep.c:826 +msgid "(standard input)" +msgstr "(ɸ½àÆþÎÏ)" + +#: src/grep.c:931 +#, c-format +msgid "warning: %s: %s\n" +msgstr "·Ù¹ð: %s: %s\n" + +#: src/grep.c:932 +msgid "recursive directory loop" +msgstr "¥Ç¥£¥ì¥¯¥È¥ê¡¼¤¬ºÆµ¢Åª¥ë¡¼¥×¤ò¤·¤Æ¤¤¤Þ¤¹" + +#: src/grep.c:980 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "»ÈÍÑË¡: %s [¥ª¥×¥·¥ç¥ó]¡Å¡Å ʸ»úÎó¥Ñ¥¿¡¼¥ó [¥Õ¥¡¥¤¥ë]¡Å¡Å\n" + +#: src/grep.c:982 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "¾Ü¤·¤¯¤Ï`%s --help'¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£\n" + +#: src/grep.c:987 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "»ÈÍÑË¡: %s [¥ª¥×¥·¥ç¥ó]¡Å¡Å ¥Ñ¥¿¡¼¥ó [¥Õ¥¡¥¤¥ë] ¡Å¡Å\n" + +#: src/grep.c:988 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"¡Ö¥Õ¥¡¥¤¥ë¡×¤â¤·¤¯¤Ïɸ½àÆþÎϤ«¤é¡Ö¥Ñ¥¿¡¼¥ó¡×¤Î¸¡º÷¤ò¹Ô¤Ê¤¦¡£\n" +"Îã: %s -i 'hello world' menu.h main.c\n" +"\n" +"Àµµ¬É½¸½¤ÎÁªÂò¤È²ò¼áÊýË¡:\n" + +#: src/grep.c:993 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp ¡Ö¥Ñ¥¿¡¼¥ó¡×¤ò³ÈÄ¥¤µ¤ì¤¿Àµµ¬É½¸½¤È¤¹¤ë\n" +" -F, --fixed-strings ¡Ö¥Ñ¥¿¡¼¥ó¡×¤ò²þ¹Ô¤Ç¶èÀÚ¤é¤ì¤¿¸ÇÄê¤Îʸ»úÎó¤È¤¹¤ë\n" +" -G, --basic-regexp ¡Ö¥Ñ¥¿¡¼¥ó¡×¤ò´ðËÜŪ¤ÊÀµµ¬É½¸½¤È¤¹¤ë\n" +" -P, --perl-regexp ¡Ö¥Ñ¥¿¡¼¥ó¡×¤òPerl¤ÎÀµµ¬É½¸½¤È¤¹¤ë\n" + +#: src/grep.c:998 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=¥Ñ¥¿¡¼¥ó Àµµ¬É½¸½¤Ë»ØÄê¥Ñ¥¿¡¼¥ó¤ò»È¤¦\n" +" -f, --file=¥Õ¥¡¥¤¥ë ¡Ö¥Ñ¥¿¡¼¥ó¡×¤ò»ØÄê¥Õ¥¡¥¤¥ë¤«¤éÆɤà\n" +" -i, --ignore-case Âçʸ»ú/¾®Ê¸»ú¤ò̵»ë¤¹¤ë\n" +" -w, --word-regexp ¡Ö¥Ñ¥¿¡¼¥ó¡×°ìÃפòñ¸ìÁ´ÂÎ(ñ¸ìñ°Ì)¤Ç¹Ô¤Ê¤¦\n" +" -x, --line-regexp ¡Ö¥Ñ¥¿¡¼¥ó¡×°ìÃפò¹ÔÁ´ÂÎ(¹Ôñ°Ì)¤Ç¹Ô¤Ê¤¦\n" +" -z, --null-data ½ÐÎϤò²þ¹Ô¤Ç¤Ê¤¯¡¢¥Ì¥ëÃͤΥХ¤¥È¤Ç¶èÀÚ¤ë\n" + +#: src/grep.c:1005 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"¤½¤Î¾:\n" +" -s, --no-messages ¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤òÍ޻ߤ¹¤ë\n" +" -v, --invert-match °ìÃפ·¤Ê¤¤¹Ô¤òÂоݤˤ¹¤ë\n" +" -V --version ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɸ½à½ÐÎϤËɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë\n" +" --help »È¤¤Êý¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë\n" +" --mmap ¤â¤·²Äǽ¤Ê¤é¡¢ÆþÎϤò¥á¥â¥ê¡¼¡¦¥Þ¥Ã¥×¤¹¤ë\n" + +#: src/grep.c:1013 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examine\n" +" --exclude=PATTERN files that match PATTERN will be skip.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skip.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"½ÐÎÏÀ©¸æ:\n" +" -m, --max-count=²ó¿ô »ØÄꤷ¤¿°ìÃײó¿ô¤Î¸å¡¢½ªÎ»¤¹¤ë\n" +" -b, --byte-offset ³Æ°ìÃפËÂФ·¤Æ¤½¤Î¥Ð¥¤¥È¡¦¥ª¥Õ¥»¥Ã¥È¤âɽ¼¨¤¹¤ë\n" +" -n, --line-number ³Æ°ìÃפËÂФ·¤Æ¤½¤Î¹Ô¿ô¤âɽ¼¨¤¹¤ë\n" +" --line-buffered ¹Ô¤´¤È¤Ë½ÐÎϤòÁݤ­½Ð¤¹\n" +" -H, --with-filename ³Æ°ìÃפËÂФ·¤Æ¤½¤Î¥Õ¥¡¥¤¥ë̾¤âɽ¼¨¤¹¤ë\n" +" -h, --no-filename ¥Õ¥¡¥¤¥ë̾¤òɽ¼¨¤·¤Ê¤¤\n" +" -q, --quiet, --silent Ä̾ï¤Î½ÐÎϤò¤¹¤Ù¤ÆÍ޻ߤ¹¤ë\n" +" --binary-files=·¿ ¥Ð¥¤¥Ê¥ê¡¼¡¦¥Õ¥¡¥¤¥ë¤Î¡Ö·¿¡×¡£¡Öbinary¡×\n" +" ¡Ötext¡×¡Öwithout-match¡×¤ò»ØÄê¡£\n" +" -a, --text --binary-files=text¤ÈƱ¤¸\n" +" -I --binary-files=without-match¤ÈƱ¤¸\n" +" -d, --directories=Áàºî ¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ø¤ÎÁàºî¡£¡Öread¡×(Æɹþ¤ß)¡¢\n" +" ¡Örecurse¡×(ºÆµ¢)¡¢¡Öskip¡×(¾Êά)¤ò»ØÄê\n" +" -R, -r, --recursive --directories=recurse¤ÈƱ¤¸\n" +" --include=¥Ñ¥¿¡¼¥ó ¥Ñ¥¿¡¼¥ó¤È°ìÃפ¹¤ë¥Õ¥¡¥¤¥ë¤ò¸¡ºº¤¹¤ë\n" +" --exclude=¥Ñ¥¿¡¼¥ó ¥Ñ¥¿¡¼¥ó¤È°ìÃפ¹¤ë¥Õ¥¡¥¤¥ë¤ò¾Êά¤¹¤ë¡£\n" +" --exclude-from=¥Õ¥¡¥¤¥ë »ØÄꤷ¤¿¥Õ¥¡¥¤¥ëÆâ¤Î¡Ö¥Ñ¥¿¡¼¥ó¡×¤È\n" +" °ìÃפ¹¤ë¥Õ¥¡¥¤¥ë¤ò¾Êά¤¹¤ë¡£\n" +" -L, --files-without-match °ìÃפΤʤ«¤Ã¤¿¥Õ¥¡¥¤¥ë̾¤Î¤ß¤òɽ¼¨¤¹¤ë\n" +" -l, --files-with-matches °ìÃפ·¤¿¥Õ¥¡¥¤¥ë̾¤Î¤ß¤òɽ¼¨¤¹¤ë\n" +" -c, --count ¥Õ¥¡¥¤¥ë¤´¤È¤Ë°ìÃפ·¤¿¹Ô¿ô¤Î¤ß¤òɽ¼¨¤¹¤ë\n" +" -Z, --null ¥Õ¥¡¥¤¥ë̾¤Î¸å¤Ë¡¢¥Ì¥ëÃͤΥХ¤¥È¤òɽ¼¨\n" + +#: src/grep.c:1037 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color, --colour use markers to distinguish the matching string\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Á°¸å´Ø·¸¤ÎÀ©¸æ:\n" +" -B, --before-context=¿ô °ìÃ×Á°¤Î¡Ö¿ô¡×¹Ô¤â½ÐÎϤ¹¤ë\n" +" -A, --after-context=¿ô °ìÃ׸å¤Î¡Ö¿ô¡×¹Ô¤â½ÐÎϤ¹¤ë\n" +" -C, --context=¹Ô¿ô °ìÃ×Á°¸å¤Î»ØÄê¹Ô¿ô¤ÎÆâÍƤâ½ÐÎϤ¹¤ë\n" +" -¹Ô¿ô --context=¹Ô¿ô ¤ÈƱ¤¸\n" +" --color, --colour use markers to distinguish the matching string\n" +" -U, --binary EOL¤Ç¤ÎCRʸ»ú¤ò¼è¤ê¾Ê¤«¤Ê¤¤(MS-DOS)\n" +" -u, --unix-byte-offsets CRʸ»ú¤¬¤Ê¤¤¤â¤Î¤È¤·¤Æ¥ª¥Õ¥»¥Ã¥È¤ò\n" +" ½ÐÎϤ¹¤ë(MS-DOS)\n" +"\n" +"¡Öegrep¡×¤Ï¡Ögrep -E¡×¤Î¤³¤È¤Ç¤¹¡£¡Öfgrep¡×¤Ï¡Ögrep -F¡×¤Î¤³¤È¤Ç¤¹¡£\n" +"¡Ö¥Õ¥¡¥¤¥ë¡×¤Î»ØÄ꤬¤Ê¤«¤Ã¤¿¤ê¡¢¡Ö¥Õ¥¡¥¤¥ë¡×¤Ë¡Ö-¡×¤ò»ØÄꤷ¤¿¤ê¤¹¤ë¤È¡¢\n" +"ɸ½àÆþÎϤ«¤éÆɤ߹þ¤ß¤Þ¤¹¡£¡Ö¥Õ¥¡¥¤¥ë¡×¤Î¸Ä¿ô¤¬1°Ê²¼¤Î¾ì¹ç¡¢-h¤È²¾Äꤷ¤Þ¤¹¡£\n" +"¤â¤·°ìÃפ¬¤¢¤ë¤È0¤Ç¡¢¤Ê¤¤¤È1¤Ç¡¢¾ã³²¤¬¤¢¤ë¤È2¤Ç¡¢½ªÎ»¤·¤Þ¤¹¡£\n" + +#: src/grep.c:1052 +msgid "\nReport bugs to .\n" +msgstr "\n¥Ð¥°¤Ï ¤ØÊó¹ð¤·¤Æ¤¯¤À¤µ¤¤¡£\n" + +#: src/grep.c:1062 +msgid "conflicting matchers specified" +msgstr "»ØÄꤷ¤¿¾È¹ç»Ò¤¬¾×Æͤ·¤Æ¤¤¤Þ¤¹" + +#: src/grep.c:1355 +msgid "unknown directories method" +msgstr "̤ÃΤΥǥ£¥ì¥¯¥È¥ê¡¼Áàºî¤Ç¤¹" + +#: src/grep.c:1422 +msgid "invalid max count" +msgstr "°ìÃײó¿ô¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹" + +#: src/grep.c:1472 +msgid "unknown binary-files type" +msgstr "̤ÃΤΥХ¤¥Ê¥ê¡¼¡¦¥Õ¥¡¥¤¥ë¤Î·¿¤Ç¤¹" + +#: src/grep.c:1543 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1545 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1547 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"¤³¤ì¤Ï¥Õ¥ê¡¼¡¦¥½¥Õ¥È¥¦¥§¥¢¤Ç¤¹¡£Ê£À½¤Ë´Ø¤¹¤ë¾ò·ï¤Ï¥½¡¼¥¹¤ò¤´Í÷¤¯¤À¤µ¤¤¡£\n" +"¤³¤ì¤Ï̵ÊݾڤǤ¹¡£±ÄÍøÌÜŪ¤ä¤¢¤ëÆÃÄê¤ÎÌÜŪ¤Ë¤à¤±¤¿Å¬Àµ¤Î¤â¤Î¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£\n" + +#: src/search.c:623 +msgid "The -P option is not supported" +msgstr "-P¥ª¥×¥·¥ç¥ó¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó" + +#: src/search.c:636 +msgid "The -P and -z options cannot be combined" +msgstr "-P¤È-z¤Î¥ª¥×¥·¥ç¥ó¤ÎÁȹ礻¤Ï¤Ç¤­¤Þ¤»¤ó" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "̤ÃΤΥ·¥¹¥Æ¥à¡¦¥¨¥é¡¼¤Ç¤¹" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó¤Î»ØÄê`%s'¤¬Û£Ëæ¤Ç¤¹\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó`--%s'¤Ï°ú¿ô¤ò¤È¤ê¤Þ¤»¤ó\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó`%c%s'¤Ï°ú¿ô¤ò¤È¤ê¤Þ¤»¤ó\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó`-%s'¤Ë¤Ï°ú¿ô¤¬É¬ÍפǤ¹\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó`--%s'¤òǧ¼±¤Ç¤­¤Þ¤»¤ó\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó`%c%s'¤òǧ¼±¤Ç¤­¤Þ¤»¤ó\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹ -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó¤¬ÉÔÀµ¤Ç¤¹ -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó`-%c'¤Ë¤Ï°ú¿ô¤¬É¬ÍפǤ¹\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó¤Î»ØÄê`-W %s'¤¬Û£Ëæ¤Ç¤¹\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: ¥ª¥×¥·¥ç¥ó`-W %s'¤Ï°ú¿ô¤ò¤È¤ê¤Þ¤»¤ó\n" + +#. 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. +#: lib/quotearg.c:265 +msgid "`" +msgstr "¡È" + +#: lib/quotearg.c:266 +msgid "'" +msgstr "¡É" diff --git a/src/apps/bin/grep-2.5/po/ko.po b/src/apps/bin/grep-2.5/po/ko.po new file mode 100644 index 0000000000..98cbfc227c --- /dev/null +++ b/src/apps/bin/grep-2.5/po/ko.po @@ -0,0 +1,397 @@ +# Korean messages for GNU grep. +# Copyright (C) 1996, 1997 Free Software Foundation, Inc. +# Bang Jun-Young , 1996-1997. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.0f\n" +"POT-Creation-Date: 1999-02-03 13:09-0500\n" +"PO-Revision-Date: 1997-09-03 11:19+0900\n" +"Last-Translator: Bang Jun-Young \n" +"Language-Team: Korean \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-KR\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:155 src/dfa.c:167 src/dfa.c:180 src/grep.c:858 +msgid "Memory exhausted" +msgstr "¸Þ¸ð¸®°¡ ¹Ù´Ú³²" + +#: src/dfa.c:452 +msgid "Unfinished \\ escape" +msgstr "¿Ï°áµÇÁö ¾ÊÀº \\ À̽ºÄÉÀÌÇÁ" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {,M} - 0 through M +#. {M,N} - M through N +#: src/dfa.c:564 src/dfa.c:570 src/dfa.c:581 src/dfa.c:592 +msgid "unfinished repeat count" +msgstr "¿Ï°áµÇÁö ¾ÊÀº ¹Ýº¹ ȸ¼ö" + +#: src/dfa.c:577 src/dfa.c:591 src/dfa.c:595 +msgid "malformed repeat count" +msgstr "À߸ø ÁÖ¾îÁø ¹Ýº¹ ȸ¼ö" + +#: src/dfa.c:660 src/dfa.c:663 src/dfa.c:690 src/dfa.c:694 src/dfa.c:695 +#: src/dfa.c:698 src/dfa.c:711 src/dfa.c:712 +msgid "Unbalanced [" +msgstr "¦ÀÌ ¸ÂÁö ¾Ê´Â [" + +#: src/dfa.c:849 +msgid "Unbalanced (" +msgstr "¦ÀÌ ¸ÂÁö ¾Ê´Â (" + +#: src/dfa.c:970 +msgid "No syntax specified" +msgstr "¹®¹ýÀÌ ÁöÁ¤µÇÁö ¾Ê¾ÒÀ½" + +#: src/dfa.c:978 +msgid "Unbalanced )" +msgstr "¦ÀÌ ¸ÂÁö ¾Ê´Â )" + +#: src/dfa.c:1998 +msgid "out of memory" +msgstr "¸Þ¸ð¸® ºÎÁ·" + +#: src/getopt.c:628 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: `%s'´Â ¸ðÈ£ÇÑ ¿É¼ÇÀÔ´Ï´Ù\n" + +#: src/getopt.c:652 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: `--%s' ¿É¼ÇÀº Àμö¸¦ Çã¿ëÇÏÁö ¾Ê½À´Ï´Ù\n" + +#: src/getopt.c:657 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: `%c%s' ¿É¼ÇÀº Àμö¸¦ Çã¿ëÇÏÁö ¾Ê½À´Ï´Ù\n" + +#: src/getopt.c:674 src/getopt.c:847 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: `%s' ¿É¼ÇÀº Àμö°¡ ÇÊ¿äÇÕ´Ï´Ù\n" + +#. --option +#: src/getopt.c:703 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ÀνÄÇÒ ¼ö ¾ø´Â ¿É¼Ç `--%s'\n" + +#. +option or -option +#: src/getopt.c:707 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ÀνÄÇÒ ¼ö ¾ø´Â ¿É¼Ç `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:733 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: À߸øµÈ ¿É¼Ç -- %c\n" + +#: src/getopt.c:736 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ºÎÀûÀýÇÑ ¿É¼Ç -- %c\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:766 src/getopt.c:896 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: ÀÌ ¿É¼ÇÀº Àμö°¡ ÇÊ¿äÇÕ´Ï´Ù -- %c\n" + +#: src/getopt.c:813 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: `-W %s'´Â ¸ðÈ£ÇÑ ¿É¼ÇÀÔ´Ï´Ù\n" + +#: src/getopt.c:831 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: `-W %s' ¿É¼ÇÀº Àμö¸¦ Çã¿ëÇÏÁö ¾Ê½À´Ï´Ù\n" + +#: src/getopt1.c:132 +#, c-format +msgid "option %s" +msgstr "%s ¿É¼Ç" + +#: src/getopt1.c:134 +#, c-format +msgid " with arg %s" +msgstr " %s Àμö¸¦ °¡Áü" + +#: src/getopt1.c:149 +msgid "digits occur in two different argv-elements.\n" +msgstr "¼ýÀÚ°¡ ¼­·Î ´Ù¸¥ µÎ ±ºµ¥ÀÇ argv ¿ø¼Ò¿¡¼­ ¹ß°ßµÇ¾ú½À´Ï´Ù.\n" + +#: src/getopt1.c:151 +#, c-format +msgid "option %c\n" +msgstr "%c ¿É¼Ç\n" + +#: src/getopt1.c:155 +msgid "option a\n" +msgstr "a ¿É¼Ç\n" + +#: src/getopt1.c:159 +msgid "option b\n" +msgstr "b ¿É¼Ç\n" + +#: src/getopt1.c:163 +#, c-format +msgid "option c with value `%s'\n" +msgstr "`%s'¸¦ °ªÀ¸·Î °®´Â c ¿É¼Ç\n" + +#: src/getopt1.c:167 +#, c-format +msgid "option d with value `%s'\n" +msgstr "`%s'¸¦ °ªÀ¸·Î °®´Â d ¿É¼Ç\n" + +#: src/getopt1.c:174 +#, c-format +msgid "?? getopt returned character code 0%o ??\n" +msgstr "?? getopt°¡ ¹®ÀÚ ÄÚµå 0%o¸¦ µ¹·ÁÁÖ¾ú½À´Ï´Ù ??\n" + +#: src/getopt1.c:180 +msgid "non-option ARGV-elements: " +msgstr "ºñ¿É¼Ç ARGV ¿ø¼Ò: " + +#: src/grep.c:169 src/grep.c:186 src/grep.c:288 src/grep.c:344 src/kwset.c:184 +#: src/kwset.c:190 +msgid "memory exhausted" +msgstr "¸Þ¸ð¸®°¡ ¹Ù´Ú³²" + +#: src/grep.c:372 src/grep.c:843 +#, c-format +msgid "%s: warning: %s: %s\n" +msgstr "%s: °æ°í: %s: %s\n" + +#: src/grep.c:497 src/grep.c:1318 +msgid "writing output" +msgstr "Ãâ·ÂÀ» ±â·ÏÇÏ°í ÀÖ½À´Ï´Ù" + +#: src/grep.c:726 +#, c-format +msgid "Binary file %s matches\n" +msgstr "" + +#: src/grep.c:742 +msgid "(standard input)" +msgstr "(Ç¥ÁØ ÀÔ·Â)" + +#: src/grep.c:844 +msgid "recursive directory loop" +msgstr "" + +#: src/grep.c:895 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "»ç¿ë¹ý: %s [¿É¼Ç]... ÆÐÅÏ [ÆÄÀÏ]...\n" + +#: src/grep.c:896 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "´õ ¸¹Àº Á¤º¸¸¦ º¸·Á¸é `%s --help' ÇϽʽÿÀ.\n" + +#: src/grep.c:900 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "»ç¿ë¹ý: %s [¿É¼Ç]... ÆÐÅÏ [ÆÄÀÏ] ...\n" + +#: src/grep.c:901 +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"\n" +"Regexp selection and interpretation:\n" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-regexp PATTERN is a fixed string separated by newlines\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +msgstr "" + +#: src/grep.c:913 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --revert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +msgstr "" + +#: src/grep.c:920 +msgid "" +"\n" +"Output control:\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" -a, --text do not suppress binary output\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'.\n" +" -r, --recursive equivalent to --directories=recurse.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +msgstr "" + +#: src/grep.c:935 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context[=NUM] print NUM (default 2) lines of output context\n" +" unless overriden by -A or -B\n" +" -NUM same as --context=NUM\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"If no -[GEF], then `egrep' assumes -E, `fgrep' -F, else -G.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit with 0 if matches, with 1 if none.\n" +"Exit with 2 if syntax errors or system errors.\n" +msgstr "" + +#: src/grep.c:950 +#, fuzzy +msgid "\nReport bugs to .\n" +msgstr "¹®Á¦Á¡Àº ·Î º¸°íÇØ ÁֽʽÿÀ.\n" + +#: src/grep.c:1093 src/grep.c:1100 src/grep.c:1109 +msgid "invalid context length argument" +msgstr "" + +#: src/grep.c:1116 src/grep.c:1121 src/grep.c:1126 +msgid "you may specify only one of -E, -F, or -G" +msgstr "-E, -F, -G Áß¿¡¼­ Çϳª¸¸ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù" + +#: src/grep.c:1145 +msgid "matcher already specified" +msgstr "¦ÀÌ ÀÌ¹Ì ÁöÁ¤µÇ¾úÀ½" + +#: src/grep.c:1166 +msgid "unknown directories method" +msgstr "" + +#: src/grep.c:1252 +#, c-format +msgid "grep (GNU grep) %s\n" +msgstr "grep (GNU grep) %s\n" + +#: src/grep.c:1254 +#, fuzzy +msgid "Copyright (C) 1988, 1992-1997, 1998 Free Software Foundation, Inc.\n" +msgstr "ÀúÀÛ±Ç (C) 1988, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.\n" + +#: src/grep.c:1256 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"ÀÌ ÇÁ·Î±×·¥Àº °ø°³ ¼ÒÇÁÆ®¿þ¾îÀÔ´Ï´Ù. º¹»ç¿¡ °üÇÑ Á¶°ÇÀº ¼Ò½º¸¦ ÂüÁ¶ÇϽʽÿÀ.\n" +"»óÇ°¼ºÀ̳ª ƯÁ¤ ¸ñÀû¿¡ ´ëÇÑ ÀûÇÕ¼ºÀ» ºñ·ÔÇÏ¿©, ¾î¶°ÇÑ º¸Áõµµ ÇÏÁö ¾Ê½À´Ï´Ù.\n" + +#: src/obstack.c:467 +msgid "memory exhausted\n" +msgstr "¸Þ¸ð¸®°¡ ¹Ù´Ú³²\n" + +#~ msgid "Regexp selection and interpretation:\n" +#~ msgstr "Á¤±Ô½Ä ¼±Åðú Çؼ®:\n" + +#~ msgid " -E, --extended-regexp PATTERN is an extended regular expression\n" +#~ msgstr " -E, --extended-regexp ÆÐÅÏÀº È®Àå Á¤±Ô½ÄÀÌ µË´Ï´Ù\n" + +#~ msgid " -F, --fixed-strings PATTERN is a fixed string separated by newlines\n" +#~ msgstr " -F, --fixed-strings ÆÐÅÏÀº ÁÙ¹Ù²Þ ¹®ÀÚ·Î ºÐ¸®µÈ °íÁ¤ ¹®ÀÚ¿­ÀÌ µË´Ï´Ù\n" + +#~ msgid " -G, --basic-regexp PATTERN is a basic regular expression\n" +#~ msgstr " -G, --basic-regexp ÆÐÅÏÀº ±âº» Á¤±Ô½ÄÀÌ µË´Ï´Ù\n" + +#~ msgid " -e, --regexp=PATTERN use PATTERN as a regular expression\n" +#~ msgstr " -e, --regexp=ÆÐÅÏ ÆÐÅÏÀ» Á¤±Ô½ÄÀ¸·Î »ç¿ëÇÕ´Ï´Ù\n" + +#~ msgid " -f, --file=FILE obtain PATTERN from FILE\n" +#~ msgstr " -f, --file=ÆÄÀÏ ÆÐÅÏÀ» ÆÄÀÏ¿¡¼­ °¡Á®¿É´Ï´Ù\n" + +#~ msgid " -i, --ignore-case ignore case distinctions\n" +#~ msgstr " -i, --ignore-case ´ë¼Ò¹®ÀÚ ±¸º°À» ¹«½ÃÇÕ´Ï´Ù\n" + +#~ msgid " -w, --word-regexp force PATTERN to match only whole words\n" +#~ msgstr " -w, --word-regexp ÆÐÅÏÀ» Àüü ´Ü¾î¿Í ÀÏÄ¡ÇÏ´Â °ÍÀ¸·Î¸¸ Á¦ÇÑÇÕ´Ï´Ù\n" + +#~ msgid " -x, --line-regexp force PATTERN to match only whole lines\n" +#~ msgstr " -x, --line-regexp ÆÐÅÏÀ» Àüü Çà°ú ÀÏÄ¡ÇÏ´Â °ÍÀ¸·Î¸¸ Á¦ÇÑÇÕ´Ï´Ù\n" + +#~ msgid "Miscellaneous:\n" +#~ msgstr "±âŸ:\n" + +#~ msgid " -s, --no-messages suppress error messages\n" +#~ msgstr " -s, --no-messages ¿À·ù ¸Þ½ÃÁö¸¦ Ç¥½ÃÇÏÁö ¾Ê½À´Ï´Ù\n" + +#~ msgid " -v, --revert-match select non-matching lines\n" +#~ msgstr " -v, --revert-match ÀÏÄ¡ÇÏÁö ¾Ê´Â ÇàµéÀ» ¼±ÅÃÇÕ´Ï´Ù\n" + +#~ msgid " -V, --version print version information and exit\n" +#~ msgstr " -V, --version ¹öÀü Á¤º¸¸¦ Ç¥½ÃÇÏ°í Á¾·áÇÕ´Ï´Ù\n" + +#~ msgid " --help display this help and exit\n" +#~ msgstr " --help ÀÌ µµ¿ò¸»À» Ç¥½ÃÇÏ°í Á¾·áÇÕ´Ï´Ù\n" + +#~ msgid "Output control:\n" +#~ msgstr "Ãâ·Â Á¦¾î:\n" + +#~ msgid " -b, --byte-offset print the byte offset with output lines\n" +#~ msgstr " -b, --byte-offset Ãâ·ÂµÇ´Â Çà¿¡ ¹ÙÀÌÆ® ¿ÀÇÁ¼ÂÀ» Ç¥½ÃÇÕ´Ï´Ù\n" + +#~ msgid " -n, --line-number print line number with output lines\n" +#~ msgstr " -n, --line-number Ãâ·ÂµÇ´Â Çà¿¡ Çà¹øÈ£¸¦ Ç¥½ÃÇÕ´Ï´Ù\n" + +#~ msgid " -H, --with-filename print the filename for each match\n" +#~ msgstr " -H, --with-filename °¢°¢ÀÇ ÀÏÄ¡ °á°ú¿¡ ´ëÇØ ÆÄÀϸíÀ» Ç¥½ÃÇÕ´Ï´Ù\n" + +#~ msgid " -q, --quiet, --silent suppress all normal output\n" +#~ msgstr " -q, --quiet, --silent ÀϹÝÀûÀÎ ¸ðµç Ãâ·ÂÀ» Ç¥½ÃÇÏÁö ¾Ê½À´Ï´Ù\n" + +#~ msgid " -L, --files-without-match only print FILE names containing no match\n" +#~ msgstr " -L, --files-without-match ÀÏÄ¡ °á°ú°¡ ¾ø´Â ÆÄÀÏ À̸§¸¸ Ç¥½ÃÇÕ´Ï´Ù\n" + +#~ msgid " -l, --files-with-matches only print FILE names containing matches\n" +#~ msgstr " -l, --files-with-matches ÀÏÄ¡ °á°ú°¡ Æ÷ÇÔµÈ ÆÄÀÏ À̸§¸¸ Ç¥½ÃÇÕ´Ï´Ù\n" + +#~ msgid " -c, --count only print a count of matching lines per FILE\n" +#~ msgstr " -c, --count ÆÄÀÏ´ç ÀÏÄ¡ÇÏ´Â ÇàÀÇ °³¼ö¸¸À» Ç¥½ÃÇÕ´Ï´Ù\n" + +#~ msgid "Context control:\n" +#~ msgstr "¹®¸Æ Á¦¾î:\n" + +#~ msgid " -NUM same as both -B NUM and -A NUM\n" +#~ msgstr " -¼ýÀÚ -B ¼ýÀÚ³ª -A ¼ýÀÚ¿Í °°À½\n" + +#~ msgid " -C, --context same as -2\n" +#~ msgstr " -C, --context -2¿Í °°À½\n" + +#~ msgid " -U, --binary do not strip CR characters at EOL\n" +#~ msgstr " -U, --binary ÇೡÀÇ CR ¹®ÀÚ¸¦ À߶ó³»Áö ¾Ê½À´Ï´Ù\n" + +#~ msgid " -u, --unix-byte-offsets report offsets as if CRs were not there\n" +#~ msgstr " -u, --unix-byte-offsets CRÀ» Á¦¿ÜÇÏ°í ¿ÀÇÁ¼ÂÀ» »êÃâÇÕ´Ï´Ù\n" + +#~ msgid "If call as `egrep', this implies -E and `fgrep' for -F.\n" +#~ msgstr "`egrep'À¸·Î È£ÃâµÇ¸é -E·Î °¡Á¤µÇ°í `fgrep'ÀÏ ¶§¿¡´Â -F°¡ °¡Á¤µË´Ï´Ù.\n" + +#~ msgid "If no -[GEF], then -G is assumed.\n" +#~ msgstr "-[GEF]°¡ ÁÖ¾îÁöÁö ¾ÊÀ¸¸é -G·Î °¡Á¤ÇÕ´Ï´Ù.\n" + +#~ msgid "(standard input)\n" +#~ msgstr "(Ç¥ÁØ ÀÔ·Â)\n" diff --git a/src/apps/bin/grep-2.5/po/nb.po b/src/apps/bin/grep-2.5/po/nb.po new file mode 100644 index 0000000000..793a9b829d --- /dev/null +++ b/src/apps/bin/grep-2.5/po/nb.po @@ -0,0 +1,353 @@ +# Norwegian messages for GNU Grep version 2.2. (bokmål dialect) +# Copyright (C) 1996 Free Software Foundation, Inc. +# Karl Anders Øygard , 1996. +# +# Eivind Tagseth , 1997 +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.2\n" +"POT-Creation-Date: 1999-02-03 13:09-0500\n" +"PO-Revision-Date: 1998-08-01 13:45+0200\n" +"Last-Translator: Eivind Tagseth \n" +"Language-Team: Norwegian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:155 src/dfa.c:167 src/dfa.c:180 src/grep.c:858 +msgid "Memory exhausted" +msgstr "Minnet oppbrukt" + +#: src/dfa.c:452 +msgid "Unfinished \\ escape" +msgstr "Uferdig \\-beskyttelse" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {,M} - 0 through M +#. {M,N} - M through N +#: src/dfa.c:564 src/dfa.c:570 src/dfa.c:581 src/dfa.c:592 +msgid "unfinished repeat count" +msgstr "uferdig gjentagelsesantall" + +#: src/dfa.c:577 src/dfa.c:591 src/dfa.c:595 +msgid "malformed repeat count" +msgstr "feilaktig gjentagelsesantall" + +#: src/dfa.c:660 src/dfa.c:663 src/dfa.c:690 src/dfa.c:694 src/dfa.c:695 +#: src/dfa.c:698 src/dfa.c:711 src/dfa.c:712 +msgid "Unbalanced [" +msgstr "Ubalansert [" + +#: src/dfa.c:849 +msgid "Unbalanced (" +msgstr "Ubalansert (" + +#: src/dfa.c:970 +msgid "No syntax specified" +msgstr "Ingen syntaks spesifisert" + +#: src/dfa.c:978 +msgid "Unbalanced )" +msgstr "Ubalansert )" + +#: src/dfa.c:1998 +msgid "out of memory" +msgstr "tomt for minne" + +#: src/getopt.c:628 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: flagget «%s» er flertydig\n" + +#: src/getopt.c:652 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: flagget «--%s» tar ikke argumenter\n" + +#: src/getopt.c:657 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: flagget «%c%s» tar ikke argumenter\n" + +#: src/getopt.c:674 src/getopt.c:847 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: flagget «%s» trenger et argument\n" + +#. --option +#: src/getopt.c:703 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ukjent flagg «--%s»\n" + +#. +option or -option +#: src/getopt.c:707 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ukjent flagg «%c%s»\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:733 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ulovlig flagg -- %c\n" + +#: src/getopt.c:736 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ugyldig flagg -- %c\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:766 src/getopt.c:896 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flagget behøver et argument -- %c\n" + +#: src/getopt.c:813 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: flagget «-W %s» er flertydig\n" + +#: src/getopt.c:831 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: flagget «-W %s» tar ikke argumenter\n" + +#: src/getopt1.c:132 +#, c-format +msgid "option %s" +msgstr "flagg %s" + +#: src/getopt1.c:134 +#, c-format +msgid " with arg %s" +msgstr " med arg %s" + +#: src/getopt1.c:149 +msgid "digits occur in two different argv-elements.\n" +msgstr "tallene forekommer i to forskjellige argv-elementer.\n" + +#: src/getopt1.c:151 +#, c-format +msgid "option %c\n" +msgstr "flagg %c\n" + +#: src/getopt1.c:155 +msgid "option a\n" +msgstr "flagg a\n" + +#: src/getopt1.c:159 +msgid "option b\n" +msgstr "flagg b\n" + +#: src/getopt1.c:163 +#, c-format +msgid "option c with value `%s'\n" +msgstr "flagg c med verdi «%s»\n" + +#: src/getopt1.c:167 +#, c-format +msgid "option d with value `%s'\n" +msgstr "flagg d med verdi «%s»\n" + +#: src/getopt1.c:174 +#, c-format +msgid "?? getopt returned character code 0%o ??\n" +msgstr "?? getopt returnerte tegnverdien 0%o ??\n" + +#: src/getopt1.c:180 +msgid "non-option ARGV-elements: " +msgstr "ARGV-elementer som ikke er flagg: " + +#: src/grep.c:169 src/grep.c:186 src/grep.c:288 src/grep.c:344 src/kwset.c:184 +#: src/kwset.c:190 +msgid "memory exhausted" +msgstr "minnet oppbrukt" + +#: src/grep.c:372 src/grep.c:843 +#, c-format +msgid "%s: warning: %s: %s\n" +msgstr "%s: advarsel: %s: %s\n" + +#: src/grep.c:497 src/grep.c:1318 +msgid "writing output" +msgstr "skriver utdata" + +#: src/grep.c:726 +#, c-format +msgid "Binary file %s matches\n" +msgstr "" + +#: src/grep.c:742 +msgid "(standard input)" +msgstr "(standard inn)" + +#: src/grep.c:844 +msgid "recursive directory loop" +msgstr "" + +#: src/grep.c:895 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Bruk: %s [FLAGG]... MØNSTER [FIL]...\n" + +#: src/grep.c:896 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Prøv «%s --help» for mer informasjon.\n" + +#: src/grep.c:900 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Bruk: %s [FLAGG]... MØNSTER [FIL] ...\n" + +#: src/grep.c:901 +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"\n" +"Regexp selection and interpretation:\n" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-regexp PATTERN is a fixed string separated by newlines\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +msgstr "" +"Søk etter MØNSTER i hver FIL eller standard inn.\n" +"\n" +"Regexp valg og fortolkning:\n" +" -E, --extended-regexp MØNSTER er et utvidet regulært uttrykk\n" +" -F, --fixed-regexp MØNSTER er en fast streng separert med linjeskift\n" +" -G, --basic-regexp MØNSTER er et grunnleggende regulært uttrykk\n" +" -e, --regexp=MØNSTER bruk MØNSTER som et regulært uttrykk\n" +" -f, --file=FIL hent MØNSTER fra FIL\n" +" -i, --ignore-case se bort ifra forskjellen på store og små bokstaver\n" +" -w, --word-regexp MØNSTER må stemme overens med hele ord\n" +" -x, --line-regexp MØNSTER må stemme overens med hele linjer\n" + +#: src/grep.c:913 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --revert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +msgstr "" +"\n" +"Diverse:\n" +" -s, --no-messages undertrykk feilmeldinger\n" +" -v, --revert-match velg linjer som ikke passer\n" +" -V, --version vis versioninformasjon og avslutt\n" +" --help vis denne helpeteksten og avslutt\n" + +#: src/grep.c:920 +#, fuzzy +msgid "" +"\n" +"Output control:\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" -a, --text do not suppress binary output\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'.\n" +" -r, --recursive equivalent to --directories=recurse.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +msgstr "" +"\n" +"Ut-kontroll:\n" +" -b, --byte-offset skriv tegnposisjon med utlinjene\n" +" -n, --line-number skriv linjenummeret med utlinjene\n" +" -H, --with-filename skriv filnavnet for hver treff\n" +" -h, --no-filename ikke skriv filnavnet\n" +" -q, --quiet, --silent undertrykk all vanlig utskrift\n" +" -L, --files-without-match skriv bare ut navnene på FILene som ikke\n" +" inneholder treff\n" +" -l, --files-with-matches skriv bare ut navnene på FILene som inneholder\n" +" treff\n" +" -c, --count skriv bare ut antall linjer som inneholder treff\n" +" per FIL\n" + +#: src/grep.c:935 +#, fuzzy +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context[=NUM] print NUM (default 2) lines of output context\n" +" unless overriden by -A or -B\n" +" -NUM same as --context=NUM\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"If no -[GEF], then `egrep' assumes -E, `fgrep' -F, else -G.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit with 0 if matches, with 1 if none.\n" +"Exit with 2 if syntax errors or system errors.\n" +msgstr "" +"\n" +"Kontekst-kontroll:\n" +" -B, --before-context=ANT skriv ANT linjer med ledende kontekst\n" +" -A, --after-context=ANT skriv ANT linjer med etterfølgende kontekst\n" +" -ANT samme som både -B ANT og -A ANT\n" +" -C, --context samme som -2\n" +" -U, --binary ikke fjern CR-tegn ved EOL (MSDOS)\n" +" -u, --unix-byte-offsets rapporter posisjoner som om CRene ikke var der\n" +" (MSDOS)\n" + +#: src/grep.c:950 +msgid "\nReport bugs to .\n" +msgstr "\nRapportér feil til .\n" + +#: src/grep.c:1093 src/grep.c:1100 src/grep.c:1109 +msgid "invalid context length argument" +msgstr "ugyldig kontekstlengde" + +#: src/grep.c:1116 src/grep.c:1121 src/grep.c:1126 +msgid "you may specify only one of -E, -F, or -G" +msgstr "du kan bare spesifisere en av -E, -F eller -G" + +#: src/grep.c:1145 +msgid "matcher already specified" +msgstr "søkeuttrykk er allerede spesifisert" + +#: src/grep.c:1166 +msgid "unknown directories method" +msgstr "" + +#: src/grep.c:1252 +#, c-format +msgid "grep (GNU grep) %s\n" +msgstr "grep (GNU grep) %s\n" + +#: src/grep.c:1254 +#, fuzzy +msgid "Copyright (C) 1988, 1992-1997, 1998 Free Software Foundation, Inc.\n" +msgstr "Copyright (C) 1988, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.\n" + +#: src/grep.c:1256 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Dette er fri programvare, se kildekoden for kopieringsbetingelser. Det\n" +"er INGEN garanti, ikke en gang for SALGBARHET eller EGNETHET FOR NOEN \n" +"SPESIELL OPPGAVE.\n" + +#: src/obstack.c:467 +msgid "memory exhausted\n" +msgstr "minnet oppbrukt\n" + +#~ msgid "(standard input)\n" +#~ msgstr "(standard inn)\n" diff --git a/src/apps/bin/grep-2.5/po/nl.po b/src/apps/bin/grep-2.5/po/nl.po new file mode 100644 index 0000000000..87bce12195 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/nl.po @@ -0,0 +1,337 @@ +# Dutch messages for GNU grep. +# Copyright (C) 1996, 2000 Free Software Foundation, Inc. +# Ivo Timmermans , 2000. +# Erick Branderhorst , 1996. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.4f\n" +"POT-Creation-Date: 2000-02-02 01:04-0500\n" +"PO-Revision-Date: 2000-05-21 03:57+02:00\n" +"Last-Translator: Ivo Timmermans \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:163 src/dfa.c:174 src/dfa.c:185 src/grep.c:902 +msgid "Memory exhausted" +msgstr "Geen geheugen meer beschikbaar" + +#: src/dfa.c:448 +msgid "Unfinished \\ escape" +msgstr "Onafgemaakte \\ escape" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:581 src/dfa.c:587 src/dfa.c:597 src/dfa.c:605 src/dfa.c:620 +msgid "unfinished repeat count" +msgstr "Onafgemaakt herhalingsaantal" + +#: src/dfa.c:594 src/dfa.c:611 src/dfa.c:619 src/dfa.c:623 +msgid "malformed repeat count" +msgstr "foutief herhalingsaantal" + +#: src/dfa.c:688 src/dfa.c:691 src/dfa.c:718 src/dfa.c:722 src/dfa.c:723 +#: src/dfa.c:726 src/dfa.c:739 src/dfa.c:740 +msgid "Unbalanced [" +msgstr "Ongebalanceerde [" + +#: src/dfa.c:886 +msgid "Unbalanced (" +msgstr "Ongebalanceerde (" + +#: src/dfa.c:1000 +msgid "No syntax specified" +msgstr "Geen syntax opgegeven" + +#: src/dfa.c:1008 +msgid "Unbalanced )" +msgstr "Ongebalanceerde )" + +#: src/dfa.c:1994 +msgid "out of memory" +msgstr "geheugen is op" + +#: src/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: optie `%s' is dubbelzinnig\n" + +#: src/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: optie `--%s' staat geen argumenten toe\n" + +#: src/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: optie `%c%s' staat geen argumenten toe\n" + +#: src/getopt.c:723 src/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: optie `%s' vereist een argument\n" + +#. --option +#: src/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: Onbekende optie `--%s'\n" + +#. +option or -option +#: src/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: onbekende optie `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ongeldige optie -- %c\n" + +#: src/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ongeldige optie -- %c\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:815 src/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: optie vereist een argument -- %c\n" + +#: src/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: optie `-W %s' is dubbelzinnig\n" + +#: src/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: optie `-W %s' staat geen argumenten toe\n" + +#: src/grep.c:185 src/grep.c:200 src/grep.c:293 src/grep.c:399 src/kwset.c:180 +#: src/kwset.c:186 src/obstack.c:471 +msgid "memory exhausted" +msgstr "geen geheugen meer beschikbaar" + +#: src/grep.c:550 src/grep.c:1441 +msgid "writing output" +msgstr "schrijven van uitvoer" + +#: src/grep.c:777 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Binair bestand %s komt overeen\n" + +#: src/grep.c:791 +msgid "(standard input)" +msgstr "(standaardinvoer)" + +#: src/grep.c:887 +#, c-format +msgid "%s: warning: %s: %s\n" +msgstr "%s: let op: %s: %s\n" + +#: src/grep.c:888 +msgid "recursive directory loop" +msgstr "recursieve map herhaling" + +#: src/grep.c:938 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Gebruik: %s [OPTIE]... PATROON [BESTAND]...\n" + +#: src/grep.c:939 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Probeer `%s --help' voor meer informatie.\n" + +#: src/grep.c:943 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Gebruik: %s [OPTIE]... PATROON [BESTAND] ...\n" + +#: src/grep.c:944 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Zoek voor PATROON in ieder BESTAND of standaard invoer.\n" +"Voorbeeld: %s -i 'hello world' menu.h main.c\n" +"\n" +"Selectie en interpretatie van reguliere expressies:\n" + +#: src/grep.c:949 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +msgstr "" +" -E, --extended-regexp PATROON is een uitgebreide reguliere expressie\n" +" -F, --fixed-strings PATROON is een verzameling van strings, op\n" +" aparte regels\n" +" -G, --basic-regexp PATROON is een basis reguliere expressie\n" + +#: src/grep.c:953 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=PATROON gebruik PATROON als reguliere exprossie\n" +" -f, --file=BESTAND haal PATROON uit BESTAND\n" +" -i, --ignore-case negeer hoofd-/kleine letters\n" +" -w, --word-regexp forceer PATROON om alleen hele woorden te zoeken\n" +" -x, --line-regexp forceer PATROON om alleen hele regels te zoeken\n" +" -z, --null-data een dataregel eindigt in een 0 byte, niet nieuwe regel\n" + +#: src/grep.c:960 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Divers:\n" +" -s, --no-messages onderdruk foutmeldingen\n" +" -v, --invert-match selecteer niet overeenkomende regels\n" +" -V, --version toon versie informatie en beëindig\n" +" --help toon deze hulptekst en beëindig\n" +" --mmap gebruik gemmapte invoer indien mogelijk\n" + +#: src/grep.c:968 +msgid "" +"\n" +"Output control:\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'.\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'.\n" +" -r, --recursive equivalent to --directories=recurse.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Uitvoer opties:\n" +" -b, --byte-offset geef byteadres bij de uitvoerregels\n" +" -n, --line-number geef een regelnummer bij de uitvoerregels\n" +" -H, --with-filename geef de bestandsnaam bij iedere overeenkomst\n" +" -h, --no-filename onderdruk het toevoegen van de bestandsnaam\n" +" -q, --quiet, --silent onderdruk alle normale uitvoer\n" +" --binary-files=TYPE neem aan dat binaire bestanden van TYPE zijn\n" +" TYPE is `binary', `text', of `without-match'.\n" +" -a, --text gelijk aan --binary-files=text\n" +" -I gelijk aan --binary-files=without-match\n" +" -d, --directories=ACTIE hoe mappen te behandelen\n" +" ACTIE is `read', `recurse' of `skip'.\n" +" -r, --recursive gelijk aan --directories=recurse.\n" +" -L, --files-without-match geef alleen BESTANDsnamen zonder overeenkomst\n" +" -l, --files-with-matches geef alleen BESTANDsnamen met overeenkomsten\n" +" -c, --count geef alleen het aantal overeenkomsten per BESTAND\n" +" -Z, --null print 0 byte na iedere BESTANDsnaam\n" + +#: src/grep.c:987 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context[=NUM] print NUM (default 2) lines of output context\n" +" unless overridden by -A or -B\n" +" -NUM same as --context=NUM\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Contextbesturing:\n" +" -B, --before-context=NUM geef NUM regels voorafgaande context\n" +" -A, --after-context=NUM geef NUM regels achterafkomende context\n" +" -C, --context[=NUM] geef NUM (standaard 2) regels context\n" +" tenzij ook -A of -B gegeven is\n" +" -NUM zelfde als --context=NUM\n" +" -U, --binary haal geen CR tekens weg bij EOL (MSDOS)\n" +" -u, --unix-byte-offsets geef adressen alsof CRs er niet waren (MSDOS)\n" +"\n" +"`egrep' betkent `grep -E'. `fgrep' betekent `grep -F'.\n" +"Indien geen BESTAND is gegeven, of BESTAND is -, wordt de standaard\n" +"invoer gelezen. Indien minder dan twee BESTANDen gegeven zijn, wordt\n" +"-h aangenomen. Afsluitwaarde is 0 in geval van overeenkomsten, 1\n" +"indien geen, en 2 indien er iets mis is.\n" + +#: src/grep.c:1002 +msgid "\nReport bugs to .\n" +msgstr "" +"\n" +"Meld fouten in het programma aan ;\n" +"meld fouten in de vertaling aan .\n" + +# viendo los fuentes , hay varias opciones +# que hay sin documentar. O quiza es que getopt() lo he entendido mal +# Son las opciones X ( requiere argumento ) , switchs -c, -b, -L e -y +# grep.c:622 -> +# opt = getopt(argc, argv, "0123456789A:B:CEFGVX:bce:f:hiLlnqsvwxy" +# grep --help -> +# usage: grep [-[[AB] ]] [-[CEFGVchilnqsvwx]] [-[ef]] [] +# La opcisn -X es a la que corresponde esta lmnea. +#: src/grep.c:1012 +msgid "conflicting matchers specified" +msgstr "conflicterende `matchers' opgegeven" + +#: src/grep.c:1203 src/grep.c:1210 src/grep.c:1219 +msgid "invalid context length argument" +msgstr "ongeldig contextlengte-argument" + +#: src/grep.c:1273 +msgid "unknown directories method" +msgstr "onbekend mappen methode" + +#: src/grep.c:1358 +msgid "unknown binary-files type" +msgstr "onbekend binair bestanstype" + +#: src/grep.c:1378 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1380 +msgid "Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" + +#: src/grep.c:1382 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Dit is vrije programmatuur; zie de broncode voor kopieervoorwaarden.\n" +"Er is GEEN garantie; zelfs niet voor VERKOOPBAARHEID of GESCHIKTHEID\n" +"VOOR EEN BEPAALD DOEL.\n" diff --git a/src/apps/bin/grep-2.5/po/no.po b/src/apps/bin/grep-2.5/po/no.po new file mode 100644 index 0000000000..0440d892d9 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/no.po @@ -0,0 +1,417 @@ +# Norwegian messages for GNU Grep version 2.2. (bokmål dialect) +# Copyright (C) 1996 Free Software Foundation, Inc. +# Karl Anders Øygard , 1996. +# +# Eivind Tagseth , 1997 +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.2\n" +"POT-Creation-Date: 2001-07-31 16:17-0400\n" +"PO-Revision-Date: 1998-08-01 13:45+0200\n" +"Last-Translator: Eivind Tagseth \n" +"Language-Team: Norwegian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Minnet oppbrukt" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 +#: src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 +#: src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 +#: src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "Ubalansert [" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Uferdig \\-beskyttelse" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "uferdig gjentagelsesantall" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "feilaktig gjentagelsesantall" + +#: src/dfa.c:1239 +msgid "Unbalanced (" +msgstr "Ubalansert (" + +#: src/dfa.c:1364 +msgid "No syntax specified" +msgstr "Ingen syntaks spesifisert" + +#: src/dfa.c:1372 +msgid "Unbalanced )" +msgstr "Ubalansert )" + +#: src/dfa.c:2942 +msgid "out of memory" +msgstr "tomt for minne" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 +#: src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "minnet oppbrukt" + +#: src/grep.c:191 +msgid "invalid context length argument" +msgstr "ugyldig kontekstlengde" + +#: src/grep.c:458 +msgid "input is too large to count" +msgstr "" + +#: src/grep.c:531 +msgid "writing output" +msgstr "skriver utdata" + +#: src/grep.c:804 +#, c-format +msgid "Binary file %s matches\n" +msgstr "" + +#: src/grep.c:818 +msgid "(standard input)" +msgstr "(standard inn)" + +#: src/grep.c:923 +#, fuzzy, c-format +msgid "warning: %s: %s\n" +msgstr "%s: advarsel: %s: %s\n" + +#: src/grep.c:924 +msgid "recursive directory loop" +msgstr "" + +#: src/grep.c:972 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Bruk: %s [FLAGG]... MØNSTER [FIL]...\n" + +#: src/grep.c:974 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Prøv «%s --help» for mer informasjon.\n" + +#: src/grep.c:979 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Bruk: %s [FLAGG]... MØNSTER [FIL] ...\n" + +#: src/grep.c:980 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" + +#: src/grep.c:985 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" + +#: src/grep.c:990 +#, fuzzy +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +"Søk etter MØNSTER i hver FIL eller standard inn.\n" +"\n" +"Regexp valg og fortolkning:\n" +" -E, --extended-regexp MØNSTER er et utvidet regulært uttrykk\n" +" -F, --fixed-regexp MØNSTER er en fast streng separert med " +"linjeskift\n" +" -G, --basic-regexp MØNSTER er et grunnleggende regulært uttrykk\n" +" -e, --regexp=MØNSTER bruk MØNSTER som et regulært uttrykk\n" +" -f, --file=FIL hent MØNSTER fra FIL\n" +" -i, --ignore-case se bort ifra forskjellen på store og små " +"bokstaver\n" +" -w, --word-regexp MØNSTER må stemme overens med hele ord\n" +" -x, --line-regexp MØNSTER må stemme overens med hele linjer\n" + +#: src/grep.c:997 +#, fuzzy +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Diverse:\n" +" -s, --no-messages undertrykk feilmeldinger\n" +" -v, --revert-match velg linjer som ikke passer\n" +" -V, --version vis versioninformasjon og avslutt\n" +" --help vis denne helpeteksten og avslutt\n" + +#: src/grep.c:1005 +#, fuzzy +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be " +"skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Ut-kontroll:\n" +" -b, --byte-offset skriv tegnposisjon med utlinjene\n" +" -n, --line-number skriv linjenummeret med utlinjene\n" +" -H, --with-filename skriv filnavnet for hver treff\n" +" -h, --no-filename ikke skriv filnavnet\n" +" -q, --quiet, --silent undertrykk all vanlig utskrift\n" +" -L, --files-without-match skriv bare ut navnene på FILene som ikke\n" +" inneholder treff\n" +" -l, --files-with-matches skriv bare ut navnene på FILene som inneholder\n" +" treff\n" +" -c, --count skriv bare ut antall linjer som inneholder " +"treff\n" +" per FIL\n" + +#: src/grep.c:1029 +#, fuzzy +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color, --colour use markers to distinguish the matching string\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Kontekst-kontroll:\n" +" -B, --before-context=ANT skriv ANT linjer med ledende kontekst\n" +" -A, --after-context=ANT skriv ANT linjer med etterfølgende kontekst\n" +" -ANT samme som både -B ANT og -A ANT\n" +" -C, --context samme som -2\n" +" -U, --binary ikke fjern CR-tegn ved EOL (MSDOS)\n" +" -u, --unix-byte-offsets rapporter posisjoner som om CRene ikke var der\n" +" (MSDOS)\n" + +#: src/grep.c:1044 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Rapportér feil til .\n" + +#: src/grep.c:1054 +#, fuzzy +msgid "conflicting matchers specified" +msgstr "søkeuttrykk er allerede spesifisert" + +#: src/grep.c:1347 +msgid "unknown directories method" +msgstr "" + +#: src/grep.c:1414 +#, fuzzy +msgid "invalid max count" +msgstr "uferdig gjentagelsesantall" + +#: src/grep.c:1464 +msgid "unknown binary-files type" +msgstr "" + +#: src/grep.c:1535 +#, fuzzy, c-format +msgid "%s (GNU grep) %s\n" +msgstr "grep (GNU grep) %s\n" + +#: src/grep.c:1537 +#, fuzzy +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "" +"Copyright (C) 1988, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.\n" + +#: src/grep.c:1539 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Dette er fri programvare, se kildekoden for kopieringsbetingelser. Det\n" +"er INGEN garanti, ikke en gang for SALGBARHET eller EGNETHET FOR NOEN \n" +"SPESIELL OPPGAVE.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: flagget «%s» er flertydig\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: flagget «--%s» tar ikke argumenter\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: flagget «%c%s» tar ikke argumenter\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: flagget «%s» trenger et argument\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ukjent flagg «--%s»\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ukjent flagg «%c%s»\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ulovlig flagg -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ugyldig flagg -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flagget behøver et argument -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: flagget «-W %s» er flertydig\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: flagget «-W %s» tar ikke argumenter\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "" + +#~ msgid "option %s" +#~ msgstr "flagg %s" + +#~ msgid " with arg %s" +#~ msgstr " med arg %s" + +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "tallene forekommer i to forskjellige argv-elementer.\n" + +#~ msgid "option %c\n" +#~ msgstr "flagg %c\n" + +#~ msgid "option a\n" +#~ msgstr "flagg a\n" + +#~ msgid "option b\n" +#~ msgstr "flagg b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "flagg c med verdi «%s»\n" + +#~ msgid "option d with value `%s'\n" +#~ msgstr "flagg d med verdi «%s»\n" + +#~ msgid "?? getopt returned character code 0%o ??\n" +#~ msgstr "?? getopt returnerte tegnverdien 0%o ??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "ARGV-elementer som ikke er flagg: " + +#~ msgid "you may specify only one of -E, -F, or -G" +#~ msgstr "du kan bare spesifisere en av -E, -F eller -G" + +#~ msgid "memory exhausted\n" +#~ msgstr "minnet oppbrukt\n" + +#~ msgid "(standard input)\n" +#~ msgstr "(standard inn)\n" diff --git a/src/apps/bin/grep-2.5/po/pl.po b/src/apps/bin/grep-2.5/po/pl.po new file mode 100644 index 0000000000..544ad10c6d --- /dev/null +++ b/src/apps/bin/grep-2.5/po/pl.po @@ -0,0 +1,408 @@ +# Polish translation of the GNU grep messages +# Copyright (C) 1995-1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Rafa³ Maszkowski , 1996-2002. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-13 13:00+0100\n" +"Last-Translator: Rafa³ Maszkowski \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Pamiêæ wyczerpana" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "[ nie do pary" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Niedokoñczona sekwencja \\" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "niedokoñczona liczba powtórzeñ" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "¼le sformatowana liczba powtórzeñ" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "( nie do pary" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Brak specyfikacji sk³adni" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr ") nie do pary" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "brak pamiêci" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "pamiêæ wyczerpana" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "b³êdny argument d³ugo¶ci kontekstowej" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "danych wej¶ciowych jest zbyt du¿o do policzenia" + +#: src/grep.c:597 +msgid "writing output" +msgstr "zapisujê wyniki" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Plik binarny %s pasuje do wzorca\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(standardowe wej¶cie)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "uwaga: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "nieskoñczona pêtla przegl±dania katalogów" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "U¿ycie: %s [OPCJA]... WZORZEC [PLIK] ...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Napisz `%s --help' ¿eby dowiedzieæ siê wiêcej.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "U¿ycie: %s [OPCJA]... WZORZEC [PLIK] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Szukanie WZORCA w ka¿dym pliku lub na standardowym wej¶ciu.\n" +"Przyk³ad: %s -i 'hello world' menu.h main.c\n" +"\n" +"Wybór i interpretacja wyra¿eñ regularnych:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp WZORZEC jest rozszerzonym wyr. regularnym\n" +" -F, --fixed-strings WZORZEC napisy oddzielone przez zn. nowej linii\n" +" -G, --basic-regexp WZORZEC jest podstawowym wyr. regularnym\n" +" -P, --perl-regexp WZORZEC jest wyra¿eniem regularnym perla\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=WZORZEC u¿ycie WZORCA jako wyra¿enia regularnego\n" +" -f, --file=PLIK u¿ycie wzorców z PLIKU\n" +" -i, --ignore-case zignorowanie ro¿nic miêdzy ma³ymi i wlk. lit.\n" +" -w, --word-regexp dopasowanie WZORZEC tylko do pe³nych s³ów\n" +" -x, --line-regexp dopasowanie WZORZEC tylko do ca³ych linii\n" +" -z, --null-data linie s± zakoñczone bajtem 0, nie znakiem\n" +" nowej linii\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Ró¿ne:\n" +" -s, --no-messages bez komunikatów o b³êdach\n" +" -v, --revert-match wybierz linie nie pasuj±ce\n" +" -V, --version wypisz informacjê o wersji i zakoñcz\n" +" --help wy¶wietl tê informacjê i zakoñcz\n" +" --mmap je¿eli mo¿liwe mapuj pliki w pamiêci\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Sterowanie danymi wyj¶ciowymi:\n" +" -m, --max-count=ILE zatrzymanie po ILE dopasowaniach\n" +" -b, --byte-offset wypisanie pozycji bajtów w wyniku\n" +" -n, --line-number wypisanie numerów linii w wyniku\n" +" --line-buffered opró¿nienie buf. wyj. po ka¿dej linii\n" +" -H, --with-filename wypisanie nazwy pliku dla ka¿dej linii\n" +" -h, --no-filename bez nazwy pliku w liniach wyj¶ciowych\n" +" --label=ETYKIETA w wyniku ETYKIETA zastêpuje nazwe pliku\n" +" -o, --only-matching pokazanie tylko kawa³ka, który pasuje do WZORCA\n" +" -q, --quiet, --silent wy³±czenie wypisywanie wyniku\n" +" --binary-files=TYP za³o¿enie, ¿e pliki binarne s± typu TYP\n" +" TYP to 'binary', 'text' lub 'without-match'.\n" +" -a, --text równowa¿ne --binary-files=text\n" +" -I równowa¿ne --binary-files=without-match\n" +" -d, --directories=DZIA£ANIE jak siê obchodziæ z katalogami,\n" +" DZIA£ANIE to `read' (czytanie), `,recurse'\n" +" (przegl±danie rekurencujne) albo 'skip'\n" +" (pominiêcie).\n" +" -D, --devices=DZIA£ANIE jak odwo³ywaæ siê do urz±dzeñ, FIFO i gniazd,\n" +" DZIA£ANIE to 'read' (czytaj) albo 'skip' (pomiñ)\n" +" -R, -r, --recursive równowa¿ne --directories=recurse .\n" +" --include=WZORZEC przeszukiwane bêd± pliki pasuj±ce do WZORCA\n" +" --exclude=WZORZEC pliki pasuj±ce do WZORCA bêd± pominiête\n" +" --exclude-from=PLIK pominiêcie plików pasuj±cych do WZORCÓW w PLIKU\n" +" -L, --files-without-match wypisanie tylko nazw PLIKÓW bez trafieñ\n" +" -l, --files-with-matches wypisanie tylko nazw PLIKÓW z trafieniami\n" +" -c, --count wypisanie tylko ilo¶ci pasuj±cych linii w PLIKACH\n" +" -Z, --null wypisanie bajtu 0 po ka¿dej nazwie PLIKU\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Sterowanie kontekstem:\n" +" -B, --before-context=ILE wypisanie ILE linii kontekstu przed\n" +" -A, --after-context=ILE wypisanie ILE linii kontekstu po\n" +" -C, --context[=ILE] wypisanie ILE (domy¶lnie 2) linii kontekstu\n" +" -ILE to samo co --context=ILE\n" +" --color[=KIEDY],\n" +" --colour[=KIEDY] oznaczanie pasuj±cych znaków,\n" +" KIEDY to `always' (zawsze), `never' (nigdy)\n" +" albo `auto' (automatycznie).\n" +" -U, --binary bez usuwania znaków nowej linii na koñcu\n" +" -u, --unix-byte-offsets podawanie pozycji tak jakby nie by³o CRów (MSDOS)\n" +"\n" +"`egrep' oznacza `grep -E'. `fgrep' oznacza `grep -F'.\n" +"Bez PLIKu albo gdy PLIK to -, czytane jest standardowe wej¶cie. Je¿eli\n" +"podano mniej ni¿ dwa PLIKi, zak³ada -h. Zakoñczenie z kodem 0 je¿eli\n" +"WZORZEC pasuje, z 1, je¿eli nie, z 2, je¿eli s± problemy.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Raporty o b³êdach wysy³aj do bug-gnu-utils@gnu.org.\n" + +# viendo los fuentes , hay varias opciones +# que hay sin documentar. O quiza es que getopt() lo he entendido mal +# Son las opciones X ( requiere argumento ) , switchs -c, -b, -L e -y +# grep.c:622 -> +# opt = getopt(argc, argv, "0123456789A:B:CEFGVX:bce:f:hiLlnqsvwxy" +# grep --help -> +# usage: grep [-[[AB] ]] [-[CEFGVchilnqsvwx]] [-[ef]] [] +# La opción -X es a la que corresponde esta línea. +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "podane sprzeczne wzorce" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "nieznany sposób przegl±dania urz±dzeñ" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "nieznany sposób przegl±dania katalogów" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "b³êdna maksymalna liczba powtórzeñ" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "nieznany typ pliku binarnego" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright (C) 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Oprogramowanie darmowe. Warunki kopiowania zamieszczone s± w kodzie ¼ród³owym.\n" +"Nie podlega ¿adnej gwarancji, nawet gwarancji przydatno¶ci do jakiegokolwiek\n" +"zastosowania lub sprzeda¿y.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "Opcja -P nie jest obs³ugiwana" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Opcje -P i -z nie mog± wystêpowaæ razem" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Nieznany b³±d systemowy" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: opcja `%s' jest niejednoznaczna\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: opcja `--%s' nie mo¿e mieæ argumentu\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: opcja `%c%s' nie mo¿e mieæ argumentu\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: opcja `%s' wymaga argumentu\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: nierozpoznana opcja `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: nierozpoznana opcja `%c%s'\n" + +# should ther be a space between -- and %c? - rzm 970731 +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: nielegalna opcja -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: b³êdna opcja -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opcja wymaga argumentu -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: opcja `-W %s' jest niejednoznaczna\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: opcja `-W %s' nie mo¿e mieæ argumentu\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "\"" diff --git a/src/apps/bin/grep-2.5/po/pt_BR.po b/src/apps/bin/grep-2.5/po/pt_BR.po new file mode 100644 index 0000000000..50cd9ae1d0 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/pt_BR.po @@ -0,0 +1,367 @@ +# Mensagens em Português do Brazil (pt_BR) para o grep da GNU. +# Copyright (C) 1997 Free Software Foundation, Inc. +# Rodrigo Stulzer Lopes , 1997 +# Based on Spanish Version +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.4f\n" +"POT-Creation-Date: 2000-02-02 01:04-0500\n" +"PO-Revision-Date: 2000-10-27 16:55-02:00\n" +"Last-Translator: Rodrigo Stulzer Lopes \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:163 src/dfa.c:174 src/dfa.c:185 src/grep.c:902 +msgid "Memory exhausted" +msgstr "Memória esgotada" + +#: src/dfa.c:448 +msgid "Unfinished \\ escape" +msgstr "escape inacabado" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:581 src/dfa.c:587 src/dfa.c:597 src/dfa.c:605 src/dfa.c:620 +msgid "unfinished repeat count" +msgstr "contador de repetição inválido" + +#: src/dfa.c:594 src/dfa.c:611 src/dfa.c:619 src/dfa.c:623 +msgid "malformed repeat count" +msgstr "contador de repetição inválido" + +#: src/dfa.c:688 src/dfa.c:691 src/dfa.c:718 src/dfa.c:722 src/dfa.c:723 +#: src/dfa.c:726 src/dfa.c:739 src/dfa.c:740 +msgid "Unbalanced [" +msgstr "[ desbalanceado" + +#: src/dfa.c:886 +msgid "Unbalanced (" +msgstr "( desbalanceado" + +#: src/dfa.c:1000 +msgid "No syntax specified" +msgstr "Sintaxe não especificada" + +#: src/dfa.c:1008 +msgid "Unbalanced )" +msgstr ") desbalanceado" + +#: src/dfa.c:1994 +msgid "out of memory" +msgstr "memória esgotada" + +#: src/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: opção `%s' é ambígua\n" + +#: src/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: opção `--%s' não aceita um argumento\n" + +#: src/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: opção `%c%s' não aceita um argumento\n" + +#: src/getopt.c:723 src/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: opção `%s' requer um argumento\n" + +#. --option +#: src/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: opção `--%s' não reconhecida\n" + +#. +option or -option +#: src/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: opção `%c%s' não reconhecida\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opção ilegal -- %c\n" + +#: src/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opção inválida -- %c\n" + +#. 1003.2 specifies the format of this message. +#: src/getopt.c:815 src/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opção espera um argumento -- %c\n" + +#: src/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: opção `-W %s' é ambígua\n" + +#: src/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: opção `-W %s' não aceita um argumento\n" + +#: src/grep.c:185 src/grep.c:200 src/grep.c:293 src/grep.c:399 src/kwset.c:180 +#: src/kwset.c:186 src/obstack.c:471 +msgid "memory exhausted" +msgstr "memória esgotada" + +#: src/grep.c:550 src/grep.c:1441 +msgid "writing output" +msgstr "escrevendo saída" + +#: src/grep.c:777 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Arquivo binário %s casa com o padrão\n" + +#: src/grep.c:791 +msgid "(standard input)" +msgstr "(entrada padrão)" + +#: src/grep.c:887 +#, c-format +msgid "%s: warning: %s: %s\n" +msgstr "%s: aviso: %s: %s\n" + +#: src/grep.c:888 +msgid "recursive directory loop" +msgstr "loop de diretório recursivo" + +#: src/grep.c:938 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Uso: %s [opção]... padrão [arquivo]...\n" + +#: src/grep.c:939 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Tente `%s --help' para mais informações.\n" + +#: src/grep.c:943 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Uso: %s [opção]... padrão [arquivo]...\n" + +#: src/grep.c:944 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Procura por PADRÃO em cada ARQUIVO ou entrada padrão.\n" +"Exemplo: %s -i 'hello world' menu.h main.c\n" +"\n" +"Seleção de expressão regular e interpretação:\n" + +#: src/grep.c:949 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +msgstr "" +" -E, --extended-regexp PADRÃO é um expressão regular extendida\n" +" -F, --fixed-strings PADRÃO é uma cadeia fixa separada por nova linha\n" +" -G, --basic-regexp PADRÃO é um expressão regular básica\n" + +#: src/grep.c:953 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=PADRÃO use PADRÃO como uma expressão regular\n" +" -f, --file=ARQUIVO obtain PADRÃO from FILE\n" +" -i, --ignore-case ignora caixa do texto\n" +" -w, --word-regexp força PADRÃO encontrar apenas palavras inteiras\n" +" -x, --line-regexp força PADRÃO encontrar apenas linhas inteiras\n" +" -z, --null-data uma linha de dados acaba com 0 bytes, não nova linha\n" + +#: src/grep.c:960 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Miscelânea:\n" +" -s, --no-messages suprime mensagens de erro\n" +" -v, --revert-match seleciona somente linhas não coincidentes\n" +" -V, --version mostra informações sobre versão e sai\n" +" --help exibe esta ajuda e sai\n" +" --mmap usa entrada de memória mapeada se possível\n" + +#: src/grep.c:968 +msgid "" +"\n" +"Output control:\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'.\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'.\n" +" -r, --recursive equivalent to --directories=recurse.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Controle de saída:\n" +" -b, --byte-offset exibe o deslocamento juntamente com a saída\n" +" -n, --line-number exibe o número da linha juntamente com a saída\n" +" -H, --with-filename exibe o nome do arquivo para cada padrão\n" +" encontrado\n" +" -h, --no-filename inibe o nome de arquivo na saída\n" +" -q, --quiet, --silent inibe todas as saídas normais\n" +" -a, --text não suprima saída de arquivos binários\n" +" --binary-files=TIPO assume que arquivos binários são TIPO\n" +" TIPO é 'binary'. 'text', ou 'without-match'.\n" +" -d, --directories=AÇÃO como tratar diretórios\n" +" AÇÃO pode ser: 'read' (ler), 'recurse' (recursivo),\n" +" ou 'skip' (não considerar).\n" +" -r, --recursive equivalente a --directories=recurse.\n" +" -L, --files-without-match exibe somente os nomes dos arquivos onde não foi\n" +" encontrado o padrão\n" +" -l, --files-with-matches exibe somente os nomes dos arquivos onde foi\n" +" encontrado o padrão\n" +" -c, --count exibe o número de padrões encontrados por arquivo\n" +" -Z, --null mostra 0 bytes depois do nome do ARQUIVO\n" + +#: src/grep.c:987 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context[=NUM] print NUM (default 2) lines of output context\n" +" unless overridden by -A or -B\n" +" -NUM same as --context=NUM\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Controle de contexto:\n" +" -B, --before-context=NUM exibe NUM linhas até o padrão\n" +" -A, --after-context=NUM exibe NUM linhas após o padrão\n" +" -C, --context=[NUM] exibe NUM (default 2) linhas do padrão\n" +" a menos que anulada por -A ou -B\n" +" -NUM o mesmo que --context=NUM\n" +" -U, --binary não elimina caracteres CR em final de linha\n" +" (MSDOS)\n" +" -u, --unix-byte-offsets relata deslocamentos como se não existissem\n" +" CRs (MSDOS)\n" +"\n" +"`egrep' é o mesmo que `grep -E', `fgrep' é `grep -F'.\n" +"Se não informado o ARQUIVO, ou se ARQUIVO é -, lê da entrada padrão.\n" +"Se menos que dois arquivos forem especificados, assume-se -h.\n" +"Retorna 0 se encontra o padrão, 1 se não encontra.\n" +"Retorna 2 se houver erro de sintaxe ou erros do sistema.\n" + +#: src/grep.c:1002 +msgid "\nReport bugs to .\n" +msgstr "\nInforme problemas para .\n" + +#: src/grep.c:1012 +msgid "conflicting matchers specified" +msgstr "padrões de procura especificados conflitam" + +#: src/grep.c:1203 src/grep.c:1210 src/grep.c:1219 +msgid "invalid context length argument" +msgstr "argumento tamanho do contexto inválido" + +#: src/grep.c:1273 +msgid "unknown directories method" +msgstr "método desconhecido de diretórios" + +#: src/grep.c:1358 +msgid "unknown binary-files type" +msgstr "tipo de arquivo binário desconhecido" + +# msgstr "la expresión a buscar ya fue especificada" +#: src/grep.c:1378 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1380 +msgid "Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" + +#: src/grep.c:1382 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Este é um free software; olhe o fonte para as condições de cópia. Não \n" +"existe garantia; nem mesmo para cópias compradas ou adaptadas para um \n" +"propósito particular\n" + +#~ msgid "option %s" +#~ msgstr "opção %s" + +#~ msgid " with arg %s" +#~ msgstr "com argumento %s" + +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "dígitos ocorrem em dois elementos diferentes de argv.\n" + +#~ msgid "option %c\n" +#~ msgstr "opção %c\n" + +#~ msgid "option a\n" +#~ msgstr "opção a\n" + +#~ msgid "option b\n" +#~ msgstr "opção b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "opção c com valor `%s'\n" + +#~ msgid "option d with value `%s'\n" +#~ msgstr "opção d com valor `%s'\n" + +#~ msgid "?? getopt returned character code 0%o ??\n" +#~ msgstr "?? getopt retornou caracter código 0%o ??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "elementos ARGV que não são opções: " + +#~ msgid "memory exhausted\n" +#~ msgstr "memória esgotada\n" + +#~ msgid "you may specify only one of -E, -F, or -G" +#~ msgstr "especifique somente uma das opções -E, -F, ou -G" diff --git a/src/apps/bin/grep-2.5/po/ru.po b/src/apps/bin/grep-2.5/po/ru.po new file mode 100644 index 0000000000..3513ced7b2 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/ru.po @@ -0,0 +1,404 @@ +# ìÏËÁÌÉÚÁÃÉÑ ÄÌÑ grep. +# Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +# Denis Perchine , 1998-2000. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-09 12:18GMT+06\n" +"Last-Translator: Denis Perchine \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=KOI8-R\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 0.9.5\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "ðÁÍÑÔØ ÉÓÞÅÒÐÁÎÁ" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "îÅÓÂÁÌÁÎÓÉÒÏ×ÁÎÎÁÑ [" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "îÅÚÁ×ÅÒÛÅÎÎÁÑ \\ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "ÎÅÚÁ×ÅÒÛÅÎÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÏ×ÔÏÒÅÎÉÊ" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "ÎÅËÏÒÒÅËÔÎÏ ÕËÁÚÁÎÏ ËÏÌÉÞÅÓÔ×Ï ÐÏ×ÔÏÒÅÎÉÊ" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "îÅÓÂÁÌÁÎÓÉÒÏ×ÁÎÎÁÑ (" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "îÅ ÕËÁÚÁÎÏ ÓÉÎÔÁËÓÉÓÁ" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr "îÅÓÂÁÌÁÎÓÉÒÏ×ÁÎÎÁÑ )" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "ÚÁËÏÎÞÉÌÁÓØ ÐÁÍÑÔØ" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "ÐÁÍÑÔØ ÉÓÞÅÒÐÁÎÁ" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "ÎÅ×ÅÒÎÙÊ ÁÒÇÕÍÅÎÔ ÄÌÉÎÙ ËÏÎÔÅËÓÔÁ" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "×ÈÏÄÎÙÅ ÄÁÎÎÙÅ ÓÌÉÛËÏÍ ×ÅÌÉËÉ, ÞÔÏÂÙ ÓÏÓÞÉÔÁÔØ" + +#: src/grep.c:597 +msgid "writing output" +msgstr "ÚÁÐÉÓÙ×ÁÀ ×ÙÈÏÄÎÙÅ ÄÁÎÎÙÅ" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "âÉÎÁÒÎÙÊ ÆÁÊÌ %s ÓÏ×ÐÁÄÁÅÔ\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(ÓÔÁÎÄÁÒÔÎÙÊ ××ÏÄ)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "ÐÒÅÄÕÐÒÅÖÄÅÎÉÅ: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "ËÁÔÁÌÏÇÉ ÚÁÃÉËÌÅÎÙ" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "éÓÐÏÌØÚÏ×ÁÎÉÅ: %s [OPTION]... PATTERN [FILE]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "ðÏÐÒÏÂÕÊÔÅ `%s --help' ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÂÏÌÅÅ ÐÏÄÒÏÂÎÏÇÏ ÏÐÉÓÁÎÉÑ.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "éÓÐÏÌØÚÏ×ÁÎÉÅ: %s [OPTION]... PATTERN [FILE] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"éÝÅÔ PATTERN × ËÁÖÄÏÍ FILE ÉÌÉ ÓÔÁÎÄÁÒÔÎÏÍ ××ÏÄÅ.\n" +"ðÒÉÍÅÒ: %s -i 'hello world' menu.h main.c\n" +"\n" +"÷ÙÂÏÒ ÔÉÐÁ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ É ÅÇÏ ÉÎÔÅÒÐÒÅÔÁÃÉÑ:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp PATTERN - ÒÁÓÛÉÒÅÎÎÏÅ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ\n" +" -F, --fixed-regexp PATTERN ÆÉËÓÉÒÏ×ÁÎÎÁÑ ÓÔÒÏÞËÁ, ÒÁÚÄÅÌÅÎÎÁÑ\n" +" ËÏÎÃÁÍÉ ÓÔÒÏË\n" +" -G, --basic-regexp PATTERN ÐÒÏÓÔÏÊ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ\n" +" -P, --perl-regexp PATTERN ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÑ ÑÚÙËÁ Perl\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +"éÝÅÔ PATTERN × ËÁÖÄÏÍ FILE'Å ÉÌÉ ÓÔÁÎÄÁÒÔÎÏÍ ××ÏÄÅ.\n" +"\n" +"÷ÙÂÏÒ ÔÉÐÁ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ É ÉÎÔÅÒÐÒÅÔÁÃÉÉ:\n" +" -e, --regexp=PATTERN ÉÓÐÏÌØÚÏ×ÁÔØ PATTERN ËÁË ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ\n" +" -f, --file=FILE ÂÒÁÔØ PATTERN ÉÚ FILE'Á\n" +" -i, --ignore-case ÉÇÎÏÒÉÒÏ×ÁÔØ ÒÁÌÉÞÉÅ ÒÅÇÉÓÔÒÏ×\n" +" -w, --word-regexp PATTERN ÄÏÌÖÅÎ ÐÏÄÈÏÄÉÔØ ËÏ ×ÓÅÍÕ ÓÌÏ×Õ\n" +" -x, --line-regexp PATTERN ÄÏÌÖÅÎ ÐÏÄÈÏÄÉÔØ ËÏ ×ÓÅÊ ÓÔÒÏËÅ\n" +" -z, --null-data ÓÔÒÏÞËÉ ÏËÁÎÞÉ×ÁÀÔÓÑ ÎÁ ÂÁÊÔ 0, Á ÎÅ ÎÁ ËÏÎÅÃ\n" +" ÓÔÒÏËÉ\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"òÁÚÎÏÏÏÂÒÁÚÎÙÅ:\n" +" -s, --no-messages ÐÏÄÁ×ÌÑÔØ ÓÏÏÂÝÅÎÉÑ Ï ÏÛÉÂËÁÈ\n" +" -v, --revert-match ×ÙÂÉÒÁÔØ ÎÅ ÐÏÄÈÏÄÑÝÉÅ ÓÔÒÏËÉ\n" +" -V, --version ÎÁÐÅÞÁÔÁÔØ ÉÎÆÏÒÍÁÃÉÀ Ï ×ÅÒÓÉÉ É ×ÙÊÔÉ\n" +" --help ÐÏËÁÚÁÔØ ÐÏÍÏÝØ É ×ÙÊÔÉ\n" +" --mmap ÉÓÐÏÌØÚÏ×ÁÔØ mmap ××ÏÄ ÐÏ ×ÏÚÍÏÖÎÏÓÔÉ\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"õÐÒÁ×ÌÅÎÉÅ ×Ù×ÏÄÏÍ:\n" +" -m, --max-count=NUM ÏÓÔÁÎÏ×ÉÔØÓÑ ÐÏÓÌÅ NUM ÓÏ×ÐÁÄÅÎÉÊ\n" +" -b, --byte-offset ÐÅÞÁÔÁÔØ ×ÍÅÓÔÅ Ó ×ÙÈÏÄÎÙÍÉ ÓÔÒÏÞËÁÍÉ ÓÍÅÝÅÎÉÅ ×\n" +" ÂÁÊÔÁÈ\n" +" -n, --line-number ÐÅÞÁÔÁÔØ ÎÏÍÅÒ ÓÔÒÏËÉ ×ÍÅÓÔÅ Ó ×ÙÈÏÄÎÙÍÉ ÓÔÒÏÞËÁÍÉ\n" +" --line-buffered ÓÂÒÁÓÙ×ÁÔØ ÂÕÆÅÒÁ ËÁÖÄÕÀ ÓÔÒÏÞËÕ\n" +" -H, --with-filename ÐÅÞÁÔÁÔØ ÉÍÑ ÆÁÊÌÁ ÄÌÑ ËÁÖÄÏÇÏ ÓÏ×ÐÁÄÅÎÉÑ\n" +" -h, --no-filename ÐÏÄÁ×ÉÔØ ×Ù×ÏÄ ÉÍÅÎÉ ÆÁÊÌÁ ÎÁ ×ÙÈÏÄÅ\n" +" --label=LABEL ×Ù×ÏÄÉÔØ LABEL ×ÍÅÓÔÏ ÉÍÅÎÉ ÆÁÊÌÁ\n" +" -q, --quiet, --silent ÐÏÄÁ×ÉÔØ ×ÅÓØ ÏÂÙÞÎÙÊ ×Ù×ÏÄ\n" +" --binary-files=TYPE ÓÞÉÔÁÔØ ÞÔÏ ÂÉÎÁÒÎÙÊ ÆÁÊÌ ÔÉÐÁ:\n" +" TYPE - 'binary', 'text', ÉÌÉ 'without-match'.\n" +" -a, --text ÎÅ ÐÏÄÁ×ÌÑÔØ ÂÉÎÁÒÎÙÊ ×Ù×ÏÄ\n" +" -I ÔÏ ÖÅ, ÞÔÏ É --binary-files=without-match\n" +" -d, --directories=ACTION ËÁË ÏÂÒÁÂÁÔÙ×ÁÔØ ËÁÔÁÌÏÇÉ\n" +" ACTION ÍÏÖÅÔ ÂÙÔØ 'read' (ÞÉÔÁÔØ),\n" +" 'recurse' (ÒÅËÕÒÓÉ×ÎÏ), ÉÌÉ 'skip' (ÐÒÏÐÕÓËÁÔØ).\n" +" -D, --devices=ACTION ËÁË ÏÂÒÁÂÁÔÙ×ÁÔØ ÕÓÔÒÏÊÓÔ×Á, ËÁÎÁÌÙ É ÓÅÔÅ×ÙÅ ËÁÎÁÌÙ\n" +" ACTION ÍÏÖÅÔ ÂÙÔØ 'read' ÉÌÉ 'skip'\n" +" -R, -r, --recursive ÁÎÁÌÏÇÉÞÎÏ --directories=recurse.\n" +" --include=PATTERN ÏÂÒÁÂÏÔÁÔØ ÆÁÊÌÙ, ÕÄÏ×ÌÅÔ×ÏÒÑÀÝÉÅ PATTERN\n" +" --exclude=PATTERN ÐÒÏÐÕÓÔÉÔØ ÆÁÊÌÙ, ÕÄÏ×ÌÅÔ×ÏÒÑÀÝÉÅ PATTERN.\n" +" --exclude-from=FILE ÐÒÏÐÕÓÔÉÔØ ÆÁÊÌÙ, ÕÄÏ×ÌÅÔ×ÏÒÑÀÝÉÅPATTERN × FILE.\n" +" -L, --files-without-match ÐÅÞÁÔÁÔØ ÔÏÌØËÏ ÉÍÅÎÁ ÆÁÊÌÏ× ÂÅÚ ÓÏ×ÐÁÄÅÎÉÊ\n" +" -l, --files-with-matches ÐÅÞÁÔÁÔØ ÔÏÌØËÏ ÉÍÅÎÁ ÆÁÊÌÏ× Ó ÓÏ×ÐÁÄÅÎÉÑÍÉ\n" +" -c, --count ÐÅÞÁÔÁÔØ ÔÏÌØËÏ ËÏÌÉÞÅÓÔ×Ï ÓÏ×ÐÁÄÁÀÝÉÈ ÓÔÒÏË ÎÁ ÆÁÊÌ\n" +" -Z, --null ÐÅÞÁÔÁÔØ ÂÁÊÔ 0 ÐÏÓÌÅ ÉÍÅÎÉ ÆÁÊÌÁ\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"õÐÒÁ×ÌÅÎÉÅ ËÏÎÔÅËÓÔÏÍ:\n" +" -B, --before-context=NUM ÐÅÞÁÔÁÔØ NUM ÓÔÒÏË ÐÒÅÄÛÅÓÔ×ÕÀÝÅÇÏ ËÏÎÔÅËÓÔÁ\n" +" -A, --after-context=NUM ÐÅÞÁÔÁÔØ NUM ÓÔÒÏË ÐÏÓÌÅÄÕÀÝÅÇÏ ËÏÎÔÅËÓÔÁ\n" +" -C, --context[=NUM] ÐÅÞÁÔÁÔØ NUM ÓÔÒÏË ËÏÎÔÅËÓÔÁ,\n" +" ÅÓÌÉ ÎÅ ÐÅÒÅËÒÙ×ÁÅÔÓÑ -A ÉÌÉ -B\n" +" --color[=WHEN],\n" +" --colour[=WHEN] ÉÓÐÏÌØÚÏ×ÁÔØ ÍÁÒËÅÒÙ ÄÌÑ ÒÁÚÌÉÞÉÑ ÓÏ×ÐÁÄÁÀÝÉÈ ÓÔÒÏË\n" +" WHEN ÍÏÖÅÔ ÂÙÔØ `always' (×ÓÅÇÄÁ), `never' (ÎÉËÏÇÄÁ) ÉÌÉ `auto' (Á×ÔÏÍÁÔÉÞÅÓËÉ).\n" +" --color, --colour ÉÓÐÏÌØÚÏ×ÁÔØ ÍÁÒËÅÒÙ ÄÌÑ ÒÁÚÌÉÞÉÑ ÓÏ×ÐÁÄÁÀÝÉÈ ÓÔÒÏË\n" +" -NUM ÔÏ ÖÅ, ÞÔÏ É --context=NUM\n" +" -U, --binary ÎÅ ÕÄÁÌÑÔØ ÓÉ×ÏÌÙ CR × ËÏÎÃÅ ÓÔÒÏËÉ (MSDOS)\n" +" -u, --unix-byte-offsets ×ÙÄÁ×ÁÔØ ÓÍÅÝÅÎÉÅ, ËÁË-ÂÕÄÔÏ ÎÅÔ CR-Ï× (MSDOS)\n" +"\n" +"åÓÌÉ ÎÅ ÕËÁÚÁÎÏ -[GEF], ÔÏÇÄÁ `egrep' ÐÒÅÄÐÏÌÁÇÁÅÔ -E, `fgrep' -F, ÉÎÁÞÅ -G.\n" +"ëÏÇÄÁ ÎÅÔ FILE'Á, ÉÌÉ ËÏÇÄÁ FILE ÜÔÏ -, ÞÉÔÁÅÔ ÓÔÁÎÄÁÒÔÎÙÊ ××ÏÄ. åÓÌÉ ÚÁÄÁÎÏ\n" +"ÍÅÎØÛÅ, ÞÅÍ Ä×Á ÆÁÊÌÁ, ÐÒÅÄÐÏÌÁÇÁÅÔ -h. ÷ÙÈÏÄÉÔ Ó 0 ÅÓÌÉ ÎÁÊÄÅÎÙ ÓÏ×ÐÁÄÅÎÉÑ,\n" +"Ó 1, ÅÓÌÉ ÎÅÔ. ÷ÙÈÏÄÉÔ Ó 2, ÅÓÌÉ ÅÓÔØ ÓÉÎÔÁËÓÉÞÅÓËÉÅ ÉÌÉ ÓÉÓÔÅÍÎÙÅ ÏÛÉÂËÉ.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"ï ÏÛÉÂËÁÈ ÓÏÏÂÝÁÊÔÅ .\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "ÚÁÄÁÎÙ ËÏÎÆÌÉËÔÕÀÝÉÅ ÏÂÒÁÚÃÙ" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "ÎÅÉÚ×ÅÓÔÎÙÊ ÍÅÔÏÄ ÄÌÑ ÕÓÔÒÏÊÓÔ×" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "ÎÅÉÚ×ÅÓÔÎÙÊ ÍÅÔÏÄ ÄÌÑ ËÁÔÁÌÏÇÏ×" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "ÎÅ×ÅÒÎÏÅ ÍÁËÓÉÍÁÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÓÏ×ÐÁÄÅÎÉÊ" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "ÎÅÉÚ×ÅÓÔÎÙÊ ÂÉÎÁÒÎÙÊ ÔÉÐ" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"üÔÏ Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ; ÓÍÏÔÒÉÔÅ ÉÓÈÏÄÎÙÅ\n" +"ÔÅËÓÔÙ ÄÌÑ ÕÓÌÏ×ÉÊ ËÏÐÉÒÏ×ÁÎÉÑ. îå ÄÁÅÔÓÑ ÎÉËÁËÏÊ ÇÁÒÁÎÔÉÉ, ÄÁÖÅ Ï\n" +"ðïäèïäéíïóôé äìñ ïðòåäåìåîîùè ãåìåê.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "ëÌÀÞ -P ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "ëÌÀÞÉ -P É -z ÎÅ ÓÏ×ÍÅÓÔÉÍÙ" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "îÅÉÚ×ÅÓÔÎÁÑ ÓÉÓÔÅÍÎÁÑ ÏÛÉÂËÁ" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: ÏÐÃÉÑ '%s' ÎÅÏÄÎÏÚÎÁÞÎÁ\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: ÏÐÃÉÑ `--%s' ÎÅ ÒÁÚÒÅÛÁÅÔ ÁÒÇÕÍÅÎÔÁ\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: ÏÐÃÉÑ `%c%s' ÎÅ ÒÁÚÒÅÛÁÅÔ ÁÒÇÕÍÅÎÔÁ\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: ÏÐÃÉÑ `%s' ÔÒÅÂÕÅÔ ÁÒÇÕÍÅÎÔ\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: ÎÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ `--%s'\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: ÎÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ÎÅ×ÅÒÎÁÑ ÏÐÃÉÑ -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: ÎÅ×ÅÒÎÁÑ ÏÐÃÉÑ -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: ÏÐÃÉÑ ÔÒÅÂÕÅÔ ÁÒÇÕÍÅÎÔ -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: ÏÐÃÉÑ `-W %s' ÎÅÏÄÎÏÚÎÁÞÎÁ\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: ÏÐÃÉÑ `-W %s' ÎÅ ÒÁÚÒÅÛÁÅÔ ÁÒÇÕÍÅÎÔÁ\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "\"" diff --git a/src/apps/bin/grep-2.5/po/sl.po b/src/apps/bin/grep-2.5/po/sl.po new file mode 100644 index 0000000000..25cf58645d --- /dev/null +++ b/src/apps/bin/grep-2.5/po/sl.po @@ -0,0 +1,444 @@ +# -*- mode: po; coding: iso-latin-2 -*- Slovenian message catalogue for grep +# Copyright (C) 1996, 1999, 2000 Free Software Foundation, Inc. +# Primo¾ Peterlin , 1996, 1999, 2000. +# +# $Id: sl.po,v 1.1 2004/03/02 02:37:05 michaelphipps Exp $ +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-11 09:25+0100\n" +"Last-Translator: Primo¾ Peterlin \n" +"Language-Team: Slovenian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Pomnilnik porabljen" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "Oklepaj [ brez zaklepaja" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Nedokonèano ube¾no zaporedje \\" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "nedokonèano ¹tevilo ponovitev" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "slabo doloèeno ¹tevilo ponovitev" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "Oklepaj ( brez zaklepaja" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Skladnja ni podana" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr "Zaklepaj ) brez oklepaja" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "zmanjkalo pomnilnika" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "pomnilnik porabljen" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "velikost konteksta ni veljavna" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "vhod je prevelik, da bi ga mogli pre¹teti" + +#: src/grep.c:597 +msgid "writing output" +msgstr "pisanje rezultatov" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Binarna datoteka %s ustreza\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(standardni vhod)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "pozor: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "rekurzivna zanka imenikov" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Uporaba: %s [IZBIRA]... VZOREC [DATOTEKA]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Poskusite ,%s --help` za dodatna pojasnila.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Uporaba: %s [IZBIRA]... VZOREC [DATOTEKA] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"V DATOTEKI ali na standardnem vhodu i¹èemo VZOREC.\n" +"Primer: %s -i 'hello.*world' menu.h main.c\n" +"\n" +"Izbira in tolmaèenje regularnih izrazov:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp VZOREC je raz¹irjeni regularni izraz\n" +" -F, --fixed-strings VZOREC je mno¾ica nizov, vsak v svoji vrstici\n" +" -G, --basic-regexp VZOREC je osnovni regularni izraz\n" +" -P, --perl-regexp VZOREC je regularni izraz z raz¹iritvami perla\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=VZOREC uporabimo VZOREC kot regularni izraz\n" +" -f, --file=DATOTEKA VZOREC preberemo s podane DATOTEKE\n" +" -i, --ignore-case ne razlikujemo med velikimi in malimi èrkami\n" +" -w, --word-regexp iskanje uspe¹no le, èe je VZOREC cela beseda\n" +" -x, --line-regexp iskanje uspe¹no le, èe je VZOREC cela vrstica\n" +" -z, --null-data vrstica podatkov je konèana z znakom NUL, ne z\n" +" znakom za skok v novo vrstico\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Razno:\n" +" -s, --no-messages brez sporoèil o napakah\n" +" -v, --invert-match komplement: vrstice, kjer ni VZORCA\n" +" -V, --version verzija programa\n" +" --help ta pomoè\n" +" --mmap èe je mo¾no, uporabi pomnilni¹ko preslikan vhod\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Nadzor izhoda:\n" +" -m, --max-count=©TEVILO odnehamo, ko je dose¾eno ©TEVILO ujemanj\n" +" -b, --byte-offset z izpisom odmika (v zlogih)\n" +" -n, --line-number z izpisom zaporedne ¹tevilke vrstice\n" +" --line-buffered izhodni medpomnilnik izpraznimo vsako vrstico\n" +" -H, --with-filename z izpisom imena datoteke\n" +" -h, --no-filename brez izpisa imena datoteke\n" +" --label=OZNAKA z navedeno OZNAKO, kadar beremo s standardnega vhoda\n" +" -o, --only-matching izpis samo dela vrstice z VZORCEM\n" +" -q, --quiet, --silent brez vsega obièajnega izpisa\n" +" --binary-type=TIP privzemi izbrani TIP binarne datoteke\n" +" TIP je lahko ,binary`, ,text` ali ,without-match`\n" +" -a, --text isto kot --binary-type=text\n" +" -I isto kot --binary-type=without-match\n" +" -d, --directories=DEJANJE kako obravnavamo imenike\n" +" DEJANJE je lahko ,read`, ,recurse` ali ,skip`\n" +" -D, --devices=DEJANJE kako obravnavamo datoteke naprav\n" +" DEJANJE je lahko ,read` ali ,skip`\n" +" -R, -r, --recursive isto kot --directories=recurse\n" +" --include=VZOREC prei¹èemo le datoteke, ki ustrezajo VZORCU\n" +" --exclude=VZOREC izpustimo datoteke, ki ustrezajo VZORCU\n" +" --exclude-from=DATOTEKA izpustimo datoteke, ki ustrezajo vzorcu v DATOTEKI\n" +" -L, --files-without-match le imena tistih DATOTEK, kjer VZORCA nismo na¹li\n" +" -l, --files-with-matches le imena tistih DATOTEK, kjer smo VZOREC na¹li\n" +" -c, --count le skupno ¹tevilo vrstic v DATOTEKI, v katerih se\n" +" pojavi VZOREC\n" +" -Z, --null izpi¹i znak NUL za imenom DATOTEKE\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Nadzor nad kontekstom:\n" +" -B, --before-context=©T ©T vrstic konteksta pred vrstico z VZORCEM\n" +" -A, --after-context=©T ©T vrstic konteksta za vrstico z VZORCEM\n" +" -C, --context[=©T] ©T vrstic konteksta pred in za vrstico z VZORCEM\n" +" -©T isto kot --context=©T\n" +" --color, --colour ujemajoèe nize barvno oznaèimo\n" +" -U, --binary ne pore¾emo znakov CR na koncu vrstic (MS-DOS)\n" +" -u, --unix-byte-offsets v odmikih ne ¹tejemo znakov CR (MS-DOS)\n" +"\n" +"Ukaz ,egrep` pomeni isto kot ,grep -E`, ,fgrep` pa isto kot ,grep -F`.\n" +"Èe DATOTEKA ni podana ali pa je -, beremo s standardnega vhoda. Èe sta podani\n" +"manj kot dve DATOTEKI, privzamemo izbiro -h. Izhodna koda je niè, èe smo VZOREC\n" +"na¹li, ena, èe ga nismo, 2 pa pomeni skladenjsko ali sistemsko napako.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Morebitne napake v programu sporoèite na .\n" + +# Sporoèilo se pojavi pri nedokumentirani izbiri -X +# grep.c:622 -> +# opt = getopt(argc, argv, "0123456789A:B:CEFGVX:bce:f:hiLlnqsvwxy" +# grep --help -> +# usage: grep [-[[AB] ]] [-[CEFGVchilnqsvwx]] [-[ef]] [] +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "podana navodila si nasprotujejo" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "neznana metoda datotek naprav" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "neznana metoda imenikov" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "neveljavno najveèje ¹tevilo" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "neznan tip binarne datoteke" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright (C) 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"To je prost program; pogoji, pod katerimi ga lahko uporabljate, razmno¾ujete\n" +"in raz¹irjate so navedeni v izvorni kodi. Za program ni NOBENEGA jamstva,\n" +"niti jamstev USTREZNOSTI ZA PRODAJO ali PRIMERNOSTI ZA UPORABO.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "Izbira -P ni podprta" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "Izbiri -P in -z se med seboj izkljuèujeta" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Neznana sistemska napaka" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: izbira ,%s` je dvoumna\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: izbira ,--%s` ne dovoljuje argumenta\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: izbira ,%c%s` ne dovoljuje argumenta\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: izbira ,%s` zahteva argument\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: neprepoznana izbira ,--%s`\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: neprepoznana izbira ,%c%s`\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: nedovoljena izbira -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: neveljavna izbira -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: izbira zahteva argument -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: izbira ,-W %s` je dvoumna\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: izbira ,-W %s` ne dovoljuje argumenta\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "," + +#: lib/quotearg.c:260 +msgid "'" +msgstr "`" + +#~ msgid "option %s" +#~ msgstr "izbira %s" + +#~ msgid " with arg %s" +#~ msgstr " z argumentom %s" + +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "¹tevke nastopajo pri dveh elementih ARGV.\n" + +#~ msgid "option %c\n" +#~ msgstr "izbira %c\n" + +#~ msgid "option a\n" +#~ msgstr "izbira a\n" + +#~ msgid "option b\n" +#~ msgstr "izbira b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "izbira c z vrednostjo ,%s`\n" + +#~ msgid "option d with value `%s'\n" +#~ msgstr "izbira d z vrednostjo ,%s`\n" + +#~ msgid "?? getopt returned character code 0%o ??\n" +#~ msgstr "?? funkcija getopt vrnila kodo znaka 0%o ??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "neizbirni elementi ARGV: " + +#~ msgid "memory exhausted\n" +#~ msgstr "pomnilnik porabljen\n" + +#~ msgid "you may specify only one of -E, -F, or -G" +#~ msgstr "izberete lahko samo eno od izbir: -E, -F ali -G" + +#~ msgid "GNU grep version 2.0" +#~ msgstr "GNU grep verzija 2.0" + +#~ msgid "(standard input)\n" +#~ msgstr "(standardni vhod)\n" diff --git a/src/apps/bin/grep-2.5/po/stamp-cat-id b/src/apps/bin/grep-2.5/po/stamp-cat-id new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/stamp-cat-id @@ -0,0 +1 @@ +timestamp diff --git a/src/apps/bin/grep-2.5/po/sv.po b/src/apps/bin/grep-2.5/po/sv.po new file mode 100644 index 0000000000..5b2d0de631 --- /dev/null +++ b/src/apps/bin/grep-2.5/po/sv.po @@ -0,0 +1,390 @@ +# Swedish messages for GNU Grep version 2.5e +# Copyright (C) 2001 Free Software Foundation, Inc. +# Thomas Olsson , 1996. +# Daniel Resare , 1998, 1999, 2000, 2001 +# $Id: sv.po,v 1.1 2004/03/02 02:37:05 michaelphipps Exp $ +# +msgid "" +msgstr "" +"Project-Id-Version: GNU grep 2.5e\n" +"POT-Creation-Date: 2001-03-07 00:02-0500\n" +"PO-Revision-Date: 2001-08-23 09:46+02:00\n" +"Last-Translator: Daniel Resare \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/grep.c:944 src/search.c:706 +msgid "Memory exhausted" +msgstr "Minnet slut" + +#: src/dfa.c:486 src/dfa.c:489 src/dfa.c:507 src/dfa.c:518 src/dfa.c:542 +#: src/dfa.c:601 src/dfa.c:606 src/dfa.c:619 src/dfa.c:620 src/dfa.c:998 +#: src/dfa.c:1001 src/dfa.c:1025 src/dfa.c:1029 src/dfa.c:1030 src/dfa.c:1033 +#: src/dfa.c:1045 src/dfa.c:1046 +msgid "Unbalanced [" +msgstr "Obalanserad [" + +#: src/dfa.c:738 +msgid "Unfinished \\ escape" +msgstr "Oavslutad \\-sekvens" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:871 src/dfa.c:877 src/dfa.c:887 src/dfa.c:895 src/dfa.c:910 +msgid "unfinished repeat count" +msgstr "oavslutad repetitionsräknare" + +#: src/dfa.c:884 src/dfa.c:901 src/dfa.c:909 src/dfa.c:913 +msgid "malformed repeat count" +msgstr "felformaterad repetionsräknare" + +#: src/dfa.c:1232 +msgid "Unbalanced (" +msgstr "Obalanserad (" + +#: src/dfa.c:1357 +msgid "No syntax specified" +msgstr "Ingen specificerad syntax" + +#: src/dfa.c:1365 +msgid "Unbalanced )" +msgstr "Obalanserad )" + +#: src/dfa.c:2933 +msgid "out of memory" +msgstr "minnet slut" + +#: lib/obstack.c:471 src/grep.c:343 src/kwset.c:171 src/kwset.c:177 +#: src/search.c:103 src/search.c:223 src/search.c:307 +msgid "memory exhausted" +msgstr "minnet slut" + +#: src/grep.c:191 +msgid "invalid context length argument" +msgstr "ogiltigt argument till -A, -B eller -C" + +#: src/grep.c:466 +msgid "input is too large to count" +msgstr "det är för mycket indata för att räkna" + +#: src/grep.c:539 +msgid "writing output" +msgstr "skriver utdata" + +#: src/grep.c:812 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Binär fil %s matchar\n" + +#: src/grep.c:826 +msgid "(standard input)" +msgstr "(standard in)" + +#: src/grep.c:931 +#, c-format +msgid "warning: %s: %s\n" +msgstr "varning: %s: %s\n" + +#: src/grep.c:932 +msgid "recursive directory loop" +msgstr "rekursiv katalogloop" + +#: src/grep.c:980 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Användning: %s [FLAGGA]... MÖNSTER [FIL]...\n" + +#: src/grep.c:982 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Försök med \"%s --help\" för mer information\n" + +#: src/grep.c:987 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Användning: %s [FLAGGA]... MÖNSTER [FIL]...\n" + +#: src/grep.c:988 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Sök efter MÖNSTER i varje FIL eller standard in.\n" +"Exempel: %s -i 'hello world' menu.h main.c\n" +"\n" +"Val och tolkning av reguljära uttryck:\n" + +#: src/grep.c:993 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp MÖNSTER är ett utökat reguljärt uttryck\n" +" -F, --fixed-strings MÖNSTER är ett antal strängar separerade med nyrad\n" +" -G, --basic-regexp MÖNSTER är ett enkelt reguljärt uttryck\n" +" -P, --perl-regexp MÖNSTER är ett reguljärt uttryck som i Perl\n" + +#: src/grep.c:998 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=MÖNSTER använd MÖNSTER som ett reguljärt uttryck\n" +" -f, --file=FIL hämta MÖNSTER från FIL\n" +" -i, --ignore-case skilj ej på gemener och versaler\n" +" -w, --word-regexp tvinga MÖNSTER att endast matcha hela ord\n" +" -x, --line-regexp tvinga MÖNSTER att endast matcha hela rader\n" +" -z, --null-data en rad indata begränsas av en nolltecken, inte\n" +" av ett nyrad-tecken\n" + +#: src/grep.c:1005 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"Diverse:\n" +" -s, --no-messages visa inga felmeddelanden\n" +" -v, --invert-match välj rader utan träffar\n" +" -V, --version visa versionsinformation och avsluta\n" +" --help visa detta hjälpmeddelande och avsluta\n" +" --mmap använd om möjligt minesmappning vid\n" +" läsning av indata.\n" + +#: src/grep.c:1013 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examine\n" +" --exclude=PATTERN files that match PATTERN will be skip.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skip.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Styrning av utskrift:\n" +" -m, --max-count=NUM skriv bara ut NUM träffar\n" +" -b, --byte-offset skriv position med visade rader\n" +" -n, --line-number skriv radnummer med visade rader\n" +" --line-buffered töm utskriftsbuffer efter varje rad\n" +" -H, --with-filename skriv filnamn vid varje träff\n" +" -h, --no-filename skriv inte filnamn vid varje visad rad\n" +" -q, --quiet, --silent undvik all normal utskrift\n" +" --binary-files=TYP antag att binära filer är av TYP\n" +" TYP är \"binary\", \"text\" eller \"without-match\"\n" +" -a, --text motsvarar --binary-files=text\n" +" -I motsvarar --binary-files=without-match\n" +" -d, --directories=ÅTGÄRD hur kataloger skall hanteras\n" +" ÅTGÄRD är \"read\", \"recurse\" eller \"skip\".\n" +" -R, -r, --recursive motsvarar --directories=recurse\n" +" --include=MÖNSTER filer som matchar MÖNSTER undersöks\n" +" --exclude=MÖNSTER filer som matchar MÖNSTER hoppas över\n" +" --exclude-from=FIL filer som matchar mönster i FIL hoppas över\n" +" -L, --files-without-match skriv bara ut FILnamn utan träffar\n" +" -l, --files-with-matches skriv bara ut FILnamn med träffar\n" +" -c, --count skriv för varje FIL bara ut antal träffade rader\n" +" -Z, --null skriv 0-byte efter FILnamn\n" + +#: src/grep.c:1037 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color, --colour use markers to distinguish the matching string\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"Kontroll av sammanhang:\n" +" -B, --before-context=ANTAL skriv ANTAL rader före träffad rad\n" +" -A, --after-context=ANTAL skriv ANTAL rader efter träffad rad\n" +" -C, --context=ANTAL skriv ANTAL rader runt träffad rad\n" +" -ANTAL motsvarar --context=ANTAL\n" +" --color, --colour använd markörer för att särskilja träff\n" +" -U, --binary ta inte bort CR-tecken vid radslut (MSDOS)\n" +" -u, --unix-byte-offsets skriv offset som om CR-tecken inte förekommit\n" +"\n" +"\"egrep\" betyder \"grep -E\". \"fgrep\" betyder \"grep -F\".\n" +"Utan FIL, eller om FIL är -, läser programmet från standard in. Om färre än\n" +"två FILer är angivna, sätts flaggan -h. Programmet returnerar 0 om något\n" +"matchar, 1 om inget matchade och 2 om något fel uppstått.\n" + +#: src/grep.c:1052 +msgid "\nReport bugs to .\n" +msgstr "" +"\n" +"Rapportera buggar till .\n" +"Skicka anmärkningar på översättningar till \n" + +#: src/grep.c:1062 +msgid "conflicting matchers specified" +msgstr "motstridiga söksträngar specificerade" + +#: src/grep.c:1355 +msgid "unknown directories method" +msgstr "okänd metod gällande kataloger" + +#: src/grep.c:1422 +msgid "invalid max count" +msgstr "ogiltigt värde för antal träffar" + +#: src/grep.c:1472 +msgid "unknown binary-files type" +msgstr "okänd binärfiltyp" + +#: src/grep.c:1543 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1545 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1547 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Detta program är fri programvara, se källkoden för kopieringsvilkor. Det\n" +"finns INGEN garanti, inte ens för SÄLJBARHET eller LÄMPLIGHET FÖR NÅGOT\n" +"SPECIELLT ÄNDAMÅL.\n" + +#: src/search.c:623 +msgid "The -P option is not supported" +msgstr "Flaggan -P stöds inte" + +#: src/search.c:636 +msgid "The -P and -z options cannot be combined" +msgstr "Flaggorna -P och -z kan inte kombineras" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Okänt systemfel" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: flaggan \"%s\" är tvetydig\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: flaggan \"%s\" tar inget argument\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: flaggan \"%c%s\" tar inget argument\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: flaggan \"%s\" behöver ett argument\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: okänd flagga \"--%s\"\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: okänd flagga \"%c%s\"\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: otillåten flagga -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: otillåten flagga -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flagga behöver ett argument -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: flaggan \"-W %s\" är tvetydig\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: flaggan \"-W %s\" tillåter inget argument\n" + +# Då det skulle krävas att spara hela filen i UTF-8 för att kunna göra +# detta rätt, känns det inte värt det. Speciellt eftersom funktionen +# inte används i grep +# +#. 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. +#: lib/quotearg.c:265 +msgid "`" +msgstr "\"" + +#: lib/quotearg.c:266 +msgid "'" +msgstr "\"" diff --git a/src/apps/bin/grep-2.5/po/tr.po b/src/apps/bin/grep-2.5/po/tr.po new file mode 100644 index 0000000000..ffe750dc8d --- /dev/null +++ b/src/apps/bin/grep-2.5/po/tr.po @@ -0,0 +1,396 @@ +# Turkish translations for GNU grep messages. +# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Nilgün Belma Bugüner , 2001, 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: grep 2.5g\n" +"POT-Creation-Date: 2002-01-22 14:39+0100\n" +"PO-Revision-Date: 2002-03-07 03:44+0200\n" +"Last-Translator: Nilgün Belma Bugüner \n" +"Language-Team: Turkish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 0.9.5\n" + +#: src/dfa.c:136 src/dfa.c:147 src/dfa.c:158 src/search.c:689 +msgid "Memory exhausted" +msgstr "Bellek tükendi" + +#: src/dfa.c:489 src/dfa.c:492 src/dfa.c:510 src/dfa.c:521 src/dfa.c:545 src/dfa.c:604 src/dfa.c:609 src/dfa.c:622 src/dfa.c:623 src/dfa.c:1001 src/dfa.c:1004 src/dfa.c:1028 src/dfa.c:1032 src/dfa.c:1033 src/dfa.c:1036 src/dfa.c:1048 src/dfa.c:1049 +msgid "Unbalanced [" +msgstr "Karşılıksız [" + +#: src/dfa.c:741 +msgid "Unfinished \\ escape" +msgstr "Tamamlanmamış \\ öncelemi" + +#. Cases: +#. {M} - exact count +#. {M,} - minimum count, maximum is infinity +#. {M,N} - M through N +#: src/dfa.c:874 src/dfa.c:880 src/dfa.c:890 src/dfa.c:898 src/dfa.c:913 +msgid "unfinished repeat count" +msgstr "Tamamlanmamış tekrar sayısı" + +#: src/dfa.c:887 src/dfa.c:904 src/dfa.c:912 src/dfa.c:916 +msgid "malformed repeat count" +msgstr "Tekrar sayısı hatalı" + +#: src/dfa.c:1253 +msgid "Unbalanced (" +msgstr "Karşılıksız (" + +#: src/dfa.c:1378 +msgid "No syntax specified" +msgstr "Sözdizimi belirtilmemiÅŸ" + +#: src/dfa.c:1386 +msgid "Unbalanced )" +msgstr "Karşılıksız )" + +#: src/dfa.c:2956 +msgid "out of memory" +msgstr "bellek yetersiz" + +#: lib/obstack.c:471 src/kwset.c:171 src/kwset.c:177 src/search.c:103 src/search.c:209 src/search.c:293 +msgid "memory exhausted" +msgstr "bellek tükendi" + +#: src/grep.c:205 +msgid "invalid context length argument" +msgstr "baÄŸlam uzunluk deÄŸeri geçersiz" + +#: src/grep.c:475 +msgid "input is too large to count" +msgstr "girdi sayılamayacak kadar büyük" + +#: src/grep.c:597 +msgid "writing output" +msgstr "çıktıyı yazıyor" + +#: src/grep.c:870 +#, c-format +msgid "Binary file %s matches\n" +msgstr "Ä°kilik dosya %s eÅŸleÅŸir\n" + +#: src/grep.c:884 +msgid "(standard input)" +msgstr "(standart girdi)" + +#: src/grep.c:989 +#, c-format +msgid "warning: %s: %s\n" +msgstr "uyarı: %s: %s\n" + +#: src/grep.c:990 +msgid "recursive directory loop" +msgstr "ardışık dizin çevrimi" + +#: src/grep.c:1038 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" +msgstr "Kullanımı: %s [SEÇENEK]... MASKE [DOSYA]...\n" + +#: src/grep.c:1040 +#, c-format +msgid "Try `%s --help' for more information.\n" +msgstr "Daha fazla bilgi için `%s --help' yazın.\n" + +#: src/grep.c:1045 +#, c-format +msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" +msgstr "Kullanımı: %s [SEÇENEK]... KALIP [DOSYA] ...\n" + +#: src/grep.c:1046 +#, c-format +msgid "" +"Search for PATTERN in each FILE or standard input.\n" +"Example: %s -i 'hello world' menu.h main.c\n" +"\n" +"Regexp selection and interpretation:\n" +msgstr "" +"Standart girdi ya da her DOSYA içinde KALIP için arama yapar.\n" +"ÖrneÄŸin: %s -i 'merhaba dunya' menu.h main.c\n" +"\n" +"Düzenli ifade seçimi ve yorumlanması:\n" + +#: src/grep.c:1051 +msgid "" +" -E, --extended-regexp PATTERN is an extended regular expression\n" +" -F, --fixed-strings PATTERN is a set of newline-separated strings\n" +" -G, --basic-regexp PATTERN is a basic regular expression\n" +" -P, --perl-regexp PATTERN is a Perl regular expression\n" +msgstr "" +" -E, --extended-regexp KALIP bir geniÅŸletilmiÅŸ düzenli ifadedir\n" +" -F, --fixed-strings KALIP satır satır ayrılmış bir dizgedir\n" +" -G, --basic-regexp KALIP bir temel düzenli ifadedir\n" +" -P, --perl-regexp KALIP bir Perl düzenli ifadesidir\n" + +#: src/grep.c:1056 +msgid "" +" -e, --regexp=PATTERN use PATTERN as a regular expression\n" +" -f, --file=FILE obtain PATTERN from FILE\n" +" -i, --ignore-case ignore case distinctions\n" +" -w, --word-regexp force PATTERN to match only whole words\n" +" -x, --line-regexp force PATTERN to match only whole lines\n" +" -z, --null-data a data line ends in 0 byte, not newline\n" +msgstr "" +" -e, --regexp=KALIP KALIP bir düzenli ifade olarak kullanılır\n" +" -f, --file=DOSYA KALIP DOSYA dan alınır\n" +" -i, --ignore-case harf büyüklüklerini bir ayrım olarak görmez\n" +" -w, --word-regexp KALIP bir deyim olarak ele alınır\n" +" -x, --line-regexp KALIP bir bütün satır olarak ele alınır\n" +" -z, --null-data satır sonu içermeyen 0 baytlık satır\n" + +#: src/grep.c:1063 +msgid "" +"\n" +"Miscellaneous:\n" +" -s, --no-messages suppress error messages\n" +" -v, --invert-match select non-matching lines\n" +" -V, --version print version information and exit\n" +" --help display this help and exit\n" +" --mmap use memory-mapped input if possible\n" +msgstr "" +"\n" +"ÇeÅŸitli:\n" +" -s, --no-messages hata iletileri gösterilmez\n" +" -v, --invert-match eÅŸleÅŸmeyen satırlar seçilir\n" +" -V, --version sürümü gösterir ve çıkar\n" +" --help bu iletileri gösterir ve çıkar\n" +" --mmap mümkünse bellek-eÅŸlemli girdi kullanılır\n" + +#: src/grep.c:1071 +msgid "" +"\n" +"Output control:\n" +" -m, --max-count=NUM stop after NUM matches\n" +" -b, --byte-offset print the byte offset with output lines\n" +" -n, --line-number print line number with output lines\n" +" --line-buffered flush output on every line\n" +" -H, --with-filename print the filename for each match\n" +" -h, --no-filename suppress the prefixing filename on output\n" +" --label=LABEL print LABEL as filename for standard input\n" +" -o, --only-matching show only the part of a line matching PATTERN\n" +" -q, --quiet, --silent suppress all normal output\n" +" --binary-files=TYPE assume that binary files are TYPE\n" +" TYPE is 'binary', 'text', or 'without-match'\n" +" -a, --text equivalent to --binary-files=text\n" +" -I equivalent to --binary-files=without-match\n" +" -d, --directories=ACTION how to handle directories\n" +" ACTION is 'read', 'recurse', or 'skip'\n" +" -D, --devices=ACTION how to handle devices, FIFOs and sockets\n" +" ACTION is 'read' or 'skip'\n" +" -R, -r, --recursive equivalent to --directories=recurse\n" +" --include=PATTERN files that match PATTERN will be examined\n" +" --exclude=PATTERN files that match PATTERN will be skipped.\n" +" --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n" +" -L, --files-without-match only print FILE names containing no match\n" +" -l, --files-with-matches only print FILE names containing matches\n" +" -c, --count only print a count of matching lines per FILE\n" +" -Z, --null print 0 byte after FILE name\n" +msgstr "" +"\n" +"Çıktı denetimi:\n" +" -m, --max-count=SAYI SAYI eÅŸleÅŸmeden sonra durur\n" +" -b, --byte-offset çıktı satırlarında bayt adresi de gösterilir\n" +" -n, --line-number çıktı satırlarında satır no.ları da gösterilir\n" +" --line-buffered her satırda tüm çıktı gösterilir\n" +" -H, --with-filename her eÅŸleÅŸmede dosya ismi de gösterilir\n" +" -h, --no-filename dosya ismi gösterilmez\n" +" --label=ETÄ°KET standar girdi dosyası olarak ETÄ°KET gösterirlir\n" +" -o, --only-matching sadece satırın KALIPla eÅŸleÅŸen bölümü gösterilir\n" +" -q, --quiet, --silent çıktı verilmez\n" +" --binary-files=TÃœR ikilik dosyalar TÃœR türünde varsayılır\n" +" TÃœR: 'binary', 'text', ya da 'without-match'\n" +" -a, --text --binary-files=text ile aynı\n" +" -I --binary-files=without-match ile aynı\n" +" -d, --directories=EYLEM dizinlerin ele alınma ÅŸekli\n" +" EYLEM: 'read', 'recurse', ya da 'skip'\n" +" -D, --devices=EYLEM aygıtların ele alınma ÅŸekli, FIFO ve soketler\n" +" için EYLEM: 'read' ya da 'skip'\n" +" -R, -r, --recursive --directories=recurse ile aynı (ardışık)\n" +" --include=KALIP KALIP ile eÅŸleÅŸen dosyalar gösterilir\n" +" --exclude=KALIP KALIP ile eÅŸleÅŸen dosyalar atlanır\n" +" --exclude-from=DOSYA DOSYA içindeki dosyalardan KALIP ile eÅŸleÅŸenler atlanır.\n" +" -L, --files-without-match sadece eÅŸleÅŸmeyen DOSYA isimleri gösterilir\n" +" -l, --files-with-matches sadece eÅŸleÅŸen DOSYA isimleri gösterilir\n" +" -c, --count her DOSYAdaki eÅŸleÅŸen satır sayısı gösterilir\n" +" -Z, --null DOSYA isminin arkasına null ekler\n" + +#: src/grep.c:1099 +msgid "" +"\n" +"Context control:\n" +" -B, --before-context=NUM print NUM lines of leading context\n" +" -A, --after-context=NUM print NUM lines of trailing context\n" +" -C, --context=NUM print NUM lines of output context\n" +" -NUM same as --context=NUM\n" +" --color[=WHEN],\n" +" --colour[=WHEN] use markers to distinguish the matching string\n" +" WHEN may be `always', `never' or `auto'.\n" +" -U, --binary do not strip CR characters at EOL (MSDOS)\n" +" -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n" +"\n" +"`egrep' means `grep -E'. `fgrep' means `grep -F'.\n" +"With no FILE, or when FILE is -, read standard input. If less than\n" +"two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n" +"and 2 if trouble.\n" +msgstr "" +"\n" +"BaÄŸlamsal denetim:\n" +" -B, --before-context=SAYI baÄŸlamdan önceki SAYI satır gösterilir\n" +" -A, --after-context=SAYI baÄŸlamdan sonraki SAYI satır gösterilir\n" +" -C, --context=SAYI çıktı olarak SAYI satır gösterilir\n" +" -SAYI --context=SAYI ile aynı\n" +" --color[=SÃœREÇ],\n" +" --colour[=SÃœREÇ] eÅŸleÅŸen dizgeleri ayırt etmede renk kullanılır\n" +" SÃœREÇ: daima 'always', hiç 'never', 'auto' -U, --binary satır sonlarındaki satırbaşı (CR) karakterlerini\n" +" kaldırmaz\n" +" -u, --unix-byte-offsets satırbaşı karakterlerine bakmaz\n" +"\n" +"`egrep' ile `grep -E', `fgrep' ile `grep -F' aynı iÅŸi yapar.\n" +"DOSYA verilmeksizin ya da yerine - verilirse standart girdi okunur.\n" +"Ä°ki DOSYAdan az verilmiÅŸse -h varsayılır.\n" +"Çıkışta durum eÅŸleÅŸme varsa 0, yoksa 1, belirsizlik varsa 2 dir.\n" + +#: src/grep.c:1116 +msgid "" +"\n" +"Report bugs to .\n" +msgstr "" +"\n" +"Yazılım hatalarını adresine bildirin.\n" + +#: src/grep.c:1126 +msgid "conflicting matchers specified" +msgstr "birbiriyle çatışan eÅŸleÅŸtiriciler belirtildi" + +#: src/grep.c:1363 +msgid "unknown devices method" +msgstr "bilinmeyen aygıt yöntemi" + +#: src/grep.c:1430 +msgid "unknown directories method" +msgstr "bilinmeyen dizin yöntemi" + +#: src/grep.c:1497 +msgid "invalid max count" +msgstr "en çok miktarı geçersiz" + +#: src/grep.c:1551 +msgid "unknown binary-files type" +msgstr "bilinmeyen ikilik dosya türü" + +#: src/grep.c:1646 +#, c-format +msgid "%s (GNU grep) %s\n" +msgstr "%s (GNU grep) %s\n" + +#: src/grep.c:1648 +msgid "Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" +msgstr "Telif Hakkı 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n" + +#: src/grep.c:1650 +msgid "" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +msgstr "" +"Bu serbest yazılımdır; kopyalama koÅŸulları için kaynak koduna bakınız.\n" +"Hiçbir garantisi yoktur; hatta SATILABÄ°LÄ°RLİĞİ veya ÅžAHSÄ° KULLANIMINIZA\n" +"UYGUNLUÄžU için bile garanti verilmez.\n" + +#: src/search.c:606 +msgid "The -P option is not supported" +msgstr "-P seçeneÄŸi desteklenmiyor" + +#: src/search.c:619 +msgid "The -P and -z options cannot be combined" +msgstr "-P ve -z seçenekleri birlikte olamaz" + +#: lib/error.c:117 +msgid "Unknown system error" +msgstr "Bilinmeyen sistem hatası" + +#: lib/getopt.c:675 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: `%s' seçeneÄŸi belirsiz\n" + +#: lib/getopt.c:700 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: `--%s' seçeneÄŸi argümansız kullanılır\n" + +#: lib/getopt.c:705 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: seçenek `%c%s' argümansız kullanılır\n" + +#: lib/getopt.c:723 lib/getopt.c:896 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: `%s' seçeneÄŸi bir argümanla kullanılır\n" + +#. --option +#: lib/getopt.c:752 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: `--%s' seçeneÄŸi bilinmiyor\n" + +#. +option or -option +#: lib/getopt.c:756 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: `%c%s' seçeneÄŸi bilinmiyor\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:782 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: kuraldışı seçenek -- %c\n" + +#: lib/getopt.c:785 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: geçersiz seçenek -- %c\n" + +#. 1003.2 specifies the format of this message. +#: lib/getopt.c:815 lib/getopt.c:945 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: seçenek bir argümanla kullanılır -- %c\n" + +#: lib/getopt.c:862 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: `-W %s' seçeneÄŸi belirsiz\n" + +#: lib/getopt.c:880 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: `-W %s' seçeneÄŸi argümansız kullanılır\n" + +#. 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. +#: lib/quotearg.c:259 +msgid "`" +msgstr "`" + +#: lib/quotearg.c:260 +msgid "'" +msgstr "'" diff --git a/src/apps/bin/grep-2.5/src/Jamfile b/src/apps/bin/grep-2.5/src/Jamfile new file mode 100644 index 0000000000..336ea326fc --- /dev/null +++ b/src/apps/bin/grep-2.5/src/Jamfile @@ -0,0 +1,6 @@ +SubDir OBOS_TOP src apps bin grep-2.5 src ; + +SubDirCcFlags += -I ../lib -DHAVE_CONFIG_H -DLOCALEDIR=\'\"/share/locale\"\' ; + +BinCommand grep : dfa.c grep.c grepmat.c kwset.c search.c : root libgreputils.a ; + diff --git a/src/apps/bin/grep-2.5/src/Makefile b/src/apps/bin/grep-2.5/src/Makefile new file mode 100644 index 0000000000..924fc2f581 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/Makefile @@ -0,0 +1,361 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/grep +pkglibdir = $(libdir)/grep +pkgincludedir = $(includedir)/grep +top_builddir = .. + +ACLOCAL = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal +AUTOCONF = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf +AUTOMAKE = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake +AUTOHEADER = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader + +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i586-pc-beos +AMTAR = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar +AWK = gawk +BUILD_INCLUDED_LIBINTL = yes +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +CC = gcc +CPP = gcc -E +DATADIRNAME = share +DEPDIR = .deps +EXEEXT = +GENCAT = gencat +GETCONF = +GLIBC21 = no +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +GMSGFMT = : +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INSTOBJEXT = .mo +INTLBISON = bison +INTLLIBS = $(top_builddir)/intl/libintl.a +INTLOBJS = $(GETTOBJS) +INTL_LIBTOOL_SUFFIX_PREFIX = +LIBICONV = +MKINSTALLDIRS = ./mkinstalldirs +MSGFMT = : +OBJEXT = o +PACKAGE = grep +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +POSUB = po +RANLIB = ranlib +SEP = : +SYMLINK = ln -s +SYMLINKFROM = grep +U = +USE_INCLUDED_LIBINTL = yes +USE_NLS = yes +VERSION = 2.5 +am__include = include +am__quote = +install_sh = /boot/home/Development/current/src/apps/bin/grep-2.5/install-sh +datadir = $(prefix)/share + +AUTOMAKE_OPTIONS = ansi2knr no-dependencies + +LN = ln + +bin_PROGRAMS = grep +grep_SOURCES = grep.c dfa.c kwset.c search.c \ + grepmat.c + +noinst_HEADERS = grep.h dfa.h kwset.h getpagesize.h system.h + +LDADD = $(top_builddir)/intl/libintl.a ../lib/libgreputils.a +localedir = $(datadir)/locale +INCLUDES = -I../intl -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\" + +EXTRA_DIST = \ + dosbuf.c \ + vms_fab.c vms_fab.h + +subdir = src +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = grep$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_grep_OBJECTS = grep$U.$(OBJEXT) dfa$U.$(OBJEXT) kwset$U.$(OBJEXT) \ + search$U.$(OBJEXT) grepmat$U.$(OBJEXT) +grep_OBJECTS = $(am_grep_OBJECTS) +grep_LDADD = $(LDADD) +grep_DEPENDENCIES = ../lib/libgreputils.a +grep_LDFLAGS = + +DEFS = -DHAVE_CONFIG_H +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = +LDFLAGS = +LIBS = +depcomp = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = -g -O2 +DIST_SOURCES = $(grep_SOURCES) +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in ansi2knr.1 \ + ansi2knr.c +SOURCES = $(grep_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +grep$(EXEEXT): $(grep_OBJECTS) $(grep_DEPENDENCIES) + @rm -f grep$(EXEEXT) + $(LINK) $(grep_LDFLAGS) $(grep_OBJECTS) $(grep_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +ANSI2KNR = +ansi2knr: ansi2knr.$(OBJEXT) + $(LINK) ansi2knr.$(OBJEXT) $(LIBS) +ansi2knr.$(OBJEXT): $(CONFIG_HEADER) + +clean-krextra: + -rm -f ansi2knr + +mostlyclean-kr: + -rm -f *_.c + +.c.o: + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: + $(COMPILE) -c `cygpath -w $<` +dfa_.c: dfa.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dfa.c; then echo $(srcdir)/dfa.c; else echo dfa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dfa_.c || rm -f dfa_.c +grep_.c: grep.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/grep.c; then echo $(srcdir)/grep.c; else echo grep.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > grep_.c || rm -f grep_.c +grepmat_.c: grepmat.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/grepmat.c; then echo $(srcdir)/grepmat.c; else echo grepmat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > grepmat_.c || rm -f grepmat_.c +kwset_.c: kwset.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kwset.c; then echo $(srcdir)/kwset.c; else echo kwset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kwset_.c || rm -f kwset_.c +search_.c: search.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/search.c; then echo $(srcdir)/search.c; else echo search.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > search_.c || rm -f search_.c +dfa_.$(OBJEXT) grep_.$(OBJEXT) grepmat_.$(OBJEXT) kwset_.$(OBJEXT) \ +search_.$(OBJEXT) : $(ANSI2KNR) +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(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 $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(ANSI2KNR) $(PROGRAMS) $(HEADERS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +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)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-krextra mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS install-exec-local + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-krextra distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-exec install-exec-am install-exec-local \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-kr tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + + +install-exec-local: + ln -s grep $(bindir)/egrep + ln -s grep $(bindir)/fgrep +# 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: diff --git a/src/apps/bin/grep-2.5/src/Makefile.am b/src/apps/bin/grep-2.5/src/Makefile.am new file mode 100644 index 0000000000..0306bf1b57 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/Makefile.am @@ -0,0 +1,22 @@ +## Process this file with automake to create Makefile.in +AUTOMAKE_OPTIONS = ansi2knr no-dependencies + +LN = ln + +bin_PROGRAMS = grep +grep_SOURCES = grep.c dfa.c kwset.c search.c \ + grepmat.c +noinst_HEADERS = grep.h dfa.h kwset.h getpagesize.h system.h + +LDADD = @INTLLIBS@ ../lib/libgreputils.a +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +INCLUDES = -I../intl -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\" + +EXTRA_DIST = \ + dosbuf.c \ + vms_fab.c vms_fab.h + +install-exec-local: + @SYMLINK@ @SYMLINKFROM@ $(bindir)/egrep + @SYMLINK@ @SYMLINKFROM@ $(bindir)/fgrep diff --git a/src/apps/bin/grep-2.5/src/Makefile.in b/src/apps/bin/grep-2.5/src/Makefile.in new file mode 100644 index 0000000000..967f28dc8e --- /dev/null +++ b/src/apps/bin/grep-2.5/src/Makefile.in @@ -0,0 +1,361 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GETCONF = @GETCONF@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SEP = @SEP@ +SYMLINK = @SYMLINK@ +SYMLINKFROM = @SYMLINKFROM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +datadir = $(prefix)/@DATADIRNAME@ + +AUTOMAKE_OPTIONS = ansi2knr no-dependencies + +LN = ln + +bin_PROGRAMS = grep +grep_SOURCES = grep.c dfa.c kwset.c search.c \ + grepmat.c + +noinst_HEADERS = grep.h dfa.h kwset.h getpagesize.h system.h + +LDADD = @INTLLIBS@ ../lib/libgreputils.a +localedir = $(datadir)/locale +INCLUDES = -I../intl -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\" + +EXTRA_DIST = \ + dosbuf.c \ + vms_fab.c vms_fab.h + +subdir = src +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = grep$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_grep_OBJECTS = grep$U.$(OBJEXT) dfa$U.$(OBJEXT) kwset$U.$(OBJEXT) \ + search$U.$(OBJEXT) grepmat$U.$(OBJEXT) +grep_OBJECTS = $(am_grep_OBJECTS) +grep_LDADD = $(LDADD) +grep_DEPENDENCIES = ../lib/libgreputils.a +grep_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(grep_SOURCES) +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in ansi2knr.1 \ + ansi2knr.c +SOURCES = $(grep_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +grep$(EXEEXT): $(grep_OBJECTS) $(grep_DEPENDENCIES) + @rm -f grep$(EXEEXT) + $(LINK) $(grep_LDFLAGS) $(grep_OBJECTS) $(grep_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +ANSI2KNR = @ANSI2KNR@ +ansi2knr: ansi2knr.$(OBJEXT) + $(LINK) ansi2knr.$(OBJEXT) $(LIBS) +ansi2knr.$(OBJEXT): $(CONFIG_HEADER) + +clean-krextra: + -rm -f ansi2knr + +mostlyclean-kr: + -rm -f *_.c + +.c.o: + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: + $(COMPILE) -c `cygpath -w $<` +dfa_.c: dfa.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dfa.c; then echo $(srcdir)/dfa.c; else echo dfa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dfa_.c || rm -f dfa_.c +grep_.c: grep.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/grep.c; then echo $(srcdir)/grep.c; else echo grep.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > grep_.c || rm -f grep_.c +grepmat_.c: grepmat.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/grepmat.c; then echo $(srcdir)/grepmat.c; else echo grepmat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > grepmat_.c || rm -f grepmat_.c +kwset_.c: kwset.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kwset.c; then echo $(srcdir)/kwset.c; else echo kwset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kwset_.c || rm -f kwset_.c +search_.c: search.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/search.c; then echo $(srcdir)/search.c; else echo search.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > search_.c || rm -f search_.c +dfa_.$(OBJEXT) grep_.$(OBJEXT) grepmat_.$(OBJEXT) kwset_.$(OBJEXT) \ +search_.$(OBJEXT) : $(ANSI2KNR) +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(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 $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(ANSI2KNR) $(PROGRAMS) $(HEADERS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +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)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-krextra mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS install-exec-local + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-krextra distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-exec install-exec-am install-exec-local \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-kr tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + + +install-exec-local: + @SYMLINK@ @SYMLINKFROM@ $(bindir)/egrep + @SYMLINK@ @SYMLINKFROM@ $(bindir)/fgrep +# 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: diff --git a/src/apps/bin/grep-2.5/src/ansi2knr.1 b/src/apps/bin/grep-2.5/src/ansi2knr.1 new file mode 100644 index 0000000000..f9ee5a631c --- /dev/null +++ b/src/apps/bin/grep-2.5/src/ansi2knr.1 @@ -0,0 +1,36 @@ +.TH ANSI2KNR 1 "19 Jan 1996" +.SH NAME +ansi2knr \- convert ANSI C to Kernighan & Ritchie C +.SH SYNOPSIS +.I ansi2knr +[--varargs] input_file [output_file] +.SH DESCRIPTION +If no output_file is supplied, output goes to stdout. +.br +There are no error messages. +.sp +.I ansi2knr +recognizes function definitions by seeing a non-keyword identifier at the left +margin, followed by a left parenthesis, with a right parenthesis as the last +character on the line, and with a left brace as the first token on the +following line (ignoring possible intervening comments). It will recognize a +multi-line header provided that no intervening line ends with a left or right +brace or a semicolon. These algorithms ignore whitespace and comments, except +that the function name must be the first thing on the line. +.sp +The following constructs will confuse it: +.br + - Any other construct that starts at the left margin and follows the +above syntax (such as a macro or function call). +.br + - Some macros that tinker with the syntax of the function header. +.sp +The --varargs switch is obsolete, and is recognized only for +backwards compatibility. The present version of +.I ansi2knr +will always attempt to convert a ... argument to va_alist and va_dcl. +.SH AUTHOR +L. Peter Deutsch wrote the original ansi2knr and +continues to maintain the current version; most of the code in the current +version is his work. ansi2knr also includes contributions by Francois +Pinard and Jim Avera . diff --git a/src/apps/bin/grep-2.5/src/ansi2knr.c b/src/apps/bin/grep-2.5/src/ansi2knr.c new file mode 100644 index 0000000000..d9bdcaf890 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/ansi2knr.c @@ -0,0 +1,678 @@ +/* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. */ + +/*$Id: ansi2knr.c,v 1.1 2004/03/02 02:37:05 michaelphipps Exp $*/ +/* Convert ANSI C function definitions to K&R ("traditional C") syntax */ + +/* +ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY. No author or distributor accepts responsibility to anyone for the +consequences of using it or for whether it serves any particular purpose or +works at all, unless he says so in writing. Refer to the GNU General Public +License (the "GPL") for full details. + +Everyone is granted permission to copy, modify and redistribute ansi2knr, +but only under the conditions described in the GPL. A copy of this license +is supposed to have been given to you along with ansi2knr so you can know +your rights and responsibilities. It should be in a file named COPYLEFT, +or, if there is no file named COPYLEFT, a file named COPYING. Among other +things, the copyright notice and this notice must be preserved on all +copies. + +We explicitly state here what we believe is already implied by the GPL: if +the ansi2knr program is distributed as a separate set of sources and a +separate executable file which are aggregated on a storage medium together +with another program, this in itself does not bring the other program under +the GPL, nor does the mere fact that such a program or the procedures for +constructing it invoke the ansi2knr executable bring any other part of the +program under the GPL. +*/ + +/* + * Usage: + ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] + * --filename provides the file name for the #line directive in the output, + * overriding input_file (if present). + * If no input_file is supplied, input is read from stdin. + * If no output_file is supplied, output goes to stdout. + * There are no error messages. + * + * ansi2knr recognizes function definitions by seeing a non-keyword + * identifier at the left margin, followed by a left parenthesis, + * with a right parenthesis as the last character on the line, + * and with a left brace as the first token on the following line + * (ignoring possible intervening comments), except that a line + * consisting of only + * identifier1(identifier2) + * will not be considered a function definition unless identifier2 is + * the word "void", and a line consisting of + * identifier1(identifier2, <>) + * will not be considered a function definition. + * ansi2knr will recognize a multi-line header provided + * that no intervening line ends with a left or right brace or a semicolon. + * These algorithms ignore whitespace and comments, except that + * the function name must be the first thing on the line. + * The following constructs will confuse it: + * - Any other construct that starts at the left margin and + * follows the above syntax (such as a macro or function call). + * - Some macros that tinker with the syntax of function headers. + */ + +/* + * The original and principal author of ansi2knr is L. Peter Deutsch + * . Other authors are noted in the change history + * that follows (in reverse chronological order): + lpd 1999-04-12 added minor fixes from Pavel Roskin + for clean compilation with + gcc -W -Wall + lpd 1999-03-22 added hack to recognize lines consisting of + identifier1(identifier2, xxx) as *not* being procedures + lpd 1999-02-03 made indentation of preprocessor commands consistent + lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an + endless loop; quoted strings within an argument list + confused the parser + lpd 1999-01-24 added a check for write errors on the output, + suggested by Jim Meyering + lpd 1998-11-09 added further hack to recognize identifier(void) + as being a procedure + lpd 1998-10-23 added hack to recognize lines consisting of + identifier1(identifier2) as *not* being procedures + lpd 1997-12-08 made input_file optional; only closes input and/or + output file if not stdin or stdout respectively; prints + usage message on stderr rather than stdout; adds + --filename switch (changes suggested by + ) + lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with + compilers that don't understand void, as suggested by + Tom Lane + lpd 1996-01-15 changed to require that the first non-comment token + on the line following a function header be a left brace, + to reduce sensitivity to macros, as suggested by Tom Lane + + lpd 1995-06-22 removed #ifndefs whose sole purpose was to define + undefined preprocessor symbols as 0; changed all #ifdefs + for configuration symbols to #ifs + lpd 1995-04-05 changed copyright notice to make it clear that + including ansi2knr in a program does not bring the entire + program under the GPL + lpd 1994-12-18 added conditionals for systems where ctype macros + don't handle 8-bit characters properly, suggested by + Francois Pinard ; + removed --varargs switch (this is now the default) + lpd 1994-10-10 removed CONFIG_BROKETS conditional + lpd 1994-07-16 added some conditionals to help GNU `configure', + suggested by Francois Pinard ; + properly erase prototype args in function parameters, + contributed by Jim Avera ; + correct error in writeblanks (it shouldn't erase EOLs) + lpd 1989-xx-xx original version + */ + +/* Most of the conditionals here are to make ansi2knr work with */ +/* or without the GNU configure machinery. */ + +#if HAVE_CONFIG_H +# include +#endif + +#include +#include + +#if HAVE_CONFIG_H + +/* + For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). + This will define HAVE_CONFIG_H and so, activate the following lines. + */ + +# if STDC_HEADERS || HAVE_STRING_H +# include +# else +# include +# endif + +#else /* not HAVE_CONFIG_H */ + +/* Otherwise do it the hard way */ + +# ifdef BSD +# include +# else +# ifdef VMS + extern int strlen(), strncmp(); +# else +# include +# endif +# endif + +#endif /* not HAVE_CONFIG_H */ + +#if STDC_HEADERS +# include +#else +/* + malloc and free should be declared in stdlib.h, + but if you've got a K&R compiler, they probably aren't. + */ +# ifdef MSDOS +# include +# else +# ifdef VMS + extern char *malloc(); + extern void free(); +# else + extern char *malloc(); + extern int free(); +# endif +# endif + +#endif + +/* Define NULL (for *very* old compilers). */ +#ifndef NULL +# define NULL (0) +#endif + +/* + * The ctype macros don't always handle 8-bit characters correctly. + * Compensate for this here. + */ +#ifdef isascii +# undef HAVE_ISASCII /* just in case */ +# define HAVE_ISASCII 1 +#else +#endif +#if STDC_HEADERS || !HAVE_ISASCII +# define is_ascii(c) 1 +#else +# define is_ascii(c) isascii(c) +#endif + +#define is_space(c) (is_ascii(c) && isspace(c)) +#define is_alpha(c) (is_ascii(c) && isalpha(c)) +#define is_alnum(c) (is_ascii(c) && isalnum(c)) + +/* Scanning macros */ +#define isidchar(ch) (is_alnum(ch) || (ch) == '_') +#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') + +/* Forward references */ +char *skipspace(); +char *scanstring(); +int writeblanks(); +int test1(); +int convert1(); + +/* The main program */ +int +main(argc, argv) + int argc; + char *argv[]; +{ FILE *in = stdin; + FILE *out = stdout; + char *filename = 0; + char *program_name = argv[0]; + char *output_name = 0; +#define bufsize 5000 /* arbitrary size */ + char *buf; + char *line; + char *more; + char *usage = + "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; + /* + * In previous versions, ansi2knr recognized a --varargs switch. + * If this switch was supplied, ansi2knr would attempt to convert + * a ... argument to va_alist and va_dcl; if this switch was not + * supplied, ansi2knr would simply drop any such arguments. + * Now, ansi2knr always does this conversion, and we only + * check for this switch for backward compatibility. + */ + int convert_varargs = 1; + int output_error; + + while ( argc > 1 && argv[1][0] == '-' ) { + if ( !strcmp(argv[1], "--varargs") ) { + convert_varargs = 1; + argc--; + argv++; + continue; + } + if ( !strcmp(argv[1], "--filename") && argc > 2 ) { + filename = argv[2]; + argc -= 2; + argv += 2; + continue; + } + fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name, + argv[1]); + fprintf(stderr, usage); + exit(1); + } + switch ( argc ) + { + default: + fprintf(stderr, usage); + exit(0); + case 3: + output_name = argv[2]; + out = fopen(output_name, "w"); + if ( out == NULL ) { + fprintf(stderr, "%s: Cannot open output file %s\n", + program_name, output_name); + exit(1); + } + /* falls through */ + case 2: + in = fopen(argv[1], "r"); + if ( in == NULL ) { + fprintf(stderr, "%s: Cannot open input file %s\n", + program_name, argv[1]); + exit(1); + } + if ( filename == 0 ) + filename = argv[1]; + /* falls through */ + case 1: + break; + } + if ( filename ) + fprintf(out, "#line 1 \"%s\"\n", filename); + buf = malloc(bufsize); + if ( buf == NULL ) + { + fprintf(stderr, "Unable to allocate read buffer!\n"); + exit(1); + } + line = buf; + while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) + { +test: line += strlen(line); + switch ( test1(buf) ) + { + case 2: /* a function header */ + convert1(buf, out, 1, convert_varargs); + break; + case 1: /* a function */ + /* Check for a { at the start of the next line. */ + more = ++line; +f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ + goto wl; + if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) + goto wl; + switch ( *skipspace(more, 1) ) + { + case '{': + /* Definitely a function header. */ + convert1(buf, out, 0, convert_varargs); + fputs(more, out); + break; + case 0: + /* The next line was blank or a comment: */ + /* keep scanning for a non-comment. */ + line += strlen(line); + goto f; + default: + /* buf isn't a function header, but */ + /* more might be. */ + fputs(buf, out); + strcpy(buf, more); + line = buf; + goto test; + } + break; + case -1: /* maybe the start of a function */ + if ( line != buf + (bufsize - 1) ) /* overflow check */ + continue; + /* falls through */ + default: /* not a function */ +wl: fputs(buf, out); + break; + } + line = buf; + } + if ( line != buf ) + fputs(buf, out); + free(buf); + if ( output_name ) { + output_error = ferror(out); + output_error |= fclose(out); + } else { /* out == stdout */ + fflush(out); + output_error = ferror(out); + } + if ( output_error ) { + fprintf(stderr, "%s: error writing to %s\n", program_name, + (output_name ? output_name : "stdout")); + exit(1); + } + if ( in != stdin ) + fclose(in); + return 0; +} + +/* Skip over whitespace and comments, in either direction. */ +char * +skipspace(p, dir) + register char *p; + register int dir; /* 1 for forward, -1 for backward */ +{ for ( ; ; ) + { while ( is_space(*p) ) + p += dir; + if ( !(*p == '/' && p[dir] == '*') ) + break; + p += dir; p += dir; + while ( !(*p == '*' && p[dir] == '/') ) + { if ( *p == 0 ) + return p; /* multi-line comment?? */ + p += dir; + } + p += dir; p += dir; + } + return p; +} + +/* Scan over a quoted string, in either direction. */ +char * +scanstring(p, dir) + register char *p; + register int dir; +{ + for (p += dir; ; p += dir) + if (*p == '"' && p[-dir] != '\\') + return p + dir; +} + +/* + * Write blanks over part of a string. + * Don't overwrite end-of-line characters. + */ +int +writeblanks(start, end) + char *start; + char *end; +{ char *p; + for ( p = start; p < end; p++ ) + if ( *p != '\r' && *p != '\n' ) + *p = ' '; + return 0; +} + +/* + * Test whether the string in buf is a function definition. + * The string may contain and/or end with a newline. + * Return as follows: + * 0 - definitely not a function definition; + * 1 - definitely a function definition; + * 2 - definitely a function prototype (NOT USED); + * -1 - may be the beginning of a function definition, + * append another line and look again. + * The reason we don't attempt to convert function prototypes is that + * Ghostscript's declaration-generating macros look too much like + * prototypes, and confuse the algorithms. + */ +int +test1(buf) + char *buf; +{ register char *p = buf; + char *bend; + char *endfn; + int contin; + + if ( !isidfirstchar(*p) ) + return 0; /* no name at left margin */ + bend = skipspace(buf + strlen(buf) - 1, -1); + switch ( *bend ) + { + case ';': contin = 0 /*2*/; break; + case ')': contin = 1; break; + case '{': return 0; /* not a function */ + case '}': return 0; /* not a function */ + default: contin = -1; + } + while ( isidchar(*p) ) + p++; + endfn = p; + p = skipspace(p, 1); + if ( *p++ != '(' ) + return 0; /* not a function */ + p = skipspace(p, 1); + if ( *p == ')' ) + return 0; /* no parameters */ + /* Check that the apparent function name isn't a keyword. */ + /* We only need to check for keywords that could be followed */ + /* by a left parenthesis (which, unfortunately, is most of them). */ + { static char *words[] = + { "asm", "auto", "case", "char", "const", "double", + "extern", "float", "for", "if", "int", "long", + "register", "return", "short", "signed", "sizeof", + "static", "switch", "typedef", "unsigned", + "void", "volatile", "while", 0 + }; + char **key = words; + char *kp; + unsigned len = endfn - buf; + + while ( (kp = *key) != 0 ) + { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) + return 0; /* name is a keyword */ + key++; + } + } + { + char *id = p; + int len; + /* + * Check for identifier1(identifier2) and not + * identifier1(void), or identifier1(identifier2, xxxx). + */ + + while ( isidchar(*p) ) + p++; + len = p - id; + p = skipspace(p, 1); + if (*p == ',' || + (*p == ')' && (len != 4 || strncmp(id, "void", 4))) + ) + return 0; /* not a function */ + } + /* + * If the last significant character was a ), we need to count + * parentheses, because it might be part of a formal parameter + * that is a procedure. + */ + if (contin > 0) { + int level = 0; + + for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) + level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); + if (level > 0) + contin = -1; + } + return contin; +} + +/* Convert a recognized function definition or header to K&R syntax. */ +int +convert1(buf, out, header, convert_varargs) + char *buf; + FILE *out; + int header; /* Boolean */ + int convert_varargs; /* Boolean */ +{ char *endfn; + register char *p; + /* + * The breaks table contains pointers to the beginning and end + * of each argument. + */ + char **breaks; + unsigned num_breaks = 2; /* for testing */ + char **btop; + char **bp; + char **ap; + char *vararg = 0; + + /* Pre-ANSI implementations don't agree on whether strchr */ + /* is called strchr or index, so we open-code it here. */ + for ( endfn = buf; *(endfn++) != '('; ) + ; +top: p = endfn; + breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); + if ( breaks == NULL ) + { /* Couldn't allocate break table, give up */ + fprintf(stderr, "Unable to allocate break table!\n"); + fputs(buf, out); + return -1; + } + btop = breaks + num_breaks * 2 - 2; + bp = breaks; + /* Parse the argument list */ + do + { int level = 0; + char *lp = NULL; + char *rp = NULL; + char *end = NULL; + + if ( bp >= btop ) + { /* Filled up break table. */ + /* Allocate a bigger one and start over. */ + free((char *)breaks); + num_breaks <<= 1; + goto top; + } + *bp++ = p; + /* Find the end of the argument */ + for ( ; end == NULL; p++ ) + { switch(*p) + { + case ',': + if ( !level ) end = p; + break; + case '(': + if ( !level ) lp = p; + level++; + break; + case ')': + if ( --level < 0 ) end = p; + else rp = p; + break; + case '/': + if (p[1] == '*') + p = skipspace(p, 1) - 1; + break; + case '"': + p = scanstring(p, 1) - 1; + break; + default: + ; + } + } + /* Erase any embedded prototype parameters. */ + if ( lp && rp ) + writeblanks(lp + 1, rp); + p--; /* back up over terminator */ + /* Find the name being declared. */ + /* This is complicated because of procedure and */ + /* array modifiers. */ + for ( ; ; ) + { p = skipspace(p - 1, -1); + switch ( *p ) + { + case ']': /* skip array dimension(s) */ + case ')': /* skip procedure args OR name */ + { int level = 1; + while ( level ) + switch ( *--p ) + { + case ']': case ')': + level++; + break; + case '[': case '(': + level--; + break; + case '/': + if (p > buf && p[-1] == '*') + p = skipspace(p, -1) + 1; + break; + case '"': + p = scanstring(p, -1) + 1; + break; + default: ; + } + } + if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) + { /* We found the name being declared */ + while ( !isidfirstchar(*p) ) + p = skipspace(p, 1) + 1; + goto found; + } + break; + default: + goto found; + } + } +found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) + { if ( convert_varargs ) + { *bp++ = "va_alist"; + vararg = p-2; + } + else + { p++; + if ( bp == breaks + 1 ) /* sole argument */ + writeblanks(breaks[0], p); + else + writeblanks(bp[-1] - 1, p); + bp--; + } + } + else + { while ( isidchar(*p) ) p--; + *bp++ = p+1; + } + p = end; + } + while ( *p++ == ',' ); + *bp = p; + /* Make a special check for 'void' arglist */ + if ( bp == breaks+2 ) + { p = skipspace(breaks[0], 1); + if ( !strncmp(p, "void", 4) ) + { p = skipspace(p+4, 1); + if ( p == breaks[2] - 1 ) + { bp = breaks; /* yup, pretend arglist is empty */ + writeblanks(breaks[0], p + 1); + } + } + } + /* Put out the function name and left parenthesis. */ + p = buf; + while ( p != endfn ) putc(*p, out), p++; + /* Put out the declaration. */ + if ( header ) + { fputs(");", out); + for ( p = breaks[0]; *p; p++ ) + if ( *p == '\r' || *p == '\n' ) + putc(*p, out); + } + else + { for ( ap = breaks+1; ap < bp; ap += 2 ) + { p = *ap; + while ( isidchar(*p) ) + putc(*p, out), p++; + if ( ap < bp - 1 ) + fputs(", ", out); + } + fputs(") ", out); + /* Put out the argument declarations */ + for ( ap = breaks+2; ap <= bp; ap += 2 ) + (*ap)[-1] = ';'; + if ( vararg != 0 ) + { *vararg = 0; + fputs(breaks[0], out); /* any prior args */ + fputs("va_dcl", out); /* the final arg */ + fputs(bp[0], out); + } + else + fputs(breaks[0], out); + } + free((char *)breaks); + return 0; +} diff --git a/src/apps/bin/grep-2.5/src/config.h b/src/apps/bin/grep-2.5/src/config.h new file mode 100644 index 0000000000..64fb5420aa --- /dev/null +++ b/src/apps/bin/grep-2.5/src/config.h @@ -0,0 +1,341 @@ +/* config.h. Generated by configure. */ +/* config.hin. Generated from configure.in by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +//#define ENABLE_NLS 1 + +/* We are building grep */ +#define GREP 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARGZ_H */ + +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Define to 1 if you have the `btowc' function. */ +#define HAVE_BTOWC 1 + +/* Define to 1 if you have the `dcgettext' function. */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if strerror_r is declared. */ +#define HAVE_DECL_STRERROR_R 1 + +/* Define if declares strtoul. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define if declares strtoull. */ +#define HAVE_DECL_STRTOULL 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define if the malloc check has been performed. */ +#define HAVE_DONE_WORKING_MALLOC_CHECK 1 + +/* Define if the realloc check has been performed. */ +#define HAVE_DONE_WORKING_REALLOC_CHECK 1 + +/* Define to 1 if you have the `doprnt' function. */ +/* #undef HAVE_DOPRNT */ + +/* Define if text file lines end in CRLF. */ +/* #undef HAVE_DOS_FILE_CONTENTS */ + +/* Define if your OS uses backslashes as directory separators */ +/* #undef HAVE_DOS_FILE_NAMES */ + +/* Define to 1 if you have the `feof_unlocked' function. */ +#define HAVE_FEOF_UNLOCKED 1 + +/* Define to 1 if you have the `fgets_unlocked' function. */ +#define HAVE_FGETS_UNLOCKED 1 + +/* Define to 1 if you have the `fnmatch' function. */ +#define HAVE_FNMATCH 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getegid' function. */ +#define HAVE_GETEGID 1 + +/* Define to 1 if you have the `geteuid' function. */ +#define HAVE_GETEUID 1 + +/* Define to 1 if you have the `getgid' function. */ +#define HAVE_GETGID 1 + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define if you have the iconv() function. */ +/* #undef HAVE_ICONV */ + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define if you have and nl_langinfo(CODESET). */ +/* #undef HAVE_LANGINFO_CODESET */ + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBINTL_H */ + +/* Define to 1 if you have the `pcre' library (-lpcre). */ +/* #undef HAVE_LIBPCRE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `mbrtowc' function. */ +#define HAVE_MBRTOWC 1 + +/* Define to 1 if you have the `memchr' function. */ +#define HAVE_MEMCHR 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mempcpy' function. */ +/* #undef HAVE_MEMPCPY */ + +/* Define to 1 if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the `munmap' function. */ +/* #undef HAVE_MUNMAP */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NL_TYPES_H */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `setenv' function. */ +/* #undef HAVE_SETENV */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setmode' function. */ +/* #undef HAVE_SETMODE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the 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 `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the `strtoull' function. */ +/* #undef HAVE_STRTOULL */ + +/* Define to 1 if you have the `strtoumax' function. */ +#define HAVE_STRTOUMAX 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tsearch' function. */ +/* #undef HAVE_TSEARCH */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the unsigned long long type. */ +#define HAVE_UNSIGNED_LONG_LONG 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wctype' function. */ +#define HAVE_WCTYPE 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WCTYPE_H */ + +/* Define to 1 if strerror_r returns a string. */ +#define HAVE_WORKING_STRERROR_R 1 + +/* Define to 1 if you have the `__argz_count' function. */ +/* #undef HAVE___ARGZ_COUNT */ + +/* Define to 1 if you have the `__argz_next' function. */ +/* #undef HAVE___ARGZ_NEXT */ + +/* Define to 1 if you have the `__argz_stringify' function. */ +/* #undef HAVE___ARGZ_STRINGIFY */ + +/* Define as const if the declaration of iconv() needs const. */ +/* #undef ICONV_CONST */ + +/* Name of package */ +#define PACKAGE "grep" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define if compiler has function prototypes */ +#define PROTOTYPES 1 + +/* 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 the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.5" + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to make fseeko etc. visible, on some hosts. */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define if your compiler is broken */ +/* #undef alloca */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +/* #undef inline */ + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to a type if does not define. */ +#define mbstate_t int + +/* Define to `long' if does not define. */ +/* #undef off_t */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +/* Define to unsigned long or unsigned long long if doesn't + define. */ +/* #undef uintmax_t */ diff --git a/src/apps/bin/grep-2.5/src/dfa.c b/src/apps/bin/grep-2.5/src/dfa.c new file mode 100644 index 0000000000..590bfa7d11 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/dfa.c @@ -0,0 +1,3583 @@ +/* dfa.c - deterministic extended regexp routines for GNU + Copyright 1988, 1998, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + +/* Written June, 1988 by Mike Haertel + Modified July, 1988 by Arthur David Olson to assist BMG speedups */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include +#ifdef STDC_HEADERS +#include +#else +extern char *calloc(), *malloc(), *realloc(); +extern void free(); +#endif + +#if defined(HAVE_STRING_H) || defined(STDC_HEADERS) +#include +#else +#include +#endif + +#if HAVE_SETLOCALE +# include +#endif + +#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC +/* We can handle multibyte string. */ +# define MBS_SUPPORT +#endif + +#ifdef MBS_SUPPORT +# include +# include +#endif + +#ifndef DEBUG /* use the same approach as regex.c */ +#undef assert +#define assert(e) +#endif /* DEBUG */ + +#ifndef isgraph +#define isgraph(C) (isprint(C) && !isspace(C)) +#endif + +#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) +#define ISALPHA(C) isalpha(C) +#define ISUPPER(C) isupper(C) +#define ISLOWER(C) islower(C) +#define ISDIGIT(C) isdigit(C) +#define ISXDIGIT(C) isxdigit(C) +#define ISSPACE(C) isspace(C) +#define ISPUNCT(C) ispunct(C) +#define ISALNUM(C) isalnum(C) +#define ISPRINT(C) isprint(C) +#define ISGRAPH(C) isgraph(C) +#define ISCNTRL(C) iscntrl(C) +#else +#define ISALPHA(C) (isascii(C) && isalpha(C)) +#define ISUPPER(C) (isascii(C) && isupper(C)) +#define ISLOWER(C) (isascii(C) && islower(C)) +#define ISDIGIT(C) (isascii(C) && isdigit(C)) +#define ISXDIGIT(C) (isascii(C) && isxdigit(C)) +#define ISSPACE(C) (isascii(C) && isspace(C)) +#define ISPUNCT(C) (isascii(C) && ispunct(C)) +#define ISALNUM(C) (isascii(C) && isalnum(C)) +#define ISPRINT(C) (isascii(C) && isprint(C)) +#define ISGRAPH(C) (isascii(C) && isgraph(C)) +#define ISCNTRL(C) (isascii(C) && iscntrl(C)) +#endif + +/* ISASCIIDIGIT differs from ISDIGIT, as follows: + - Its arg may be any int or unsigned int; it need not be an unsigned char. + - It's guaranteed to evaluate its argument exactly once. + - It's typically faster. + Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that + only '0' through '9' are digits. Prefer ISASCIIDIGIT to ISDIGIT unless + it's important to use the locale's definition of `digit' even when the + host does not conform to Posix. */ +#define ISASCIIDIGIT(c) ((unsigned) (c) - '0' <= 9) + +/* If we (don't) have I18N. */ +/* glibc defines _ */ +#ifndef _ +# ifdef HAVE_LIBINTL_H +# include +# ifndef _ +# define _(Str) gettext (Str) +# endif +# else +# define _(Str) (Str) +# endif +#endif + +#include "regex.h" +#include "dfa.h" +#include "hard-locale.h" + +/* HPUX, define those as macros in sys/param.h */ +#ifdef setbit +# undef setbit +#endif +#ifdef clrbit +# undef clrbit +#endif + +static void dfamust PARAMS ((struct dfa *dfa)); +static void regexp PARAMS ((int toplevel)); + +static ptr_t +xcalloc (size_t n, size_t s) +{ + ptr_t r = calloc(n, s); + + if (!r) + dfaerror(_("Memory exhausted")); + return r; +} + +static ptr_t +xmalloc (size_t n) +{ + ptr_t r = malloc(n); + + assert(n != 0); + if (!r) + dfaerror(_("Memory exhausted")); + return r; +} + +static ptr_t +xrealloc (ptr_t p, size_t n) +{ + ptr_t r = realloc(p, n); + + assert(n != 0); + if (!r) + dfaerror(_("Memory exhausted")); + return r; +} + +#define CALLOC(p, t, n) ((p) = (t *) xcalloc((size_t)(n), sizeof (t))) +#define MALLOC(p, t, n) ((p) = (t *) xmalloc((n) * sizeof (t))) +#define REALLOC(p, t, n) ((p) = (t *) xrealloc((ptr_t) (p), (n) * sizeof (t))) + +/* Reallocate an array of type t if nalloc is too small for index. */ +#define REALLOC_IF_NECESSARY(p, t, nalloc, index) \ + if ((index) >= (nalloc)) \ + { \ + do \ + (nalloc) *= 2; \ + while ((index) >= (nalloc)); \ + REALLOC(p, t, nalloc); \ + } + +#ifdef DEBUG + +static void +prtok (token t) +{ + char const *s; + + if (t < 0) + fprintf(stderr, "END"); + else if (t < NOTCHAR) + fprintf(stderr, "%c", t); + else + { + switch (t) + { + case EMPTY: s = "EMPTY"; break; + case BACKREF: s = "BACKREF"; break; + case BEGLINE: s = "BEGLINE"; break; + case ENDLINE: s = "ENDLINE"; break; + case BEGWORD: s = "BEGWORD"; break; + case ENDWORD: s = "ENDWORD"; break; + case LIMWORD: s = "LIMWORD"; break; + case NOTLIMWORD: s = "NOTLIMWORD"; break; + case QMARK: s = "QMARK"; break; + case STAR: s = "STAR"; break; + case PLUS: s = "PLUS"; break; + case CAT: s = "CAT"; break; + case OR: s = "OR"; break; + case ORTOP: s = "ORTOP"; break; + case LPAREN: s = "LPAREN"; break; + case RPAREN: s = "RPAREN"; break; + case CRANGE: s = "CRANGE"; break; +#ifdef MBS_SUPPORT + case ANYCHAR: s = "ANYCHAR"; break; + case MBCSET: s = "MBCSET"; break; +#endif /* MBS_SUPPORT */ + default: s = "CSET"; break; + } + fprintf(stderr, "%s", s); + } +} +#endif /* DEBUG */ + +/* Stuff pertaining to charclasses. */ + +static int +tstbit (unsigned b, charclass c) +{ + return c[b / INTBITS] & 1 << b % INTBITS; +} + +static void +setbit (unsigned b, charclass c) +{ + c[b / INTBITS] |= 1 << b % INTBITS; +} + +static void +clrbit (unsigned b, charclass c) +{ + c[b / INTBITS] &= ~(1 << b % INTBITS); +} + +static void +copyset (charclass src, charclass dst) +{ + memcpy (dst, src, sizeof (charclass)); +} + +static void +zeroset (charclass s) +{ + memset (s, 0, sizeof (charclass)); +} + +static void +notset (charclass s) +{ + int i; + + for (i = 0; i < CHARCLASS_INTS; ++i) + s[i] = ~s[i]; +} + +static int +equal (charclass s1, charclass s2) +{ + return memcmp (s1, s2, sizeof (charclass)) == 0; +} + +/* A pointer to the current dfa is kept here during parsing. */ +static struct dfa *dfa; + +/* Find the index of charclass s in dfa->charclasses, or allocate a new charclass. */ +static int +charclass_index (charclass s) +{ + int i; + + for (i = 0; i < dfa->cindex; ++i) + if (equal(s, dfa->charclasses[i])) + return i; + REALLOC_IF_NECESSARY(dfa->charclasses, charclass, dfa->calloc, dfa->cindex); + ++dfa->cindex; + copyset(s, dfa->charclasses[i]); + return i; +} + +/* Syntax bits controlling the behavior of the lexical analyzer. */ +static reg_syntax_t syntax_bits, syntax_bits_set; + +/* Flag for case-folding letters into sets. */ +static int case_fold; + +/* End-of-line byte in data. */ +static unsigned char eolbyte; + +/* Entry point to set syntax options. */ +void +dfasyntax (reg_syntax_t bits, int fold, unsigned char eol) +{ + syntax_bits_set = 1; + syntax_bits = bits; + case_fold = fold; + eolbyte = eol; +} + +/* Like setbit, but if case is folded, set both cases of a letter. */ +static void +setbit_case_fold (unsigned b, charclass c) +{ + setbit (b, c); + if (case_fold) + { + if (ISUPPER (b)) + setbit (tolower (b), c); + else if (ISLOWER (b)) + setbit (toupper (b), c); + } +} + +/* Lexical analyzer. All the dross that deals with the obnoxious + GNU Regex syntax bits is located here. The poor, suffering + reader is referred to the GNU Regex documentation for the + meaning of the @#%!@#%^!@ syntax bits. */ + +static char const *lexstart; /* Pointer to beginning of input string. */ +static char const *lexptr; /* Pointer to next input character. */ +static int lexleft; /* Number of characters remaining. */ +static token lasttok; /* Previous token returned; initially END. */ +static int laststart; /* True if we're separated from beginning or (, | + only by zero-width characters. */ +static int parens; /* Count of outstanding left parens. */ +static int minrep, maxrep; /* Repeat counts for {m,n}. */ +static int hard_LC_COLLATE; /* Nonzero if LC_COLLATE is hard. */ + +#ifdef MBS_SUPPORT +/* These variables are used only if (MB_CUR_MAX > 1). */ +static mbstate_t mbs; /* Mbstate for mbrlen(). */ +static int cur_mb_len; /* Byte length of the current scanning + multibyte character. */ +static int cur_mb_index; /* Byte index of the current scanning multibyte + character. + + singlebyte character : cur_mb_index = 0 + multibyte character + 1st byte : cur_mb_index = 1 + 2nd byte : cur_mb_index = 2 + ... + nth byte : cur_mb_index = n */ +static unsigned char *mblen_buf;/* Correspond to the input buffer in dfaexec(). + Each element store the amount of remain + byte of corresponding multibyte character + in the input string. A element's value + is 0 if corresponding character is a + singlebyte chracter. + e.g. input : 'a', , , + mblen_buf : 0, 3, 2, 1 + */ +static wchar_t *inputwcs; /* Wide character representation of input + string in dfaexec(). + The length of this array is same as + the length of input string(char array). + inputstring[i] is a single-byte char, + or 1st byte of a multibyte char. + And inputwcs[i] is the codepoint. */ +static unsigned char const *buf_begin;/* refference to begin in dfaexec(). */ +static unsigned char const *buf_end; /* refference to end in dfaexec(). */ +#endif /* MBS_SUPPORT */ + +#ifdef MBS_SUPPORT +/* This function update cur_mb_len, and cur_mb_index. + p points current lexptr, len is the remaining buffer length. */ +static void +update_mb_len_index (unsigned char const *p, int len) +{ + /* If last character is a part of a multibyte character, + we update cur_mb_index. */ + if (cur_mb_index) + cur_mb_index = (cur_mb_index >= cur_mb_len)? 0 + : cur_mb_index + 1; + + /* If last character is a single byte character, or the + last portion of a multibyte character, we check whether + next character is a multibyte character or not. */ + if (! cur_mb_index) + { + cur_mb_len = mbrlen(p, len, &mbs); + if (cur_mb_len > 1) + /* It is a multibyte character. + cur_mb_len was already set by mbrlen(). */ + cur_mb_index = 1; + else if (cur_mb_len < 1) + /* Invalid sequence. We treat it as a singlebyte character. + cur_mb_index is aleady 0. */ + cur_mb_len = 1; + /* Otherwise, cur_mb_len == 1, it is a singlebyte character. + cur_mb_index is aleady 0. */ + } +} +#endif /* MBS_SUPPORT */ + +#ifdef MBS_SUPPORT +/* Note that characters become unsigned here. */ +# define FETCH(c, eoferr) \ + { \ + if (! lexleft) \ + { \ + if (eoferr != 0) \ + dfaerror (eoferr); \ + else \ + return lasttok = END; \ + } \ + if (MB_CUR_MAX > 1) \ + update_mb_len_index(lexptr, lexleft); \ + (c) = (unsigned char) *lexptr++; \ + --lexleft; \ + } + +/* This function fetch a wide character, and update cur_mb_len, + used only if the current locale is a multibyte environment. */ +static wchar_t +fetch_wc (char const *eoferr) +{ + wchar_t wc; + if (! lexleft) + { + if (eoferr != 0) + dfaerror (eoferr); + else + return -1; + } + + cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs); + if (cur_mb_len <= 0) + { + cur_mb_len = 1; + wc = *lexptr; + } + lexptr += cur_mb_len; + lexleft -= cur_mb_len; + return wc; +} +#else +/* Note that characters become unsigned here. */ +# define FETCH(c, eoferr) \ + { \ + if (! lexleft) \ + { \ + if (eoferr != 0) \ + dfaerror (eoferr); \ + else \ + return lasttok = END; \ + } \ + (c) = (unsigned char) *lexptr++; \ + --lexleft; \ + } +#endif /* MBS_SUPPORT */ + +#ifdef MBS_SUPPORT +/* Multibyte character handling sub-routin for lex. + This function parse a bracket expression and build a struct + mb_char_classes. */ +static void +parse_bracket_exp_mb () +{ + wchar_t wc, wc1, wc2; + + /* Work area to build a mb_char_classes. */ + struct mb_char_classes *work_mbc; + int chars_al, range_sts_al, range_ends_al, ch_classes_al, + equivs_al, coll_elems_al; + + REALLOC_IF_NECESSARY(dfa->mbcsets, struct mb_char_classes, + dfa->mbcsets_alloc, dfa->nmbcsets + 1); + /* dfa->multibyte_prop[] hold the index of dfa->mbcsets. + We will update dfa->multibyte_prop in addtok(), because we can't + decide the index in dfa->tokens[]. */ + + /* Initialize work are */ + work_mbc = &(dfa->mbcsets[dfa->nmbcsets++]); + + chars_al = 1; + range_sts_al = range_ends_al = 0; + ch_classes_al = equivs_al = coll_elems_al = 0; + MALLOC(work_mbc->chars, wchar_t, chars_al); + + work_mbc->nchars = work_mbc->nranges = work_mbc->nch_classes = 0; + work_mbc->nequivs = work_mbc->ncoll_elems = 0; + work_mbc->chars = work_mbc->ch_classes = NULL; + work_mbc->range_sts = work_mbc->range_ends = NULL; + work_mbc->equivs = work_mbc->coll_elems = NULL; + + wc = fetch_wc(_("Unbalanced [")); + if (wc == L'^') + { + wc = fetch_wc(_("Unbalanced [")); + work_mbc->invert = 1; + } + else + work_mbc->invert = 0; + do + { + wc1 = -1; /* mark wc1 is not initialized". */ + + /* Note that if we're looking at some other [:...:] construct, + we just treat it as a bunch of ordinary characters. We can do + this because we assume regex has checked for syntax errors before + dfa is ever called. */ + if (wc == L'[' && (syntax_bits & RE_CHAR_CLASSES)) + { +#define BRACKET_BUFFER_SIZE 128 + char str[BRACKET_BUFFER_SIZE]; + wc1 = wc; + wc = fetch_wc(_("Unbalanced [")); + + /* If pattern contains `[[:', `[[.', or `[[='. */ + if (cur_mb_len == 1 && (wc == L':' || wc == L'.' || wc == L'=')) + { + unsigned char c; + unsigned char delim = (unsigned char)wc; + int len = 0; + for (;;) + { + if (! lexleft) + dfaerror (_("Unbalanced [")); + c = (unsigned char) *lexptr++; + --lexleft; + + if ((c == delim && *lexptr == ']') || lexleft == 0) + break; + if (len < BRACKET_BUFFER_SIZE) + str[len++] = c; + else + /* This is in any case an invalid class name. */ + str[0] = '\0'; + } + str[len] = '\0'; + + if (lexleft == 0) + { + REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al, + work_mbc->nchars + 2); + work_mbc->chars[work_mbc->nchars++] = L'['; + work_mbc->chars[work_mbc->nchars++] = delim; + break; + } + + if (--lexleft, *lexptr++ != ']') + dfaerror (_("Unbalanced [")); + if (delim == ':') + /* build character class. */ + { + wctype_t wt; + /* Query the character class as wctype_t. */ + wt = wctype (str); + + if (ch_classes_al == 0) + MALLOC(work_mbc->ch_classes, wchar_t, ++ch_classes_al); + REALLOC_IF_NECESSARY(work_mbc->ch_classes, wctype_t, + ch_classes_al, + work_mbc->nch_classes + 1); + work_mbc->ch_classes[work_mbc->nch_classes++] = wt; + + } + else if (delim == '=' || delim == '.') + { + char *elem; + MALLOC(elem, char, len + 1); + strncpy(elem, str, len + 1); + + if (delim == '=') + /* build equivalent class. */ + { + if (equivs_al == 0) + MALLOC(work_mbc->equivs, char*, ++equivs_al); + REALLOC_IF_NECESSARY(work_mbc->equivs, char*, + equivs_al, + work_mbc->nequivs + 1); + work_mbc->equivs[work_mbc->nequivs++] = elem; + } + + if (delim == '.') + /* build collating element. */ + { + if (coll_elems_al == 0) + MALLOC(work_mbc->coll_elems, char*, ++coll_elems_al); + REALLOC_IF_NECESSARY(work_mbc->coll_elems, char*, + coll_elems_al, + work_mbc->ncoll_elems + 1); + work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem; + } + } + wc = -1; + } + else + /* We treat '[' as a normal character here. */ + { + wc2 = wc1; wc1 = wc; wc = wc2; /* swap */ + } + } + else + { + if (wc == L'\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) + wc = fetch_wc(("Unbalanced [")); + } + + if (wc1 == -1) + wc1 = fetch_wc(_("Unbalanced [")); + + if (wc1 == L'-') + /* build range characters. */ + { + wc2 = fetch_wc(_("Unbalanced [")); + if (wc2 == L']') + { + /* In the case [x-], the - is an ordinary hyphen, + which is left in c1, the lookahead character. */ + lexptr -= cur_mb_len; + lexleft += cur_mb_len; + wc2 = wc; + } + else + { + if (wc2 == L'\\' + && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) + wc2 = fetch_wc(_("Unbalanced [")); + wc1 = fetch_wc(_("Unbalanced [")); + } + + if (range_sts_al == 0) + { + MALLOC(work_mbc->range_sts, wchar_t, ++range_sts_al); + MALLOC(work_mbc->range_ends, wchar_t, ++range_ends_al); + } + REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t, + range_sts_al, work_mbc->nranges + 1); + work_mbc->range_sts[work_mbc->nranges] = wc; + REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t, + range_ends_al, work_mbc->nranges + 1); + work_mbc->range_ends[work_mbc->nranges++] = wc2; + } + else if (wc != -1) + /* build normal characters. */ + { + REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al, + work_mbc->nchars + 1); + work_mbc->chars[work_mbc->nchars++] = wc; + } + } + while ((wc = wc1) != L']'); +} +#endif /* MBS_SUPPORT */ + +#ifdef __STDC__ +#define FUNC(F, P) static int F(int c) { return P(c); } +#else +#define FUNC(F, P) static int F(c) int c; { return P(c); } +#endif + +FUNC(is_alpha, ISALPHA) +FUNC(is_upper, ISUPPER) +FUNC(is_lower, ISLOWER) +FUNC(is_digit, ISDIGIT) +FUNC(is_xdigit, ISXDIGIT) +FUNC(is_space, ISSPACE) +FUNC(is_punct, ISPUNCT) +FUNC(is_alnum, ISALNUM) +FUNC(is_print, ISPRINT) +FUNC(is_graph, ISGRAPH) +FUNC(is_cntrl, ISCNTRL) + +static int +is_blank (int c) +{ + return (c == ' ' || c == '\t'); +} + +/* The following list maps the names of the Posix named character classes + to predicate functions that determine whether a given character is in + the class. The leading [ has already been eaten by the lexical analyzer. */ +static struct { + const char *name; + int (*pred) PARAMS ((int)); +} const prednames[] = { + { ":alpha:]", is_alpha }, + { ":upper:]", is_upper }, + { ":lower:]", is_lower }, + { ":digit:]", is_digit }, + { ":xdigit:]", is_xdigit }, + { ":space:]", is_space }, + { ":punct:]", is_punct }, + { ":alnum:]", is_alnum }, + { ":print:]", is_print }, + { ":graph:]", is_graph }, + { ":cntrl:]", is_cntrl }, + { ":blank:]", is_blank }, + { 0 } +}; + +/* Return non-zero if C is a `word-constituent' byte; zero otherwise. */ +#define IS_WORD_CONSTITUENT(C) (ISALNUM(C) || (C) == '_') + +static int +looking_at (char const *s) +{ + size_t len; + + len = strlen(s); + if (lexleft < len) + return 0; + return strncmp(s, lexptr, len) == 0; +} + +static token +lex (void) +{ + unsigned c, c1, c2; + int backslash = 0, invert; + charclass ccl; + int i; + + /* Basic plan: We fetch a character. If it's a backslash, + we set the backslash flag and go through the loop again. + On the plus side, this avoids having a duplicate of the + main switch inside the backslash case. On the minus side, + it means that just about every case begins with + "if (backslash) ...". */ + for (i = 0; i < 2; ++i) + { + FETCH(c, 0); +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && cur_mb_index) + /* If this is a part of a multi-byte character, we must treat + this byte data as a normal character. + e.g. In case of SJIS encoding, some character contains '\', + but they must not be backslash. */ + goto normal_char; +#endif /* MBS_SUPPORT */ + switch (c) + { + case '\\': + if (backslash) + goto normal_char; + if (lexleft == 0) + dfaerror(_("Unfinished \\ escape")); + backslash = 1; + break; + + case '^': + if (backslash) + goto normal_char; + if (syntax_bits & RE_CONTEXT_INDEP_ANCHORS + || lasttok == END + || lasttok == LPAREN + || lasttok == OR) + return lasttok = BEGLINE; + goto normal_char; + + case '$': + if (backslash) + goto normal_char; + if (syntax_bits & RE_CONTEXT_INDEP_ANCHORS + || lexleft == 0 + || (syntax_bits & RE_NO_BK_PARENS + ? lexleft > 0 && *lexptr == ')' + : lexleft > 1 && lexptr[0] == '\\' && lexptr[1] == ')') + || (syntax_bits & RE_NO_BK_VBAR + ? lexleft > 0 && *lexptr == '|' + : lexleft > 1 && lexptr[0] == '\\' && lexptr[1] == '|') + || ((syntax_bits & RE_NEWLINE_ALT) + && lexleft > 0 && *lexptr == '\n')) + return lasttok = ENDLINE; + goto normal_char; + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (backslash && !(syntax_bits & RE_NO_BK_REFS)) + { + laststart = 0; + return lasttok = BACKREF; + } + goto normal_char; + + case '`': + if (backslash && !(syntax_bits & RE_NO_GNU_OPS)) + return lasttok = BEGLINE; /* FIXME: should be beginning of string */ + goto normal_char; + + case '\'': + if (backslash && !(syntax_bits & RE_NO_GNU_OPS)) + return lasttok = ENDLINE; /* FIXME: should be end of string */ + goto normal_char; + + case '<': + if (backslash && !(syntax_bits & RE_NO_GNU_OPS)) + return lasttok = BEGWORD; + goto normal_char; + + case '>': + if (backslash && !(syntax_bits & RE_NO_GNU_OPS)) + return lasttok = ENDWORD; + goto normal_char; + + case 'b': + if (backslash && !(syntax_bits & RE_NO_GNU_OPS)) + return lasttok = LIMWORD; + goto normal_char; + + case 'B': + if (backslash && !(syntax_bits & RE_NO_GNU_OPS)) + return lasttok = NOTLIMWORD; + goto normal_char; + + case '?': + if (syntax_bits & RE_LIMITED_OPS) + goto normal_char; + if (backslash != ((syntax_bits & RE_BK_PLUS_QM) != 0)) + goto normal_char; + if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart) + goto normal_char; + return lasttok = QMARK; + + case '*': + if (backslash) + goto normal_char; + if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart) + goto normal_char; + return lasttok = STAR; + + case '+': + if (syntax_bits & RE_LIMITED_OPS) + goto normal_char; + if (backslash != ((syntax_bits & RE_BK_PLUS_QM) != 0)) + goto normal_char; + if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart) + goto normal_char; + return lasttok = PLUS; + + case '{': + if (!(syntax_bits & RE_INTERVALS)) + goto normal_char; + if (backslash != ((syntax_bits & RE_NO_BK_BRACES) == 0)) + goto normal_char; + if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart) + goto normal_char; + + if (syntax_bits & RE_NO_BK_BRACES) + { + /* Scan ahead for a valid interval; if it's not valid, + treat it as a literal '{'. */ + int lo = -1, hi = -1; + char const *p = lexptr; + char const *lim = p + lexleft; + for (; p != lim && ISASCIIDIGIT (*p); p++) + lo = (lo < 0 ? 0 : lo * 10) + *p - '0'; + if (p != lim && *p == ',') + while (++p != lim && ISASCIIDIGIT (*p)) + hi = (hi < 0 ? 0 : hi * 10) + *p - '0'; + else + hi = lo; + if (p == lim || *p != '}' + || lo < 0 || RE_DUP_MAX < hi || (0 <= hi && hi < lo)) + goto normal_char; + } + + minrep = 0; + /* Cases: + {M} - exact count + {M,} - minimum count, maximum is infinity + {M,N} - M through N */ + FETCH(c, _("unfinished repeat count")); + if (ISASCIIDIGIT (c)) + { + minrep = c - '0'; + for (;;) + { + FETCH(c, _("unfinished repeat count")); + if (! ISASCIIDIGIT (c)) + break; + minrep = 10 * minrep + c - '0'; + } + } + else + dfaerror(_("malformed repeat count")); + if (c == ',') + { + FETCH (c, _("unfinished repeat count")); + if (! ISASCIIDIGIT (c)) + maxrep = -1; + else + { + maxrep = c - '0'; + for (;;) + { + FETCH (c, _("unfinished repeat count")); + if (! ISASCIIDIGIT (c)) + break; + maxrep = 10 * maxrep + c - '0'; + } + if (0 <= maxrep && maxrep < minrep) + dfaerror (_("malformed repeat count")); + } + } + else + maxrep = minrep; + if (!(syntax_bits & RE_NO_BK_BRACES)) + { + if (c != '\\') + dfaerror(_("malformed repeat count")); + FETCH(c, _("unfinished repeat count")); + } + if (c != '}') + dfaerror(_("malformed repeat count")); + laststart = 0; + return lasttok = REPMN; + + case '|': + if (syntax_bits & RE_LIMITED_OPS) + goto normal_char; + if (backslash != ((syntax_bits & RE_NO_BK_VBAR) == 0)) + goto normal_char; + laststart = 1; + return lasttok = OR; + + case '\n': + if (syntax_bits & RE_LIMITED_OPS + || backslash + || !(syntax_bits & RE_NEWLINE_ALT)) + goto normal_char; + laststart = 1; + return lasttok = OR; + + case '(': + if (backslash != ((syntax_bits & RE_NO_BK_PARENS) == 0)) + goto normal_char; + ++parens; + laststart = 1; + return lasttok = LPAREN; + + case ')': + if (backslash != ((syntax_bits & RE_NO_BK_PARENS) == 0)) + goto normal_char; + if (parens == 0 && syntax_bits & RE_UNMATCHED_RIGHT_PAREN_ORD) + goto normal_char; + --parens; + laststart = 0; + return lasttok = RPAREN; + + case '.': + if (backslash) + goto normal_char; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + /* In multibyte environment period must match with a single + character not a byte. So we use ANYCHAR. */ + laststart = 0; + return lasttok = ANYCHAR; + } +#endif /* MBS_SUPPORT */ + zeroset(ccl); + notset(ccl); + if (!(syntax_bits & RE_DOT_NEWLINE)) + clrbit(eolbyte, ccl); + if (syntax_bits & RE_DOT_NOT_NULL) + clrbit('\0', ccl); + laststart = 0; + return lasttok = CSET + charclass_index(ccl); + + case 'w': + case 'W': + if (!backslash || (syntax_bits & RE_NO_GNU_OPS)) + goto normal_char; + zeroset(ccl); + for (c2 = 0; c2 < NOTCHAR; ++c2) + if (IS_WORD_CONSTITUENT(c2)) + setbit(c2, ccl); + if (c == 'W') + notset(ccl); + laststart = 0; + return lasttok = CSET + charclass_index(ccl); + + case '[': + if (backslash) + goto normal_char; + laststart = 0; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + /* In multibyte environment a bracket expression may contain + multibyte characters, which must be treated as characters + (not bytes). So we parse it by parse_bracket_exp_mb(). */ + parse_bracket_exp_mb(); + return lasttok = MBCSET; + } +#endif + zeroset(ccl); + FETCH(c, _("Unbalanced [")); + if (c == '^') + { + FETCH(c, _("Unbalanced [")); + invert = 1; + } + else + invert = 0; + do + { + /* Nobody ever said this had to be fast. :-) + Note that if we're looking at some other [:...:] + construct, we just treat it as a bunch of ordinary + characters. We can do this because we assume + regex has checked for syntax errors before + dfa is ever called. */ + if (c == '[' && (syntax_bits & RE_CHAR_CLASSES)) + for (c1 = 0; prednames[c1].name; ++c1) + if (looking_at(prednames[c1].name)) + { + int (*pred) PARAMS ((int)) = prednames[c1].pred; + + for (c2 = 0; c2 < NOTCHAR; ++c2) + if ((*pred)(c2)) + setbit_case_fold (c2, ccl); + lexptr += strlen(prednames[c1].name); + lexleft -= strlen(prednames[c1].name); + FETCH(c1, _("Unbalanced [")); + goto skip; + } + if (c == '\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) + FETCH(c, _("Unbalanced [")); + FETCH(c1, _("Unbalanced [")); + if (c1 == '-') + { + FETCH(c2, _("Unbalanced [")); + if (c2 == ']') + { + /* In the case [x-], the - is an ordinary hyphen, + which is left in c1, the lookahead character. */ + --lexptr; + ++lexleft; + } + else + { + if (c2 == '\\' + && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) + FETCH(c2, _("Unbalanced [")); + FETCH(c1, _("Unbalanced [")); + if (!hard_LC_COLLATE) { + for (; c <= c2; c++) + setbit_case_fold (c, ccl); + } else { + /* POSIX locales are painful - leave the decision to libc */ + char expr[6] = { '[', c, '-', c2, ']', '\0' }; + regex_t re; + if (regcomp (&re, expr, case_fold ? REG_ICASE : 0) == REG_NOERROR) { + for (c = 0; c < NOTCHAR; ++c) { + char buf[2] = { c, '\0' }; + regmatch_t mat; + if (regexec (&re, buf, 1, &mat, 0) == REG_NOERROR + && mat.rm_so == 0 && mat.rm_eo == 1) + setbit_case_fold (c, ccl); + } + regfree (&re); + } + } + continue; + } + } + + setbit_case_fold (c, ccl); + + skip: + ; + } + while ((c = c1) != ']'); + if (invert) + { + notset(ccl); + if (syntax_bits & RE_HAT_LISTS_NOT_NEWLINE) + clrbit(eolbyte, ccl); + } + return lasttok = CSET + charclass_index(ccl); + + default: + normal_char: + laststart = 0; + if (case_fold && ISALPHA(c)) + { + zeroset(ccl); + setbit_case_fold (c, ccl); + return lasttok = CSET + charclass_index(ccl); + } + return c; + } + } + + /* The above loop should consume at most a backslash + and some other character. */ + abort(); + return END; /* keeps pedantic compilers happy. */ +} + +/* Recursive descent parser for regular expressions. */ + +static token tok; /* Lookahead token. */ +static int depth; /* Current depth of a hypothetical stack + holding deferred productions. This is + used to determine the depth that will be + required of the real stack later on in + dfaanalyze(). */ + +/* Add the given token to the parse tree, maintaining the depth count and + updating the maximum depth if necessary. */ +static void +addtok (token t) +{ +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + REALLOC_IF_NECESSARY(dfa->multibyte_prop, int, dfa->nmultibyte_prop, + dfa->tindex); + /* Set dfa->multibyte_prop. See struct dfa in dfa.h. */ + if (t == MBCSET) + dfa->multibyte_prop[dfa->tindex] = ((dfa->nmbcsets - 1) << 2) + 3; + else if (t < NOTCHAR) + dfa->multibyte_prop[dfa->tindex] + = (cur_mb_len == 1)? 3 /* single-byte char */ + : (((cur_mb_index == 1)? 1 : 0) /* 1st-byte of multibyte char */ + + ((cur_mb_index == cur_mb_len)? 2 : 0)); /* last-byte */ + else + /* It may be unnecesssary, but it is safer to treat other + symbols as singlebyte characters. */ + dfa->multibyte_prop[dfa->tindex] = 3; + } +#endif + + REALLOC_IF_NECESSARY(dfa->tokens, token, dfa->talloc, dfa->tindex); + dfa->tokens[dfa->tindex++] = t; + + switch (t) + { + case QMARK: + case STAR: + case PLUS: + break; + + case CAT: + case OR: + case ORTOP: + --depth; + break; + + default: + ++dfa->nleaves; + case EMPTY: + ++depth; + break; + } + if (depth > dfa->depth) + dfa->depth = depth; +} + +/* The grammar understood by the parser is as follows. + + regexp: + regexp OR branch + branch + + branch: + branch closure + closure + + closure: + closure QMARK + closure STAR + closure PLUS + closure REPMN + atom + + atom: + + + ANYCHAR + MBCSET + CSET + BACKREF + BEGLINE + ENDLINE + BEGWORD + ENDWORD + LIMWORD + NOTLIMWORD + CRANGE + LPAREN regexp RPAREN + + + The parser builds a parse tree in postfix form in an array of tokens. */ + +static void +atom (void) +{ + if ((tok >= 0 && tok < NOTCHAR) || tok >= CSET || tok == BACKREF + || tok == BEGLINE || tok == ENDLINE || tok == BEGWORD +#ifdef MBS_SUPPORT + || tok == ANYCHAR || tok == MBCSET /* MB_CUR_MAX > 1 */ +#endif /* MBS_SUPPORT */ + || tok == ENDWORD || tok == LIMWORD || tok == NOTLIMWORD) + { + addtok(tok); + tok = lex(); +#ifdef MBS_SUPPORT + /* We treat a multibyte character as a single atom, so that DFA + can treat a multibyte character as a single expression. + + e.g. We construct following tree from "". + + + */ + if (MB_CUR_MAX > 1) + { + while (cur_mb_index > 1 && tok >= 0 && tok < NOTCHAR) + { + addtok(tok); + addtok(CAT); + tok = lex(); + } + } +#endif /* MBS_SUPPORT */ + } + else if (tok == CRANGE) + { + /* A character range like "[a-z]" in a locale other than "C" or + "POSIX". This range might any sequence of one or more + characters. Unfortunately the POSIX locale primitives give + us no practical way to find what character sequences might be + matched. Treat this approximately like "(.\1)" -- i.e. match + one character, and then punt to the full matcher. */ + charclass ccl; + zeroset (ccl); + notset (ccl); + addtok (CSET + charclass_index (ccl)); + addtok (BACKREF); + addtok (CAT); + tok = lex (); + } + else if (tok == LPAREN) + { + tok = lex(); + regexp(0); + if (tok != RPAREN) + dfaerror(_("Unbalanced (")); + tok = lex(); + } + else + addtok(EMPTY); +} + +/* Return the number of tokens in the given subexpression. */ +static int +nsubtoks (int tindex) +{ + int ntoks1; + + switch (dfa->tokens[tindex - 1]) + { + default: + return 1; + case QMARK: + case STAR: + case PLUS: + return 1 + nsubtoks(tindex - 1); + case CAT: + case OR: + case ORTOP: + ntoks1 = nsubtoks(tindex - 1); + return 1 + ntoks1 + nsubtoks(tindex - 1 - ntoks1); + } +} + +/* Copy the given subexpression to the top of the tree. */ +static void +copytoks (int tindex, int ntokens) +{ + int i; + + for (i = 0; i < ntokens; ++i) + addtok(dfa->tokens[tindex + i]); +} + +static void +closure (void) +{ + int tindex, ntokens, i; + + atom(); + while (tok == QMARK || tok == STAR || tok == PLUS || tok == REPMN) + if (tok == REPMN) + { + ntokens = nsubtoks(dfa->tindex); + tindex = dfa->tindex - ntokens; + if (maxrep < 0) + addtok(PLUS); + if (minrep == 0) + addtok(QMARK); + for (i = 1; i < minrep; ++i) + { + copytoks(tindex, ntokens); + addtok(CAT); + } + for (; i < maxrep; ++i) + { + copytoks(tindex, ntokens); + addtok(QMARK); + addtok(CAT); + } + tok = lex(); + } + else + { + addtok(tok); + tok = lex(); + } +} + +static void +branch (void) +{ + closure(); + while (tok != RPAREN && tok != OR && tok >= 0) + { + closure(); + addtok(CAT); + } +} + +static void +regexp (int toplevel) +{ + branch(); + while (tok == OR) + { + tok = lex(); + branch(); + if (toplevel) + addtok(ORTOP); + else + addtok(OR); + } +} + +/* Main entry point for the parser. S is a string to be parsed, len is the + length of the string, so s can include NUL characters. D is a pointer to + the struct dfa to parse into. */ +void +dfaparse (char const *s, size_t len, struct dfa *d) +{ + dfa = d; + lexstart = lexptr = s; + lexleft = len; + lasttok = END; + laststart = 1; + parens = 0; +#if ENABLE_NLS + hard_LC_COLLATE = hard_locale (LC_COLLATE); +#endif +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + cur_mb_index = 0; + cur_mb_len = 0; + memset(&mbs, 0, sizeof(mbstate_t)); + } +#endif /* MBS_SUPPORT */ + + if (! syntax_bits_set) + dfaerror(_("No syntax specified")); + + tok = lex(); + depth = d->depth; + + regexp(1); + + if (tok != END) + dfaerror(_("Unbalanced )")); + + addtok(END - d->nregexps); + addtok(CAT); + + if (d->nregexps) + addtok(ORTOP); + + ++d->nregexps; +} + +/* Some primitives for operating on sets of positions. */ + +/* Copy one set to another; the destination must be large enough. */ +static void +copy (position_set const *src, position_set *dst) +{ + int i; + + for (i = 0; i < src->nelem; ++i) + dst->elems[i] = src->elems[i]; + dst->nelem = src->nelem; +} + +/* Insert a position in a set. Position sets are maintained in sorted + order according to index. If position already exists in the set with + the same index then their constraints are logically or'd together. + S->elems must point to an array large enough to hold the resulting set. */ +static void +insert (position p, position_set *s) +{ + int i; + position t1, t2; + + for (i = 0; i < s->nelem && p.index < s->elems[i].index; ++i) + continue; + if (i < s->nelem && p.index == s->elems[i].index) + s->elems[i].constraint |= p.constraint; + else + { + t1 = p; + ++s->nelem; + while (i < s->nelem) + { + t2 = s->elems[i]; + s->elems[i++] = t1; + t1 = t2; + } + } +} + +/* Merge two sets of positions into a third. The result is exactly as if + the positions of both sets were inserted into an initially empty set. */ +static void +merge (position_set const *s1, position_set const *s2, position_set *m) +{ + int i = 0, j = 0; + + m->nelem = 0; + while (i < s1->nelem && j < s2->nelem) + if (s1->elems[i].index > s2->elems[j].index) + m->elems[m->nelem++] = s1->elems[i++]; + else if (s1->elems[i].index < s2->elems[j].index) + m->elems[m->nelem++] = s2->elems[j++]; + else + { + m->elems[m->nelem] = s1->elems[i++]; + m->elems[m->nelem++].constraint |= s2->elems[j++].constraint; + } + while (i < s1->nelem) + m->elems[m->nelem++] = s1->elems[i++]; + while (j < s2->nelem) + m->elems[m->nelem++] = s2->elems[j++]; +} + +/* Delete a position from a set. */ +static void +delete (position p, position_set *s) +{ + int i; + + for (i = 0; i < s->nelem; ++i) + if (p.index == s->elems[i].index) + break; + if (i < s->nelem) + for (--s->nelem; i < s->nelem; ++i) + s->elems[i] = s->elems[i + 1]; +} + +/* Find the index of the state corresponding to the given position set with + the given preceding context, or create a new state if there is no such + state. Newline and letter tell whether we got here on a newline or + letter, respectively. */ +static int +state_index (struct dfa *d, position_set const *s, int newline, int letter) +{ + int hash = 0; + int constraint; + int i, j; + + newline = newline ? 1 : 0; + letter = letter ? 1 : 0; + + for (i = 0; i < s->nelem; ++i) + hash ^= s->elems[i].index + s->elems[i].constraint; + + /* Try to find a state that exactly matches the proposed one. */ + for (i = 0; i < d->sindex; ++i) + { + if (hash != d->states[i].hash || s->nelem != d->states[i].elems.nelem + || newline != d->states[i].newline || letter != d->states[i].letter) + continue; + for (j = 0; j < s->nelem; ++j) + if (s->elems[j].constraint + != d->states[i].elems.elems[j].constraint + || s->elems[j].index != d->states[i].elems.elems[j].index) + break; + if (j == s->nelem) + return i; + } + + /* We'll have to create a new state. */ + REALLOC_IF_NECESSARY(d->states, dfa_state, d->salloc, d->sindex); + d->states[i].hash = hash; + MALLOC(d->states[i].elems.elems, position, s->nelem); + copy(s, &d->states[i].elems); + d->states[i].newline = newline; + d->states[i].letter = letter; + d->states[i].backref = 0; + d->states[i].constraint = 0; + d->states[i].first_end = 0; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + d->states[i].mbps.nelem = 0; +#endif + for (j = 0; j < s->nelem; ++j) + if (d->tokens[s->elems[j].index] < 0) + { + constraint = s->elems[j].constraint; + if (SUCCEEDS_IN_CONTEXT(constraint, newline, 0, letter, 0) + || SUCCEEDS_IN_CONTEXT(constraint, newline, 0, letter, 1) + || SUCCEEDS_IN_CONTEXT(constraint, newline, 1, letter, 0) + || SUCCEEDS_IN_CONTEXT(constraint, newline, 1, letter, 1)) + d->states[i].constraint |= constraint; + if (! d->states[i].first_end) + d->states[i].first_end = d->tokens[s->elems[j].index]; + } + else if (d->tokens[s->elems[j].index] == BACKREF) + { + d->states[i].constraint = NO_CONSTRAINT; + d->states[i].backref = 1; + } + + ++d->sindex; + + return i; +} + +/* Find the epsilon closure of a set of positions. If any position of the set + contains a symbol that matches the empty string in some context, replace + that position with the elements of its follow labeled with an appropriate + constraint. Repeat exhaustively until no funny positions are left. + S->elems must be large enough to hold the result. */ +static void +epsclosure (position_set *s, struct dfa const *d) +{ + int i, j; + int *visited; + position p, old; + + MALLOC(visited, int, d->tindex); + for (i = 0; i < d->tindex; ++i) + visited[i] = 0; + + for (i = 0; i < s->nelem; ++i) + if (d->tokens[s->elems[i].index] >= NOTCHAR + && d->tokens[s->elems[i].index] != BACKREF +#ifdef MBS_SUPPORT + && d->tokens[s->elems[i].index] != ANYCHAR + && d->tokens[s->elems[i].index] != MBCSET +#endif + && d->tokens[s->elems[i].index] < CSET) + { + old = s->elems[i]; + p.constraint = old.constraint; + delete(s->elems[i], s); + if (visited[old.index]) + { + --i; + continue; + } + visited[old.index] = 1; + switch (d->tokens[old.index]) + { + case BEGLINE: + p.constraint &= BEGLINE_CONSTRAINT; + break; + case ENDLINE: + p.constraint &= ENDLINE_CONSTRAINT; + break; + case BEGWORD: + p.constraint &= BEGWORD_CONSTRAINT; + break; + case ENDWORD: + p.constraint &= ENDWORD_CONSTRAINT; + break; + case LIMWORD: + p.constraint &= LIMWORD_CONSTRAINT; + break; + case NOTLIMWORD: + p.constraint &= NOTLIMWORD_CONSTRAINT; + break; + default: + break; + } + for (j = 0; j < d->follows[old.index].nelem; ++j) + { + p.index = d->follows[old.index].elems[j].index; + insert(p, s); + } + /* Force rescan to start at the beginning. */ + i = -1; + } + + free(visited); +} + +/* Perform bottom-up analysis on the parse tree, computing various functions. + Note that at this point, we're pretending constructs like \< are real + characters rather than constraints on what can follow them. + + Nullable: A node is nullable if it is at the root of a regexp that can + match the empty string. + * EMPTY leaves are nullable. + * No other leaf is nullable. + * A QMARK or STAR node is nullable. + * A PLUS node is nullable if its argument is nullable. + * A CAT node is nullable if both its arguments are nullable. + * An OR node is nullable if either argument is nullable. + + Firstpos: The firstpos of a node is the set of positions (nonempty leaves) + that could correspond to the first character of a string matching the + regexp rooted at the given node. + * EMPTY leaves have empty firstpos. + * The firstpos of a nonempty leaf is that leaf itself. + * The firstpos of a QMARK, STAR, or PLUS node is the firstpos of its + argument. + * The firstpos of a CAT node is the firstpos of the left argument, union + the firstpos of the right if the left argument is nullable. + * The firstpos of an OR node is the union of firstpos of each argument. + + Lastpos: The lastpos of a node is the set of positions that could + correspond to the last character of a string matching the regexp at + the given node. + * EMPTY leaves have empty lastpos. + * The lastpos of a nonempty leaf is that leaf itself. + * The lastpos of a QMARK, STAR, or PLUS node is the lastpos of its + argument. + * The lastpos of a CAT node is the lastpos of its right argument, union + the lastpos of the left if the right argument is nullable. + * The lastpos of an OR node is the union of the lastpos of each argument. + + Follow: The follow of a position is the set of positions that could + correspond to the character following a character matching the node in + a string matching the regexp. At this point we consider special symbols + that match the empty string in some context to be just normal characters. + Later, if we find that a special symbol is in a follow set, we will + replace it with the elements of its follow, labeled with an appropriate + constraint. + * Every node in the firstpos of the argument of a STAR or PLUS node is in + the follow of every node in the lastpos. + * Every node in the firstpos of the second argument of a CAT node is in + the follow of every node in the lastpos of the first argument. + + Because of the postfix representation of the parse tree, the depth-first + analysis is conveniently done by a linear scan with the aid of a stack. + Sets are stored as arrays of the elements, obeying a stack-like allocation + scheme; the number of elements in each set deeper in the stack can be + used to determine the address of a particular set's array. */ +void +dfaanalyze (struct dfa *d, int searchflag) +{ + int *nullable; /* Nullable stack. */ + int *nfirstpos; /* Element count stack for firstpos sets. */ + position *firstpos; /* Array where firstpos elements are stored. */ + int *nlastpos; /* Element count stack for lastpos sets. */ + position *lastpos; /* Array where lastpos elements are stored. */ + int *nalloc; /* Sizes of arrays allocated to follow sets. */ + position_set tmp; /* Temporary set for merging sets. */ + position_set merged; /* Result of merging sets. */ + int wants_newline; /* True if some position wants newline info. */ + int *o_nullable; + int *o_nfirst, *o_nlast; + position *o_firstpos, *o_lastpos; + int i, j; + position *pos; + +#ifdef DEBUG + fprintf(stderr, "dfaanalyze:\n"); + for (i = 0; i < d->tindex; ++i) + { + fprintf(stderr, " %d:", i); + prtok(d->tokens[i]); + } + putc('\n', stderr); +#endif + + d->searchflag = searchflag; + + MALLOC(nullable, int, d->depth); + o_nullable = nullable; + MALLOC(nfirstpos, int, d->depth); + o_nfirst = nfirstpos; + MALLOC(firstpos, position, d->nleaves); + o_firstpos = firstpos, firstpos += d->nleaves; + MALLOC(nlastpos, int, d->depth); + o_nlast = nlastpos; + MALLOC(lastpos, position, d->nleaves); + o_lastpos = lastpos, lastpos += d->nleaves; + MALLOC(nalloc, int, d->tindex); + for (i = 0; i < d->tindex; ++i) + nalloc[i] = 0; + MALLOC(merged.elems, position, d->nleaves); + + CALLOC(d->follows, position_set, d->tindex); + + for (i = 0; i < d->tindex; ++i) +#ifdef DEBUG + { /* Nonsyntactic #ifdef goo... */ +#endif + switch (d->tokens[i]) + { + case EMPTY: + /* The empty set is nullable. */ + *nullable++ = 1; + + /* The firstpos and lastpos of the empty leaf are both empty. */ + *nfirstpos++ = *nlastpos++ = 0; + break; + + case STAR: + case PLUS: + /* Every element in the firstpos of the argument is in the follow + of every element in the lastpos. */ + tmp.nelem = nfirstpos[-1]; + tmp.elems = firstpos; + pos = lastpos; + for (j = 0; j < nlastpos[-1]; ++j) + { + merge(&tmp, &d->follows[pos[j].index], &merged); + REALLOC_IF_NECESSARY(d->follows[pos[j].index].elems, position, + nalloc[pos[j].index], merged.nelem - 1); + copy(&merged, &d->follows[pos[j].index]); + } + + case QMARK: + /* A QMARK or STAR node is automatically nullable. */ + if (d->tokens[i] != PLUS) + nullable[-1] = 1; + break; + + case CAT: + /* Every element in the firstpos of the second argument is in the + follow of every element in the lastpos of the first argument. */ + tmp.nelem = nfirstpos[-1]; + tmp.elems = firstpos; + pos = lastpos + nlastpos[-1]; + for (j = 0; j < nlastpos[-2]; ++j) + { + merge(&tmp, &d->follows[pos[j].index], &merged); + REALLOC_IF_NECESSARY(d->follows[pos[j].index].elems, position, + nalloc[pos[j].index], merged.nelem - 1); + copy(&merged, &d->follows[pos[j].index]); + } + + /* The firstpos of a CAT node is the firstpos of the first argument, + union that of the second argument if the first is nullable. */ + if (nullable[-2]) + nfirstpos[-2] += nfirstpos[-1]; + else + firstpos += nfirstpos[-1]; + --nfirstpos; + + /* The lastpos of a CAT node is the lastpos of the second argument, + union that of the first argument if the second is nullable. */ + if (nullable[-1]) + nlastpos[-2] += nlastpos[-1]; + else + { + pos = lastpos + nlastpos[-2]; + for (j = nlastpos[-1] - 1; j >= 0; --j) + pos[j] = lastpos[j]; + lastpos += nlastpos[-2]; + nlastpos[-2] = nlastpos[-1]; + } + --nlastpos; + + /* A CAT node is nullable if both arguments are nullable. */ + nullable[-2] = nullable[-1] && nullable[-2]; + --nullable; + break; + + case OR: + case ORTOP: + /* The firstpos is the union of the firstpos of each argument. */ + nfirstpos[-2] += nfirstpos[-1]; + --nfirstpos; + + /* The lastpos is the union of the lastpos of each argument. */ + nlastpos[-2] += nlastpos[-1]; + --nlastpos; + + /* An OR node is nullable if either argument is nullable. */ + nullable[-2] = nullable[-1] || nullable[-2]; + --nullable; + break; + + default: + /* Anything else is a nonempty position. (Note that special + constructs like \< are treated as nonempty strings here; + an "epsilon closure" effectively makes them nullable later. + Backreferences have to get a real position so we can detect + transitions on them later. But they are nullable. */ + *nullable++ = d->tokens[i] == BACKREF; + + /* This position is in its own firstpos and lastpos. */ + *nfirstpos++ = *nlastpos++ = 1; + --firstpos, --lastpos; + firstpos->index = lastpos->index = i; + firstpos->constraint = lastpos->constraint = NO_CONSTRAINT; + + /* Allocate the follow set for this position. */ + nalloc[i] = 1; + MALLOC(d->follows[i].elems, position, nalloc[i]); + break; + } +#ifdef DEBUG + /* ... balance the above nonsyntactic #ifdef goo... */ + fprintf(stderr, "node %d:", i); + prtok(d->tokens[i]); + putc('\n', stderr); + fprintf(stderr, nullable[-1] ? " nullable: yes\n" : " nullable: no\n"); + fprintf(stderr, " firstpos:"); + for (j = nfirstpos[-1] - 1; j >= 0; --j) + { + fprintf(stderr, " %d:", firstpos[j].index); + prtok(d->tokens[firstpos[j].index]); + } + fprintf(stderr, "\n lastpos:"); + for (j = nlastpos[-1] - 1; j >= 0; --j) + { + fprintf(stderr, " %d:", lastpos[j].index); + prtok(d->tokens[lastpos[j].index]); + } + putc('\n', stderr); + } +#endif + + /* For each follow set that is the follow set of a real position, replace + it with its epsilon closure. */ + for (i = 0; i < d->tindex; ++i) + if (d->tokens[i] < NOTCHAR || d->tokens[i] == BACKREF +#ifdef MBS_SUPPORT + || d->tokens[i] == ANYCHAR + || d->tokens[i] == MBCSET +#endif + || d->tokens[i] >= CSET) + { +#ifdef DEBUG + fprintf(stderr, "follows(%d:", i); + prtok(d->tokens[i]); + fprintf(stderr, "):"); + for (j = d->follows[i].nelem - 1; j >= 0; --j) + { + fprintf(stderr, " %d:", d->follows[i].elems[j].index); + prtok(d->tokens[d->follows[i].elems[j].index]); + } + putc('\n', stderr); +#endif + copy(&d->follows[i], &merged); + epsclosure(&merged, d); + if (d->follows[i].nelem < merged.nelem) + REALLOC(d->follows[i].elems, position, merged.nelem); + copy(&merged, &d->follows[i]); + } + + /* Get the epsilon closure of the firstpos of the regexp. The result will + be the set of positions of state 0. */ + merged.nelem = 0; + for (i = 0; i < nfirstpos[-1]; ++i) + insert(firstpos[i], &merged); + epsclosure(&merged, d); + + /* Check if any of the positions of state 0 will want newline context. */ + wants_newline = 0; + for (i = 0; i < merged.nelem; ++i) + if (PREV_NEWLINE_DEPENDENT(merged.elems[i].constraint)) + wants_newline = 1; + + /* Build the initial state. */ + d->salloc = 1; + d->sindex = 0; + MALLOC(d->states, dfa_state, d->salloc); + state_index(d, &merged, wants_newline, 0); + + free(o_nullable); + free(o_nfirst); + free(o_firstpos); + free(o_nlast); + free(o_lastpos); + free(nalloc); + free(merged.elems); +} + +/* Find, for each character, the transition out of state s of d, and store + it in the appropriate slot of trans. + + We divide the positions of s into groups (positions can appear in more + than one group). Each group is labeled with a set of characters that + every position in the group matches (taking into account, if necessary, + preceding context information of s). For each group, find the union + of the its elements' follows. This set is the set of positions of the + new state. For each character in the group's label, set the transition + on this character to be to a state corresponding to the set's positions, + and its associated backward context information, if necessary. + + If we are building a searching matcher, we include the positions of state + 0 in every state. + + The collection of groups is constructed by building an equivalence-class + partition of the positions of s. + + For each position, find the set of characters C that it matches. Eliminate + any characters from C that fail on grounds of backward context. + + Search through the groups, looking for a group whose label L has nonempty + intersection with C. If L - C is nonempty, create a new group labeled + L - C and having the same positions as the current group, and set L to + the intersection of L and C. Insert the position in this group, set + C = C - L, and resume scanning. + + If after comparing with every group there are characters remaining in C, + create a new group labeled with the characters of C and insert this + position in that group. */ +void +dfastate (int s, struct dfa *d, int trans[]) +{ + position_set grps[NOTCHAR]; /* As many as will ever be needed. */ + charclass labels[NOTCHAR]; /* Labels corresponding to the groups. */ + int ngrps = 0; /* Number of groups actually used. */ + position pos; /* Current position being considered. */ + charclass matches; /* Set of matching characters. */ + int matchesf; /* True if matches is nonempty. */ + charclass intersect; /* Intersection with some label set. */ + int intersectf; /* True if intersect is nonempty. */ + charclass leftovers; /* Stuff in the label that didn't match. */ + int leftoversf; /* True if leftovers is nonempty. */ + static charclass letters; /* Set of characters considered letters. */ + static charclass newline; /* Set of characters that aren't newline. */ + position_set follows; /* Union of the follows of some group. */ + position_set tmp; /* Temporary space for merging sets. */ + int state; /* New state. */ + int wants_newline; /* New state wants to know newline context. */ + int state_newline; /* New state on a newline transition. */ + int wants_letter; /* New state wants to know letter context. */ + int state_letter; /* New state on a letter transition. */ + static int initialized; /* Flag for static initialization. */ +#ifdef MBS_SUPPORT + int next_isnt_1st_byte = 0; /* Flag If we can't add state0. */ +#endif + int i, j, k; + + /* Initialize the set of letters, if necessary. */ + if (! initialized) + { + initialized = 1; + for (i = 0; i < NOTCHAR; ++i) + if (IS_WORD_CONSTITUENT(i)) + setbit(i, letters); + setbit(eolbyte, newline); + } + + zeroset(matches); + + for (i = 0; i < d->states[s].elems.nelem; ++i) + { + pos = d->states[s].elems.elems[i]; + if (d->tokens[pos.index] >= 0 && d->tokens[pos.index] < NOTCHAR) + setbit(d->tokens[pos.index], matches); + else if (d->tokens[pos.index] >= CSET) + copyset(d->charclasses[d->tokens[pos.index] - CSET], matches); +#ifdef MBS_SUPPORT + else if (d->tokens[pos.index] == ANYCHAR + || d->tokens[pos.index] == MBCSET) + /* MB_CUR_MAX > 1 */ + { + /* ANYCHAR and MBCSET must match with a single character, so we + must put it to d->states[s].mbps, which contains the positions + which can match with a single character not a byte. */ + if (d->states[s].mbps.nelem == 0) + { + MALLOC(d->states[s].mbps.elems, position, + d->states[s].elems.nelem); + } + insert(pos, &(d->states[s].mbps)); + continue; + } +#endif /* MBS_SUPPORT */ + else + continue; + + /* Some characters may need to be eliminated from matches because + they fail in the current context. */ + if (pos.constraint != 0xFF) + { + if (! MATCHES_NEWLINE_CONTEXT(pos.constraint, + d->states[s].newline, 1)) + clrbit(eolbyte, matches); + if (! MATCHES_NEWLINE_CONTEXT(pos.constraint, + d->states[s].newline, 0)) + for (j = 0; j < CHARCLASS_INTS; ++j) + matches[j] &= newline[j]; + if (! MATCHES_LETTER_CONTEXT(pos.constraint, + d->states[s].letter, 1)) + for (j = 0; j < CHARCLASS_INTS; ++j) + matches[j] &= ~letters[j]; + if (! MATCHES_LETTER_CONTEXT(pos.constraint, + d->states[s].letter, 0)) + for (j = 0; j < CHARCLASS_INTS; ++j) + matches[j] &= letters[j]; + + /* If there are no characters left, there's no point in going on. */ + for (j = 0; j < CHARCLASS_INTS && !matches[j]; ++j) + continue; + if (j == CHARCLASS_INTS) + continue; + } + + for (j = 0; j < ngrps; ++j) + { + /* If matches contains a single character only, and the current + group's label doesn't contain that character, go on to the + next group. */ + if (d->tokens[pos.index] >= 0 && d->tokens[pos.index] < NOTCHAR + && !tstbit(d->tokens[pos.index], labels[j])) + continue; + + /* Check if this group's label has a nonempty intersection with + matches. */ + intersectf = 0; + for (k = 0; k < CHARCLASS_INTS; ++k) + (intersect[k] = matches[k] & labels[j][k]) ? (intersectf = 1) : 0; + if (! intersectf) + continue; + + /* It does; now find the set differences both ways. */ + leftoversf = matchesf = 0; + for (k = 0; k < CHARCLASS_INTS; ++k) + { + /* Even an optimizing compiler can't know this for sure. */ + int match = matches[k], label = labels[j][k]; + + (leftovers[k] = ~match & label) ? (leftoversf = 1) : 0; + (matches[k] = match & ~label) ? (matchesf = 1) : 0; + } + + /* If there were leftovers, create a new group labeled with them. */ + if (leftoversf) + { + copyset(leftovers, labels[ngrps]); + copyset(intersect, labels[j]); + MALLOC(grps[ngrps].elems, position, d->nleaves); + copy(&grps[j], &grps[ngrps]); + ++ngrps; + } + + /* Put the position in the current group. Note that there is no + reason to call insert() here. */ + grps[j].elems[grps[j].nelem++] = pos; + + /* If every character matching the current position has been + accounted for, we're done. */ + if (! matchesf) + break; + } + + /* If we've passed the last group, and there are still characters + unaccounted for, then we'll have to create a new group. */ + if (j == ngrps) + { + copyset(matches, labels[ngrps]); + zeroset(matches); + MALLOC(grps[ngrps].elems, position, d->nleaves); + grps[ngrps].nelem = 1; + grps[ngrps].elems[0] = pos; + ++ngrps; + } + } + + MALLOC(follows.elems, position, d->nleaves); + MALLOC(tmp.elems, position, d->nleaves); + + /* If we are a searching matcher, the default transition is to a state + containing the positions of state 0, otherwise the default transition + is to fail miserably. */ + if (d->searchflag) + { + wants_newline = 0; + wants_letter = 0; + for (i = 0; i < d->states[0].elems.nelem; ++i) + { + if (PREV_NEWLINE_DEPENDENT(d->states[0].elems.elems[i].constraint)) + wants_newline = 1; + if (PREV_LETTER_DEPENDENT(d->states[0].elems.elems[i].constraint)) + wants_letter = 1; + } + copy(&d->states[0].elems, &follows); + state = state_index(d, &follows, 0, 0); + if (wants_newline) + state_newline = state_index(d, &follows, 1, 0); + else + state_newline = state; + if (wants_letter) + state_letter = state_index(d, &follows, 0, 1); + else + state_letter = state; + for (i = 0; i < NOTCHAR; ++i) + trans[i] = (IS_WORD_CONSTITUENT(i)) ? state_letter : state; + trans[eolbyte] = state_newline; + } + else + for (i = 0; i < NOTCHAR; ++i) + trans[i] = -1; + + for (i = 0; i < ngrps; ++i) + { + follows.nelem = 0; + + /* Find the union of the follows of the positions of the group. + This is a hideously inefficient loop. Fix it someday. */ + for (j = 0; j < grps[i].nelem; ++j) + for (k = 0; k < d->follows[grps[i].elems[j].index].nelem; ++k) + insert(d->follows[grps[i].elems[j].index].elems[k], &follows); + +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + /* If a token in follows.elems is not 1st byte of a multibyte + character, or the states of follows must accept the bytes + which are not 1st byte of the multibyte character. + Then, if a state of follows encounter a byte, it must not be + a 1st byte of a multibyte character nor singlebyte character. + We cansel to add state[0].follows to next state, because + state[0] must accept 1st-byte + + For example, we assume is a certain singlebyte + character, is a certain multibyte character, and the + codepoint of equals the 2nd byte of the codepoint of + . + When state[0] accepts , state[i] transit to state[i+1] + by accepting accepts 1st byte of , and state[i+1] + accepts 2nd byte of , if state[i+1] encounter the + codepoint of , it must not be but 2nd byte of + , so we can not add state[0]. */ + + next_isnt_1st_byte = 0; + for (j = 0; j < follows.nelem; ++j) + { + if (!(d->multibyte_prop[follows.elems[j].index] & 1)) + { + next_isnt_1st_byte = 1; + break; + } + } + } +#endif + + /* If we are building a searching matcher, throw in the positions + of state 0 as well. */ +#ifdef MBS_SUPPORT + if (d->searchflag && (MB_CUR_MAX == 1 || !next_isnt_1st_byte)) +#else + if (d->searchflag) +#endif + for (j = 0; j < d->states[0].elems.nelem; ++j) + insert(d->states[0].elems.elems[j], &follows); + + /* Find out if the new state will want any context information. */ + wants_newline = 0; + if (tstbit(eolbyte, labels[i])) + for (j = 0; j < follows.nelem; ++j) + if (PREV_NEWLINE_DEPENDENT(follows.elems[j].constraint)) + wants_newline = 1; + + wants_letter = 0; + for (j = 0; j < CHARCLASS_INTS; ++j) + if (labels[i][j] & letters[j]) + break; + if (j < CHARCLASS_INTS) + for (j = 0; j < follows.nelem; ++j) + if (PREV_LETTER_DEPENDENT(follows.elems[j].constraint)) + wants_letter = 1; + + /* Find the state(s) corresponding to the union of the follows. */ + state = state_index(d, &follows, 0, 0); + if (wants_newline) + state_newline = state_index(d, &follows, 1, 0); + else + state_newline = state; + if (wants_letter) + state_letter = state_index(d, &follows, 0, 1); + else + state_letter = state; + + /* Set the transitions for each character in the current label. */ + for (j = 0; j < CHARCLASS_INTS; ++j) + for (k = 0; k < INTBITS; ++k) + if (labels[i][j] & 1 << k) + { + int c = j * INTBITS + k; + + if (c == eolbyte) + trans[c] = state_newline; + else if (IS_WORD_CONSTITUENT(c)) + trans[c] = state_letter; + else if (c < NOTCHAR) + trans[c] = state; + } + } + + for (i = 0; i < ngrps; ++i) + free(grps[i].elems); + free(follows.elems); + free(tmp.elems); +} + +/* Some routines for manipulating a compiled dfa's transition tables. + Each state may or may not have a transition table; if it does, and it + is a non-accepting state, then d->trans[state] points to its table. + If it is an accepting state then d->fails[state] points to its table. + If it has no table at all, then d->trans[state] is NULL. + TODO: Improve this comment, get rid of the unnecessary redundancy. */ + +static void +build_state (int s, struct dfa *d) +{ + int *trans; /* The new transition table. */ + int i; + + /* Set an upper limit on the number of transition tables that will ever + exist at once. 1024 is arbitrary. The idea is that the frequently + used transition tables will be quickly rebuilt, whereas the ones that + were only needed once or twice will be cleared away. */ + if (d->trcount >= 1024) + { + for (i = 0; i < d->tralloc; ++i) + if (d->trans[i]) + { + free((ptr_t) d->trans[i]); + d->trans[i] = NULL; + } + else if (d->fails[i]) + { + free((ptr_t) d->fails[i]); + d->fails[i] = NULL; + } + d->trcount = 0; + } + + ++d->trcount; + + /* Set up the success bits for this state. */ + d->success[s] = 0; + if (ACCEPTS_IN_CONTEXT(d->states[s].newline, 1, d->states[s].letter, 0, + s, *d)) + d->success[s] |= 4; + if (ACCEPTS_IN_CONTEXT(d->states[s].newline, 0, d->states[s].letter, 1, + s, *d)) + d->success[s] |= 2; + if (ACCEPTS_IN_CONTEXT(d->states[s].newline, 0, d->states[s].letter, 0, + s, *d)) + d->success[s] |= 1; + + MALLOC(trans, int, NOTCHAR); + dfastate(s, d, trans); + + /* Now go through the new transition table, and make sure that the trans + and fail arrays are allocated large enough to hold a pointer for the + largest state mentioned in the table. */ + for (i = 0; i < NOTCHAR; ++i) + if (trans[i] >= d->tralloc) + { + int oldalloc = d->tralloc; + + while (trans[i] >= d->tralloc) + d->tralloc *= 2; + REALLOC(d->realtrans, int *, d->tralloc + 1); + d->trans = d->realtrans + 1; + REALLOC(d->fails, int *, d->tralloc); + REALLOC(d->success, int, d->tralloc); + while (oldalloc < d->tralloc) + { + d->trans[oldalloc] = NULL; + d->fails[oldalloc++] = NULL; + } + } + + /* Newline is a sentinel. */ + trans[eolbyte] = -1; + + if (ACCEPTING(s, *d)) + d->fails[s] = trans; + else + d->trans[s] = trans; +} + +static void +build_state_zero (struct dfa *d) +{ + d->tralloc = 1; + d->trcount = 0; + CALLOC(d->realtrans, int *, d->tralloc + 1); + d->trans = d->realtrans + 1; + CALLOC(d->fails, int *, d->tralloc); + MALLOC(d->success, int, d->tralloc); + build_state(0, d); +} + +#ifdef MBS_SUPPORT +/* Multibyte character handling sub-routins for dfaexec. */ + +/* Initial state may encounter the byte which is not a singlebyte character + nor 1st byte of a multibyte character. But it is incorrect for initial + state to accept such a byte. + For example, in sjis encoding the regular expression like "\\" accepts + the codepoint 0x5c, but should not accept the 2nd byte of the codepoint + 0x815c. Then Initial state must skip the bytes which are not a singlebyte + character nor 1st byte of a multibyte character. */ +#define SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p) \ + if (s == 0) \ + { \ + while (inputwcs[p - buf_begin] == 0 \ + && mblen_buf[p - buf_begin] > 0 \ + && p < buf_end) \ + ++p; \ + if (p >= end) \ + { \ + free(mblen_buf); \ + free(inputwcs); \ + return (size_t) -1; \ + } \ + } + +static void +realloc_trans_if_necessary(struct dfa *d, int new_state) +{ + /* Make sure that the trans and fail arrays are allocated large enough + to hold a pointer for the new state. */ + if (new_state >= d->tralloc) + { + int oldalloc = d->tralloc; + + while (new_state >= d->tralloc) + d->tralloc *= 2; + REALLOC(d->realtrans, int *, d->tralloc + 1); + d->trans = d->realtrans + 1; + REALLOC(d->fails, int *, d->tralloc); + REALLOC(d->success, int, d->tralloc); + while (oldalloc < d->tralloc) + { + d->trans[oldalloc] = NULL; + d->fails[oldalloc++] = NULL; + } + } +} + +/* Return values of transit_state_singlebyte(), and + transit_state_consume_1char. */ +typedef enum +{ + TRANSIT_STATE_IN_PROGRESS, /* State transition has not finished. */ + TRANSIT_STATE_DONE, /* State transition has finished. */ + TRANSIT_STATE_END_BUFFER /* Reach the end of the buffer. */ +} status_transit_state; + +/* Consume a single byte and transit state from 's' to '*next_state'. + This function is almost same as the state transition routin in dfaexec(). + But state transition is done just once, otherwise matching succeed or + reach the end of the buffer. */ +static status_transit_state +transit_state_singlebyte (struct dfa *d, int s, unsigned char const *p, + int *next_state) +{ + int *t; + int works = s; + + status_transit_state rval = TRANSIT_STATE_IN_PROGRESS; + + while (rval == TRANSIT_STATE_IN_PROGRESS) + { + if ((t = d->trans[works]) != NULL) + { + works = t[*p]; + rval = TRANSIT_STATE_DONE; + if (works < 0) + works = 0; + } + else if (works < 0) + { + if (p == buf_end) + /* At the moment, it must not happen. */ + return TRANSIT_STATE_END_BUFFER; + works = 0; + } + else if (d->fails[works]) + { + works = d->fails[works][*p]; + rval = TRANSIT_STATE_DONE; + } + else + { + build_state(works, d); + } + } + *next_state = works; + return rval; +} + +/* Check whether period can match or not in the current context. If it can, + return the amount of the bytes with which period can match, otherwise + return 0. + `pos' is the position of the period. `index' is the index from the + buf_begin, and it is the current position in the buffer. */ +static int +match_anychar (struct dfa *d, int s, position pos, int index) +{ + int newline = 0; + int letter = 0; + wchar_t wc; + int mbclen; + + wc = inputwcs[index]; + mbclen = (mblen_buf[index] == 0)? 1 : mblen_buf[index]; + + /* Check context. */ + if (wc == (wchar_t)eolbyte) + { + if (!(syntax_bits & RE_DOT_NEWLINE)) + return 0; + newline = 1; + } + else if (wc == (wchar_t)'\0') + { + if (syntax_bits & RE_DOT_NOT_NULL) + return 0; + newline = 1; + } + + if (iswalnum(wc) || wc == L'_') + letter = 1; + + if (!SUCCEEDS_IN_CONTEXT(pos.constraint, d->states[s].newline, + newline, d->states[s].letter, letter)) + return 0; + + return mbclen; +} + +/* Check whether bracket expression can match or not in the current context. + If it can, return the amount of the bytes with which expression can match, + otherwise return 0. + `pos' is the position of the bracket expression. `index' is the index + from the buf_begin, and it is the current position in the buffer. */ +int +match_mb_charset (struct dfa *d, int s, position pos, int index) +{ + int i; + int match; /* Flag which represent that matching succeed. */ + int match_len; /* Length of the character (or collating element) + with which this operator match. */ + int op_len; /* Length of the operator. */ + char buffer[128]; + wchar_t wcbuf[6]; + + /* Pointer to the structure to which we are currently reffering. */ + struct mb_char_classes *work_mbc; + + int newline = 0; + int letter = 0; + wchar_t wc; /* Current reffering character. */ + + wc = inputwcs[index]; + + /* Check context. */ + if (wc == (wchar_t)eolbyte) + { + if (!(syntax_bits & RE_DOT_NEWLINE)) + return 0; + newline = 1; + } + else if (wc == (wchar_t)'\0') + { + if (syntax_bits & RE_DOT_NOT_NULL) + return 0; + newline = 1; + } + if (iswalnum(wc) || wc == L'_') + letter = 1; + if (!SUCCEEDS_IN_CONTEXT(pos.constraint, d->states[s].newline, + newline, d->states[s].letter, letter)) + return 0; + + /* Assign the current reffering operator to work_mbc. */ + work_mbc = &(d->mbcsets[(d->multibyte_prop[pos.index]) >> 2]); + match = !work_mbc->invert; + match_len = (mblen_buf[index] == 0)? 1 : mblen_buf[index]; + + /* match with a character class? */ + for (i = 0; inch_classes; i++) + { + if (iswctype((wint_t)wc, work_mbc->ch_classes[i])) + goto charset_matched; + } + + strncpy(buffer, buf_begin + index, match_len); + buffer[match_len] = '\0'; + + /* match with an equivalent class? */ + for (i = 0; inequivs; i++) + { + op_len = strlen(work_mbc->equivs[i]); + strncpy(buffer, buf_begin + index, op_len); + buffer[op_len] = '\0'; + if (strcoll(work_mbc->equivs[i], buffer) == 0) + { + match_len = op_len; + goto charset_matched; + } + } + + /* match with a collating element? */ + for (i = 0; incoll_elems; i++) + { + op_len = strlen(work_mbc->coll_elems[i]); + strncpy(buffer, buf_begin + index, op_len); + buffer[op_len] = '\0'; + + if (strcoll(work_mbc->coll_elems[i], buffer) == 0) + { + match_len = op_len; + goto charset_matched; + } + } + + wcbuf[0] = wc; + wcbuf[1] = wcbuf[3] = wcbuf[5] = '\0'; + + /* match with a range? */ + for (i = 0; inranges; i++) + { + wcbuf[2] = work_mbc->range_sts[i]; + wcbuf[4] = work_mbc->range_ends[i]; + + if (wcscoll(wcbuf, wcbuf+2) >= 0 && + wcscoll(wcbuf+4, wcbuf) >= 0) + goto charset_matched; + } + + /* match with a character? */ + for (i = 0; inchars; i++) + { + if (wc == work_mbc->chars[i]) + goto charset_matched; + } + + match = !match; + + charset_matched: + return match ? match_len : 0; +} + +/* Check each of `d->states[s].mbps.elem' can match or not. Then return the + array which corresponds to `d->states[s].mbps.elem' and each element of + the array contains the amount of the bytes with which the element can + match. + `index' is the index from the buf_begin, and it is the current position + in the buffer. + Caller MUST free the array which this function return. */ +static int* +check_matching_with_multibyte_ops (struct dfa *d, int s, int index) +{ + int i; + int* rarray; + + MALLOC(rarray, int, d->states[s].mbps.nelem); + for (i = 0; i < d->states[s].mbps.nelem; ++i) + { + position pos = d->states[s].mbps.elems[i]; + switch(d->tokens[pos.index]) + { + case ANYCHAR: + rarray[i] = match_anychar(d, s, pos, index); + break; + case MBCSET: + rarray[i] = match_mb_charset(d, s, pos, index); + break; + default: + break; /* can not happen. */ + } + } + return rarray; +} + +/* Consume a single character and enumerate all of the positions which can + be next position from the state `s'. + `match_lens' is the input. It can be NULL, but it can also be the output + of check_matching_with_multibyte_ops() for optimization. + `mbclen' and `pps' are the output. `mbclen' is the length of the + character consumed, and `pps' is the set this function enumerate. */ +static status_transit_state +transit_state_consume_1char (struct dfa *d, int s, unsigned char const **pp, + int *match_lens, int *mbclen, position_set *pps) +{ + int i, j; + int s1, s2; + int* work_mbls; + status_transit_state rs = TRANSIT_STATE_DONE; + + /* Calculate the length of the (single/multi byte) character + to which p points. */ + *mbclen = (mblen_buf[*pp - buf_begin] == 0)? 1 + : mblen_buf[*pp - buf_begin]; + + /* Calculate the state which can be reached from the state `s' by + consuming `*mbclen' single bytes from the buffer. */ + s1 = s; + for (i = 0; i < *mbclen; i++) + { + s2 = s1; + rs = transit_state_singlebyte(d, s2, (*pp)++, &s1); + } + /* Copy the positions contained by `s1' to the set `pps'. */ + copy(&(d->states[s1].elems), pps); + + /* Check (inputed)match_lens, and initialize if it is NULL. */ + if (match_lens == NULL && d->states[s].mbps.nelem != 0) + work_mbls = check_matching_with_multibyte_ops(d, s, *pp - buf_begin); + else + work_mbls = match_lens; + + /* Add all of the positions which can be reached from `s' by consuming + a single character. */ + for (i = 0; i < d->states[s].mbps.nelem ; i++) + { + if (work_mbls[i] == *mbclen) + for (j = 0; j < d->follows[d->states[s].mbps.elems[i].index].nelem; + j++) + insert(d->follows[d->states[s].mbps.elems[i].index].elems[j], + pps); + } + + if (match_lens == NULL && work_mbls != NULL) + free(work_mbls); + return rs; +} + +/* Transit state from s, then return new state and update the pointer of the + buffer. This function is for some operator which can match with a multi- + byte character or a collating element(which may be multi characters). */ +static int +transit_state (struct dfa *d, int s, unsigned char const **pp) +{ + int s1; + int mbclen; /* The length of current input multibyte character. */ + int maxlen = 0; + int i, j; + int *match_lens = NULL; + int nelem = d->states[s].mbps.nelem; /* Just a alias. */ + position_set follows; + unsigned char const *p1 = *pp; + status_transit_state rs; + wchar_t wc; + + if (nelem > 0) + /* This state has (a) multibyte operator(s). + We check whether each of them can match or not. */ + { + /* Note: caller must free the return value of this function. */ + match_lens = check_matching_with_multibyte_ops(d, s, *pp - buf_begin); + + for (i = 0; i < nelem; i++) + /* Search the operator which match the longest string, + in this state. */ + { + if (match_lens[i] > maxlen) + maxlen = match_lens[i]; + } + } + + if (nelem == 0 || maxlen == 0) + /* This state has no multibyte operator which can match. + We need to check only one singlebyte character. */ + { + status_transit_state rs; + rs = transit_state_singlebyte(d, s, *pp, &s1); + + /* We must update the pointer if state transition succeeded. */ + if (rs == TRANSIT_STATE_DONE) + ++*pp; + + if (match_lens != NULL) + free(match_lens); + return s1; + } + + /* This state has some operators which can match a multibyte character. */ + follows.nelem = 0; + MALLOC(follows.elems, position, d->nleaves); + + /* `maxlen' may be longer than the length of a character, because it may + not be a character but a (multi character) collating element. + We enumerate all of the positions which `s' can reach by consuming + `maxlen' bytes. */ + rs = transit_state_consume_1char(d, s, pp, match_lens, &mbclen, &follows); + + wc = inputwcs[*pp - mbclen - buf_begin]; + s1 = state_index(d, &follows, wc == L'\n', iswalnum(wc)); + realloc_trans_if_necessary(d, s1); + + while (*pp - p1 < maxlen) + { + follows.nelem = 0; + rs = transit_state_consume_1char(d, s1, pp, NULL, &mbclen, &follows); + + for (i = 0; i < nelem ; i++) + { + if (match_lens[i] == *pp - p1) + for (j = 0; + j < d->follows[d->states[s1].mbps.elems[i].index].nelem; j++) + insert(d->follows[d->states[s1].mbps.elems[i].index].elems[j], + &follows); + } + + wc = inputwcs[*pp - mbclen - buf_begin]; + s1 = state_index(d, &follows, wc == L'\n', iswalnum(wc)); + realloc_trans_if_necessary(d, s1); + } + free(match_lens); + free(follows.elems); + return s1; +} + +#endif + +/* Search through a buffer looking for a match to the given struct dfa. + Find the first occurrence of a string matching the regexp in the buffer, + and the shortest possible version thereof. Return the offset of the first + character after the match, or (size_t) -1 if none is found. BEGIN points to + the beginning of the buffer, and SIZE is the size of the buffer. If SIZE + is nonzero, BEGIN[SIZE - 1] must be a newline. BACKREF points to a place + where we're supposed to store a 1 if backreferencing happened and the + match needs to be verified by a backtracking matcher. Otherwise + we store a 0 in *backref. */ +size_t +dfaexec (struct dfa *d, char const *begin, size_t size, int *backref) +{ + register int s; /* Current state. */ + register unsigned char const *p; /* Current input character. */ + register unsigned char const *end; /* One past the last input character. */ + register int **trans, *t; /* Copy of d->trans so it can be optimized + into a register. */ + register unsigned char eol = eolbyte; /* Likewise for eolbyte. */ + static int sbit[NOTCHAR]; /* Table for anding with d->success. */ + static int sbit_init; + + if (! sbit_init) + { + int i; + + sbit_init = 1; + for (i = 0; i < NOTCHAR; ++i) + sbit[i] = (IS_WORD_CONSTITUENT(i)) ? 2 : 1; + sbit[eol] = 4; + } + + if (! d->tralloc) + build_state_zero(d); + + s = 0; + p = (unsigned char const *) begin; + end = p + size; + trans = d->trans; + +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + int remain_bytes, i; + buf_begin = begin; + buf_end = end; + + /* initialize mblen_buf, and inputwcs. */ + MALLOC(mblen_buf, unsigned char, end - (unsigned char const *)begin + 2); + MALLOC(inputwcs, wchar_t, end - (unsigned char const *)begin + 2); + memset(&mbs, 0, sizeof(mbstate_t)); + remain_bytes = 0; + for (i = 0; i < end - (unsigned char const *)begin + 1; i++) + { + if (remain_bytes == 0) + { + remain_bytes + = mbrtowc(inputwcs + i, begin + i, + end - (unsigned char const *)begin - i + 1, &mbs); + if (remain_bytes <= 1) + { + remain_bytes = 0; + inputwcs[i] = (wchar_t)begin[i]; + mblen_buf[i] = 0; + } + else + { + mblen_buf[i] = remain_bytes; + remain_bytes--; + } + } + else + { + mblen_buf[i] = remain_bytes; + inputwcs[i] = 0; + remain_bytes--; + } + } + mblen_buf[i] = 0; + inputwcs[i] = 0; /* sentinel */ + } +#endif /* MBS_SUPPORT */ + + for (;;) + { +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + while ((t = trans[s])) + { + if (d->states[s].mbps.nelem != 0) + { + /* Can match with a multibyte character( and multi character + collating element). */ + unsigned char const *nextp; + + SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p); + + nextp = p; + s = transit_state(d, s, &nextp); + p = nextp; + + /* Trans table might be updated. */ + trans = d->trans; + } + else + { + SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p); + s = t[*p++]; + } + } + else +#endif /* MBS_SUPPORT */ + while ((t = trans[s])) + s = t[*p++]; + + if (s < 0) + { + if (p == end) + { +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + free(mblen_buf); + free(inputwcs); + } +#endif /* MBS_SUPPORT */ + return (size_t) -1; + } + s = 0; + } + else if ((t = d->fails[s])) + { + if (d->success[s] & sbit[*p]) + { + if (backref) + *backref = (d->states[s].backref != 0); +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + free(mblen_buf); + free(inputwcs); + } +#endif /* MBS_SUPPORT */ + return (char const *) p - begin; + } + +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p); + if (d->states[s].mbps.nelem != 0) + { + /* Can match with a multibyte character( and multi + character collating element). */ + unsigned char const *nextp; + nextp = p; + s = transit_state(d, s, &nextp); + p = nextp; + + /* Trans table might be updated. */ + trans = d->trans; + } + else + s = t[*p++]; + } + else +#endif /* MBS_SUPPORT */ + s = t[*p++]; + } + else + { + build_state(s, d); + trans = d->trans; + } + } +} + +/* Initialize the components of a dfa that the other routines don't + initialize for themselves. */ +void +dfainit (struct dfa *d) +{ + d->calloc = 1; + MALLOC(d->charclasses, charclass, d->calloc); + d->cindex = 0; + + d->talloc = 1; + MALLOC(d->tokens, token, d->talloc); + d->tindex = d->depth = d->nleaves = d->nregexps = 0; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + d->nmultibyte_prop = 1; + MALLOC(d->multibyte_prop, int, d->nmultibyte_prop); + d->nmbcsets = 0; + d->mbcsets_alloc = 1; + MALLOC(d->mbcsets, struct mb_char_classes, d->mbcsets_alloc); + } +#endif + + d->searchflag = 0; + d->tralloc = 0; + + d->musts = 0; +} + +/* Parse and analyze a single string of the given length. */ +void +dfacomp (char const *s, size_t len, struct dfa *d, int searchflag) +{ + if (case_fold) /* dummy folding in service of dfamust() */ + { + char *lcopy; + int i; + + lcopy = malloc(len); + if (!lcopy) + dfaerror(_("out of memory")); + + /* This is a kludge. */ + case_fold = 0; + for (i = 0; i < len; ++i) + if (ISUPPER ((unsigned char) s[i])) + lcopy[i] = tolower ((unsigned char) s[i]); + else + lcopy[i] = s[i]; + + dfainit(d); + dfaparse(lcopy, len, d); + free(lcopy); + dfamust(d); + d->cindex = d->tindex = d->depth = d->nleaves = d->nregexps = 0; + case_fold = 1; + dfaparse(s, len, d); + dfaanalyze(d, searchflag); + } + else + { + dfainit(d); + dfaparse(s, len, d); + dfamust(d); + dfaanalyze(d, searchflag); + } +} + +/* Free the storage held by the components of a dfa. */ +void +dfafree (struct dfa *d) +{ + int i; + struct dfamust *dm, *ndm; + + free((ptr_t) d->charclasses); + free((ptr_t) d->tokens); + +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + free((ptr_t) d->multibyte_prop); + for (i = 0; i < d->nmbcsets; ++i) + { + int j; + struct mb_char_classes *p = &(d->mbcsets[i]); + if (p->chars != NULL) + free(p->chars); + if (p->ch_classes != NULL) + free(p->ch_classes); + if (p->range_sts != NULL) + free(p->range_sts); + if (p->range_ends != NULL) + free(p->range_ends); + + for (j = 0; j < p->nequivs; ++j) + free(p->equivs[j]); + if (p->equivs != NULL) + free(p->equivs); + + for (j = 0; j < p->ncoll_elems; ++j) + free(p->coll_elems[j]); + if (p->coll_elems != NULL) + free(p->coll_elems); + } + free((ptr_t) d->mbcsets); + } +#endif /* MBS_SUPPORT */ + + for (i = 0; i < d->sindex; ++i) + free((ptr_t) d->states[i].elems.elems); + free((ptr_t) d->states); + for (i = 0; i < d->tindex; ++i) + if (d->follows[i].elems) + free((ptr_t) d->follows[i].elems); + free((ptr_t) d->follows); + for (i = 0; i < d->tralloc; ++i) + if (d->trans[i]) + free((ptr_t) d->trans[i]); + else if (d->fails[i]) + free((ptr_t) d->fails[i]); + if (d->realtrans) free((ptr_t) d->realtrans); + if (d->fails) free((ptr_t) d->fails); + if (d->success) free((ptr_t) d->success); + for (dm = d->musts; dm; dm = ndm) + { + ndm = dm->next; + free(dm->must); + free((ptr_t) dm); + } +} + +/* Having found the postfix representation of the regular expression, + try to find a long sequence of characters that must appear in any line + containing the r.e. + Finding a "longest" sequence is beyond the scope here; + we take an easy way out and hope for the best. + (Take "(ab|a)b"--please.) + + We do a bottom-up calculation of sequences of characters that must appear + in matches of r.e.'s represented by trees rooted at the nodes of the postfix + representation: + sequences that must appear at the left of the match ("left") + sequences that must appear at the right of the match ("right") + lists of sequences that must appear somewhere in the match ("in") + sequences that must constitute the match ("is") + + When we get to the root of the tree, we use one of the longest of its + calculated "in" sequences as our answer. The sequence we find is returned in + d->must (where "d" is the single argument passed to "dfamust"); + the length of the sequence is returned in d->mustn. + + The sequences calculated for the various types of node (in pseudo ANSI c) + are shown below. "p" is the operand of unary operators (and the left-hand + operand of binary operators); "q" is the right-hand operand of binary + operators. + + "ZERO" means "a zero-length sequence" below. + + Type left right is in + ---- ---- ----- -- -- + char c # c # c # c # c + + ANYCHAR ZERO ZERO ZERO ZERO + + MBCSET ZERO ZERO ZERO ZERO + + CSET ZERO ZERO ZERO ZERO + + STAR ZERO ZERO ZERO ZERO + + QMARK ZERO ZERO ZERO ZERO + + PLUS p->left p->right ZERO p->in + + CAT (p->is==ZERO)? (q->is==ZERO)? (p->is!=ZERO && p->in plus + p->left : q->right : q->is!=ZERO) ? q->in plus + p->is##q->left p->right##q->is p->is##q->is : p->right##q->left + ZERO + + OR longest common longest common (do p->is and substrings common to + leading trailing q->is have same p->in and q->in + (sub)sequence (sub)sequence length and + of p->left of p->right content) ? + and q->left and q->right p->is : NULL + + If there's anything else we recognize in the tree, all four sequences get set + to zero-length sequences. If there's something we don't recognize in the tree, + we just return a zero-length sequence. + + Break ties in favor of infrequent letters (choosing 'zzz' in preference to + 'aaa')? + + And. . .is it here or someplace that we might ponder "optimizations" such as + egrep 'psi|epsilon' -> egrep 'psi' + egrep 'pepsi|epsilon' -> egrep 'epsi' + (Yes, we now find "epsi" as a "string + that must occur", but we might also + simplify the *entire* r.e. being sought) + grep '[c]' -> grep 'c' + grep '(ab|a)b' -> grep 'ab' + grep 'ab*' -> grep 'a' + grep 'a*b' -> grep 'b' + + There are several issues: + + Is optimization easy (enough)? + + Does optimization actually accomplish anything, + or is the automaton you get from "psi|epsilon" (for example) + the same as the one you get from "psi" (for example)? + + Are optimizable r.e.'s likely to be used in real-life situations + (something like 'ab*' is probably unlikely; something like is + 'psi|epsilon' is likelier)? */ + +static char * +icatalloc (char *old, char *new) +{ + char *result; + size_t oldsize, newsize; + + newsize = (new == NULL) ? 0 : strlen(new); + if (old == NULL) + oldsize = 0; + else if (newsize == 0) + return old; + else oldsize = strlen(old); + if (old == NULL) + result = (char *) malloc(newsize + 1); + else + result = (char *) realloc((void *) old, oldsize + newsize + 1); + if (result != NULL && new != NULL) + (void) strcpy(result + oldsize, new); + return result; +} + +static char * +icpyalloc (char *string) +{ + return icatalloc((char *) NULL, string); +} + +static char * +istrstr (char *lookin, char *lookfor) +{ + char *cp; + size_t len; + + len = strlen(lookfor); + for (cp = lookin; *cp != '\0'; ++cp) + if (strncmp(cp, lookfor, len) == 0) + return cp; + return NULL; +} + +static void +ifree (char *cp) +{ + if (cp != NULL) + free(cp); +} + +static void +freelist (char **cpp) +{ + int i; + + if (cpp == NULL) + return; + for (i = 0; cpp[i] != NULL; ++i) + { + free(cpp[i]); + cpp[i] = NULL; + } +} + +static char ** +enlist (char **cpp, char *new, size_t len) +{ + int i, j; + + if (cpp == NULL) + return NULL; + if ((new = icpyalloc(new)) == NULL) + { + freelist(cpp); + return NULL; + } + new[len] = '\0'; + /* Is there already something in the list that's new (or longer)? */ + for (i = 0; cpp[i] != NULL; ++i) + if (istrstr(cpp[i], new) != NULL) + { + free(new); + return cpp; + } + /* Eliminate any obsoleted strings. */ + j = 0; + while (cpp[j] != NULL) + if (istrstr(new, cpp[j]) == NULL) + ++j; + else + { + free(cpp[j]); + if (--i == j) + break; + cpp[j] = cpp[i]; + cpp[i] = NULL; + } + /* Add the new string. */ + cpp = (char **) realloc((char *) cpp, (i + 2) * sizeof *cpp); + if (cpp == NULL) + return NULL; + cpp[i] = new; + cpp[i + 1] = NULL; + return cpp; +} + +/* Given pointers to two strings, return a pointer to an allocated + list of their distinct common substrings. Return NULL if something + seems wild. */ +static char ** +comsubs (char *left, char *right) +{ + char **cpp; + char *lcp; + char *rcp; + size_t i, len; + + if (left == NULL || right == NULL) + return NULL; + cpp = (char **) malloc(sizeof *cpp); + if (cpp == NULL) + return NULL; + cpp[0] = NULL; + for (lcp = left; *lcp != '\0'; ++lcp) + { + len = 0; + rcp = strchr (right, *lcp); + while (rcp != NULL) + { + for (i = 1; lcp[i] != '\0' && lcp[i] == rcp[i]; ++i) + continue; + if (i > len) + len = i; + rcp = strchr (rcp + 1, *lcp); + } + if (len == 0) + continue; + if ((cpp = enlist(cpp, lcp, len)) == NULL) + break; + } + return cpp; +} + +static char ** +addlists (char **old, char **new) +{ + int i; + + if (old == NULL || new == NULL) + return NULL; + for (i = 0; new[i] != NULL; ++i) + { + old = enlist(old, new[i], strlen(new[i])); + if (old == NULL) + break; + } + return old; +} + +/* Given two lists of substrings, return a new list giving substrings + common to both. */ +static char ** +inboth (char **left, char **right) +{ + char **both; + char **temp; + int lnum, rnum; + + if (left == NULL || right == NULL) + return NULL; + both = (char **) malloc(sizeof *both); + if (both == NULL) + return NULL; + both[0] = NULL; + for (lnum = 0; left[lnum] != NULL; ++lnum) + { + for (rnum = 0; right[rnum] != NULL; ++rnum) + { + temp = comsubs(left[lnum], right[rnum]); + if (temp == NULL) + { + freelist(both); + return NULL; + } + both = addlists(both, temp); + freelist(temp); + free(temp); + if (both == NULL) + return NULL; + } + } + return both; +} + +typedef struct +{ + char **in; + char *left; + char *right; + char *is; +} must; + +static void +resetmust (must *mp) +{ + mp->left[0] = mp->right[0] = mp->is[0] = '\0'; + freelist(mp->in); +} + +static void +dfamust (struct dfa *dfa) +{ + must *musts; + must *mp; + char *result; + int ri; + int i; + int exact; + token t; + static must must0; + struct dfamust *dm; + static char empty_string[] = ""; + + result = empty_string; + exact = 0; + musts = (must *) malloc((dfa->tindex + 1) * sizeof *musts); + if (musts == NULL) + return; + mp = musts; + for (i = 0; i <= dfa->tindex; ++i) + mp[i] = must0; + for (i = 0; i <= dfa->tindex; ++i) + { + mp[i].in = (char **) malloc(sizeof *mp[i].in); + mp[i].left = malloc(2); + mp[i].right = malloc(2); + mp[i].is = malloc(2); + if (mp[i].in == NULL || mp[i].left == NULL || + mp[i].right == NULL || mp[i].is == NULL) + goto done; + mp[i].left[0] = mp[i].right[0] = mp[i].is[0] = '\0'; + mp[i].in[0] = NULL; + } +#ifdef DEBUG + fprintf(stderr, "dfamust:\n"); + for (i = 0; i < dfa->tindex; ++i) + { + fprintf(stderr, " %d:", i); + prtok(dfa->tokens[i]); + } + putc('\n', stderr); +#endif + for (ri = 0; ri < dfa->tindex; ++ri) + { + switch (t = dfa->tokens[ri]) + { + case LPAREN: + case RPAREN: + goto done; /* "cannot happen" */ + case EMPTY: + case BEGLINE: + case ENDLINE: + case BEGWORD: + case ENDWORD: + case LIMWORD: + case NOTLIMWORD: + case BACKREF: + resetmust(mp); + break; + case STAR: + case QMARK: + if (mp <= musts) + goto done; /* "cannot happen" */ + --mp; + resetmust(mp); + break; + case OR: + case ORTOP: + if (mp < &musts[2]) + goto done; /* "cannot happen" */ + { + char **new; + must *lmp; + must *rmp; + int j, ln, rn, n; + + rmp = --mp; + lmp = --mp; + /* Guaranteed to be. Unlikely, but. . . */ + if (strcmp(lmp->is, rmp->is) != 0) + lmp->is[0] = '\0'; + /* Left side--easy */ + i = 0; + while (lmp->left[i] != '\0' && lmp->left[i] == rmp->left[i]) + ++i; + lmp->left[i] = '\0'; + /* Right side */ + ln = strlen(lmp->right); + rn = strlen(rmp->right); + n = ln; + if (n > rn) + n = rn; + for (i = 0; i < n; ++i) + if (lmp->right[ln - i - 1] != rmp->right[rn - i - 1]) + break; + for (j = 0; j < i; ++j) + lmp->right[j] = lmp->right[(ln - i) + j]; + lmp->right[j] = '\0'; + new = inboth(lmp->in, rmp->in); + if (new == NULL) + goto done; + freelist(lmp->in); + free((char *) lmp->in); + lmp->in = new; + } + break; + case PLUS: + if (mp <= musts) + goto done; /* "cannot happen" */ + --mp; + mp->is[0] = '\0'; + break; + case END: + if (mp != &musts[1]) + goto done; /* "cannot happen" */ + for (i = 0; musts[0].in[i] != NULL; ++i) + if (strlen(musts[0].in[i]) > strlen(result)) + result = musts[0].in[i]; + if (strcmp(result, musts[0].is) == 0) + exact = 1; + goto done; + case CAT: + if (mp < &musts[2]) + goto done; /* "cannot happen" */ + { + must *lmp; + must *rmp; + + rmp = --mp; + lmp = --mp; + /* In. Everything in left, plus everything in + right, plus catenation of + left's right and right's left. */ + lmp->in = addlists(lmp->in, rmp->in); + if (lmp->in == NULL) + goto done; + if (lmp->right[0] != '\0' && + rmp->left[0] != '\0') + { + char *tp; + + tp = icpyalloc(lmp->right); + if (tp == NULL) + goto done; + tp = icatalloc(tp, rmp->left); + if (tp == NULL) + goto done; + lmp->in = enlist(lmp->in, tp, + strlen(tp)); + free(tp); + if (lmp->in == NULL) + goto done; + } + /* Left-hand */ + if (lmp->is[0] != '\0') + { + lmp->left = icatalloc(lmp->left, + rmp->left); + if (lmp->left == NULL) + goto done; + } + /* Right-hand */ + if (rmp->is[0] == '\0') + lmp->right[0] = '\0'; + lmp->right = icatalloc(lmp->right, rmp->right); + if (lmp->right == NULL) + goto done; + /* Guaranteed to be */ + if (lmp->is[0] != '\0' && rmp->is[0] != '\0') + { + lmp->is = icatalloc(lmp->is, rmp->is); + if (lmp->is == NULL) + goto done; + } + else + lmp->is[0] = '\0'; + } + break; + default: + if (t < END) + { + /* "cannot happen" */ + goto done; + } + else if (t == '\0') + { + /* not on *my* shift */ + goto done; + } + else if (t >= CSET +#ifdef MBS_SUPPORT + || t == ANYCHAR + || t == MBCSET +#endif /* MBS_SUPPORT */ + ) + { + /* easy enough */ + resetmust(mp); + } + else + { + /* plain character */ + resetmust(mp); + mp->is[0] = mp->left[0] = mp->right[0] = t; + mp->is[1] = mp->left[1] = mp->right[1] = '\0'; + mp->in = enlist(mp->in, mp->is, (size_t)1); + if (mp->in == NULL) + goto done; + } + break; + } +#ifdef DEBUG + fprintf(stderr, " node: %d:", ri); + prtok(dfa->tokens[ri]); + fprintf(stderr, "\n in:"); + for (i = 0; mp->in[i]; ++i) + fprintf(stderr, " \"%s\"", mp->in[i]); + fprintf(stderr, "\n is: \"%s\"\n", mp->is); + fprintf(stderr, " left: \"%s\"\n", mp->left); + fprintf(stderr, " right: \"%s\"\n", mp->right); +#endif + ++mp; + } + done: + if (strlen(result)) + { + dm = (struct dfamust *) malloc(sizeof (struct dfamust)); + dm->exact = exact; + dm->must = malloc(strlen(result) + 1); + strcpy(dm->must, result); + dm->next = dfa->musts; + dfa->musts = dm; + } + mp = musts; + for (i = 0; i <= dfa->tindex; ++i) + { + freelist(mp[i].in); + ifree((char *) mp[i].in); + ifree(mp[i].left); + ifree(mp[i].right); + ifree(mp[i].is); + } + free((char *) mp); +} +/* vim:set shiftwidth=2: */ diff --git a/src/apps/bin/grep-2.5/src/dfa.h b/src/apps/bin/grep-2.5/src/dfa.h new file mode 100644 index 0000000000..bbc0457afe --- /dev/null +++ b/src/apps/bin/grep-2.5/src/dfa.h @@ -0,0 +1,432 @@ +/* dfa.h - declarations for GNU deterministic regexp compiler + Copyright (C) 1988, 1998 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + +/* Written June, 1988 by Mike Haertel */ + +/* FIXME: + 2. We should not export so much of the DFA internals. + In addition to clobbering modularity, we eat up valuable + name space. */ + +#ifdef __STDC__ +# ifndef _PTR_T +# define _PTR_T + typedef void * ptr_t; +# endif +#else +# ifndef _PTR_T +# define _PTR_T + typedef char * ptr_t; +# endif +#endif + +#ifdef PARAMS +# undef PARAMS +#endif +#if PROTOTYPES +# define PARAMS(x) x +#else +# define PARAMS(x) () +#endif + +/* Number of bits in an unsigned char. */ +#ifndef CHARBITS +#define CHARBITS 8 +#endif + +/* First integer value that is greater than any character code. */ +#define NOTCHAR (1 << CHARBITS) + +/* INTBITS need not be exact, just a lower bound. */ +#ifndef INTBITS +#define INTBITS (CHARBITS * sizeof (int)) +#endif + +/* Number of ints required to hold a bit for every character. */ +#define CHARCLASS_INTS ((NOTCHAR + INTBITS - 1) / INTBITS) + +/* Sets of unsigned characters are stored as bit vectors in arrays of ints. */ +typedef int charclass[CHARCLASS_INTS]; + +/* The regexp is parsed into an array of tokens in postfix form. Some tokens + are operators and others are terminal symbols. Most (but not all) of these + codes are returned by the lexical analyzer. */ + +typedef enum +{ + END = -1, /* END is a terminal symbol that matches the + end of input; any value of END or less in + the parse tree is such a symbol. Accepting + states of the DFA are those that would have + a transition on END. */ + + /* Ordinary character values are terminal symbols that match themselves. */ + + EMPTY = NOTCHAR, /* EMPTY is a terminal symbol that matches + the empty string. */ + + BACKREF, /* BACKREF is generated by \; it + it not completely handled. If the scanner + detects a transition on backref, it returns + a kind of "semi-success" indicating that + the match will have to be verified with + a backtracking matcher. */ + + BEGLINE, /* BEGLINE is a terminal symbol that matches + the empty string if it is at the beginning + of a line. */ + + ENDLINE, /* ENDLINE is a terminal symbol that matches + the empty string if it is at the end of + a line. */ + + BEGWORD, /* BEGWORD is a terminal symbol that matches + the empty string if it is at the beginning + of a word. */ + + ENDWORD, /* ENDWORD is a terminal symbol that matches + the empty string if it is at the end of + a word. */ + + LIMWORD, /* LIMWORD is a terminal symbol that matches + the empty string if it is at the beginning + or the end of a word. */ + + NOTLIMWORD, /* NOTLIMWORD is a terminal symbol that + matches the empty string if it is not at + the beginning or end of a word. */ + + QMARK, /* QMARK is an operator of one argument that + matches zero or one occurences of its + argument. */ + + STAR, /* STAR is an operator of one argument that + matches the Kleene closure (zero or more + occurrences) of its argument. */ + + PLUS, /* PLUS is an operator of one argument that + matches the positive closure (one or more + occurrences) of its argument. */ + + REPMN, /* REPMN is a lexical token corresponding + to the {m,n} construct. REPMN never + appears in the compiled token vector. */ + + CAT, /* CAT is an operator of two arguments that + matches the concatenation of its + arguments. CAT is never returned by the + lexical analyzer. */ + + OR, /* OR is an operator of two arguments that + matches either of its arguments. */ + + ORTOP, /* OR at the toplevel in the parse tree. + This is used for a boyer-moore heuristic. */ + + LPAREN, /* LPAREN never appears in the parse tree, + it is only a lexeme. */ + + RPAREN, /* RPAREN never appears in the parse tree. */ + + CRANGE, /* CRANGE never appears in the parse tree. + It stands for a character range that can + match a string of one or more characters. + For example, [a-z] can match "ch" in + a Spanish locale. */ + +#ifdef MBS_SUPPORT + ANYCHAR, /* ANYCHAR is a terminal symbol that matches + any multibyte(or singlebyte) characters. + It is used only if MB_CUR_MAX > 1. */ + + MBCSET, /* MBCSET is similar to CSET, but for + multibyte characters. */ +#endif /* MBS_SUPPORT */ + + CSET /* CSET and (and any value greater) is a + terminal symbol that matches any of a + class of characters. */ +} token; + +/* Sets are stored in an array in the compiled dfa; the index of the + array corresponding to a given set token is given by SET_INDEX(t). */ +#define SET_INDEX(t) ((t) - CSET) + +/* Sometimes characters can only be matched depending on the surrounding + context. Such context decisions depend on what the previous character + was, and the value of the current (lookahead) character. Context + dependent constraints are encoded as 8 bit integers. Each bit that + is set indicates that the constraint succeeds in the corresponding + context. + + bit 7 - previous and current are newlines + bit 6 - previous was newline, current isn't + bit 5 - previous wasn't newline, current is + bit 4 - neither previous nor current is a newline + bit 3 - previous and current are word-constituents + bit 2 - previous was word-constituent, current isn't + bit 1 - previous wasn't word-constituent, current is + bit 0 - neither previous nor current is word-constituent + + Word-constituent characters are those that satisfy isalnum(). + + The macro SUCCEEDS_IN_CONTEXT determines whether a a given constraint + succeeds in a particular context. Prevn is true if the previous character + was a newline, currn is true if the lookahead character is a newline. + Prevl and currl similarly depend upon whether the previous and current + characters are word-constituent letters. */ +#define MATCHES_NEWLINE_CONTEXT(constraint, prevn, currn) \ + ((constraint) & 1 << (((prevn) ? 2 : 0) + ((currn) ? 1 : 0) + 4)) +#define MATCHES_LETTER_CONTEXT(constraint, prevl, currl) \ + ((constraint) & 1 << (((prevl) ? 2 : 0) + ((currl) ? 1 : 0))) +#define SUCCEEDS_IN_CONTEXT(constraint, prevn, currn, prevl, currl) \ + (MATCHES_NEWLINE_CONTEXT(constraint, prevn, currn) \ + && MATCHES_LETTER_CONTEXT(constraint, prevl, currl)) + +/* The following macros give information about what a constraint depends on. */ +#define PREV_NEWLINE_DEPENDENT(constraint) \ + (((constraint) & 0xc0) >> 2 != ((constraint) & 0x30)) +#define PREV_LETTER_DEPENDENT(constraint) \ + (((constraint) & 0x0c) >> 2 != ((constraint) & 0x03)) + +/* Tokens that match the empty string subject to some constraint actually + work by applying that constraint to determine what may follow them, + taking into account what has gone before. The following values are + the constraints corresponding to the special tokens previously defined. */ +#define NO_CONSTRAINT 0xff +#define BEGLINE_CONSTRAINT 0xcf +#define ENDLINE_CONSTRAINT 0xaf +#define BEGWORD_CONSTRAINT 0xf2 +#define ENDWORD_CONSTRAINT 0xf4 +#define LIMWORD_CONSTRAINT 0xf6 +#define NOTLIMWORD_CONSTRAINT 0xf9 + +/* States of the recognizer correspond to sets of positions in the parse + tree, together with the constraints under which they may be matched. + So a position is encoded as an index into the parse tree together with + a constraint. */ +typedef struct +{ + unsigned index; /* Index into the parse array. */ + unsigned constraint; /* Constraint for matching this position. */ +} position; + +/* Sets of positions are stored as arrays. */ +typedef struct +{ + position *elems; /* Elements of this position set. */ + int nelem; /* Number of elements in this set. */ +} position_set; + +/* A state of the dfa consists of a set of positions, some flags, + and the token value of the lowest-numbered position of the state that + contains an END token. */ +typedef struct +{ + int hash; /* Hash of the positions of this state. */ + position_set elems; /* Positions this state could match. */ + char newline; /* True if previous state matched newline. */ + char letter; /* True if previous state matched a letter. */ + char backref; /* True if this state matches a \. */ + unsigned char constraint; /* Constraint for this state to accept. */ + int first_end; /* Token value of the first END in elems. */ +#ifdef MBS_SUPPORT + position_set mbps; /* Positions which can match multibyte + characters. e.g. period. + These staff are used only if + MB_CUR_MAX > 1. */ +#endif +} dfa_state; + +/* Element of a list of strings, at least one of which is known to + appear in any R.E. matching the DFA. */ +struct dfamust +{ + int exact; + char *must; + struct dfamust *next; +}; + +#ifdef MBS_SUPPORT +/* A bracket operator. + e.g. [a-c], [[:alpha:]], etc. */ +struct mb_char_classes +{ + int invert; + wchar_t *chars; /* Normal characters. */ + int nchars; + wctype_t *ch_classes; /* Character classes. */ + int nch_classes; + wchar_t *range_sts; /* Range characters (start of the range). */ + wchar_t *range_ends; /* Range characters (end of the range). */ + int nranges; + char **equivs; /* Equivalent classes. */ + int nequivs; + char **coll_elems; + int ncoll_elems; /* Collating elements. */ +}; +#endif + +/* A compiled regular expression. */ +struct dfa +{ + /* Stuff built by the scanner. */ + charclass *charclasses; /* Array of character sets for CSET tokens. */ + int cindex; /* Index for adding new charclasses. */ + int calloc; /* Number of charclasses currently allocated. */ + + /* Stuff built by the parser. */ + token *tokens; /* Postfix parse array. */ + int tindex; /* Index for adding new tokens. */ + int talloc; /* Number of tokens currently allocated. */ + int depth; /* Depth required of an evaluation stack + used for depth-first traversal of the + parse tree. */ + int nleaves; /* Number of leaves on the parse tree. */ + int nregexps; /* Count of parallel regexps being built + with dfaparse(). */ +#ifdef MBS_SUPPORT + /* These stuff are used only if MB_CUR_MAX > 1 or multibyte environments. */ + int nmultibyte_prop; + int *multibyte_prop; + /* The value of multibyte_prop[i] is defined by following rule. + if tokens[i] < NOTCHAR + bit 1 : tokens[i] is a singlebyte character, or the last-byte of + a multibyte character. + bit 0 : tokens[i] is a singlebyte character, or the 1st-byte of + a multibyte character. + if tokens[i] = MBCSET + ("the index of mbcsets correspnd to this operator" << 2) + 3 + + e.g. + tokens + = 'single_byte_a', 'multi_byte_A', single_byte_b' + = 'sb_a', 'mb_A(1st byte)', 'mb_A(2nd byte)', 'mb_A(3rd byte)', 'sb_b' + multibyte_prop + = 3 , 1 , 0 , 2 , 3 + */ + + /* Array of the bracket expressoin in the DFA. */ + struct mb_char_classes *mbcsets; + int nmbcsets; + int mbcsets_alloc; +#endif + + /* Stuff owned by the state builder. */ + dfa_state *states; /* States of the dfa. */ + int sindex; /* Index for adding new states. */ + int salloc; /* Number of states currently allocated. */ + + /* Stuff built by the structure analyzer. */ + position_set *follows; /* Array of follow sets, indexed by position + index. The follow of a position is the set + of positions containing characters that + could conceivably follow a character + matching the given position in a string + matching the regexp. Allocated to the + maximum possible position index. */ + int searchflag; /* True if we are supposed to build a searching + as opposed to an exact matcher. A searching + matcher finds the first and shortest string + matching a regexp anywhere in the buffer, + whereas an exact matcher finds the longest + string matching, but anchored to the + beginning of the buffer. */ + + /* Stuff owned by the executor. */ + int tralloc; /* Number of transition tables that have + slots so far. */ + int trcount; /* Number of transition tables that have + actually been built. */ + int **trans; /* Transition tables for states that can + never accept. If the transitions for a + state have not yet been computed, or the + state could possibly accept, its entry in + this table is NULL. */ + int **realtrans; /* Trans always points to realtrans + 1; this + is so trans[-1] can contain NULL. */ + int **fails; /* Transition tables after failing to accept + on a state that potentially could do so. */ + int *success; /* Table of acceptance conditions used in + dfaexec and computed in build_state. */ + struct dfamust *musts; /* List of strings, at least one of which + is known to appear in any r.e. matching + the dfa. */ +}; + +/* Some macros for user access to dfa internals. */ + +/* ACCEPTING returns true if s could possibly be an accepting state of r. */ +#define ACCEPTING(s, r) ((r).states[s].constraint) + +/* ACCEPTS_IN_CONTEXT returns true if the given state accepts in the + specified context. */ +#define ACCEPTS_IN_CONTEXT(prevn, currn, prevl, currl, state, dfa) \ + SUCCEEDS_IN_CONTEXT((dfa).states[state].constraint, \ + prevn, currn, prevl, currl) + +/* FIRST_MATCHING_REGEXP returns the index number of the first of parallel + regexps that a given state could accept. Parallel regexps are numbered + starting at 1. */ +#define FIRST_MATCHING_REGEXP(state, dfa) (-(dfa).states[state].first_end) + +/* Entry points. */ + +/* dfasyntax() takes three arguments; the first sets the syntax bits described + earlier in this file, the second sets the case-folding flag, and the + third specifies the line terminator. */ +extern void dfasyntax PARAMS ((reg_syntax_t, int, unsigned char)); + +/* Compile the given string of the given length into the given struct dfa. + Final argument is a flag specifying whether to build a searching or an + exact matcher. */ +extern void dfacomp PARAMS ((char const *, size_t, struct dfa *, int)); + +/* Execute the given struct dfa on the buffer of characters. The + last byte of the buffer must equal the end-of-line byte. + The final argument points to a flag that will + be set if further examination by a backtracking matcher is needed in + order to verify backreferencing; otherwise the flag will be cleared. + Returns (size_t) -1 if no match is found, or the offset of the first + character after the first & shortest matching string in the buffer. */ +extern size_t dfaexec PARAMS ((struct dfa *, char const *, size_t, int *)); + +/* Free the storage held by the components of a struct dfa. */ +extern void dfafree PARAMS ((struct dfa *)); + +/* Entry points for people who know what they're doing. */ + +/* Initialize the components of a struct dfa. */ +extern void dfainit PARAMS ((struct dfa *)); + +/* Incrementally parse a string of given length into a struct dfa. */ +extern void dfaparse PARAMS ((char const *, size_t, struct dfa *)); + +/* Analyze a parsed regexp; second argument tells whether to build a searching + or an exact matcher. */ +extern void dfaanalyze PARAMS ((struct dfa *, int)); + +/* Compute, for each possible character, the transitions out of a given + state, storing them in an array of integers. */ +extern void dfastate PARAMS ((int, struct dfa *, int [])); + +/* Error handling. */ + +/* dfaerror() is called by the regexp routines whenever an error occurs. It + takes a single argument, a NUL-terminated string describing the error. + The user must supply a dfaerror. */ +extern void dfaerror PARAMS ((const char *)); diff --git a/src/apps/bin/grep-2.5/src/dosbuf.c b/src/apps/bin/grep-2.5/src/dosbuf.c new file mode 100644 index 0000000000..1d33adccbe --- /dev/null +++ b/src/apps/bin/grep-2.5/src/dosbuf.c @@ -0,0 +1,181 @@ +/* Messy DOS-specific code for correctly treating binary, Unix text + and DOS text files. + + This has several aspects: + + * Guessing the file type (unless the user tells us); + * Stripping CR characters from DOS text files (otherwise regex + functions won't work correctly); + * Reporting correct byte count with -b for any kind of file. + +*/ + +typedef enum { + UNKNOWN, DOS_BINARY, DOS_TEXT, UNIX_TEXT +} File_type; + +struct dos_map { + off_t pos; /* position in buffer passed to matcher */ + off_t add; /* how much to add when reporting char position */ +}; + +static int dos_report_unix_offset = 0; + +static File_type dos_file_type = UNKNOWN; +static File_type dos_use_file_type = UNKNOWN; +static off_t dos_stripped_crs = 0; +static struct dos_map *dos_pos_map; +static int dos_pos_map_size = 0; +static int dos_pos_map_used = 0; +static int inp_map_idx = 0, out_map_idx = 1; + +/* Guess DOS file type by looking at its contents. */ +static inline File_type +guess_type (char *buf, register size_t buflen) +{ + int crlf_seen = 0; + register char *bp = buf; + + while (buflen--) + { + /* Treat a file as binary if it has a NUL character. */ + if (!*bp) + return DOS_BINARY; + + /* CR before LF means DOS text file (unless we later see + binary characters). */ + else if (*bp == '\r' && buflen && bp[1] == '\n') + crlf_seen = 1; + + bp++; + } + + return crlf_seen ? DOS_TEXT : UNIX_TEXT; +} + +/* Convert external DOS file representation to internal. + Return the count of characters left in the buffer. + Build table to map character positions when reporting byte counts. */ +static inline int +undossify_input (register char *buf, size_t buflen) +{ + int chars_left = 0; + + if (totalcc == 0) + { + /* New file: forget everything we knew about character + position mapping table and file type. */ + inp_map_idx = 0; + out_map_idx = 1; + dos_pos_map_used = 0; + dos_stripped_crs = 0; + dos_file_type = dos_use_file_type; + } + + /* Guess if this file is binary, unless we already know that. */ + if (dos_file_type == UNKNOWN) + dos_file_type = guess_type(buf, buflen); + + /* If this file is to be treated as DOS Text, strip the CR characters + and maybe build the table for character position mapping on output. */ + if (dos_file_type == DOS_TEXT) + { + char *destp = buf; + + while (buflen--) + { + if (*buf != '\r') + { + *destp++ = *buf++; + chars_left++; + } + else + { + buf++; + if (out_byte && !dos_report_unix_offset) + { + dos_stripped_crs++; + while (buflen && *buf == '\r') + { + dos_stripped_crs++; + buflen--; + buf++; + } + if (inp_map_idx >= dos_pos_map_size - 1) + { + dos_pos_map_size = inp_map_idx ? inp_map_idx * 2 : 1000; + dos_pos_map = + (struct dos_map *)xrealloc((char *)dos_pos_map, + dos_pos_map_size * + sizeof(struct dos_map)); + } + + if (!inp_map_idx) + { + /* Add sentinel entry. */ + dos_pos_map[inp_map_idx].pos = 0; + dos_pos_map[inp_map_idx++].add = 0; + + /* Initialize first real entry. */ + dos_pos_map[inp_map_idx].add = 0; + } + + /* Put the new entry. If the stripped CR characters + precede a Newline (the usual case), pretend that + they were found *after* the Newline. This makes + displayed byte offsets more reasonable in some + cases, and fits better the intuitive notion that + the line ends *before* the CR, not *after* it. */ + inp_map_idx++; + dos_pos_map[inp_map_idx-1].pos = + (*buf == '\n' ? destp + 1 : destp ) - bufbeg + totalcc; + dos_pos_map[inp_map_idx].add = dos_stripped_crs; + dos_pos_map_used = inp_map_idx; + + /* The following will be updated on the next pass. */ + dos_pos_map[inp_map_idx].pos = destp - bufbeg + totalcc + 1; + } + } + } + + return chars_left; + } + + return buflen; +} + +/* Convert internal byte count into external. */ +static inline off_t +dossified_pos (off_t byteno) +{ + off_t pos_lo; + off_t pos_hi; + + if (dos_file_type != DOS_TEXT || dos_report_unix_offset) + return byteno; + + /* Optimization: usually the file will be scanned sequentially. + So in most cases, this byte position will be found in the + table near the previous one, as recorded in `out_map_idx'. */ + pos_lo = dos_pos_map[out_map_idx-1].pos; + pos_hi = dos_pos_map[out_map_idx].pos; + + /* If the initial guess failed, search up or down, as + appropriate, beginning with the previous place. */ + if (byteno >= pos_hi) + { + out_map_idx++; + while (out_map_idx < dos_pos_map_used && + byteno >= dos_pos_map[out_map_idx].pos) + out_map_idx++; + } + + else if (byteno < pos_lo) + { + out_map_idx--; + while (out_map_idx > 1 && byteno < dos_pos_map[out_map_idx-1].pos) + out_map_idx--; + } + + return byteno + dos_pos_map[out_map_idx].add; +} diff --git a/src/apps/bin/grep-2.5/src/getpagesize.h b/src/apps/bin/grep-2.5/src/getpagesize.h new file mode 100644 index 0000000000..198967b919 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/getpagesize.h @@ -0,0 +1,46 @@ +/* Emulate getpagesize on systems that lack it. */ + +#ifndef HAVE_GETPAGESIZE + +#if !defined getpagesize && defined __BEOS__ +# include +# define getpagesize() B_PAGE_SIZE +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#if !defined getpagesize && defined _SC_PAGESIZE +# if !(defined VMS && __VMS_VER < 70000000) +# define getpagesize() sysconf (_SC_PAGESIZE) +# endif +#endif + +#if !defined getpagesize && defined VMS +# ifdef __ALPHA +# define getpagesize() 8192 +# else +# define getpagesize() 512 +# endif +#endif + +#ifndef getpagesize +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# define getpagesize() (NBPG * CLSIZE) +# else +# ifdef NBPC +# define getpagesize() NBPC +# endif +# endif +# endif +#endif + +#endif /* not HAVE_GETPAGESIZE */ diff --git a/src/apps/bin/grep-2.5/src/grep b/src/apps/bin/grep-2.5/src/grep new file mode 100755 index 0000000000..d814648e75 Binary files /dev/null and b/src/apps/bin/grep-2.5/src/grep differ diff --git a/src/apps/bin/grep-2.5/src/grep.c b/src/apps/bin/grep-2.5/src/grep.c new file mode 100644 index 0000000000..c378cf951e --- /dev/null +++ b/src/apps/bin/grep-2.5/src/grep.c @@ -0,0 +1,1736 @@ +/* grep.c - main driver file for grep. + Copyright 1992, 1997-1999, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Written July 1992 by Mike Haertel. */ + +#ifdef HAVE_CONFIG_H +# include +#endif +#include +#include +#if defined(HAVE_MMAP) +# include +#endif +#if defined(HAVE_SETRLIMIT) +# include +# include +#endif +#include +#include "system.h" +#include "getopt.h" +#include "getpagesize.h" +#include "grep.h" +#include "savedir.h" +#include "xstrtol.h" +#include "xalloc.h" +#include "error.h" +#include "exclude.h" +#include "closeout.h" + +#undef MAX +#define MAX(A,B) ((A) > (B) ? (A) : (B)) + +struct stats +{ + struct stats const *parent; + struct stat stat; +}; + +/* base of chain of stat buffers, used to detect directory loops */ +static struct stats stats_base; + +/* if non-zero, display usage information and exit */ +static int show_help; + +/* If non-zero, print the version on standard output and exit. */ +static int show_version; + +/* If nonzero, suppress diagnostics for nonexistent or unreadable files. */ +static int suppress_errors; + +/* If nonzero, use mmap if possible. */ +static int mmap_option; + +/* If nonzero, use grep_color marker. */ +static int color_option; + +/* If nonzero, show only the part of a line matching the expression. */ +static int only_matching; + +/* The color string used. The user can overwrite it using the environment + variable GREP_COLOR. The default is to print red. */ +static const char *grep_color = "01;31"; + +static struct exclude *excluded_patterns; +static struct exclude *included_patterns; +/* Short options. */ +static char const short_options[] = +"0123456789A:B:C:D:EFGHIPUVX:abcd:e:f:hiKLlm:noqRrsuvwxyZz"; + +/* Non-boolean long options that have no corresponding short equivalents. */ +enum +{ + BINARY_FILES_OPTION = CHAR_MAX + 1, + COLOR_OPTION, + INCLUDE_OPTION, + EXCLUDE_OPTION, + EXCLUDE_FROM_OPTION, + LINE_BUFFERED_OPTION, + LABEL_OPTION +}; + +/* Long options equivalences. */ +static struct option const long_options[] = +{ + {"after-context", required_argument, NULL, 'A'}, + {"basic-regexp", no_argument, NULL, 'G'}, + {"before-context", required_argument, NULL, 'B'}, + {"binary-files", required_argument, NULL, BINARY_FILES_OPTION}, + {"byte-offset", no_argument, NULL, 'b'}, + {"context", required_argument, NULL, 'C'}, + {"color", optional_argument, NULL, COLOR_OPTION}, + {"colour", optional_argument, NULL, COLOR_OPTION}, + {"count", no_argument, NULL, 'c'}, + {"devices", required_argument, NULL, 'D'}, + {"directories", required_argument, NULL, 'd'}, + {"extended-regexp", no_argument, NULL, 'E'}, + {"exclude", required_argument, NULL, EXCLUDE_OPTION}, + {"exclude-from", required_argument, NULL, EXCLUDE_FROM_OPTION}, + {"file", required_argument, NULL, 'f'}, + {"files-with-matches", no_argument, NULL, 'l'}, + {"files-without-match", no_argument, NULL, 'L'}, + {"fixed-regexp", no_argument, NULL, 'F'}, + {"fixed-strings", no_argument, NULL, 'F'}, + {"help", no_argument, &show_help, 1}, + {"include", required_argument, NULL, INCLUDE_OPTION}, + {"ignore-case", no_argument, NULL, 'i'}, + {"label", required_argument, NULL, LABEL_OPTION}, + {"line-buffered", no_argument, NULL, LINE_BUFFERED_OPTION}, + {"line-number", no_argument, NULL, 'n'}, + {"line-regexp", no_argument, NULL, 'x'}, + {"max-count", required_argument, NULL, 'm'}, + {"mmap", no_argument, &mmap_option, 1}, + {"no-filename", no_argument, NULL, 'h'}, + {"no-messages", no_argument, NULL, 's'}, + {"null", no_argument, NULL, 'Z'}, + {"null-data", no_argument, NULL, 'z'}, + {"only-matching", no_argument, NULL, 'o'}, + {"perl-regexp", no_argument, NULL, 'P'}, + {"quiet", no_argument, NULL, 'q'}, + {"recursive", no_argument, NULL, 'r'}, + {"recursive", no_argument, NULL, 'R'}, + {"regexp", required_argument, NULL, 'e'}, + {"invert-match", no_argument, NULL, 'v'}, + {"silent", no_argument, NULL, 'q'}, + {"text", no_argument, NULL, 'a'}, + {"binary", no_argument, NULL, 'U'}, + {"unix-byte-offsets", no_argument, NULL, 'u'}, + {"version", no_argument, NULL, 'V'}, + {"with-filename", no_argument, NULL, 'H'}, + {"word-regexp", no_argument, NULL, 'w'}, + {0, 0, 0, 0} +}; + +/* Define flags declared in grep.h. */ +int match_icase; +int match_words; +int match_lines; +unsigned char eolbyte; + +/* For error messages. */ +/* The name the program was run with, stripped of any leading path. */ +char *program_name; +static char const *filename; +static int errseen; + +/* How to handle directories. */ +static enum + { + READ_DIRECTORIES, + RECURSE_DIRECTORIES, + SKIP_DIRECTORIES + } directories = READ_DIRECTORIES; + +/* How to handle devices. */ +static enum + { + READ_DEVICES, + SKIP_DEVICES + } devices = READ_DEVICES; + +static int grepdir PARAMS ((char const *, struct stats const *)); +#if defined(HAVE_DOS_FILE_CONTENTS) +static inline int undossify_input PARAMS ((register char *, size_t)); +#endif + +/* Functions we'll use to search. */ +static void (*compile) PARAMS ((char const *, size_t)); +static size_t (*execute) PARAMS ((char const *, size_t, size_t *, int)); + +/* Like error, but suppress the diagnostic if requested. */ +static void +suppressible_error (char const *mesg, int errnum) +{ + if (! suppress_errors) + error (0, errnum, "%s", mesg); + errseen = 1; +} + +/* Convert STR to a positive integer, storing the result in *OUT. + STR must be a valid context length argument; report an error if it + isn't. */ +static void +context_length_arg (char const *str, int *out) +{ + uintmax_t value; + if (! (xstrtoumax (str, 0, 10, &value, "") == LONGINT_OK + && 0 <= (*out = value) + && *out == value)) + { + error (2, 0, "%s: %s\n", str, _("invalid context length argument")); + } +} + + +/* Hairy buffering mechanism for grep. The intent is to keep + all reads aligned on a page boundary and multiples of the + page size, unless a read yields a partial page. */ + +static char *buffer; /* Base of buffer. */ +static size_t bufalloc; /* Allocated buffer size, counting slop. */ +#define INITIAL_BUFSIZE 32768 /* Initial buffer size, not counting slop. */ +static int bufdesc; /* File descriptor. */ +static char *bufbeg; /* Beginning of user-visible stuff. */ +static char *buflim; /* Limit of user-visible stuff. */ +static size_t pagesize; /* alignment of memory pages */ +static off_t bufoffset; /* Read offset; defined on regular files. */ +static off_t after_last_match; /* Pointer after last matching line that + would have been output if we were + outputting characters. */ + +#if defined(HAVE_MMAP) +static int bufmapped; /* True if buffer is memory-mapped. */ +static off_t initial_bufoffset; /* Initial value of bufoffset. */ +#else +# define bufmapped 0 +#endif + +/* Return VAL aligned to the next multiple of ALIGNMENT. VAL can be + an integer or a pointer. Both args must be free of side effects. */ +#define ALIGN_TO(val, alignment) \ + ((size_t) (val) % (alignment) == 0 \ + ? (val) \ + : (val) + ((alignment) - (size_t) (val) % (alignment))) + +/* Reset the buffer for a new file, returning zero if we should skip it. + Initialize on the first time through. */ +static int +reset (int fd, char const *file, struct stats *stats) +{ + if (! pagesize) + { + pagesize = getpagesize (); + if (pagesize == 0 || 2 * pagesize + 1 <= pagesize) + abort (); + bufalloc = ALIGN_TO (INITIAL_BUFSIZE, pagesize) + pagesize + 1; + buffer = xmalloc (bufalloc); + } + + bufbeg = buflim = ALIGN_TO (buffer + 1, pagesize); + bufbeg[-1] = eolbyte; + bufdesc = fd; + + if (fstat (fd, &stats->stat) != 0) + { + error (0, errno, "fstat"); + return 0; + } + if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode)) + return 0; +#if defined (DJGPP) || defined (__BEOS__) + if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode))) +#else + if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode))) +#endif + return 0; + if (S_ISREG (stats->stat.st_mode)) + { + if (file) + bufoffset = 0; + else + { + bufoffset = lseek (fd, 0, SEEK_CUR); + if (bufoffset < 0) + { + error (0, errno, "lseek"); + return 0; + } + } +#if defined(HAVE_MMAP) + initial_bufoffset = bufoffset; + bufmapped = mmap_option && bufoffset % pagesize == 0; +#endif + } + else + { +#if defined(HAVE_MMAP) + bufmapped = 0; +#endif + } + return 1; +} + +/* Read new stuff into the buffer, saving the specified + amount of old stuff. When we're done, 'bufbeg' points + to the beginning of the buffer contents, and 'buflim' + points just after the end. Return zero if there's an error. */ +static int +fillbuf (size_t save, struct stats const *stats) +{ + size_t fillsize = 0; + int cc = 1; + char *readbuf; + size_t readsize; + + /* Offset from start of buffer to start of old stuff + that we want to save. */ + size_t saved_offset = buflim - save - buffer; + + if (pagesize <= buffer + bufalloc - buflim) + { + readbuf = buflim; + bufbeg = buflim - save; + } + else + { + size_t minsize = save + pagesize; + size_t newsize; + size_t newalloc; + char *newbuf; + + /* Grow newsize until it is at least as great as minsize. */ + for (newsize = bufalloc - pagesize - 1; newsize < minsize; newsize *= 2) + if (newsize * 2 < newsize || newsize * 2 + pagesize + 1 < newsize * 2) + xalloc_die (); + + /* Try not to allocate more memory than the file size indicates, + as that might cause unnecessary memory exhaustion if the file + is large. However, do not use the original file size as a + heuristic if we've already read past the file end, as most + likely the file is growing. */ + if (S_ISREG (stats->stat.st_mode)) + { + off_t to_be_read = stats->stat.st_size - bufoffset; + off_t maxsize_off = save + to_be_read; + if (0 <= to_be_read && to_be_read <= maxsize_off + && maxsize_off == (size_t) maxsize_off + && minsize <= (size_t) maxsize_off + && (size_t) maxsize_off < newsize) + newsize = maxsize_off; + } + + /* Add enough room so that the buffer is aligned and has room + for byte sentinels fore and aft. */ + newalloc = newsize + pagesize + 1; + + newbuf = bufalloc < newalloc ? xmalloc (bufalloc = newalloc) : buffer; + readbuf = ALIGN_TO (newbuf + 1 + save, pagesize); + bufbeg = readbuf - save; + memmove (bufbeg, buffer + saved_offset, save); + bufbeg[-1] = eolbyte; + if (newbuf != buffer) + { + free (buffer); + buffer = newbuf; + } + } + + readsize = buffer + bufalloc - readbuf; + readsize -= readsize % pagesize; + +#if defined(HAVE_MMAP) + if (bufmapped) + { + size_t mmapsize = readsize; + + /* Don't mmap past the end of the file; some hosts don't allow this. + Use `read' on the last page. */ + if (stats->stat.st_size - bufoffset < mmapsize) + { + mmapsize = stats->stat.st_size - bufoffset; + mmapsize -= mmapsize % pagesize; + } + + if (mmapsize + && (mmap ((caddr_t) readbuf, mmapsize, + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, + bufdesc, bufoffset) + != (caddr_t) -1)) + { + /* Do not bother to use madvise with MADV_SEQUENTIAL or + MADV_WILLNEED on the mmapped memory. One might think it + would help, but it slows us down about 30% on SunOS 4.1. */ + fillsize = mmapsize; + } + else + { + /* Stop using mmap on this file. Synchronize the file + offset. Do not warn about mmap failures. On some hosts + (e.g. Solaris 2.5) mmap can fail merely because some + other process has an advisory read lock on the file. + There's no point alarming the user about this misfeature. */ + bufmapped = 0; + if (bufoffset != initial_bufoffset + && lseek (bufdesc, bufoffset, SEEK_SET) < 0) + { + error (0, errno, "lseek"); + cc = 0; + } + } + } +#endif /*HAVE_MMAP*/ + + if (! fillsize) + { + ssize_t bytesread; + while ((bytesread = read (bufdesc, readbuf, readsize)) < 0 + && errno == EINTR) + continue; + if (bytesread < 0) + cc = 0; + else + fillsize = bytesread; + } + + bufoffset += fillsize; +#if defined(HAVE_DOS_FILE_CONTENTS) + if (fillsize) + fillsize = undossify_input (readbuf, fillsize); +#endif + buflim = readbuf + fillsize; + return cc; +} + +/* Flags controlling the style of output. */ +static enum +{ + BINARY_BINARY_FILES, + TEXT_BINARY_FILES, + WITHOUT_MATCH_BINARY_FILES +} binary_files; /* How to handle binary files. */ + +static int filename_mask; /* If zero, output nulls after filenames. */ +static int out_quiet; /* Suppress all normal output. */ +static int out_invert; /* Print nonmatching stuff. */ +static int out_file; /* Print filenames. */ +static int out_line; /* Print line numbers. */ +static int out_byte; /* Print byte offsets. */ +static int out_before; /* Lines of leading context. */ +static int out_after; /* Lines of trailing context. */ +static int count_matches; /* Count matching lines. */ +static int list_files; /* List matching files. */ +static int no_filenames; /* Suppress file names. */ +static off_t max_count; /* Stop after outputting this many + lines from an input file. */ +static int line_buffered; /* If nonzero, use line buffering, i.e. + fflush everyline out. */ +static char *label = NULL; /* Fake filename for stdin */ + + +/* Internal variables to keep track of byte count, context, etc. */ +static uintmax_t totalcc; /* Total character count before bufbeg. */ +static char const *lastnl; /* Pointer after last newline counted. */ +static char const *lastout; /* Pointer after last character output; + NULL if no character has been output + or if it's conceptually before bufbeg. */ +static uintmax_t totalnl; /* Total newline count before lastnl. */ +static off_t outleft; /* Maximum number of lines to be output. */ +static int pending; /* Pending lines of output. + Always kept 0 if out_quiet is true. */ +static int done_on_match; /* Stop scanning file on first match. */ +static int exit_on_match; /* Exit on first match. */ + +#if defined(HAVE_DOS_FILE_CONTENTS) +# include "dosbuf.c" +#endif + +/* Add two numbers that count input bytes or lines, and report an + error if the addition overflows. */ +static uintmax_t +add_count (uintmax_t a, uintmax_t b) +{ + uintmax_t sum = a + b; + if (sum < a) + error (2, 0, _("input is too large to count")); + return sum; +} + +static void +nlscan (char const *lim) +{ + size_t newlines = 0; + char const *beg; + for (beg = lastnl; beg != lim; beg = memchr (beg, eolbyte, lim - beg), beg++) + newlines++; + totalnl = add_count (totalnl, newlines); + lastnl = lim; +} + +/* Print a byte offset, followed by a character separator. */ +static void +print_offset_sep (uintmax_t pos, char sep) +{ + /* Do not rely on printf to print pos, since uintmax_t may be longer + than long, and long long is not portable. */ + + char buf[sizeof pos * CHAR_BIT]; + char *p = buf + sizeof buf - 1; + *p = sep; + + do + *--p = '0' + pos % 10; + while ((pos /= 10) != 0); + + fwrite (p, 1, buf + sizeof buf - p, stdout); +} + +static void +prline (char const *beg, char const *lim, int sep) +{ + if (out_file) + printf ("%s%c", filename, sep & filename_mask); + if (out_line) + { + nlscan (beg); + totalnl = add_count (totalnl, 1); + print_offset_sep (totalnl, sep); + lastnl = lim; + } + if (out_byte) + { + uintmax_t pos = add_count (totalcc, beg - bufbeg); +#if defined(HAVE_DOS_FILE_CONTENTS) + pos = dossified_pos (pos); +#endif + print_offset_sep (pos, sep); + } + if (only_matching) + { + size_t match_size; + size_t match_offset; + while ((match_offset = (*execute) (beg, lim - beg, &match_size, 1)) + != (size_t) -1) + { + char const *b = beg + match_offset; + if (b == lim) + break; + if(color_option) + printf("\33[%sm", grep_color); + fwrite(b, sizeof (char), match_size, stdout); + if(color_option) + fputs("\33[00m", stdout); + fputs("\n", stdout); + beg = b + match_size; + } + lastout = lim; + if(line_buffered) + fflush(stdout); + return; + } + if (color_option) + { + size_t match_size; + size_t match_offset; + if(match_icase) + { + /* Yuck, this is tricky */ + char *buf = (char*) xmalloc (lim - beg); + char *ibeg = buf; + char *ilim = ibeg + (lim - beg); + int i; + for (i = 0; i < lim - beg; i++) + ibeg[i] = tolower (beg[i]); + while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1)) + != (size_t) -1) + { + char const *b = beg + match_offset; + if (b == lim) + break; + fwrite (beg, sizeof (char), match_offset, stdout); + printf ("\33[%sm", grep_color); + fwrite (b, sizeof (char), match_size, stdout); + fputs ("\33[00m", stdout); + beg = b + match_size; + ibeg = ibeg + match_offset + match_size; + } + fwrite (beg, 1, lim - beg, stdout); + free (buf); + lastout = lim; + return; + } + while ((match_offset = (*execute) (beg, lim - beg, &match_size, 1)) + != (size_t) -1) + { + char const *b = beg + match_offset; + /* Avoid matching the empty line at the end of the buffer. */ + if (b == lim) + break; + fwrite (beg, sizeof (char), match_offset, stdout); + printf ("\33[%sm", grep_color); + fwrite (b, sizeof (char), match_size, stdout); + fputs ("\33[00m", stdout); + beg = b + match_size; + } + } + fwrite (beg, 1, lim - beg, stdout); + if (ferror (stdout)) + error (0, errno, _("writing output")); + lastout = lim; + if (line_buffered) + fflush (stdout); +} + +/* Print pending lines of trailing context prior to LIM. Trailing context ends + at the next matching line when OUTLEFT is 0. */ +static void +prpending (char const *lim) +{ + if (!lastout) + lastout = bufbeg; + while (pending > 0 && lastout < lim) + { + char const *nl = memchr (lastout, eolbyte, lim - lastout); + size_t match_size; + --pending; + if (outleft + || (((*execute) (lastout, nl - lastout, &match_size, 0) == (size_t) -1) + == !out_invert)) + prline (lastout, nl + 1, '-'); + else + pending = 0; + } +} + +/* Print the lines between BEG and LIM. Deal with context crap. + If NLINESP is non-null, store a count of lines between BEG and LIM. */ +static void +prtext (char const *beg, char const *lim, int *nlinesp) +{ + static int used; /* avoid printing "--" before any output */ + char const *bp, *p; + char eol = eolbyte; + int i, n; + + if (!out_quiet && pending > 0) + prpending (beg); + + p = beg; + + if (!out_quiet) + { + /* Deal with leading context crap. */ + + bp = lastout ? lastout : bufbeg; + for (i = 0; i < out_before; ++i) + if (p > bp) + do + --p; + while (p[-1] != eol); + + /* We only print the "--" separator if our output is + discontiguous from the last output in the file. */ + if ((out_before || out_after) && used && p != lastout) + puts ("--"); + + while (p < beg) + { + char const *nl = memchr (p, eol, beg - p); + nl++; + prline (p, nl, '-'); + p = nl; + } + } + + if (nlinesp) + { + /* Caller wants a line count. */ + for (n = 0; p < lim && n < outleft; n++) + { + char const *nl = memchr (p, eol, lim - p); + nl++; + if (!out_quiet) + prline (p, nl, ':'); + p = nl; + } + *nlinesp = n; + + /* relying on it that this function is never called when outleft = 0. */ + after_last_match = bufoffset - (buflim - p); + } + else + if (!out_quiet) + prline (beg, lim, ':'); + + pending = out_quiet ? 0 : out_after; + used = 1; +} + +/* Scan the specified portion of the buffer, matching lines (or + between matching lines if OUT_INVERT is true). Return a count of + lines printed. */ +static int +grepbuf (char const *beg, char const *lim) +{ + int nlines, n; + register char const *p; + size_t match_offset; + size_t match_size; + + nlines = 0; + p = beg; + while ((match_offset = (*execute) (p, lim - p, &match_size, 0)) != (size_t) -1) + { + char const *b = p + match_offset; + char const *endp = b + match_size; + /* Avoid matching the empty line at the end of the buffer. */ + if (b == lim) + break; + if (!out_invert) + { + prtext (b, endp, (int *) 0); + nlines++; + outleft--; + if (!outleft || done_on_match) + { + if (exit_on_match) + exit (0); + after_last_match = bufoffset - (buflim - endp); + return nlines; + } + } + else if (p < b) + { + prtext (p, b, &n); + nlines += n; + outleft -= n; + if (!outleft) + return nlines; + } + p = endp; + } + if (out_invert && p < lim) + { + prtext (p, lim, &n); + nlines += n; + outleft -= n; + } + return nlines; +} + +/* Search a given file. Normally, return a count of lines printed; + but if the file is a directory and we search it recursively, then + return -2 if there was a match, and -1 otherwise. */ +static int +grep (int fd, char const *file, struct stats *stats) +{ + int nlines, i; + int not_text; + size_t residue, save; + char oldc; + char *beg; + char *lim; + char eol = eolbyte; + + if (!reset (fd, file, stats)) + return 0; + + if (file && directories == RECURSE_DIRECTORIES + && S_ISDIR (stats->stat.st_mode)) + { + /* Close fd now, so that we don't open a lot of file descriptors + when we recurse deeply. */ + if (close (fd) != 0) + error (0, errno, "%s", file); + return grepdir (file, stats) - 2; + } + + totalcc = 0; + lastout = 0; + totalnl = 0; + outleft = max_count; + after_last_match = 0; + pending = 0; + + nlines = 0; + residue = 0; + save = 0; + + if (! fillbuf (save, stats)) + { + if (! is_EISDIR (errno, file)) + suppressible_error (filename, errno); + return 0; + } + + not_text = (((binary_files == BINARY_BINARY_FILES && !out_quiet) + || binary_files == WITHOUT_MATCH_BINARY_FILES) + && memchr (bufbeg, eol ? '\0' : '\200', buflim - bufbeg)); + if (not_text && binary_files == WITHOUT_MATCH_BINARY_FILES) + return 0; + done_on_match += not_text; + out_quiet += not_text; + + for (;;) + { + lastnl = bufbeg; + if (lastout) + lastout = bufbeg; + + beg = bufbeg + save; + + /* no more data to scan (eof) except for maybe a residue -> break */ + if (beg == buflim) + break; + + /* Determine new residue (the length of an incomplete line at the end of + the buffer, 0 means there is no incomplete last line). */ + oldc = beg[-1]; + beg[-1] = eol; + for (lim = buflim; lim[-1] != eol; lim--) + continue; + beg[-1] = oldc; + if (lim == beg) + lim = beg - residue; + beg -= residue; + residue = buflim - lim; + + if (beg < lim) + { + if (outleft) + nlines += grepbuf (beg, lim); + if (pending) + prpending (lim); + if((!outleft && !pending) || (nlines && done_on_match && !out_invert)) + goto finish_grep; + } + + /* The last OUT_BEFORE lines at the end of the buffer will be needed as + leading context if there is a matching line at the begin of the + next data. Make beg point to their begin. */ + i = 0; + beg = lim; + while (i < out_before && beg > bufbeg && beg != lastout) + { + ++i; + do + --beg; + while (beg[-1] != eol); + } + + /* detect if leading context is discontinuous from last printed line. */ + if (beg != lastout) + lastout = 0; + + /* Handle some details and read more data to scan. */ + save = residue + lim - beg; + if (out_byte) + totalcc = add_count (totalcc, buflim - bufbeg - save); + if (out_line) + nlscan (beg); + if (! fillbuf (save, stats)) + { + if (! is_EISDIR (errno, file)) + suppressible_error (filename, errno); + goto finish_grep; + } + } + if (residue) + { + *buflim++ = eol; + if (outleft) + nlines += grepbuf (bufbeg + save - residue, buflim); + if (pending) + prpending (buflim); + } + + finish_grep: + done_on_match -= not_text; + out_quiet -= not_text; + if ((not_text & ~out_quiet) && nlines != 0) + printf (_("Binary file %s matches\n"), filename); + return nlines; +} + +static int +grepfile (char const *file, struct stats *stats) +{ + int desc; + int count; + int status; + + if (! file) + { + desc = 0; + filename = label ? label : _("(standard input)"); + } + else + { + while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR) + continue; + + if (desc < 0) + { + int e = errno; + + if (is_EISDIR (e, file) && directories == RECURSE_DIRECTORIES) + { + if (stat (file, &stats->stat) != 0) + { + error (0, errno, "%s", file); + return 1; + } + + return grepdir (file, stats); + } + + if (!suppress_errors) + { + if (directories == SKIP_DIRECTORIES) + switch (e) + { +#if defined(EISDIR) + case EISDIR: + return 1; +#endif + case EACCES: + /* When skipping directories, don't worry about + directories that can't be opened. */ + if (isdir (file)) + return 1; + break; + } + } + + suppressible_error (file, e); + return 1; + } + + filename = file; + } + +#if defined(SET_BINARY) + /* Set input to binary mode. Pipes are simulated with files + on DOS, so this includes the case of "foo | grep bar". */ + if (!isatty (desc)) + SET_BINARY (desc); +#endif + + count = grep (desc, file, stats); + if (count < 0) + status = count + 2; + else + { + if (count_matches) + { + if (out_file) + printf ("%s%c", filename, ':' & filename_mask); + printf ("%d\n", count); + } + + status = !count; + if (list_files == 1 - 2 * status) + printf ("%s%c", filename, '\n' & filename_mask); + + if (! file) + { + off_t required_offset = outleft ? bufoffset : after_last_match; + if ((bufmapped || required_offset != bufoffset) + && lseek (desc, required_offset, SEEK_SET) < 0 + && S_ISREG (stats->stat.st_mode)) + error (0, errno, "%s", filename); + } + else + while (close (desc) != 0) + if (errno != EINTR) + { + error (0, errno, "%s", file); + break; + } + } + + return status; +} + +static int +grepdir (char const *dir, struct stats const *stats) +{ + int status = 1; + struct stats const *ancestor; + char *name_space; + + /* Mingw32 does not support st_ino. No known working hosts use zero + for st_ino, so assume that the Mingw32 bug applies if it's zero. */ + if (stats->stat.st_ino) + for (ancestor = stats; (ancestor = ancestor->parent) != 0; ) + if (ancestor->stat.st_ino == stats->stat.st_ino + && ancestor->stat.st_dev == stats->stat.st_dev) + { + if (!suppress_errors) + error (0, 0, _("warning: %s: %s\n"), dir, + _("recursive directory loop")); + return 1; + } + + name_space = savedir (dir, stats->stat.st_size, included_patterns, + excluded_patterns); + + if (! name_space) + { + if (errno) + suppressible_error (dir, errno); + else + xalloc_die (); + } + else + { + size_t dirlen = strlen (dir); + int needs_slash = ! (dirlen == FILESYSTEM_PREFIX_LEN (dir) + || IS_SLASH (dir[dirlen - 1])); + char *file = NULL; + char const *namep = name_space; + struct stats child; + child.parent = stats; + out_file += !no_filenames; + while (*namep) + { + size_t namelen = strlen (namep); + file = xrealloc (file, dirlen + 1 + namelen + 1); + strcpy (file, dir); + file[dirlen] = '/'; + strcpy (file + dirlen + needs_slash, namep); + namep += namelen + 1; + status &= grepfile (file, &child); + } + out_file -= !no_filenames; + if (file) + free (file); + free (name_space); + } + + return status; +} + +static void +usage (int status) +{ + if (status != 0) + { + fprintf (stderr, _("Usage: %s [OPTION]... PATTERN [FILE]...\n"), + program_name); + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + } + else + { + printf (_("Usage: %s [OPTION]... PATTERN [FILE] ...\n"), program_name); + printf (_("\ +Search for PATTERN in each FILE or standard input.\n\ +Example: %s -i 'hello world' menu.h main.c\n\ +\n\ +Regexp selection and interpretation:\n"), program_name); + printf (_("\ + -E, --extended-regexp PATTERN is an extended regular expression\n\ + -F, --fixed-strings PATTERN is a set of newline-separated strings\n\ + -G, --basic-regexp PATTERN is a basic regular expression\n\ + -P, --perl-regexp PATTERN is a Perl regular expression\n")); + printf (_("\ + -e, --regexp=PATTERN use PATTERN as a regular expression\n\ + -f, --file=FILE obtain PATTERN from FILE\n\ + -i, --ignore-case ignore case distinctions\n\ + -w, --word-regexp force PATTERN to match only whole words\n\ + -x, --line-regexp force PATTERN to match only whole lines\n\ + -z, --null-data a data line ends in 0 byte, not newline\n")); + printf (_("\ +\n\ +Miscellaneous:\n\ + -s, --no-messages suppress error messages\n\ + -v, --invert-match select non-matching lines\n\ + -V, --version print version information and exit\n\ + --help display this help and exit\n\ + --mmap use memory-mapped input if possible\n")); + printf (_("\ +\n\ +Output control:\n\ + -m, --max-count=NUM stop after NUM matches\n\ + -b, --byte-offset print the byte offset with output lines\n\ + -n, --line-number print line number with output lines\n\ + --line-buffered flush output on every line\n\ + -H, --with-filename print the filename for each match\n\ + -h, --no-filename suppress the prefixing filename on output\n\ + --label=LABEL print LABEL as filename for standard input\n\ + -o, --only-matching show only the part of a line matching PATTERN\n\ + -q, --quiet, --silent suppress all normal output\n\ + --binary-files=TYPE assume that binary files are TYPE\n\ + TYPE is 'binary', 'text', or 'without-match'\n\ + -a, --text equivalent to --binary-files=text\n\ + -I equivalent to --binary-files=without-match\n\ + -d, --directories=ACTION how to handle directories\n\ + ACTION is 'read', 'recurse', or 'skip'\n\ + -D, --devices=ACTION how to handle devices, FIFOs and sockets\n\ + ACTION is 'read' or 'skip'\n\ + -R, -r, --recursive equivalent to --directories=recurse\n\ + --include=PATTERN files that match PATTERN will be examined\n\ + --exclude=PATTERN files that match PATTERN will be skipped.\n\ + --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n\ + -L, --files-without-match only print FILE names containing no match\n\ + -l, --files-with-matches only print FILE names containing matches\n\ + -c, --count only print a count of matching lines per FILE\n\ + -Z, --null print 0 byte after FILE name\n")); + printf (_("\ +\n\ +Context control:\n\ + -B, --before-context=NUM print NUM lines of leading context\n\ + -A, --after-context=NUM print NUM lines of trailing context\n\ + -C, --context=NUM print NUM lines of output context\n\ + -NUM same as --context=NUM\n\ + --color[=WHEN],\n\ + --colour[=WHEN] use markers to distinguish the matching string\n\ + WHEN may be `always', `never' or `auto'.\n\ + -U, --binary do not strip CR characters at EOL (MSDOS)\n\ + -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n\ +\n\ +`egrep' means `grep -E'. `fgrep' means `grep -F'.\n\ +With no FILE, or when FILE is -, read standard input. If less than\n\ +two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n\ +and 2 if trouble.\n")); + printf (_("\nReport bugs to .\n")); + } + exit (status); +} + +/* Set the matcher to M, reporting any conflicts. */ +static void +setmatcher (char const *m) +{ + if (matcher && strcmp (matcher, m) != 0) + error (2, 0, _("conflicting matchers specified")); + matcher = m; +} + +/* Go through the matchers vector and look for the specified matcher. + If we find it, install it in compile and execute, and return 1. */ +static int +install_matcher (char const *name) +{ + int i; +#if defined(HAVE_SETRLIMIT) + struct rlimit rlim; +#endif + + for (i = 0; matchers[i].compile; i++) + if (strcmp (name, matchers[i].name) == 0) + { + compile = matchers[i].compile; + execute = matchers[i].execute; +#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_STACK) + /* I think every platform needs to do this, so that regex.c + doesn't oveflow the stack. The default value of + `re_max_failures' is too large for some platforms: it needs + more than 3MB-large stack. + + The test for HAVE_SETRLIMIT should go into `configure'. */ + if (!getrlimit (RLIMIT_STACK, &rlim)) + { + long newlim; + extern long int re_max_failures; /* from regex.c */ + + /* Approximate the amount regex.c needs, plus some more. */ + newlim = re_max_failures * 2 * 20 * sizeof (char *); + if (newlim > rlim.rlim_max) + { + newlim = rlim.rlim_max; + re_max_failures = newlim / (2 * 20 * sizeof (char *)); + } + if (rlim.rlim_cur < newlim) + { + rlim.rlim_cur = newlim; + setrlimit (RLIMIT_STACK, &rlim); + } + } +#endif + return 1; + } + return 0; +} + +/* Find the white-space-separated options specified by OPTIONS, and + using BUF to store copies of these options, set ARGV[0], ARGV[1], + etc. to the option copies. Return the number N of options found. + Do not set ARGV[N] to NULL. If ARGV is NULL, do not store ARGV[0] + etc. Backslash can be used to escape whitespace (and backslashes). */ +static int +prepend_args (char const *options, char *buf, char **argv) +{ + char const *o = options; + char *b = buf; + int n = 0; + + for (;;) + { + while (ISSPACE ((unsigned char) *o)) + o++; + if (!*o) + return n; + if (argv) + argv[n] = b; + n++; + + do + if ((*b++ = *o++) == '\\' && *o) + b[-1] = *o++; + while (*o && ! ISSPACE ((unsigned char) *o)); + + *b++ = '\0'; + } +} + +/* Prepend the whitespace-separated options in OPTIONS to the argument + vector of a main program with argument count *PARGC and argument + vector *PARGV. */ +static void +prepend_default_options (char const *options, int *pargc, char ***pargv) +{ + if (options) + { + char *buf = xmalloc (strlen (options) + 1); + int prepended = prepend_args (options, buf, (char **) NULL); + int argc = *pargc; + char * const *argv = *pargv; + char **pp = (char **) xmalloc ((prepended + argc + 1) * sizeof *pp); + *pargc = prepended + argc; + *pargv = pp; + *pp++ = *argv++; + pp += prepend_args (options, buf, pp); + while ((*pp++ = *argv++)) + continue; + } +} + +/* Get the next non-digit option from ARGC and ARGV. + Return -1 if there are no more options. + Process any digit options that were encountered on the way, + and store the resulting integer into *DEFAULT_CONTEXT. */ +static int +get_nondigit_option (int argc, char *const *argv, int *default_context) +{ + int opt; + char buf[sizeof (uintmax_t) * CHAR_BIT + 4]; + char *p = buf; + + /* Set buf[0] to anything but '0', for the leading-zero test below. */ + buf[0] = '\0'; + + while (opt = getopt_long (argc, argv, short_options, long_options, NULL), + '0' <= opt && opt <= '9') + { + /* Suppress trivial leading zeros, to avoid incorrect + diagnostic on strings like 00000000000. */ + p -= buf[0] == '0'; + + *p++ = opt; + if (p == buf + sizeof buf - 4) + { + /* Too many digits. Append "..." to make context_length_arg + complain about "X...", where X contains the digits seen + so far. */ + strcpy (p, "..."); + p += 3; + break; + } + } + if (p != buf) + { + *p = '\0'; + context_length_arg (buf, default_context); + } + + return opt; +} + +int +main (int argc, char **argv) +{ + char *keys; + size_t keycc, oldcc, keyalloc; + int with_filenames; + int opt, cc, status; + int default_context; + FILE *fp; + extern char *optarg; + extern int optind; + + initialize_main (&argc, &argv); + program_name = argv[0]; + if (program_name && strrchr (program_name, '/')) + program_name = strrchr (program_name, '/') + 1; + + if (!strcmp(program_name, "egrep")) + setmatcher ("egrep"); + if (!strcmp(program_name, "fgrep")) + setmatcher ("fgrep"); + +#if defined(__MSDOS__) || defined(_WIN32) + /* DOS and MS-Windows use backslashes as directory separators, and usually + have an .exe suffix. They also have case-insensitive filesystems. */ + if (program_name) + { + char *p = program_name; + char *bslash = strrchr (argv[0], '\\'); + + if (bslash && bslash >= program_name) /* for mixed forward/backslash case */ + program_name = bslash + 1; + else if (program_name == argv[0] + && argv[0][0] && argv[0][1] == ':') /* "c:progname" */ + program_name = argv[0] + 2; + + /* Collapse the letter-case, so `strcmp' could be used hence. */ + for ( ; *p; p++) + if (*p >= 'A' && *p <= 'Z') + *p += 'a' - 'A'; + + /* Remove the .exe extension, if any. */ + if ((p = strrchr (program_name, '.')) && strcmp (p, ".exe") == 0) + *p = '\0'; + } +#endif + + keys = NULL; + keycc = 0; + with_filenames = 0; + eolbyte = '\n'; + filename_mask = ~0; + + max_count = TYPE_MAXIMUM (off_t); + + /* The value -1 means to use DEFAULT_CONTEXT. */ + out_after = out_before = -1; + /* Default before/after context: chaged by -C/-NUM options */ + default_context = 0; + /* Changed by -o option */ + only_matching = 0; + + /* Internationalization. */ +#if defined(HAVE_SETLOCALE) + setlocale (LC_ALL, ""); +#endif +#if defined(ENABLE_NLS) + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); +#endif + + atexit (close_stdout); + + prepend_default_options (getenv ("GREP_OPTIONS"), &argc, &argv); + + while ((opt = get_nondigit_option (argc, argv, &default_context)) != -1) + switch (opt) + { + case 'A': + context_length_arg (optarg, &out_after); + break; + + case 'B': + context_length_arg (optarg, &out_before); + break; + + case 'C': + /* Set output match context, but let any explicit leading or + trailing amount specified with -A or -B stand. */ + context_length_arg (optarg, &default_context); + break; + + case 'D': + if (strcmp (optarg, "read") == 0) + devices = READ_DEVICES; + else if (strcmp (optarg, "skip") == 0) + devices = SKIP_DEVICES; + else + error (2, 0, _("unknown devices method")); + break; + + case 'E': + setmatcher ("egrep"); + break; + + case 'F': + setmatcher ("fgrep"); + break; + + case 'P': + setmatcher ("perl"); + break; + + case 'G': + setmatcher ("grep"); + break; + + case 'H': + with_filenames = 1; + break; + + case 'I': + binary_files = WITHOUT_MATCH_BINARY_FILES; + break; + + case 'U': +#if defined(HAVE_DOS_FILE_CONTENTS) + dos_use_file_type = DOS_BINARY; +#endif + break; + + case 'u': +#if defined(HAVE_DOS_FILE_CONTENTS) + dos_report_unix_offset = 1; +#endif + break; + + case 'V': + show_version = 1; + break; + + case 'X': + setmatcher (optarg); + break; + + case 'a': + binary_files = TEXT_BINARY_FILES; + break; + + case 'b': + out_byte = 1; + break; + + case 'c': + count_matches = 1; + break; + + case 'd': + if (strcmp (optarg, "read") == 0) + directories = READ_DIRECTORIES; + else if (strcmp (optarg, "skip") == 0) + directories = SKIP_DIRECTORIES; + else if (strcmp (optarg, "recurse") == 0) + directories = RECURSE_DIRECTORIES; + else + error (2, 0, _("unknown directories method")); + break; + + case 'e': + cc = strlen (optarg); + keys = xrealloc (keys, keycc + cc + 1); + strcpy (&keys[keycc], optarg); + keycc += cc; + keys[keycc++] = '\n'; + break; + + case 'f': + fp = strcmp (optarg, "-") != 0 ? fopen (optarg, "r") : stdin; + if (!fp) + error (2, errno, "%s", optarg); + for (keyalloc = 1; keyalloc <= keycc + 1; keyalloc *= 2) + ; + keys = xrealloc (keys, keyalloc); + oldcc = keycc; + while (!feof (fp) + && (cc = fread (keys + keycc, 1, keyalloc - 1 - keycc, fp)) > 0) + { + keycc += cc; + if (keycc == keyalloc - 1) + keys = xrealloc (keys, keyalloc *= 2); + } + if (fp != stdin) + fclose(fp); + /* Append final newline if file ended in non-newline. */ + if (oldcc != keycc && keys[keycc - 1] != '\n') + keys[keycc++] = '\n'; + break; + + case 'h': + no_filenames = 1; + break; + + case 'i': + case 'y': /* For old-timers . . . */ + match_icase = 1; + break; + + case 'L': + /* Like -l, except list files that don't contain matches. + Inspired by the same option in Hume's gre. */ + list_files = -1; + break; + + case 'l': + list_files = 1; + break; + + case 'm': + { + uintmax_t value; + switch (xstrtoumax (optarg, 0, 10, &value, "")) + { + case LONGINT_OK: + max_count = value; + if (0 <= max_count && max_count == value) + break; + /* Fall through. */ + case LONGINT_OVERFLOW: + max_count = TYPE_MAXIMUM (off_t); + break; + + default: + error (2, 0, _("invalid max count")); + } + } + break; + + case 'n': + out_line = 1; + break; + + case 'o': + only_matching = 1; + break; + + case 'q': + exit_on_match = 1; + break; + + case 'R': + case 'r': + directories = RECURSE_DIRECTORIES; + break; + + case 's': + suppress_errors = 1; + break; + + case 'v': + out_invert = 1; + break; + + case 'w': + match_words = 1; + break; + + case 'x': + match_lines = 1; + break; + + case 'Z': + filename_mask = 0; + break; + + case 'z': + eolbyte = '\0'; + break; + + case BINARY_FILES_OPTION: + if (strcmp (optarg, "binary") == 0) + binary_files = BINARY_BINARY_FILES; + else if (strcmp (optarg, "text") == 0) + binary_files = TEXT_BINARY_FILES; + else if (strcmp (optarg, "without-match") == 0) + binary_files = WITHOUT_MATCH_BINARY_FILES; + else + error (2, 0, _("unknown binary-files type")); + break; + + case COLOR_OPTION: + if(optarg) { + if(!strcasecmp(optarg, "always") || !strcasecmp(optarg, "yes") || + !strcasecmp(optarg, "force")) + color_option = 1; + else if(!strcasecmp(optarg, "never") || !strcasecmp(optarg, "no") || + !strcasecmp(optarg, "none")) + color_option = 0; + else if(!strcasecmp(optarg, "auto") || !strcasecmp(optarg, "tty") || + !strcasecmp(optarg, "if-tty")) + color_option = 2; + else + show_help = 1; + } else + color_option = 2; + if(color_option == 2) { + if(isatty(STDOUT_FILENO) && getenv("TERM") && + strcmp(getenv("TERM"), "dumb")) + color_option = 1; + else + color_option = 0; + } + break; + + case EXCLUDE_OPTION: + if (!excluded_patterns) + excluded_patterns = new_exclude (); + add_exclude (excluded_patterns, optarg); + break; + + case EXCLUDE_FROM_OPTION: + if (!excluded_patterns) + excluded_patterns = new_exclude (); + if (add_exclude_file (add_exclude, excluded_patterns, optarg, '\n') + != 0) + { + error (2, errno, "%s", optarg); + } + break; + + case INCLUDE_OPTION: + if (!included_patterns) + included_patterns = new_exclude (); + add_exclude (included_patterns, optarg); + break; + + case LINE_BUFFERED_OPTION: + line_buffered = 1; + break; + + case LABEL_OPTION: + label = optarg; + break; + + case 0: + /* long options */ + break; + + default: + usage (2); + break; + + } + + /* POSIX.2 says that -q overrides -l, which in turn overrides the + other output options. */ + if (exit_on_match) + list_files = 0; + if (exit_on_match | list_files) + { + count_matches = 0; + done_on_match = 1; + } + out_quiet = count_matches | done_on_match; + + if (out_after < 0) + out_after = default_context; + if (out_before < 0) + out_before = default_context; + + if (color_option) + { + char *userval = getenv ("GREP_COLOR"); + if (userval != NULL && *userval != '\0') + grep_color = userval; + } + + if (! matcher) + matcher = "grep"; + + if (show_version) + { + printf (_("%s (GNU grep) %s\n"), matcher, VERSION); + printf ("\n"); + printf (_("\ +Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.\n")); + printf (_("\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n")); + printf ("\n"); + exit (0); + } + + if (show_help) + usage (0); + + if (keys) + { + if (keycc == 0) + { + /* No keys were specified (e.g. -f /dev/null). Match nothing. */ + out_invert ^= 1; + match_lines = match_words = 0; + } + else + /* Strip trailing newline. */ + --keycc; + } + else + if (optind < argc) + { + keys = argv[optind++]; + keycc = strlen (keys); + } + else + usage (2); + + if (!install_matcher (matcher) && !install_matcher ("default")) + abort (); + + (*compile)(keys, keycc); + + if ((argc - optind > 1 && !no_filenames) || with_filenames) + out_file = 1; + +#ifdef SET_BINARY + /* Output is set to binary mode because we shouldn't convert + NL to CR-LF pairs, especially when grepping binary files. */ + if (!isatty (1)) + SET_BINARY (1); +#endif + + if (max_count == 0) + exit (1); + + if (optind < argc) + { + status = 1; + do + { + char *file = argv[optind]; + if ((included_patterns || excluded_patterns) + && !isdir (file)) + { + if (included_patterns && + ! excluded_filename (included_patterns, file, 0)) + continue; + if (excluded_patterns && + excluded_filename (excluded_patterns, file, 0)) + continue; + } + status &= grepfile (strcmp (file, "-") == 0 ? (char *) NULL : file, + &stats_base); + } + while ( ++optind < argc); + } + else + status = grepfile ((char *) NULL, &stats_base); + + /* We register via atexit() to test stdout. */ + exit (errseen ? 2 : status); +} +/* vim:set shiftwidth=2: */ diff --git a/src/apps/bin/grep-2.5/src/grep.h b/src/apps/bin/grep-2.5/src/grep.h new file mode 100644 index 0000000000..c13f2120be --- /dev/null +++ b/src/apps/bin/grep-2.5/src/grep.h @@ -0,0 +1,42 @@ +/* grep.h - interface to grep driver for searching subroutines. + Copyright (C) 1992, 1998, 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ +# define __attribute__(x) +#endif + +/* Grep.c expects the matchers vector to be terminated + by an entry with a NULL compile, and to contain at least + an entry named "default". */ + +extern struct matcher +{ + char name[8]; + void (*compile) PARAMS ((char const *, size_t)); + size_t (*execute) PARAMS ((char const *, size_t, size_t *, int)); +} const matchers[]; + +/* Exported from fgrepmat.c, egrepmat.c, grepmat.c. */ +extern char const *matcher; + +/* The following flags are exported from grep for the matchers + to look at. */ +extern int match_icase; /* -i */ +extern int match_words; /* -w */ +extern int match_lines; /* -x */ +extern unsigned char eolbyte; /* -z */ diff --git a/src/apps/bin/grep-2.5/src/grepmat.c b/src/apps/bin/grep-2.5/src/grepmat.c new file mode 100644 index 0000000000..7947a65744 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/grepmat.c @@ -0,0 +1,6 @@ +#ifdef HAVE_CONFIG_H +# include +#endif +#include "system.h" +#include "grep.h" +char const *matcher; diff --git a/src/apps/bin/grep-2.5/src/kwset.c b/src/apps/bin/grep-2.5/src/kwset.c new file mode 100644 index 0000000000..97134bf690 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/kwset.c @@ -0,0 +1,771 @@ +/* kwset.c - search for any of a set of keywords. + Copyright 1989, 1998, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Written August 1989 by Mike Haertel. + The author may be reached (Email) at the address mike@ai.mit.edu, + or (US mail) as Mike Haertel c/o Free Software Foundation. */ + +/* The algorithm implemented by these routines bears a startling resemblence + to one discovered by Beate Commentz-Walter, although it is not identical. + See "A String Matching Algorithm Fast on the Average," Technical Report, + IBM-Germany, Scientific Center Heidelberg, Tiergartenstrasse 15, D-6900 + Heidelberg, Germany. See also Aho, A.V., and M. Corasick, "Efficient + String Matching: An Aid to Bibliographic Search," CACM June 1975, + Vol. 18, No. 6, which describes the failure function used below. */ + +#ifdef HAVE_CONFIG_H +# include +#endif +#include +#include "system.h" +#include "kwset.h" +#include "obstack.h" + +#ifdef GREP +extern char *xmalloc(); +# undef malloc +# define malloc xmalloc +#endif + +#define NCHAR (UCHAR_MAX + 1) +#define obstack_chunk_alloc malloc +#define obstack_chunk_free free + +/* Balanced tree of edges and labels leaving a given trie node. */ +struct tree +{ + struct tree *llink; /* Left link; MUST be first field. */ + struct tree *rlink; /* Right link (to larger labels). */ + struct trie *trie; /* Trie node pointed to by this edge. */ + unsigned char label; /* Label on this edge. */ + char balance; /* Difference in depths of subtrees. */ +}; + +/* Node of a trie representing a set of reversed keywords. */ +struct trie +{ + unsigned int accepting; /* Word index of accepted word, or zero. */ + struct tree *links; /* Tree of edges leaving this node. */ + struct trie *parent; /* Parent of this node. */ + struct trie *next; /* List of all trie nodes in level order. */ + struct trie *fail; /* Aho-Corasick failure function. */ + int depth; /* Depth of this node from the root. */ + int shift; /* Shift function for search failures. */ + int maxshift; /* Max shift of self and descendents. */ +}; + +/* Structure returned opaquely to the caller, containing everything. */ +struct kwset +{ + struct obstack obstack; /* Obstack for node allocation. */ + int words; /* Number of words in the trie. */ + struct trie *trie; /* The trie itself. */ + int mind; /* Minimum depth of an accepting node. */ + int maxd; /* Maximum depth of any node. */ + unsigned char delta[NCHAR]; /* Delta table for rapid search. */ + struct trie *next[NCHAR]; /* Table of children of the root. */ + char *target; /* Target string if there's only one. */ + int mind2; /* Used in Boyer-Moore search for one string. */ + char const *trans; /* Character translation table. */ +}; + +/* Allocate and initialize a keyword set object, returning an opaque + pointer to it. Return NULL if memory is not available. */ +kwset_t +kwsalloc (char const *trans) +{ + struct kwset *kwset; + + kwset = (struct kwset *) malloc(sizeof (struct kwset)); + if (!kwset) + return 0; + + obstack_init(&kwset->obstack); + kwset->words = 0; + kwset->trie + = (struct trie *) obstack_alloc(&kwset->obstack, sizeof (struct trie)); + if (!kwset->trie) + { + kwsfree((kwset_t) kwset); + return 0; + } + kwset->trie->accepting = 0; + kwset->trie->links = 0; + kwset->trie->parent = 0; + kwset->trie->next = 0; + kwset->trie->fail = 0; + kwset->trie->depth = 0; + kwset->trie->shift = 0; + kwset->mind = INT_MAX; + kwset->maxd = -1; + kwset->target = 0; + kwset->trans = trans; + + return (kwset_t) kwset; +} + +/* Add the given string to the contents of the keyword set. Return NULL + for success, an error message otherwise. */ +char * +kwsincr (kwset_t kws, char const *text, size_t len) +{ + struct kwset *kwset; + register struct trie *trie; + register unsigned char label; + register struct tree *link; + register int depth; + struct tree *links[12]; + enum { L, R } dirs[12]; + struct tree *t, *r, *l, *rl, *lr; + + kwset = (struct kwset *) kws; + trie = kwset->trie; + text += len; + + /* Descend the trie (built of reversed keywords) character-by-character, + installing new nodes when necessary. */ + while (len--) + { + label = kwset->trans ? kwset->trans[(unsigned char) *--text] : *--text; + + /* Descend the tree of outgoing links for this trie node, + looking for the current character and keeping track + of the path followed. */ + link = trie->links; + links[0] = (struct tree *) &trie->links; + dirs[0] = L; + depth = 1; + + while (link && label != link->label) + { + links[depth] = link; + if (label < link->label) + dirs[depth++] = L, link = link->llink; + else + dirs[depth++] = R, link = link->rlink; + } + + /* The current character doesn't have an outgoing link at + this trie node, so build a new trie node and install + a link in the current trie node's tree. */ + if (!link) + { + link = (struct tree *) obstack_alloc(&kwset->obstack, + sizeof (struct tree)); + if (!link) + return _("memory exhausted"); + link->llink = 0; + link->rlink = 0; + link->trie = (struct trie *) obstack_alloc(&kwset->obstack, + sizeof (struct trie)); + if (!link->trie) + return _("memory exhausted"); + link->trie->accepting = 0; + link->trie->links = 0; + link->trie->parent = trie; + link->trie->next = 0; + link->trie->fail = 0; + link->trie->depth = trie->depth + 1; + link->trie->shift = 0; + link->label = label; + link->balance = 0; + + /* Install the new tree node in its parent. */ + if (dirs[--depth] == L) + links[depth]->llink = link; + else + links[depth]->rlink = link; + + /* Back up the tree fixing the balance flags. */ + while (depth && !links[depth]->balance) + { + if (dirs[depth] == L) + --links[depth]->balance; + else + ++links[depth]->balance; + --depth; + } + + /* Rebalance the tree by pointer rotations if necessary. */ + if (depth && ((dirs[depth] == L && --links[depth]->balance) + || (dirs[depth] == R && ++links[depth]->balance))) + { + switch (links[depth]->balance) + { + case (char) -2: + switch (dirs[depth + 1]) + { + case L: + r = links[depth], t = r->llink, rl = t->rlink; + t->rlink = r, r->llink = rl; + t->balance = r->balance = 0; + break; + case R: + r = links[depth], l = r->llink, t = l->rlink; + rl = t->rlink, lr = t->llink; + t->llink = l, l->rlink = lr, t->rlink = r, r->llink = rl; + l->balance = t->balance != 1 ? 0 : -1; + r->balance = t->balance != (char) -1 ? 0 : 1; + t->balance = 0; + break; + default: + abort (); + } + break; + case 2: + switch (dirs[depth + 1]) + { + case R: + l = links[depth], t = l->rlink, lr = t->llink; + t->llink = l, l->rlink = lr; + t->balance = l->balance = 0; + break; + case L: + l = links[depth], r = l->rlink, t = r->llink; + lr = t->llink, rl = t->rlink; + t->llink = l, l->rlink = lr, t->rlink = r, r->llink = rl; + l->balance = t->balance != 1 ? 0 : -1; + r->balance = t->balance != (char) -1 ? 0 : 1; + t->balance = 0; + break; + default: + abort (); + } + break; + default: + abort (); + } + + if (dirs[depth - 1] == L) + links[depth - 1]->llink = t; + else + links[depth - 1]->rlink = t; + } + } + + trie = link->trie; + } + + /* Mark the node we finally reached as accepting, encoding the + index number of this word in the keyword set so far. */ + if (!trie->accepting) + trie->accepting = 1 + 2 * kwset->words; + ++kwset->words; + + /* Keep track of the longest and shortest string of the keyword set. */ + if (trie->depth < kwset->mind) + kwset->mind = trie->depth; + if (trie->depth > kwset->maxd) + kwset->maxd = trie->depth; + + return 0; +} + +/* Enqueue the trie nodes referenced from the given tree in the + given queue. */ +static void +enqueue (struct tree *tree, struct trie **last) +{ + if (!tree) + return; + enqueue(tree->llink, last); + enqueue(tree->rlink, last); + (*last) = (*last)->next = tree->trie; +} + +/* Compute the Aho-Corasick failure function for the trie nodes referenced + from the given tree, given the failure function for their parent as + well as a last resort failure node. */ +static void +treefails (register struct tree const *tree, struct trie const *fail, + struct trie *recourse) +{ + register struct tree *link; + + if (!tree) + return; + + treefails(tree->llink, fail, recourse); + treefails(tree->rlink, fail, recourse); + + /* Find, in the chain of fails going back to the root, the first + node that has a descendent on the current label. */ + while (fail) + { + link = fail->links; + while (link && tree->label != link->label) + if (tree->label < link->label) + link = link->llink; + else + link = link->rlink; + if (link) + { + tree->trie->fail = link->trie; + return; + } + fail = fail->fail; + } + + tree->trie->fail = recourse; +} + +/* Set delta entries for the links of the given tree such that + the preexisting delta value is larger than the current depth. */ +static void +treedelta (register struct tree const *tree, + register unsigned int depth, + unsigned char delta[]) +{ + if (!tree) + return; + treedelta(tree->llink, depth, delta); + treedelta(tree->rlink, depth, delta); + if (depth < delta[tree->label]) + delta[tree->label] = depth; +} + +/* Return true if A has every label in B. */ +static int +hasevery (register struct tree const *a, register struct tree const *b) +{ + if (!b) + return 1; + if (!hasevery(a, b->llink)) + return 0; + if (!hasevery(a, b->rlink)) + return 0; + while (a && b->label != a->label) + if (b->label < a->label) + a = a->llink; + else + a = a->rlink; + return !!a; +} + +/* Compute a vector, indexed by character code, of the trie nodes + referenced from the given tree. */ +static void +treenext (struct tree const *tree, struct trie *next[]) +{ + if (!tree) + return; + treenext(tree->llink, next); + treenext(tree->rlink, next); + next[tree->label] = tree->trie; +} + +/* Compute the shift for each trie node, as well as the delta + table and next cache for the given keyword set. */ +char * +kwsprep (kwset_t kws) +{ + register struct kwset *kwset; + register int i; + register struct trie *curr, *fail; + register char const *trans; + unsigned char delta[NCHAR]; + struct trie *last, *next[NCHAR]; + + kwset = (struct kwset *) kws; + + /* Initial values for the delta table; will be changed later. The + delta entry for a given character is the smallest depth of any + node at which an outgoing edge is labeled by that character. */ + if (kwset->mind < 256) + for (i = 0; i < NCHAR; ++i) + delta[i] = kwset->mind; + else + for (i = 0; i < NCHAR; ++i) + delta[i] = 255; + + /* Check if we can use the simple boyer-moore algorithm, instead + of the hairy commentz-walter algorithm. */ + if (kwset->words == 1 && kwset->trans == 0) + { + /* Looking for just one string. Extract it from the trie. */ + kwset->target = obstack_alloc(&kwset->obstack, kwset->mind); + for (i = kwset->mind - 1, curr = kwset->trie; i >= 0; --i) + { + kwset->target[i] = curr->links->label; + curr = curr->links->trie; + } + /* Build the Boyer Moore delta. Boy that's easy compared to CW. */ + for (i = 0; i < kwset->mind; ++i) + delta[(unsigned char) kwset->target[i]] = kwset->mind - (i + 1); + kwset->mind2 = kwset->mind; + /* Find the minimal delta2 shift that we might make after + a backwards match has failed. */ + for (i = 0; i < kwset->mind - 1; ++i) + if (kwset->target[i] == kwset->target[kwset->mind - 1]) + kwset->mind2 = kwset->mind - (i + 1); + } + else + { + /* Traverse the nodes of the trie in level order, simultaneously + computing the delta table, failure function, and shift function. */ + for (curr = last = kwset->trie; curr; curr = curr->next) + { + /* Enqueue the immediate descendents in the level order queue. */ + enqueue(curr->links, &last); + + curr->shift = kwset->mind; + curr->maxshift = kwset->mind; + + /* Update the delta table for the descendents of this node. */ + treedelta(curr->links, curr->depth, delta); + + /* Compute the failure function for the decendents of this node. */ + treefails(curr->links, curr->fail, kwset->trie); + + /* Update the shifts at each node in the current node's chain + of fails back to the root. */ + for (fail = curr->fail; fail; fail = fail->fail) + { + /* If the current node has some outgoing edge that the fail + doesn't, then the shift at the fail should be no larger + than the difference of their depths. */ + if (!hasevery(fail->links, curr->links)) + if (curr->depth - fail->depth < fail->shift) + fail->shift = curr->depth - fail->depth; + + /* If the current node is accepting then the shift at the + fail and its descendents should be no larger than the + difference of their depths. */ + if (curr->accepting && fail->maxshift > curr->depth - fail->depth) + fail->maxshift = curr->depth - fail->depth; + } + } + + /* Traverse the trie in level order again, fixing up all nodes whose + shift exceeds their inherited maxshift. */ + for (curr = kwset->trie->next; curr; curr = curr->next) + { + if (curr->maxshift > curr->parent->maxshift) + curr->maxshift = curr->parent->maxshift; + if (curr->shift > curr->maxshift) + curr->shift = curr->maxshift; + } + + /* Create a vector, indexed by character code, of the outgoing links + from the root node. */ + for (i = 0; i < NCHAR; ++i) + next[i] = 0; + treenext(kwset->trie->links, next); + + if ((trans = kwset->trans) != 0) + for (i = 0; i < NCHAR; ++i) + kwset->next[i] = next[(unsigned char) trans[i]]; + else + for (i = 0; i < NCHAR; ++i) + kwset->next[i] = next[i]; + } + + /* Fix things up for any translation table. */ + if ((trans = kwset->trans) != 0) + for (i = 0; i < NCHAR; ++i) + kwset->delta[i] = delta[(unsigned char) trans[i]]; + else + for (i = 0; i < NCHAR; ++i) + kwset->delta[i] = delta[i]; + + return 0; +} + +#define U(C) ((unsigned char) (C)) + +/* Fast boyer-moore search. */ +static size_t +bmexec (kwset_t kws, char const *text, size_t size) +{ + struct kwset const *kwset; + register unsigned char const *d1; + register char const *ep, *sp, *tp; + register int d, gc, i, len, md2; + + kwset = (struct kwset const *) kws; + len = kwset->mind; + + if (len == 0) + return 0; + if (len > size) + return -1; + if (len == 1) + { + tp = memchr (text, kwset->target[0], size); + return tp ? tp - text : -1; + } + + d1 = kwset->delta; + sp = kwset->target + len; + gc = U(sp[-2]); + md2 = kwset->mind2; + tp = text + len; + + /* Significance of 12: 1 (initial offset) + 10 (skip loop) + 1 (md2). */ + if (size > 12 * len) + /* 11 is not a bug, the initial offset happens only once. */ + for (ep = text + size - 11 * len;;) + { + while (tp <= ep) + { + d = d1[U(tp[-1])], tp += d; + d = d1[U(tp[-1])], tp += d; + if (d == 0) + goto found; + d = d1[U(tp[-1])], tp += d; + d = d1[U(tp[-1])], tp += d; + d = d1[U(tp[-1])], tp += d; + if (d == 0) + goto found; + d = d1[U(tp[-1])], tp += d; + d = d1[U(tp[-1])], tp += d; + d = d1[U(tp[-1])], tp += d; + if (d == 0) + goto found; + d = d1[U(tp[-1])], tp += d; + d = d1[U(tp[-1])], tp += d; + } + break; + found: + if (U(tp[-2]) == gc) + { + for (i = 3; i <= len && U(tp[-i]) == U(sp[-i]); ++i) + ; + if (i > len) + return tp - len - text; + } + tp += md2; + } + + /* Now we have only a few characters left to search. We + carefully avoid ever producing an out-of-bounds pointer. */ + ep = text + size; + d = d1[U(tp[-1])]; + while (d <= ep - tp) + { + d = d1[U((tp += d)[-1])]; + if (d != 0) + continue; + if (U(tp[-2]) == gc) + { + for (i = 3; i <= len && U(tp[-i]) == U(sp[-i]); ++i) + ; + if (i > len) + return tp - len - text; + } + d = md2; + } + + return -1; +} + +/* Hairy multiple string search. */ +static size_t +cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch) +{ + struct kwset const *kwset; + struct trie * const *next; + struct trie const *trie; + struct trie const *accept; + char const *beg, *lim, *mch, *lmch; + register unsigned char c; + register unsigned char const *delta; + register int d; + register char const *end, *qlim; + register struct tree const *tree; + register char const *trans; + +#ifdef lint + accept = NULL; +#endif + + /* Initialize register copies and look for easy ways out. */ + kwset = (struct kwset *) kws; + if (len < kwset->mind) + return -1; + next = kwset->next; + delta = kwset->delta; + trans = kwset->trans; + lim = text + len; + end = text; + if ((d = kwset->mind) != 0) + mch = 0; + else + { + mch = text, accept = kwset->trie; + goto match; + } + + if (len >= 4 * kwset->mind) + qlim = lim - 4 * kwset->mind; + else + qlim = 0; + + while (lim - end >= d) + { + if (qlim && end <= qlim) + { + end += d - 1; + while ((d = delta[c = *end]) && end < qlim) + { + end += d; + end += delta[(unsigned char) *end]; + end += delta[(unsigned char) *end]; + } + ++end; + } + else + d = delta[c = (end += d)[-1]]; + if (d) + continue; + beg = end - 1; + trie = next[c]; + if (trie->accepting) + { + mch = beg; + accept = trie; + } + d = trie->shift; + while (beg > text) + { + c = trans ? trans[(unsigned char) *--beg] : *--beg; + tree = trie->links; + while (tree && c != tree->label) + if (c < tree->label) + tree = tree->llink; + else + tree = tree->rlink; + if (tree) + { + trie = tree->trie; + if (trie->accepting) + { + mch = beg; + accept = trie; + } + } + else + break; + d = trie->shift; + } + if (mch) + goto match; + } + return -1; + + match: + /* Given a known match, find the longest possible match anchored + at or before its starting point. This is nearly a verbatim + copy of the preceding main search loops. */ + if (lim - mch > kwset->maxd) + lim = mch + kwset->maxd; + lmch = 0; + d = 1; + while (lim - end >= d) + { + if ((d = delta[c = (end += d)[-1]]) != 0) + continue; + beg = end - 1; + if (!(trie = next[c])) + { + d = 1; + continue; + } + if (trie->accepting && beg <= mch) + { + lmch = beg; + accept = trie; + } + d = trie->shift; + while (beg > text) + { + c = trans ? trans[(unsigned char) *--beg] : *--beg; + tree = trie->links; + while (tree && c != tree->label) + if (c < tree->label) + tree = tree->llink; + else + tree = tree->rlink; + if (tree) + { + trie = tree->trie; + if (trie->accepting && beg <= mch) + { + lmch = beg; + accept = trie; + } + } + else + break; + d = trie->shift; + } + if (lmch) + { + mch = lmch; + goto match; + } + if (!d) + d = 1; + } + + if (kwsmatch) + { + kwsmatch->index = accept->accepting / 2; + kwsmatch->offset[0] = mch - text; + kwsmatch->size[0] = accept->depth; + } + return mch - text; +} + +/* Search through the given text for a match of any member of the + given keyword set. Return a pointer to the first character of + the matching substring, or NULL if no match is found. If FOUNDLEN + is non-NULL store in the referenced location the length of the + matching substring. Similarly, if FOUNDIDX is non-NULL, store + in the referenced location the index number of the particular + keyword matched. */ +size_t +kwsexec (kwset_t kws, char const *text, size_t size, + struct kwsmatch *kwsmatch) +{ + struct kwset const *kwset = (struct kwset *) kws; + if (kwset->words == 1 && kwset->trans == 0) + { + size_t ret = bmexec (kws, text, size); + if (kwsmatch != 0 && ret != (size_t) -1) + { + kwsmatch->index = 0; + kwsmatch->offset[0] = ret; + kwsmatch->size[0] = kwset->mind; + } + return ret; + } + else + return cwexec(kws, text, size, kwsmatch); +} + +/* Free the components of the given keyword set. */ +void +kwsfree (kwset_t kws) +{ + struct kwset *kwset; + + kwset = (struct kwset *) kws; + obstack_free(&kwset->obstack, 0); + free(kws); +} diff --git a/src/apps/bin/grep-2.5/src/kwset.h b/src/apps/bin/grep-2.5/src/kwset.h new file mode 100644 index 0000000000..33ee261a97 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/kwset.h @@ -0,0 +1,57 @@ +/* kwset.h - header declaring the keyword set library. + Copyright (C) 1989, 1998 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Written August 1989 by Mike Haertel. + The author may be reached (Email) at the address mike@ai.mit.edu, + or (US mail) as Mike Haertel c/o Free Software Foundation. */ + +struct kwsmatch +{ + int index; /* Index number of matching keyword. */ + size_t offset[1]; /* Offset of each submatch. */ + size_t size[1]; /* Length of each submatch. */ +}; + +typedef ptr_t kwset_t; + +/* Return an opaque pointer to a newly allocated keyword set, or NULL + if enough memory cannot be obtained. The argument if non-NULL + specifies a table of character translations to be applied to all + pattern and search text. */ +extern kwset_t kwsalloc PARAMS((char const *)); + +/* Incrementally extend the keyword set to include the given string. + Return NULL for success, or an error message. Remember an index + number for each keyword included in the set. */ +extern char *kwsincr PARAMS((kwset_t, char const *, size_t)); + +/* When the keyword set has been completely built, prepare it for + use. Return NULL for success, or an error message. */ +extern char *kwsprep PARAMS((kwset_t)); + +/* Search through the given buffer for a member of the keyword set. + Return a pointer to the leftmost longest match found, or NULL if + no match is found. If foundlen is non-NULL, store the length of + the matching substring in the integer it points to. Similarly, + if foundindex is non-NULL, store the index of the particular + keyword found therein. */ +extern size_t kwsexec PARAMS((kwset_t, char const *, size_t, struct kwsmatch *)); + +/* Deallocate the given keyword set and all its associated storage. */ +extern void kwsfree PARAMS((kwset_t)); + diff --git a/src/apps/bin/grep-2.5/src/search.c b/src/apps/bin/grep-2.5/src/search.c new file mode 100644 index 0000000000..7bd233fbca --- /dev/null +++ b/src/apps/bin/grep-2.5/src/search.c @@ -0,0 +1,724 @@ +/* search.c - searching subroutines using dfa, kwset and regex for grep. + Copyright 1992, 1998, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Written August 1992 by Mike Haertel. */ + +#ifdef HAVE_CONFIG_H +# include +#endif +#include +#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC +/* We can handle multibyte string. */ +# define MBS_SUPPORT +# include +# include +#endif + +#include "system.h" +#include "grep.h" +#include "regex.h" +#include "dfa.h" +#include "kwset.h" +#include "error.h" +#include "xalloc.h" +#ifdef HAVE_LIBPCRE +# include +#endif + +#define NCHAR (UCHAR_MAX + 1) + +/* For -w, we also consider _ to be word constituent. */ +#define WCHAR(C) (ISALNUM(C) || (C) == '_') + +/* DFA compiled regexp. */ +static struct dfa dfa; + +/* The Regex compiled patterns. */ +static struct patterns +{ + /* Regex compiled regexp. */ + struct re_pattern_buffer regexbuf; + struct re_registers regs; /* This is here on account of a BRAIN-DEAD + Q@#%!# library interface in regex.c. */ +} patterns0; + +struct patterns *patterns; +size_t pcount; + +/* KWset compiled pattern. For Ecompile and Gcompile, we compile + a list of strings, at least one of which is known to occur in + any string matching the regexp. */ +static kwset_t kwset; + +/* Number of compiled fixed strings known to exactly match the regexp. + If kwsexec returns < kwset_exact_matches, then we don't need to + call the regexp matcher at all. */ +static int kwset_exact_matches; + +#if defined(MBS_SUPPORT) +static char* check_multibyte_string PARAMS ((char const *buf, size_t size)); +#endif +static void kwsinit PARAMS ((void)); +static void kwsmusts PARAMS ((void)); +static void Gcompile PARAMS ((char const *, size_t)); +static void Ecompile PARAMS ((char const *, size_t)); +static size_t EGexecute PARAMS ((char const *, size_t, size_t *, int )); +static void Fcompile PARAMS ((char const *, size_t)); +static size_t Fexecute PARAMS ((char const *, size_t, size_t *, int)); +static void Pcompile PARAMS ((char const *, size_t )); +static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int)); + +void +dfaerror (char const *mesg) +{ + error (2, 0, mesg); +} + +static void +kwsinit (void) +{ + static char trans[NCHAR]; + int i; + + if (match_icase) + for (i = 0; i < NCHAR; ++i) + trans[i] = TOLOWER (i); + + if (!(kwset = kwsalloc (match_icase ? trans : (char *) 0))) + error (2, 0, _("memory exhausted")); +} + +/* If the DFA turns out to have some set of fixed strings one of + which must occur in the match, then we build a kwset matcher + to find those strings, and thus quickly filter out impossible + matches. */ +static void +kwsmusts (void) +{ + struct dfamust const *dm; + char const *err; + + if (dfa.musts) + { + kwsinit (); + /* First, we compile in the substrings known to be exact + matches. The kwset matcher will return the index + of the matching string that it chooses. */ + for (dm = dfa.musts; dm; dm = dm->next) + { + if (!dm->exact) + continue; + ++kwset_exact_matches; + if ((err = kwsincr (kwset, dm->must, strlen (dm->must))) != 0) + error (2, 0, err); + } + /* Now, we compile the substrings that will require + the use of the regexp matcher. */ + for (dm = dfa.musts; dm; dm = dm->next) + { + if (dm->exact) + continue; + if ((err = kwsincr (kwset, dm->must, strlen (dm->must))) != 0) + error (2, 0, err); + } + if ((err = kwsprep (kwset)) != 0) + error (2, 0, err); + } +} + +#ifdef MBS_SUPPORT +/* This function allocate the array which correspond to "buf". + Then this check multibyte string and mark on the positions which + are not singlebyte character nor the first byte of a multibyte + character. Caller must free the array. */ +static char* +check_multibyte_string(char const *buf, size_t size) +{ + char *mb_properties = malloc(size); + mbstate_t cur_state; + int i; + memset(&cur_state, 0, sizeof(mbstate_t)); + memset(mb_properties, 0, sizeof(char)*size); + for (i = 0; i < size ;) + { + size_t mbclen; + mbclen = mbrlen(buf + i, size - i, &cur_state); + + if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0) + { + /* An invalid sequence, or a truncated multibyte character. + We treat it as a singlebyte character. */ + mbclen = 1; + } + mb_properties[i] = mbclen; + i += mbclen; + } + + return mb_properties; +} +#endif + +static void +Gcompile (char const *pattern, size_t size) +{ + const char *err; + char const *sep; + size_t total = size; + char const *motif = pattern; + + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE); + dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte); + + /* For GNU regex compiler we have to pass the patterns separately to detect + errors like "[\nallo\n]\n". The patterns here are "[", "allo" and "]" + GNU regex should have raise a syntax error. The same for backref, where + the backref should have been local to each pattern. */ + do + { + size_t len; + sep = memchr (motif, '\n', total); + if (sep) + { + len = sep - motif; + sep++; + total -= (len + 1); + } + else + { + len = total; + total = 0; + } + + patterns = realloc (patterns, (pcount + 1) * sizeof (*patterns)); + if (patterns == NULL) + error (2, errno, _("memory exhausted")); + + patterns[pcount] = patterns0; + + if ((err = re_compile_pattern (motif, len, + &(patterns[pcount].regexbuf))) != 0) + error (2, 0, err); + pcount++; + + motif = sep; + } while (sep && total != 0); + + /* In the match_words and match_lines cases, we use a different pattern + for the DFA matcher that will quickly throw out cases that won't work. + Then if DFA succeeds we do some hairy stuff using the regex matcher + to decide whether the match should really count. */ + if (match_words || match_lines) + { + /* In the whole-word case, we use the pattern: + \(^\|[^[:alnum:]_]\)\(userpattern\)\([^[:alnum:]_]|$\). + In the whole-line case, we use the pattern: + ^\(userpattern\)$. */ + + static char const line_beg[] = "^\\("; + static char const line_end[] = "\\)$"; + static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\("; + static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)"; + char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); + size_t i; + strcpy (n, match_lines ? line_beg : word_beg); + i = strlen (n); + memcpy (n + i, pattern, size); + i += size; + strcpy (n + i, match_lines ? line_end : word_end); + i += strlen (n + i); + pattern = n; + size = i; + } + + dfacomp (pattern, size, &dfa, 1); + kwsmusts (); +} + +static void +Ecompile (char const *pattern, size_t size) +{ + const char *err; + const char *sep; + size_t total = size; + char const *motif = pattern; + + if (strcmp (matcher, "awk") == 0) + { + re_set_syntax (RE_SYNTAX_AWK); + dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte); + } + else + { + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte); + } + + /* For GNU regex compiler we have to pass the patterns separately to detect + errors like "[\nallo\n]\n". The patterns here are "[", "allo" and "]" + GNU regex should have raise a syntax error. The same for backref, where + the backref should have been local to each pattern. */ + do + { + size_t len; + sep = memchr (motif, '\n', total); + if (sep) + { + len = sep - motif; + sep++; + total -= (len + 1); + } + else + { + len = total; + total = 0; + } + + patterns = realloc (patterns, (pcount + 1) * sizeof (*patterns)); + if (patterns == NULL) + error (2, errno, _("memory exhausted")); + patterns[pcount] = patterns0; + + if ((err = re_compile_pattern (motif, len, + &(patterns[pcount].regexbuf))) != 0) + error (2, 0, err); + pcount++; + + motif = sep; + } while (sep && total != 0); + + /* In the match_words and match_lines cases, we use a different pattern + for the DFA matcher that will quickly throw out cases that won't work. + Then if DFA succeeds we do some hairy stuff using the regex matcher + to decide whether the match should really count. */ + if (match_words || match_lines) + { + /* In the whole-word case, we use the pattern: + (^|[^[:alnum:]_])(userpattern)([^[:alnum:]_]|$). + In the whole-line case, we use the pattern: + ^(userpattern)$. */ + + static char const line_beg[] = "^("; + static char const line_end[] = ")$"; + static char const word_beg[] = "(^|[^[:alnum:]_])("; + static char const word_end[] = ")([^[:alnum:]_]|$)"; + char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end); + size_t i; + strcpy (n, match_lines ? line_beg : word_beg); + i = strlen(n); + memcpy (n + i, pattern, size); + i += size; + strcpy (n + i, match_lines ? line_end : word_end); + i += strlen (n + i); + pattern = n; + size = i; + } + + dfacomp (pattern, size, &dfa, 1); + kwsmusts (); +} + +static size_t +EGexecute (char const *buf, size_t size, size_t *match_size, int exact) +{ + register char const *buflim, *beg, *end; + char eol = eolbyte; + int backref, start, len; + struct kwsmatch kwsm; + size_t i; +#ifdef MBS_SUPPORT + char *mb_properties = NULL; +#endif /* MBS_SUPPORT */ + +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && kwset) + mb_properties = check_multibyte_string(buf, size); +#endif /* MBS_SUPPORT */ + + buflim = buf + size; + + for (beg = end = buf; end < buflim; beg = end) + { + if (!exact) + { + if (kwset) + { + /* Find a possible match using the KWset matcher. */ + size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm); + if (offset == (size_t) -1) + { +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + free(mb_properties); +#endif + return (size_t)-1; + } + beg += offset; + /* Narrow down to the line containing the candidate, and + run it through DFA. */ + end = memchr(beg, eol, buflim - beg); + end++; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0) + continue; +#endif + while (beg > buf && beg[-1] != eol) + --beg; + if (kwsm.index < kwset_exact_matches) + goto success; + if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1) + continue; + } + else + { + /* No good fixed strings; start with DFA. */ + size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref); + if (offset == (size_t) -1) + break; + /* Narrow down to the line we've found. */ + beg += offset; + end = memchr (beg, eol, buflim - beg); + end++; + while (beg > buf && beg[-1] != eol) + --beg; + } + /* Successful, no backreferences encountered! */ + if (!backref) + goto success; + } + else + end = beg + size; + + /* If we've made it to this point, this means DFA has seen + a probable match, and we need to run it through Regex. */ + for (i = 0; i < pcount; i++) + { + patterns[i].regexbuf.not_eol = 0; + if (0 <= (start = re_search (&(patterns[i].regexbuf), beg, + end - beg - 1, 0, + end - beg - 1, &(patterns[i].regs)))) + { + len = patterns[i].regs.end[0] - start; + if (exact) + { + *match_size = len; + return start; + } + if ((!match_lines && !match_words) + || (match_lines && len == end - beg - 1)) + goto success; + /* If -w, check if the match aligns with word boundaries. + We do this iteratively because: + (a) the line may contain more than one occurence of the + pattern, and + (b) Several alternatives in the pattern might be valid at a + given point, and we may need to consider a shorter one to + find a word boundary. */ + if (match_words) + while (start >= 0) + { + if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1])) + && (len == end - beg - 1 + || !WCHAR ((unsigned char) beg[start + len]))) + goto success; + if (len > 0) + { + /* Try a shorter length anchored at the same place. */ + --len; + patterns[i].regexbuf.not_eol = 1; + len = re_match (&(patterns[i].regexbuf), beg, + start + len, start, + &(patterns[i].regs)); + } + if (len <= 0) + { + /* Try looking further on. */ + if (start == end - beg - 1) + break; + ++start; + patterns[i].regexbuf.not_eol = 0; + start = re_search (&(patterns[i].regexbuf), beg, + end - beg - 1, + start, end - beg - 1 - start, + &(patterns[i].regs)); + len = patterns[i].regs.end[0] - start; + } + } + } + } /* for Regex patterns. */ + } /* for (beg = end ..) */ +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && mb_properties) + free (mb_properties); +#endif /* MBS_SUPPORT */ + return (size_t) -1; + + success: +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && mb_properties) + free (mb_properties); +#endif /* MBS_SUPPORT */ + *match_size = end - beg; + return beg - buf; +} + +static void +Fcompile (char const *pattern, size_t size) +{ + char const *beg, *lim, *err; + + kwsinit (); + beg = pattern; + do + { + for (lim = beg; lim < pattern + size && *lim != '\n'; ++lim) + ; + if ((err = kwsincr (kwset, beg, lim - beg)) != 0) + error (2, 0, err); + if (lim < pattern + size) + ++lim; + beg = lim; + } + while (beg < pattern + size); + + if ((err = kwsprep (kwset)) != 0) + error (2, 0, err); +} + +static size_t +Fexecute (char const *buf, size_t size, size_t *match_size, int exact) +{ + register char const *beg, *try, *end; + register size_t len; + char eol = eolbyte; + struct kwsmatch kwsmatch; +#ifdef MBS_SUPPORT + char *mb_properties; + if (MB_CUR_MAX > 1) + mb_properties = check_multibyte_string (buf, size); +#endif /* MBS_SUPPORT */ + + for (beg = buf; beg <= buf + size; ++beg) + { + size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch); + if (offset == (size_t) -1) + { +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + free(mb_properties); +#endif /* MBS_SUPPORT */ + return offset; + } +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0) + continue; /* It is a part of multibyte character. */ +#endif /* MBS_SUPPORT */ + beg += offset; + len = kwsmatch.size[0]; + if (exact) + { + *match_size = len; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + free (mb_properties); +#endif /* MBS_SUPPORT */ + return beg - buf; + } + if (match_lines) + { + if (beg > buf && beg[-1] != eol) + continue; + if (beg + len < buf + size && beg[len] != eol) + continue; + goto success; + } + else if (match_words) + for (try = beg; len; ) + { + if (try > buf && WCHAR((unsigned char) try[-1])) + break; + if (try + len < buf + size && WCHAR((unsigned char) try[len])) + { + offset = kwsexec (kwset, beg, --len, &kwsmatch); + if (offset == (size_t) -1) + { +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + free (mb_properties); +#endif /* MBS_SUPPORT */ + return offset; + } + try = beg + offset; + len = kwsmatch.size[0]; + } + else + goto success; + } + else + goto success; + } + +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + free (mb_properties); +#endif /* MBS_SUPPORT */ + return -1; + + success: + end = memchr (beg + len, eol, (buf + size) - (beg + len)); + end++; + while (buf < beg && beg[-1] != eol) + --beg; + *match_size = end - beg; +#ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + free (mb_properties); +#endif /* MBS_SUPPORT */ + return beg - buf; +} + +#if HAVE_LIBPCRE +/* Compiled internal form of a Perl regular expression. */ +static pcre *cre; + +/* Additional information about the pattern. */ +static pcre_extra *extra; +#endif + +static void +Pcompile (char const *pattern, size_t size) +{ +#if !HAVE_LIBPCRE + error (2, 0, _("The -P option is not supported")); +#else + int e; + char const *ep; + char *re = xmalloc (4 * size + 7); + int flags = PCRE_MULTILINE | (match_icase ? PCRE_CASELESS : 0); + char const *patlim = pattern + size; + char *n = re; + char const *p; + char const *pnul; + + /* FIXME: Remove this restriction. */ + if (eolbyte != '\n') + error (2, 0, _("The -P and -z options cannot be combined")); + + *n = '\0'; + if (match_lines) + strcpy (n, "^("); + if (match_words) + strcpy (n, "\\b("); + n += strlen (n); + + /* The PCRE interface doesn't allow NUL bytes in the pattern, so + replace each NUL byte in the pattern with the four characters + "\000", removing a preceding backslash if there are an odd + number of backslashes before the NUL. + + FIXME: This method does not work with some multibyte character + encodings, notably Shift-JIS, where a multibyte character can end + in a backslash byte. */ + for (p = pattern; (pnul = memchr (p, '\0', patlim - p)); p = pnul + 1) + { + memcpy (n, p, pnul - p); + n += pnul - p; + for (p = pnul; pattern < p && p[-1] == '\\'; p--) + continue; + n -= (pnul - p) & 1; + strcpy (n, "\\000"); + n += 4; + } + + memcpy (n, p, patlim - p); + n += patlim - p; + *n = '\0'; + if (match_words) + strcpy (n, ")\\b"); + if (match_lines) + strcpy (n, ")$"); + + cre = pcre_compile (re, flags, &ep, &e, pcre_maketables ()); + if (!cre) + error (2, 0, ep); + + extra = pcre_study (cre, 0, &ep); + if (ep) + error (2, 0, ep); + + free (re); +#endif +} + +static size_t +Pexecute (char const *buf, size_t size, size_t *match_size, int exact) +{ +#if !HAVE_LIBPCRE + abort (); + return -1; +#else + /* This array must have at least two elements; everything after that + is just for performance improvement in pcre_exec. */ + int sub[300]; + + int e = pcre_exec (cre, extra, buf, size, 0, 0, + sub, sizeof sub / sizeof *sub); + + if (e <= 0) + { + switch (e) + { + case PCRE_ERROR_NOMATCH: + return -1; + + case PCRE_ERROR_NOMEMORY: + error (2, 0, _("Memory exhausted")); + + default: + abort (); + } + } + else + { + /* Narrow down to the line we've found. */ + char const *beg = buf + sub[0]; + char const *end = buf + sub[1]; + char const *buflim = buf + size; + char eol = eolbyte; + if (!exact) + { + end = memchr (end, eol, buflim - end); + end++; + while (buf < beg && beg[-1] != eol) + --beg; + } + + *match_size = end - beg; + return beg - buf; + } +#endif +} + +struct matcher const matchers[] = { + { "default", Gcompile, EGexecute }, + { "grep", Gcompile, EGexecute }, + { "egrep", Ecompile, EGexecute }, + { "awk", Ecompile, EGexecute }, + { "fgrep", Fcompile, Fexecute }, + { "perl", Pcompile, Pexecute }, + { "", 0, 0 }, +}; diff --git a/src/apps/bin/grep-2.5/src/system.h b/src/apps/bin/grep-2.5/src/system.h new file mode 100644 index 0000000000..99906d8aaf --- /dev/null +++ b/src/apps/bin/grep-2.5/src/system.h @@ -0,0 +1,206 @@ +/* Portability cruft. Include after config.h and sys/types.h. + Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#undef PARAMS +#if defined (__STDC__) && __STDC__ +# ifndef _PTR_T +# define _PTR_T + typedef void * ptr_t; +# endif +# define PARAMS(x) x +#else +# ifndef _PTR_T +# define _PTR_T + typedef char * ptr_t; +# endif +# define PARAMS(x) () +#endif + +#ifdef HAVE_UNISTD_H +# include +# include +#else +# define O_RDONLY 0 +# define SEEK_SET 0 +# define SEEK_CUR 1 +int open(), read(), close(); +#endif + +#include +#ifndef errno +extern int errno; +#endif + +#ifndef HAVE_STRERROR +extern int sys_nerr; +extern char *sys_errlist[]; +# define strerror(E) (0 <= (E) && (E) < sys_nerr ? _(sys_errlist[E]) : _("Unknown system error")) +#endif + +/* Some operating systems treat text and binary files differently. */ +#ifdef __BEOS__ +# undef O_BINARY /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +#endif +#ifdef HAVE_DOS_FILE_CONTENTS +# include +# ifdef HAVE_SETMODE +# define SET_BINARY(fd) setmode (fd, O_BINARY) +# else +# define SET_BINARY(fd) _setmode (fd, O_BINARY) +# endif +#endif + +#ifdef HAVE_DOS_FILE_NAMES +# define IS_SLASH(c) ((c) == '/' || (c) == '\\') +# define FILESYSTEM_PREFIX_LEN(f) ((f)[0] && (f)[1] == ':' ? 2 : 0) +#endif + +#ifndef IS_SLASH +# define IS_SLASH(c) ((c) == '/') +#endif + +#ifndef FILESYSTEM_PREFIX_LEN +# define FILESYSTEM_PREFIX_LEN(f) 0 +#endif + +int isdir PARAMS ((char const *)); + +#ifdef HAVE_DIR_EACCES_BUG +# ifdef EISDIR +# define is_EISDIR(e, f) \ + ((e) == EISDIR \ + || ((e) == EACCES && isdir (f) && ((e) = EISDIR, 1))) +# else +# define is_EISDIR(e, f) ((e) == EACCES && isdir (f)) +# endif +#endif + +#ifndef is_EISDIR +# ifdef EISDIR +# define is_EISDIR(e, f) ((e) == EISDIR) +# else +# define is_EISDIR(e, f) 0 +# endif +#endif + +#if STAT_MACROS_BROKEN +# undef S_ISDIR +# undef S_ISREG +#endif +#if !defined(S_ISDIR) && defined(S_IFDIR) +# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR) +#endif +#if !defined(S_ISREG) && defined(S_IFREG) +# define S_ISREG(Mode) (((Mode) & S_IFMT) == S_IFREG) +#endif + +#ifdef STDC_HEADERS +# include +#else +char *getenv (); +ptr_t malloc(), realloc(), calloc(); +void free(); +#endif + +#if __STDC__ +# include +#endif +#ifdef STDC_HEADERS +# include +#endif +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif +/* The extra casts work around common compiler bugs. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ + : (t) 0)) +#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) +#ifndef CHAR_MAX +# define CHAR_MAX TYPE_MAXIMUM (char) +#endif +#ifndef INT_MAX +# define INT_MAX TYPE_MAXIMUM (int) +#endif +#ifndef UCHAR_MAX +# define UCHAR_MAX TYPE_MAXIMUM (unsigned char) +#endif + +#if !defined(STDC_HEADERS) && defined(HAVE_STRING_H) && defined(HAVE_MEMORY_H) +# include +#endif +#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +# include +#else +# include +# undef strchr +# define strchr index +# undef strrchr +# define strrchr rindex +# undef memcpy +# define memcpy(d, s, n) bcopy (s, d, n) +#endif +#ifndef HAVE_MEMCHR +ptr_t memchr(); +#endif +#if ! defined HAVE_MEMMOVE && ! defined memmove +# define memmove(d, s, n) bcopy (s, d, n) +#endif + +#include + +#ifndef isgraph +# define isgraph(C) (isprint(C) && !isspace(C)) +#endif + +#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) +# define IN_CTYPE_DOMAIN(c) 1 +#else +# define IN_CTYPE_DOMAIN(c) isascii(c) +#endif + +#define ISALPHA(C) (IN_CTYPE_DOMAIN (C) && isalpha (C)) +#define ISUPPER(C) (IN_CTYPE_DOMAIN (C) && isupper (C)) +#define ISLOWER(C) (IN_CTYPE_DOMAIN (C) && islower (C)) +#define ISDIGIT(C) (IN_CTYPE_DOMAIN (C) && isdigit (C)) +#define ISXDIGIT(C) (IN_CTYPE_DOMAIN (C) && isxdigit (C)) +#define ISSPACE(C) (IN_CTYPE_DOMAIN (C) && isspace (C)) +#define ISPUNCT(C) (IN_CTYPE_DOMAIN (C) && ispunct (C)) +#define ISALNUM(C) (IN_CTYPE_DOMAIN (C) && isalnum (C)) +#define ISPRINT(C) (IN_CTYPE_DOMAIN (C) && isprint (C)) +#define ISGRAPH(C) (IN_CTYPE_DOMAIN (C) && isgraph (C)) +#define ISCNTRL(C) (IN_CTYPE_DOMAIN (C) && iscntrl (C)) + +#define TOLOWER(C) (ISUPPER(C) ? tolower(C) : (C)) + +#if ENABLE_NLS +# include +# define _(String) gettext (String) +#else +# define _(String) String +#endif +#define N_(String) String + +#if HAVE_SETLOCALE +# include +#endif + +#ifndef initialize_main +#define initialize_main(argcp, argvp) +#endif diff --git a/src/apps/bin/grep-2.5/src/vms_fab.c b/src/apps/bin/grep-2.5/src/vms_fab.c new file mode 100644 index 0000000000..1fdb2c0efa --- /dev/null +++ b/src/apps/bin/grep-2.5/src/vms_fab.c @@ -0,0 +1,86 @@ + /* + + + This macro sets up the file access block and name block for VMS. + It also does the initial parsing of the input string (resolving + wildcards, + if any) and finds all files matching the input pattern. + The address of the first matching pattern is returned. + + Written by Phillip C. Brisco 8/98. + */ +#include "vms_fab.h" + +void +vms_fab (int * argp, char **argvp[]) +{ + extern int optind; + int optout; + + fab = cc$rms_fab; + nam = cc$rms_nam; + + optout = 0; + strcpy (fna_buffer, *argvp[optind]); + length_of_fna_buffer = NAM$C_MAXRSS; + + fab.fab$b_bid = FAB$C_BID; + fab.fab$b_bln = FAB$C_BLN; + fab.fab$l_fop = FAB$M_NAM; + fab.fab$l_nam = &nam; + fab.fab$l_fna = (char *)&fna_buffer; + fab.fab$b_fns = length_of_fna_buffer; + + nam.nam$b_bid = NAM$C_BID; + nam.nam$b_bln = NAM$C_BLN; + nam.nam$l_esa = (char *)&expanded_name; + nam.nam$b_ess = NAM$C_MAXRSS; + nam.nam$l_rsa = (char *)&result_name; + nam.nam$b_rss = NAM$C_MAXRSS; + + fab_stat = sys$parse (&fab); + fab_stat = sys$search (&fab); + + if (fab_stat != 65537) + { + fprintf (stderr, "No Matches found.\n"); + exit (0); + } + + /* + While we find matching patterns, continue searching for more. + */ + while (fab_stat == 65537) + { + /* + Allocate memory for the filename + */ + arr_ptr[optout] = alloca (max_file_path_size + 1); + + strcpy (arr_ptr[optout], result_name); + + /* + If we don't tack on a null character at the end of the + filename, + we can get partial data which is still there from the last + sys$search command. + */ + arr_ptr[optout][nam.nam$b_dev + + nam.nam$b_dir + + nam.nam$b_name + + nam.nam$b_type + + nam.nam$b_ver] = '\0'; + + fab_stat = sys$search (&fab); + optout++; + } + + optout--; + + /* Return a pointer to the beginning of memory that has the expanded + filenames. + */ + *argp = optout; + *argvp = arr_ptr; + +} diff --git a/src/apps/bin/grep-2.5/src/vms_fab.h b/src/apps/bin/grep-2.5/src/vms_fab.h new file mode 100644 index 0000000000..6bad6504d6 --- /dev/null +++ b/src/apps/bin/grep-2.5/src/vms_fab.h @@ -0,0 +1,33 @@ +/* + This file includes the setup for the file access block for VMS. + Written by Phillip C. Brisco 8/98. + */ + +#include +#include +#include +#include +#include +#include +#include + +#if defined(VMS) && defined(__DECC) /* need function prototype */ +# if (__DECC_VER<50790004) /* have an own one */ +char *alloca(unsigned int); +# else +# define alloca __ALLOCA +# endif +#endif + + +struct FAB fab; +struct NAM nam; + +int length_of_fna_buffer; +int fab_stat; +char expanded_name[NAM$C_MAXRSS]; +char fna_buffer[NAM$C_MAXRSS]; +char result_name[NAM$C_MAXRSS]; +char final_name[NAM$C_MAXRSS]; +int max_file_path_size = NAM$C_MAXRSS; +char *arr_ptr[32767]; diff --git a/src/apps/bin/grep-2.5/stamp-h b/src/apps/bin/grep-2.5/stamp-h new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/src/apps/bin/grep-2.5/stamp-h @@ -0,0 +1 @@ +timestamp diff --git a/src/apps/bin/grep-2.5/stamp-h.in b/src/apps/bin/grep-2.5/stamp-h.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/apps/bin/grep-2.5/stamp-h1 b/src/apps/bin/grep-2.5/stamp-h1 new file mode 100644 index 0000000000..9788f70238 --- /dev/null +++ b/src/apps/bin/grep-2.5/stamp-h1 @@ -0,0 +1 @@ +timestamp diff --git a/src/apps/bin/grep-2.5/tests/Makefile b/src/apps/bin/grep-2.5/tests/Makefile new file mode 100644 index 0000000000..9135a1cc5d --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/Makefile @@ -0,0 +1,298 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. + + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include +pkgdatadir = $(datadir)/grep +pkglibdir = $(libdir)/grep +pkgincludedir = $(includedir)/grep +top_builddir = .. + +ACLOCAL = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run aclocal +AUTOCONF = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoconf +AUTOMAKE = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run automake +AUTOHEADER = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run autoheader + +INSTALL = /bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +INSTALL_HEADER = $(INSTALL_DATA) +transform = s,x,x, +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i586-pc-beos +AMTAR = ${SHELL} /boot/home/Development/current/src/apps/bin/grep-2.5/missing --run tar +BUILD_INCLUDED_LIBINTL = yes +CATALOGS = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +CATOBJEXT = .gmo +CC = gcc +CPP = gcc -E +DATADIRNAME = share +DEPDIR = .deps +EXEEXT = +GENCAT = gencat +GETCONF = +GLIBC21 = no +GMOFILES = cs.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo fr.gmo gl.gmo hr.gmo id.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo ru.gmo sl.gmo sv.gmo +GMSGFMT = : +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INSTOBJEXT = .mo +INTLBISON = bison +INTLLIBS = $(top_builddir)/intl/libintl.a +INTLOBJS = $(GETTOBJS) +INTL_LIBTOOL_SUFFIX_PREFIX = +LIBICONV = +MKINSTALLDIRS = ./mkinstalldirs +MSGFMT = : +OBJEXT = o +PACKAGE = grep +POFILES = cs.po de.po el.po eo.po es.po et.po fr.po gl.po hr.po id.po it.po ja.po ko.po nl.po no.po pl.po pt_BR.po ru.po sl.po sv.po +POSUB = po +RANLIB = ranlib +SEP = : +SYMLINK = ln -s +SYMLINKFROM = grep +U = +USE_INCLUDED_LIBINTL = yes +USE_NLS = yes +VERSION = 2.5 +am__include = include +am__quote = +install_sh = /boot/home/Development/current/src/apps/bin/grep-2.5/install-sh + +AWK = gawk + +TESTS = warning.sh khadafy.sh spencer1.sh bre.sh ere.sh \ + status.sh empty.sh options.sh backref.sh file.sh + +EXTRA_DIST = $(TESTS) \ + khadafy.lines khadafy.regexp \ + spencer1.awk spencer1.tests \ + bre.awk ere.awk bre.tests ere.tests + +CLEANFILES = spencer1.script bre.script ere.script khadafy.out patfile +TESTS_ENVIRONMENT = \ + AWK=$(AWK) \ + GREP=$(top_builddir)/src/grep \ + GREP_OPTIONS='' \ + LC_ALL=C + +subdir = tests +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || 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-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + distclean distclean-generic distdir dvi dvi-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + + +# the *.sh when checkout does not have the right permission +# make sure everyting is ok. +dist-hook: + cd $(distdir); for i in $(TESTS); do chmod +x $$i; done +# 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: diff --git a/src/apps/bin/grep-2.5/tests/Makefile.am b/src/apps/bin/grep-2.5/tests/Makefile.am new file mode 100644 index 0000000000..599db6785c --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to create Makefile.in + +AWK=@AWK@ + +TESTS = warning.sh khadafy.sh spencer1.sh bre.sh ere.sh \ + status.sh empty.sh options.sh backref.sh file.sh +EXTRA_DIST = $(TESTS) \ + khadafy.lines khadafy.regexp \ + spencer1.awk spencer1.tests \ + bre.awk ere.awk bre.tests ere.tests +CLEANFILES = spencer1.script bre.script ere.script khadafy.out patfile +TESTS_ENVIRONMENT = \ + AWK=$(AWK) \ + GREP=$(top_builddir)/src/grep \ + GREP_OPTIONS='' \ + LC_ALL=C + +# the *.sh when checkout does not have the right permission +# make sure everyting is ok. +dist-hook: + cd $(distdir); for i in $(TESTS); do chmod +x $$i; done diff --git a/src/apps/bin/grep-2.5/tests/Makefile.in b/src/apps/bin/grep-2.5/tests/Makefile.in new file mode 100644 index 0000000000..c3e3cb33cf --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/Makefile.in @@ -0,0 +1,298 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GETCONF = @GETCONF@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SEP = @SEP@ +SYMLINK = @SYMLINK@ +SYMLINKFROM = @SYMLINKFROM@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AWK = @AWK@ + +TESTS = warning.sh khadafy.sh spencer1.sh bre.sh ere.sh \ + status.sh empty.sh options.sh backref.sh file.sh + +EXTRA_DIST = $(TESTS) \ + khadafy.lines khadafy.regexp \ + spencer1.awk spencer1.tests \ + bre.awk ere.awk bre.tests ere.tests + +CLEANFILES = spencer1.script bre.script ere.script khadafy.out patfile +TESTS_ENVIRONMENT = \ + AWK=$(AWK) \ + GREP=$(top_builddir)/src/grep \ + GREP_OPTIONS='' \ + LC_ALL=C + +subdir = tests +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + fi + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || 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-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + distclean distclean-generic distdir dvi dvi-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + + +# the *.sh when checkout does not have the right permission +# make sure everyting is ok. +dist-hook: + cd $(distdir); for i in $(TESTS); do chmod +x $$i; done +# 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: diff --git a/src/apps/bin/grep-2.5/tests/backref.sh b/src/apps/bin/grep-2.5/tests/backref.sh new file mode 100755 index 0000000000..83f6dcc940 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/backref.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# Test that backrefs are local to regex. +# +# + +: ${srcdir=.} + +failures=0 + +# checking for a palindrome +echo "radar" | ${GREP} -e '\(.\)\(.\).\2\1' > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "backref: palindrome, test \#1 failed" + failures=1 +fi + +# hit hard with the `Bond' tests +echo "civic" | ${GREP} -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "Options: Bond, test \#2 failed" + failures=1 +fi + +# backref are local should be error +echo "123" | ${GREP} -e 'a\(.\)' -e 'b\1' > /dev/null 2>&1 +if test $? -ne 2 ; then + echo "Options: Backref not local, test \#3 failed" + failures=1 +fi + +# Pattern should faile +echo "123" | ${GREP} -e '[' -e ']' > /dev/null 2>&1 +if test $? -ne 2 ; then + echo "Options: Compiled not local, test \#3 failed" + failures=1 +fi + +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/bre.awk b/src/apps/bin/grep-2.5/tests/bre.awk new file mode 100644 index 0000000000..16a58147a3 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/bre.awk @@ -0,0 +1,27 @@ +BEGIN { + FS="@"; + n = 0; + printf ("# Generated Spencer BRE Test\n"); + printf ("failures=0\n"); +} + +$0 ~ /^#/ { next; } + +NF == 3 { +# printf ("status=`echo '%s' | { ${GREP} -e '%s' > /dev/null 2>&1; echo $?; cat >/dev/null; }`\n",$3, $2); + printf ("status=`echo '%s' | { ${GREP} -e '%s' > /dev/null 2>&1; echo $? ; }`\n",$3, $2); + printf ("if test $status -ne %s ; then\n", $1); + printf ("\techo Spencer bre test \\#%d failed\n", ++n); + printf ("\tfailures=1\n"); + printf ("fi\n"); +} + +NF == 4 { +#don't alarm users +# printf ("echo '%s' | ${GREP} -e '%s' > /dev/null 2>&1\n",$3, $2); +# printf ("if test $? -ne %s ; then\n", $1); +# printf ("\techo Expected non conformance \\#%d ... continuing\n", ++n); +# printf ("fi\n"); +} + +END { printf ("exit $failures\n"); } diff --git a/src/apps/bin/grep-2.5/tests/bre.script b/src/apps/bin/grep-2.5/tests/bre.script new file mode 100644 index 0000000000..dd418f2d82 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/bre.script @@ -0,0 +1,263 @@ +# Generated Spencer BRE Test +failures=0 +status=`echo 'abc' | { ${GREP} -e 'a\(b\)c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#1 failed + failures=1 +fi +status=`echo 'a(' | { ${GREP} -e 'a(' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#2 failed + failures=1 +fi +status=`echo 'EPAREN' | { ${GREP} -e 'a\(' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#3 failed + failures=1 +fi +status=`echo 'EPAREN' | { ${GREP} -e 'a\(b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#4 failed + failures=1 +fi +status=`echo 'a(b' | { ${GREP} -e 'a(b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#5 failed + failures=1 +fi +status=`echo 'a)' | { ${GREP} -e 'a)' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#6 failed + failures=1 +fi +status=`echo 'EPAREN' | { ${GREP} -e 'a\)' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#7 failed + failures=1 +fi +status=`echo 'EPAREN' | { ${GREP} -e '\)' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#8 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -e 'a\(\)b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#9 failed + failures=1 +fi +status=`echo 'a$b' | { ${GREP} -e 'a$b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#10 failed + failures=1 +fi +status=`echo 'b' | { ${GREP} -e 'a*\(^b$\)c*' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#11 failed + failures=1 +fi +status=`echo '|' | { ${GREP} -e '|' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#12 failed + failures=1 +fi +status=`echo '*' | { ${GREP} -e '*' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#13 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -e '\(\)' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#14 failed + failures=1 +fi +status=`echo '*' | { ${GREP} -e '^*' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#15 failed + failures=1 +fi +status=`echo '{' | { ${GREP} -e '\{' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#16 failed + failures=1 +fi +status=`echo 'abbcbd' | { ${GREP} -e 'a\(b*\)c\1d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 1 ; then + echo Spencer bre test \#17 failed + failures=1 +fi +status=`echo 'abbcbbbd' | { ${GREP} -e 'a\(b*\)c\1d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 1 ; then + echo Spencer bre test \#18 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -e '^\(.\)\1' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 1 ; then + echo Spencer bre test \#19 failed + failures=1 +fi +status=`echo 'abbccd' | { ${GREP} -e 'a\(\([bc]\)\2\)*d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#20 failed + failures=1 +fi +status=`echo 'abbcbd' | { ${GREP} -e 'a\(\([bc]\)\2\)*d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 1 ; then + echo Spencer bre test \#21 failed + failures=1 +fi +status=`echo 'abbbd' | { ${GREP} -e 'a\(\(b\)*\2\)*d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#22 failed + failures=1 +fi +status=`echo 'aabcd' | { ${GREP} -e '\(a\)\1bcd' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#23 failed + failures=1 +fi +status=`echo 'aabcd' | { ${GREP} -e '\(a\)\1bc*d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#24 failed + failures=1 +fi +status=`echo 'aabd' | { ${GREP} -e '\(a\)\1bc*d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#25 failed + failures=1 +fi +status=`echo 'aabcccd' | { ${GREP} -e '\(a\)\1bc*d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#26 failed + failures=1 +fi +status=`echo 'aabcccd' | { ${GREP} -e '^\(a\)\1b\(c\)*cd$' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#27 failed + failures=1 +fi +status=`echo 'a*b' | { ${GREP} -e 'a\(*\)b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#28 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -e 'a\(**\)b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#29 failed + failures=1 +fi +status=`echo '*a' | { ${GREP} -e '*a' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#30 failed + failures=1 +fi +status=`echo 'a' | { ${GREP} -e '**a' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#31 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -e 'a\{1\}b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#32 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -e 'a\{1,\}b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#33 failed + failures=1 +fi +status=`echo 'aab' | { ${GREP} -e 'a\{1,2\}b' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#34 failed + failures=1 +fi +status=`echo 'EBRACE' | { ${GREP} -e 'a\{1' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#35 failed + failures=1 +fi +status=`echo 'EBRACE' | { ${GREP} -e 'a\{1a' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#36 failed + failures=1 +fi +status=`echo 'BADBR' | { ${GREP} -e 'a\{1a\}' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#37 failed + failures=1 +fi +status=`echo 'BADBR' | { ${GREP} -e 'a\{,2\}' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#38 failed + failures=1 +fi +status=`echo 'BADBR' | { ${GREP} -e 'a\{,\}' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#39 failed + failures=1 +fi +status=`echo 'BADBR' | { ${GREP} -e 'a\{1,x\}' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#40 failed + failures=1 +fi +status=`echo 'EBRACE' | { ${GREP} -e 'a\{1,x' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#41 failed + failures=1 +fi +status=`echo 'BADBR' | { ${GREP} -e 'a\{32768\}' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#42 failed + failures=1 +fi +status=`echo 'BADBR' | { ${GREP} -e 'a\{1,0\}' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 2 ; then + echo Spencer bre test \#43 failed + failures=1 +fi +status=`echo 'abcac' | { ${GREP} -e 'ab\{0,0\}c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#44 failed + failures=1 +fi +status=`echo 'abcac' | { ${GREP} -e 'ab\{0,1\}c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#45 failed + failures=1 +fi +status=`echo 'abbcac' | { ${GREP} -e 'ab\{0,3\}c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#46 failed + failures=1 +fi +status=`echo 'acabc' | { ${GREP} -e 'ab\{1,1\}c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#47 failed + failures=1 +fi +status=`echo 'acabc' | { ${GREP} -e 'ab\{1,3\}c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#48 failed + failures=1 +fi +status=`echo 'abcabbc' | { ${GREP} -e 'ab\{2,2\}c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#49 failed + failures=1 +fi +status=`echo 'abcabbc' | { ${GREP} -e 'ab\{2,4\}c' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#50 failed + failures=1 +fi +status=`echo 'acd' | { ${GREP} -e 'a\(b\)?c\1d' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 1 ; then + echo Spencer bre test \#51 failed + failures=1 +fi +status=`echo '-5' | { ${GREP} -e '-\{0,1\}[0-9]*$' > /dev/null 2>&1; echo $? ; }` +if test $status -ne 0 ; then + echo Spencer bre test \#52 failed + failures=1 +fi +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/bre.sh b/src/apps/bin/grep-2.5/tests/bre.sh new file mode 100644 index 0000000000..e7ccf0a037 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/bre.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Regression test for GNU grep. + +: ${srcdir=.} + +failures=0 + +# . . . and the following by Henry Spencer. + +${AWK-awk} -f $srcdir/bre.awk $srcdir/bre.tests > bre.script + +sh bre.script && exit $failures +exit 1 diff --git a/src/apps/bin/grep-2.5/tests/bre.tests b/src/apps/bin/grep-2.5/tests/bre.tests new file mode 100644 index 0000000000..1ed159dad7 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/bre.tests @@ -0,0 +1,62 @@ +0@a\(b\)c@abc +0@a(@a( +2@a\(@EPAREN +2@a\(b@EPAREN +0@a(b@a(b +0@a)@a) +2@a\)@EPAREN +2@\)@EPAREN +0@a\(\)b@ab +0@a^b@a^b@TO CORRECT +0@a$b@a$b +0@\($\)\(^\)@@ +0@a*\(^b$\)c*@b +0@|@| +0@*@* +0@\(\)@abc +2@\(\{1\}a\)@BADRPT@TO CORRECT +0@^*@* +2@^\{1\}@BADRPT@TO CORRECT +0@\{@{ +1@a\(b*\)c\1d@abbcbd +1@a\(b*\)c\1d@abbcbbbd +1@^\(.\)\1@abc +0@a\(\([bc]\)\2\)*d@abbccd +1@a\(\([bc]\)\2\)*d@abbcbd +0@a\(\(b\)*\2\)*d@abbbd +0@\(a\)\1bcd@aabcd +0@\(a\)\1bc*d@aabcd +0@\(a\)\1bc*d@aabd +0@\(a\)\1bc*d@aabcccd +0@\(a\)\1bc*[ce]d@aabcccd@TO CORRECT +0@^\(a\)\1b\(c\)*cd$@aabcccd +0@a\(*\)b@a*b +0@a\(**\)b@ab +2@a\(***\)b@BADRPT@TO CORRECT +0@*a@*a +0@**a@a +2@***a@BADRPT@TO CORRECT +0@a\{1\}b@ab +0@a\{1,\}b@ab +0@a\{1,2\}b@aab +2@a\{1@EBRACE +2@a\{1a@EBRACE +2@a\{1a\}@BADBR +2@a\{,2\}@BADBR +2@a\{,\}@BADBR +2@a\{1,x\}@BADBR +2@a\{1,x@EBRACE +2@a\{32768\}@BADBR +2@a\{1,0\}@BADBR +0@ab\{0,0\}c@abcac +0@ab\{0,1\}c@abcac +0@ab\{0,3\}c@abbcac +0@ab\{1,1\}c@acabc +0@ab\{1,3\}c@acabc +0@ab\{2,2\}c@abcabbc +0@ab\{2,4\}c@abcabbc +2@a\{1\}\{1\}@BADRPT@TO CORRECT +2@a*\{1\}@BADRPT@TO CORRECT +2@a\{1\}*@BADRPT@TO CORRECT +1@a\(b\)?c\1d@acd +0@-\{0,1\}[0-9]*$@-5 diff --git a/src/apps/bin/grep-2.5/tests/empty.sh b/src/apps/bin/grep-2.5/tests/empty.sh new file mode 100644 index 0000000000..d4225fecd0 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/empty.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# test that the empty file means no pattern +# and an empty pattern means match all. + +: ${srcdir=.} + +failures=0 + +for options in '-E' '-E -w' '-F -x' '-G -w -x'; do + + # should return 0 found a match + echo "" | ${GREP} $options -e '' > /dev/null 2>&1 + if test $? -ne 0 ; then + echo "Status: Wrong status code, test \#1 failed ($options)" + failures=1 + fi + + # should return 1 found no match + echo "abcd" | ${GREP} $options -f /dev/null > /dev/null 2>&1 + if test $? -ne 1 ; then + echo "Status: Wrong status code, test \#2 failed ($options)" + failures=1 + fi + + # should return 0 found a match + echo "abcd" | ${GREP} $options -f /dev/null -e "abcd" > /dev/null 2>&1 + if test $? -ne 0 ; then + echo "Status: Wrong status code, test \#3 failed ($options)" + failures=1 + fi +done + +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/ere.awk b/src/apps/bin/grep-2.5/tests/ere.awk new file mode 100644 index 0000000000..234d219e84 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/ere.awk @@ -0,0 +1,32 @@ +BEGIN { + FS="@"; + n = 0; + printf ("# Generated Spencer ERE Test\n"); + printf ("failures=0\n"); +} + +$0 ~ /^#/ { next; } + +NF == 3 { +# printf ("status=`echo '%s' | { ${GREP} -E -e '%s' > /dev/null 2>&1; echo $?; cat >/dev/null; }`\n",$3, $2); + printf ("status=`echo '%s' | { ${GREP} -E -e '%s' > /dev/null 2>&1; echo $?; }`\n",$3, $2); + printf ("if test $status -ne %s ; then\n", $1); + printf ("\techo Spencer ere test \\#%d failed\n", ++n); + printf ("\tfailures=1\n"); + printf ("fi\n"); +} + +NF == 4 { +# don't alarm the user for now +# printf ("echo '%s'|${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2); +# printf ("if test $? -ne %s ; then\n", $1); +# printf ("\techo Expected non conformance \\#%d ... continuing\n", ++n); +# printf ("fi\n"); +} + +NF == 5 { +# don't alarm the user for now + next; +} + +END { printf ("exit $failures\n"); } diff --git a/src/apps/bin/grep-2.5/tests/ere.script b/src/apps/bin/grep-2.5/tests/ere.script new file mode 100644 index 0000000000..6b5fc846f0 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/ere.script @@ -0,0 +1,618 @@ +# Generated Spencer ERE Test +failures=0 +status=`echo 'a' | { ${GREP} -E -e 'a' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#1 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'abc' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#2 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'abc|de' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#3 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a|b|c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#4 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a(b)c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#5 failed + failures=1 +fi +status=`echo 'EPAREN' | { ${GREP} -E -e 'a(' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#6 failed + failures=1 +fi +status=`echo 'a(' | { ${GREP} -E -e 'a\(' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#7 failed + failures=1 +fi +status=`echo 'EPAREN' | { ${GREP} -E -e 'a(b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#8 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -E -e 'a()b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#9 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e '^abc$' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#10 failed + failures=1 +fi +status=`echo 'a^b' | { ${GREP} -E -e 'a^b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 1 ; then + echo Spencer ere test \#11 failed + failures=1 +fi +status=`echo 'a$b' | { ${GREP} -E -e 'a$b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 1 ; then + echo Spencer ere test \#12 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e '^' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#13 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e '$' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#14 failed + failures=1 +fi +status=`echo 'b' | { ${GREP} -E -e 'a*(^b$)c*' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#15 failed + failures=1 +fi +status=`echo 'PASS' | { ${GREP} -E -e '&C' > /dev/null 2>&1; echo $?; }` +if test $status -ne 1 ; then + echo Spencer ere test \#16 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e '()' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#17 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a.c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#18 failed + failures=1 +fi +status=`echo 'abd' | { ${GREP} -E -e 'a[bc]d' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#19 failed + failures=1 +fi +status=`echo 'a*c' | { ${GREP} -E -e 'a\*c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#20 failed + failures=1 +fi +status=`echo 'a[b' | { ${GREP} -E -e 'a\[b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#21 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#22 failed + failures=1 +fi +status=`echo 'a' | { ${GREP} -E -e 'a$' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#23 failed + failures=1 +fi +status=`echo 'a$' | { ${GREP} -E -e 'a$' > /dev/null 2>&1; echo $?; }` +if test $status -ne 1 ; then + echo Spencer ere test \#24 failed + failures=1 +fi +status=`echo 'a' | { ${GREP} -E -e 'a\\$' > /dev/null 2>&1; echo $?; }` +if test $status -ne 1 ; then + echo Spencer ere test \#25 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'ab*c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#26 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'ab+c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#27 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'ab?c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#28 failed + failures=1 +fi +status=`echo '{1' | { ${GREP} -E -e '{1' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#29 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -E -e 'a{1}b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#30 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -E -e 'a{1,}b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#31 failed + failures=1 +fi +status=`echo 'aab' | { ${GREP} -E -e 'a{1,2}b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#32 failed + failures=1 +fi +status=`echo 'a{1' | { ${GREP} -E -e 'a{1' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#33 failed + failures=1 +fi +status=`echo 'aa' | { ${GREP} -E -e 'a{1a' > /dev/null 2>&1; echo $?; }` +if test $status -ne 1 ; then + echo Spencer ere test \#34 failed + failures=1 +fi +status=`echo 'a{1a}' | { ${GREP} -E -e 'a{1a}' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#35 failed + failures=1 +fi +status=`echo 'a{,2}' | { ${GREP} -E -e 'a{,2}' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#36 failed + failures=1 +fi +status=`echo 'a{,}' | { ${GREP} -E -e 'a{,}' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#37 failed + failures=1 +fi +status=`echo 'a{1,,,}' | { ${GREP} -E -e 'a{1,*}' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#38 failed + failures=1 +fi +status=`echo 'abcac' | { ${GREP} -E -e 'ab{0,0}c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#39 failed + failures=1 +fi +status=`echo 'abcac' | { ${GREP} -E -e 'ab{0,1}c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#40 failed + failures=1 +fi +status=`echo 'abbcac' | { ${GREP} -E -e 'ab{0,3}c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#41 failed + failures=1 +fi +status=`echo 'acabc' | { ${GREP} -E -e 'ab{1,1}c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#42 failed + failures=1 +fi +status=`echo 'acabc' | { ${GREP} -E -e 'ab{1,3}c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#43 failed + failures=1 +fi +status=`echo 'abcabbc' | { ${GREP} -E -e 'ab{2,2}c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#44 failed + failures=1 +fi +status=`echo 'abcabbc' | { ${GREP} -E -e 'ab{2,4}c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#45 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a[b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#46 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a[ab]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#47 failed + failures=1 +fi +status=`echo 'adc' | { ${GREP} -E -e 'a[^ab]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#48 failed + failures=1 +fi +status=`echo 'a]c' | { ${GREP} -E -e 'a[]b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#49 failed + failures=1 +fi +status=`echo 'a[c' | { ${GREP} -E -e 'a[[b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#50 failed + failures=1 +fi +status=`echo 'a-c' | { ${GREP} -E -e 'a[-b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#51 failed + failures=1 +fi +status=`echo 'adc' | { ${GREP} -E -e 'a[^]b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#52 failed + failures=1 +fi +status=`echo 'adc' | { ${GREP} -E -e 'a[^-b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#53 failed + failures=1 +fi +status=`echo 'a-c' | { ${GREP} -E -e 'a[b-]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#54 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#55 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#56 failed + failures=1 +fi +status=`echo 'a2c' | { ${GREP} -E -e 'a[1-3]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#57 failed + failures=1 +fi +status=`echo 'ERANGE' | { ${GREP} -E -e 'a[1-' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#58 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[.' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#59 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[.x' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#60 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[.x.' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#61 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a[[:alpha:]]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#62 failed + failures=1 +fi +status=`echo 'ECTYPE' | { ${GREP} -E -e 'a[[:notdef:]]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#63 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[:' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#64 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[:alpha' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#65 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[:alpha:]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#66 failed + failures=1 +fi +status=`echo 'ECTYPE' | { ${GREP} -E -e 'a[[:alpha,:]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#67 failed + failures=1 +fi +status=`echo 'ECTYPE' | { ${GREP} -E -e 'a[[:]:]]b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#68 failed + failures=1 +fi +status=`echo 'ECTYPE' | { ${GREP} -E -e 'a[[:-:]]b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#69 failed + failures=1 +fi +status=`echo 'ECTYPE' | { ${GREP} -E -e 'a[[:alph:]]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#70 failed + failures=1 +fi +status=`echo 'ECTYPE' | { ${GREP} -E -e 'a[[:alphabet:]]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#71 failed + failures=1 +fi +status=`echo 'a019b' | { ${GREP} -E -e '[[:digit:]]+' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#72 failed + failures=1 +fi +status=`echo 'AabC' | { ${GREP} -E -e '[[:lower:]]+' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#73 failed + failures=1 +fi +status=`echo 'aBCd' | { ${GREP} -E -e '[[:upper:]]+' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#74 failed + failures=1 +fi +status=`echo 'p0f3Cq' | { ${GREP} -E -e '[[:xdigit:]]+' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#75 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[=' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#76 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[=b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#77 failed + failures=1 +fi +status=`echo 'EBRACK' | { ${GREP} -E -e 'a[[=b=' > /dev/null 2>&1; echo $?; }` +if test $status -ne 2 ; then + echo Spencer ere test \#78 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a(((b)))c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#79 failed + failures=1 +fi +status=`echo 'abd' | { ${GREP} -E -e 'a(b|(c))d' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#80 failed + failures=1 +fi +status=`echo 'abbd' | { ${GREP} -E -e 'a(b*|c)d' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#81 failed + failures=1 +fi +status=`echo 'aaaaabaaaabaaaabaaaab' | { ${GREP} -E -e 'a[ab]{20}' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#82 failed + failures=1 +fi +status=`echo 'aaaaabaaaabaaaabaaaab' | { ${GREP} -E -e 'a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#83 failed + failures=1 +fi +status=`echo 'aaaaabaaaabaaaabaaaabweeknights' | { ${GREP} -E -e 'a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#84 failed + failures=1 +fi +status=`echo 'a12345678901234567890123456789b' | { ${GREP} -E -e '12345678901234567890123456789' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#85 failed + failures=1 +fi +status=`echo 'a123456789012345678901234567890b' | { ${GREP} -E -e '123456789012345678901234567890' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#86 failed + failures=1 +fi +status=`echo 'a1234567890123456789012345678901b' | { ${GREP} -E -e '1234567890123456789012345678901' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#87 failed + failures=1 +fi +status=`echo 'a12345678901234567890123456789012b' | { ${GREP} -E -e '12345678901234567890123456789012' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#88 failed + failures=1 +fi +status=`echo 'a123456789012345678901234567890123b' | { ${GREP} -E -e '123456789012345678901234567890123' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#89 failed + failures=1 +fi +status=`echo 'a1234567890123456789012345678901234567890123456789012345678901234567890b' | { ${GREP} -E -e '1234567890123456789012345678901234567890123456789012345678901234567890' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#90 failed + failures=1 +fi +status=`echo 'xacegikmoq' | { ${GREP} -E -e '[ab][cd][ef][gh][ij][kl][mn]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#91 failed + failures=1 +fi +status=`echo 'xacegikmoq' | { ${GREP} -E -e '[ab][cd][ef][gh][ij][kl][mn][op]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#92 failed + failures=1 +fi +status=`echo 'xacegikmoqy' | { ${GREP} -E -e '[ab][cd][ef][gh][ij][kl][mn][op][qr]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#93 failed + failures=1 +fi +status=`echo 'xacegikmoqy' | { ${GREP} -E -e '[ab][cd][ef][gh][ij][kl][mn][op][q]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#94 failed + failures=1 +fi +status=`echo 'xabcy' | { ${GREP} -E -e 'abc' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#95 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e 'a[^b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 1 ; then + echo Spencer ere test \#96 failed + failures=1 +fi +status=`echo 'adc' | { ${GREP} -E -e 'a[^b]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#97 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e '[a]b[c]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#98 failed + failures=1 +fi +status=`echo 'aba' | { ${GREP} -E -e '[a]b[a]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#99 failed + failures=1 +fi +status=`echo 'abc' | { ${GREP} -E -e '[abc]b[abc]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#100 failed + failures=1 +fi +status=`echo 'abd' | { ${GREP} -E -e '[abc]b[abd]' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#101 failed + failures=1 +fi +status=`echo 'accd' | { ${GREP} -E -e 'a(b?c)+d' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#102 failed + failures=1 +fi +status=`echo 'weeknights' | { ${GREP} -E -e '(wee|week)(knights|night)' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#103 failed + failures=1 +fi +status=`echo 'weeknights' | { ${GREP} -E -e '(we|wee|week|frob)(knights|night|day)' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#104 failed + failures=1 +fi +status=`echo 'xyzaaabcaababdacd' | { ${GREP} -E -e 'a[bc]d' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#105 failed + failures=1 +fi +status=`echo 'aaabc' | { ${GREP} -E -e 'a[ab]c' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#106 failed + failures=1 +fi +status=`echo 'b' | { ${GREP} -E -e 'a*' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#107 failed + failures=1 +fi +status=`echo '/*x*/' | { ${GREP} -E -e '/\*.*\*/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#108 failed + failures=1 +fi +status=`echo '/*x*/y/*z*/' | { ${GREP} -E -e '/\*.*\*/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#109 failed + failures=1 +fi +status=`echo '/*x*/' | { ${GREP} -E -e '/\*([^*]|\*[^/])*\*/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#110 failed + failures=1 +fi +status=`echo '/*x*/y/*z*/' | { ${GREP} -E -e '/\*([^*]|\*[^/])*\*/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#111 failed + failures=1 +fi +status=`echo '/*x**/y/*z*/' | { ${GREP} -E -e '/\*([^*]|\*[^/])*\*/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#112 failed + failures=1 +fi +status=`echo '/*x*/' | { ${GREP} -E -e '/\*([^*]|\*+[^*/])*\*+/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#113 failed + failures=1 +fi +status=`echo '/*x*/y/*z*/' | { ${GREP} -E -e '/\*([^*]|\*+[^*/])*\*+/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#114 failed + failures=1 +fi +status=`echo '/*x**/y/*z*/' | { ${GREP} -E -e '/\*([^*]|\*+[^*/])*\*+/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#115 failed + failures=1 +fi +status=`echo '/*x****/y/*z*/' | { ${GREP} -E -e '/\*([^*]|\*+[^*/])*\*+/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#116 failed + failures=1 +fi +status=`echo '/*x**x*/y/*z*/' | { ${GREP} -E -e '/\*([^*]|\*+[^*/])*\*+/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#117 failed + failures=1 +fi +status=`echo '/*x***x/y/*z*/' | { ${GREP} -E -e '/\*([^*]|\*+[^*/])*\*+/' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#118 failed + failures=1 +fi +status=`echo 'A1' | { ${GREP} -E -e '(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A])' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#119 failed + failures=1 +fi +status=`echo 'abcdefghijklmnop' | { ${GREP} -E -e 'abcdefghijklmnop' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#120 failed + failures=1 +fi +status=`echo 'abcdefghijklmnopqrstuv' | { ${GREP} -E -e 'abcdefghijklmnopqrstuv' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#121 failed + failures=1 +fi +status=`echo 'CC11' | { ${GREP} -E -e 'CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#122 failed + failures=1 +fi +status=`echo 'ab' | { ${GREP} -E -e 'a?b' > /dev/null 2>&1; echo $?; }` +if test $status -ne 0 ; then + echo Spencer ere test \#123 failed + failures=1 +fi +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/ere.sh b/src/apps/bin/grep-2.5/tests/ere.sh new file mode 100644 index 0000000000..d57e2fae5a --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/ere.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Regression test for GNU grep. + +: ${srcdir=.} + +failures=0 + +# . . . and the following by Henry Spencer. + +${AWK-awk} -f $srcdir/ere.awk $srcdir/ere.tests > ere.script + +sh ere.script && exit $failures +exit 1 diff --git a/src/apps/bin/grep-2.5/tests/ere.tests b/src/apps/bin/grep-2.5/tests/ere.tests new file mode 100644 index 0000000000..20ef2b1b2b --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/ere.tests @@ -0,0 +1,215 @@ +0@a@a +0@abc@abc +0@abc|de@abc +0@a|b|c@abc +0@a(b)c@abc +2@a(@EPAREN +0@a\(@a( +2@a(b@EPAREN +0@a)@a)@POSIX BOTCH +0@)@)@POSIX BOTCH +0@a()b@ab +0@^abc$@abc +1@a^b@a^b +1@a$b@a$b +0@^@abc +0@$@abc +0@^$@@ +0@$^@@ +0@^^@@ +0@$$@@ +0@a*(^b$)c*@b +2@|@EMPTY@NO ALTERNATION +2@*@BADRPT@TO CORRECT +2@+@BADRPT@TO CORRECT +2@?@BADRPT@TO CORRECT +1@&C@PASS +0@()@abc +2@a||b@EMPTY@NO ALTERNATION +2@|ab@EMPTY@NO ALTERNATION +2@ab|@EMPTY@NO ALTERNATION +2@(|a)b@EMPTY@NO ALTERNATION +2@(a|)b@EMPTY@NO ALTERNATION +2@(*a)@BADRPT@TO CORRECT +2@(+a)@BADRPT@TO CORRECT +2@(?a)@BADRPT@TO CORRECT +2@({1}a)@BADRPT@TO CORRECT +2@(a|*b)@BADRPT@NO ALTERNATION +2@(a|+b)@BADRPT@NO ALTERNATION +2@(a|?b)@BADRPT@NO ALTERNATION +2@(a|{1}b)@BADRPT@NO ALTERNATION +2@^*@BADRPT@TO CORRECT +2@^+@BADRPT@TO CORRECT +2@^?@BADRPT@TO CORRECT +2@^{1}@BADRPT@TO CORRECT +0@a.c@abc +0@a[bc]d@abd +0@a\*c@a*c +0@a\\b@a\b@TO CORRECT +0@a\\\*b@a\*b@SHELL TROUBLE +0@a\bc@abc@TO CORRECT +2@a\@EESCAPE@SHELL TROUBLE +0@a\\bc@a\bc@TO CORRECT +0@a\[b@a[b +2@a[b@EBRACK +0@a$@a +1@a$@a$ +1@a\$@a@SHELL TROUBLE +0@a\$@a$@SHELL TROUBLE +1@a\\$@a +1@a\\$@a$@SHELL TROUBLE +1@a\\$@a\$@SHELL TROUBLE +0@a\\$@a\@SHEL TROUBLE +0@ab*c@abc +0@ab+c@abc +0@ab?c@abc +0@{@{@TO CORRECT +0@{abc@{abc@TO CORRECT +0@{1@{1 +2@{1}@BADRPT@TO CORRECT +0@a{b@a{b@TO CORRECT +0@a{1}b@ab +0@a{1,}b@ab +0@a{1,2}b@aab +0@a{1@a{1 +1@a{1a@aa +0@a{1a}@a{1a} +0@a{,2}@a{,2} +0@a{,}@a{,} +0@a{1,*}@a{1,,,} +2@a{1,x@EBRACE@TO CORRECT +2@a{300}@BADBR@TO CORRECT +2@a{1,0}@BADBR@TO CORRECT +0@ab{0,0}c@abcac +0@ab{0,1}c@abcac +0@ab{0,3}c@abbcac +0@ab{1,1}c@acabc +0@ab{1,3}c@acabc +0@ab{2,2}c@abcabbc +0@ab{2,4}c@abcabbc +2@a**@BADRPT@TO CORRECT +2@a++@BADRPT@TO CORRECT +2@a??@BADRPT@TO CORRECT +2@a*+@BADRPT@TO CORRECT +2@a*?@BADRPT@TO CORRECT +2@a+*@BADRPT@TO CORRECT +2@a+?@BADRPT@TO CORRECT +2@a?*@BADRPT@TO CORRECT +2@a?+@BADRPT@TO CORRECT +2@a{1}{1}@BADRPT@TO CORRECT +2@a*{1}@BADRPT@TO CORRECT +2@a+{1}@BADRPT@TO CORRECT +2@a?{1}@BADRPT@TO CORRECT +2@a{1}*@BADRPT@TO CORRECT +2@a{1}+@BADRPT@TO CORRECT +2@a{1}?@BADRPT@TO CORRECT +0@a*{b}@a{b}@TO CORRECT +0@a[b]c@abc +0@a[ab]c@abc +0@a[^ab]c@adc +0@a[]b]c@a]c +0@a[[b]c@a[c +0@a[-b]c@a-c +0@a[^]b]c@adc +0@a[^-b]c@adc +0@a[b-]c@a-c +2@a[b@EBRACK +2@a[]@EBRACK +0@a[1-3]c@a2c +2@a[3-1]c@ERANGE@TO CORRECT +2@a[1-3-5]c@ERANGE@TO CORRECT +0@a[[.-.]--]c@a-c@TO CORRECT +2@a[1-@ERANGE +2@a[[.@EBRACK +2@a[[.x@EBRACK +2@a[[.x.@EBRACK +2@a[[.x.]@EBRACK@TO CORRECT +0@a[[.x.]]@ax@TO CORRECT +2@a[[.x,.]]@ECOLLATE@TO CORRECT +0@a[[.one.]]b@a1b@TO CORRECT +2@a[[.notdef.]]b@ECOLLATE@TO CORRECT +0@a[[.].]]b@a]b@TO CORRECT +0@a[[:alpha:]]c@abc +2@a[[:notdef:]]c@ECTYPE +2@a[[:@EBRACK +2@a[[:alpha@EBRACK +2@a[[:alpha:]@EBRACK +2@a[[:alpha,:]@ECTYPE +2@a[[:]:]]b@ECTYPE +2@a[[:-:]]b@ECTYPE +2@a[[:alph:]]@ECTYPE +2@a[[:alphabet:]]@ECTYPE +0@[[:digit:]]+@a019b +0@[[:lower:]]+@AabC +0@[[:upper:]]+@aBCd +0@[[:xdigit:]]+@p0f3Cq +0@a[[=b=]]c@abc@TO CORRECT +2@a[[=@EBRACK +2@a[[=b@EBRACK +2@a[[=b=@EBRACK +2@a[[=b=]@EBRACK@TO CORRECT +2@a[[=b,=]]@ECOLLATE@TO CORRECT +0@a[[=one=]]b@a1b@TO CORRECT +0@a(((b)))c@abc +0@a(b|(c))d@abd +0@a(b*|c)d@abbd +0@a[ab]{20}@aaaaabaaaabaaaabaaaab +0@a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]@aaaaabaaaabaaaabaaaab +0@a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)@aaaaabaaaabaaaabaaaabweeknights +0@12345678901234567890123456789@a12345678901234567890123456789b +0@123456789012345678901234567890@a123456789012345678901234567890b +0@1234567890123456789012345678901@a1234567890123456789012345678901b +0@12345678901234567890123456789012@a12345678901234567890123456789012b +0@123456789012345678901234567890123@a123456789012345678901234567890123b +0@1234567890123456789012345678901234567890123456789012345678901234567890@a1234567890123456789012345678901234567890123456789012345678901234567890b +0@[ab][cd][ef][gh][ij][kl][mn]@xacegikmoq +0@[ab][cd][ef][gh][ij][kl][mn][op]@xacegikmoq +0@[ab][cd][ef][gh][ij][kl][mn][op][qr]@xacegikmoqy +0@[ab][cd][ef][gh][ij][kl][mn][op][q]@xacegikmoqy +0@abc@xabcy +0@aBc@Abc@TO CORRECT +0@a[Bc]*d@abBCcd@TO CORRECT +0@0[[:upper:]]1@0a1@TO CORRECT +0@0[[:lower:]]1@0A1@TO CORRECT +1@a[^b]c@abc +1@a[^b]c@aBc@TO CORRECT +0@a[^b]c@adc +0@[a]b[c]@abc +0@[a]b[a]@aba +0@[abc]b[abc]@abc +0@[abc]b[abd]@abd +0@a(b?c)+d@accd +0@(wee|week)(knights|night)@weeknights +0@(we|wee|week|frob)(knights|night|day)@weeknights +0@a[bc]d@xyzaaabcaababdacd +0@a[ab]c@aaabc +0@a*@b +0@/\*.*\*/@/*x*/ +0@/\*.*\*/@/*x*/y/*z*/ +0@/\*([^*]|\*[^/])*\*/@/*x*/ +0@/\*([^*]|\*[^/])*\*/@/*x*/y/*z*/ +0@/\*([^*]|\*[^/])*\*/@/*x**/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x*/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x**/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x****/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x**x*/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x***x/y/*z*/ +0@aZb@a@TO CORRECT +0@[[:<:]]a@a@TO CORRECT +1@[[:<:]]a@ba@TO CORRECT +0@[[:<:]]a@-a@TO CORRECT +0@a[[:>:]]@a@TO CORRECT +1@a[[:>:]]@ab@TO CORRECT +0@a[[:>:]]@a-@TO CORRECT +0@[[:<:]]a.c[[:>:]]@axcd-dayc-dazce-abc@TO CORRECT +0@[[:<:]]a.c[[:>:]]@axcd-dayc-dazce-abc-q@TO CORRECT +0@[[:<:]]a.c[[:>:]]@axc-dayc-dazce-abc@TO CORRECT +0@[[:<:]]b.c[[:>:]]@a_bxc-byc_d-bzc-q@TO CORRECT +0@[[:<:]].x..[[:>:]]@y_xa_-_xb_y-_xc_-axdc@TO CORRECT +1@[[:<:]]a_b[[:>:]]@x_a_b@TO CORRECT +0@(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A])@A1 +0@abcdefghijklmnop@abcdefghijklmnop +0@abcdefghijklmnopqrstuv@abcdefghijklmnopqrstuv +0@CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a@CC11 +0@a?b@ab diff --git a/src/apps/bin/grep-2.5/tests/file.sh b/src/apps/bin/grep-2.5/tests/file.sh new file mode 100755 index 0000000000..3db95bed68 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/file.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# Test for POSIX.2 options for grep +# +# grep -E -f pattern_file file +# grep -F -f pattern_file file +# grep -G -f pattern_file file +# + +: ${srcdir=.} + +failures=0 + +cat <patfile +radar +MILES +GNU +EOF + +# match +echo "miles" | ${GREP} -i -E -f patfile > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "File_pattern: Wrong status code, test \#1 failed" + failures=1 +fi + +# match +echo "GNU" | ${GREP} -G -f patfile > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "File_pattern: Wrong status code, test \#2 failed" + failures=1 +fi + +# checking for no match +echo "ridar" | ${GREP} -F -f patfile > /dev/null 2>&1 +if test $? -ne 1 ; then + echo "File_pattern: Wrong status code, test \#3 failed" + failures=1 +fi + +cat <patfile + +EOF +# empty pattern : every match +echo "abbcd" | ${GREP} -F -f patfile > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "File_pattern: Wrong status code, test \#4 failed" + failures=1 +fi + +cp /dev/null patfile + +# null pattern : no match +echo "abbcd" | ${GREP} -F -f patfile > /dev/null 2>&1 +if test $? -ne 1 ; then + echo "File_pattern: Wrong status code, test \#5 failed" + failures=1 +fi + +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/formatbre.awk b/src/apps/bin/grep-2.5/tests/formatbre.awk new file mode 100644 index 0000000000..68a9c62660 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/formatbre.awk @@ -0,0 +1,55 @@ +# +# Basic Regular Expression + +# kip comments +$0 ~ /^#/ { next; } + +# skip those option specific to regexec/regcomp +$2 ~ /[msnr$#p^]/ { next; } + +# skip empty lines +$0 ~ /^$/ { next; } + +# debug +#{ printf ("<%s> <%s> <%s> <%s>\n", $1, $2, $3, $4); } + +# subreg expresion +NF >= 5 { next; } + +# errors +NF == 3 { +# gsub (/@/, ","); +# it means empty lines + gsub (/\"\"/, ""); +# escapes + gsub (/\\\'/, "\\\'\'"); +# error in regex + if (index ($2, "C") != 0) + { + if (index ($2, "b") != 0) + printf ("2@%s@%s\n", $1, $3); + } +# erro no match + else + { + if (index ($2, "b") != 0) + printf ("1@%s@%s\n", $1, $3); + } + next; +} + +# ok +NF == 4 { +# skip those magic cookies can't rely on echo to gnerate them + if (match($3, /[NSTZ]/)) + next; + +# gsub (/@/, ","); +# it means empty lines + gsub (/\"\"/, ""); +# escape escapes + gsub (/\\\'/, "\\\'\'"); + + if (index ($2, "b") != 0) + printf ("0@%s@%s\n", $1, $3); +} diff --git a/src/apps/bin/grep-2.5/tests/formatere.awk b/src/apps/bin/grep-2.5/tests/formatere.awk new file mode 100644 index 0000000000..ba60439a18 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/formatere.awk @@ -0,0 +1,60 @@ +# +# Extended Regular Expression + +# skip comments +$0 ~ /^#/ { next; } + +# skip specifics to regcomp/regexec +$2 ~ /[msnr$#p^]/ { next; } + +# jump empty lines +$0 ~ /^$/ { next; } + +# subreg skip +NF >= 5 { next; } + +# debug +#{ printf ("<%s> <%s> <%s> <%s>\n", $1, $2, $3, $4); } + +# errors +NF == 3 { +# nuke any remaining '@' +# gsub (/@/, ","); +# it means empty lines + gsub (/\"\"/, ""); +# escapes + gsub (/\\\'/, "\\\'\'"); +# error in regex + if (index ($2, "C") != 0) + { + if (index ($2, "b") == 0) + printf ("2@%s@%s\n", $1, $3); + } +# error not matching + else + { + if (index ($2, "b") == 0) + printf ("1@%s@%s\n", $1, $3); + } + next; +} + +# ok +NF == 4 { +# skip those magic cookies can't rely on echo to gnerate them + if (match($3, /[NSTZ]/)) + next; + +# nuke any remaining '@' +# gsub (/@/, ","); +# it means empty lines + gsub (/\"\"/, ""); +# escape escapes + gsub (/\\\'/, "\\\'\'"); + + if (index ($2, "b") == 0) + { + printf ("0@%s@%s\n", $1, $3); + } + next; +} diff --git a/src/apps/bin/grep-2.5/tests/khadafy.lines b/src/apps/bin/grep-2.5/tests/khadafy.lines new file mode 100644 index 0000000000..57e21a1794 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/khadafy.lines @@ -0,0 +1,32 @@ +1) Muammar Qaddafi +2) Mo'ammar Gadhafi +3) Muammar Kaddafi +4) Muammar Qadhafi +5) Moammar El Kadhafi +6) Muammar Gadafi +7) Mu'ammar al-Qadafi +8) Moamer El Kazzafi +9) Moamar al-Gaddafi +10) Mu'ammar Al Qathafi +11) Muammar Al Qathafi +12) Mo'ammar el-Gadhafi +13) Moamar El Kadhafi +14) Muammar al-Qadhafi +15) Mu'ammar al-Qadhdhafi +16) Mu'ammar Qadafi +17) Moamar Gaddafi +18) Mu'ammar Qadhdhafi +19) Muammar Khaddafi +20) Muammar al-Khaddafi +21) Mu'amar al-Kadafi +22) Muammar Ghaddafy +23) Muammar Ghadafi +24) Muammar Ghaddafi +25) Muamar Kaddafi +26) Muammar Quathafi +27) Muammar Gheddafi +28) Muamar Al-Kaddafi +29) Moammar Khadafy +30) Moammar Qudhafi +31) Mu'ammar al-Qaddafi +32) Mulazim Awwal Mu'ammar Muhammad Abu Minyar al-Qadhafi diff --git a/src/apps/bin/grep-2.5/tests/khadafy.out b/src/apps/bin/grep-2.5/tests/khadafy.out new file mode 100644 index 0000000000..57e21a1794 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/khadafy.out @@ -0,0 +1,32 @@ +1) Muammar Qaddafi +2) Mo'ammar Gadhafi +3) Muammar Kaddafi +4) Muammar Qadhafi +5) Moammar El Kadhafi +6) Muammar Gadafi +7) Mu'ammar al-Qadafi +8) Moamer El Kazzafi +9) Moamar al-Gaddafi +10) Mu'ammar Al Qathafi +11) Muammar Al Qathafi +12) Mo'ammar el-Gadhafi +13) Moamar El Kadhafi +14) Muammar al-Qadhafi +15) Mu'ammar al-Qadhdhafi +16) Mu'ammar Qadafi +17) Moamar Gaddafi +18) Mu'ammar Qadhdhafi +19) Muammar Khaddafi +20) Muammar al-Khaddafi +21) Mu'amar al-Kadafi +22) Muammar Ghaddafy +23) Muammar Ghadafi +24) Muammar Ghaddafi +25) Muamar Kaddafi +26) Muammar Quathafi +27) Muammar Gheddafi +28) Muamar Al-Kaddafi +29) Moammar Khadafy +30) Moammar Qudhafi +31) Mu'ammar al-Qaddafi +32) Mulazim Awwal Mu'ammar Muhammad Abu Minyar al-Qadhafi diff --git a/src/apps/bin/grep-2.5/tests/khadafy.regexp b/src/apps/bin/grep-2.5/tests/khadafy.regexp new file mode 100644 index 0000000000..46fe8ddd6d --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/khadafy.regexp @@ -0,0 +1 @@ +M[ou]'?am+[ae]r .*([AEae]l[- ])?[GKQ]h?[aeu]+([dtz][dhz]?)+af[iy] diff --git a/src/apps/bin/grep-2.5/tests/khadafy.sh b/src/apps/bin/grep-2.5/tests/khadafy.sh new file mode 100644 index 0000000000..e3d2cde4c0 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/khadafy.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Regression test for GNU grep. + +: ${srcdir=.} +: ${GREP=../src/grep} + +failures=0 + +# The Khadafy test is brought to you by Scott Anderson . . . + +${GREP} -E -f $srcdir/khadafy.regexp $srcdir/khadafy.lines > khadafy.out +if cmp $srcdir/khadafy.lines khadafy.out +then + : +else + echo Khadafy test failed -- output left on khadafy.out + failures=1 +fi + +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/options.sh b/src/apps/bin/grep-2.5/tests/options.sh new file mode 100644 index 0000000000..0f1852971d --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/options.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Test for POSIX.2 options for grep +# +# grep [ -E| -F][ -c| -l| -q ][-insvx] -e pattern_list +# [-f pattern_file] ... [file. ..] +# grep [ -E| -F][ -c| -l| -q ][-insvx][-e pattern_list] +# -f pattern_file ... [file ...] +# grep [ -E| -F][ -c| -l| -q ][-insvx] pattern_list [file...] +# + +: ${srcdir=.} + +failures=0 + +# checking for -E extended regex +echo "abababccccccd" | ${GREP} -E -e 'c{3}' > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "Options: Wrong status code, test \#1 failed" + failures=1 +fi + +# checking for basic regex +echo "abababccccccd" | ${GREP} -G -e 'c\{3\}' > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "Options: Wrong status code, test \#2 failed" + failures=1 +fi + +# checking for fixed string +echo "abababccccccd" | ${GREP} -F -e 'c\{3\}' > /dev/null 2>&1 +if test $? -ne 1 ; then + echo "Options: Wrong status code, test \#3 failed" + failures=1 +fi + +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/patfile b/src/apps/bin/grep-2.5/tests/patfile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/apps/bin/grep-2.5/tests/spencer1.awk b/src/apps/bin/grep-2.5/tests/spencer1.awk new file mode 100644 index 0000000000..ba7aeb66af --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/spencer1.awk @@ -0,0 +1,15 @@ +BEGIN { + FS = "@"; + printf ("failures=0\n"); +} + +$0 !~ /^#/ && NF = 3 { +# printf ("status=`echo '%s'| { ${GREP} -E -e '%s' > /dev/null 2>&1; echo $?; cat >/dev/null; }`\n",$3, $2); + printf ("status=`echo '%s'| { ${GREP} -E -e '%s' >/dev/null 2>&1 ; echo $?; }`\n",$3, $2); + printf ("if test $status -ne %s ; then\n", $1); + printf ("\techo Spencer test \\#%d failed\n", ++n); + printf ("\tfailures=1\n"); + printf ("fi\n"); +} + +END { printf ("exit $failures\n"); } diff --git a/src/apps/bin/grep-2.5/tests/spencer1.script b/src/apps/bin/grep-2.5/tests/spencer1.script new file mode 100644 index 0000000000..0a66c86bd3 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/spencer1.script @@ -0,0 +1,612 @@ +failures=0 +status=`echo 'abc'| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#1 failed + failures=1 +fi +status=`echo 'xbc'| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#2 failed + failures=1 +fi +status=`echo 'axc'| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#3 failed + failures=1 +fi +status=`echo 'abx'| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#4 failed + failures=1 +fi +status=`echo 'xabcy'| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#5 failed + failures=1 +fi +status=`echo 'ababc'| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#6 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'ab*c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#7 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'ab*bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#8 failed + failures=1 +fi +status=`echo 'abbc'| { ${GREP} -E -e 'ab*bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#9 failed + failures=1 +fi +status=`echo 'abbbbc'| { ${GREP} -E -e 'ab*bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#10 failed + failures=1 +fi +status=`echo 'abbc'| { ${GREP} -E -e 'ab+bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#11 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'ab+bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#12 failed + failures=1 +fi +status=`echo 'abq'| { ${GREP} -E -e 'ab+bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#13 failed + failures=1 +fi +status=`echo 'abbbbc'| { ${GREP} -E -e 'ab+bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#14 failed + failures=1 +fi +status=`echo 'abbc'| { ${GREP} -E -e 'ab?bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#15 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'ab?bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#16 failed + failures=1 +fi +status=`echo 'abbbbc'| { ${GREP} -E -e 'ab?bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#17 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'ab?c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#18 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e '^abc$' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#19 failed + failures=1 +fi +status=`echo 'abcc'| { ${GREP} -E -e '^abc$' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#20 failed + failures=1 +fi +status=`echo 'abcc'| { ${GREP} -E -e '^abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#21 failed + failures=1 +fi +status=`echo 'aabc'| { ${GREP} -E -e '^abc$' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#22 failed + failures=1 +fi +status=`echo 'aabc'| { ${GREP} -E -e 'abc$' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#23 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e '^' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#24 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e '$' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#25 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'a.c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#26 failed + failures=1 +fi +status=`echo 'axc'| { ${GREP} -E -e 'a.c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#27 failed + failures=1 +fi +status=`echo 'axyzc'| { ${GREP} -E -e 'a.*c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#28 failed + failures=1 +fi +status=`echo 'axyzd'| { ${GREP} -E -e 'a.*c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#29 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'a[bc]d' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#30 failed + failures=1 +fi +status=`echo 'abd'| { ${GREP} -E -e 'a[bc]d' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#31 failed + failures=1 +fi +status=`echo 'abd'| { ${GREP} -E -e 'a[b-d]e' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#32 failed + failures=1 +fi +status=`echo 'ace'| { ${GREP} -E -e 'a[b-d]e' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#33 failed + failures=1 +fi +status=`echo 'aac'| { ${GREP} -E -e 'a[b-d]' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#34 failed + failures=1 +fi +status=`echo 'a-'| { ${GREP} -E -e 'a[-b]' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#35 failed + failures=1 +fi +status=`echo 'a-'| { ${GREP} -E -e 'a[b-]' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#36 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e 'a[b-a]' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#37 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e 'a[]b' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 2 ; then + echo Spencer test \#38 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e 'a[' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 2 ; then + echo Spencer test \#39 failed + failures=1 +fi +status=`echo 'a]'| { ${GREP} -E -e 'a]' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#40 failed + failures=1 +fi +status=`echo 'a]b'| { ${GREP} -E -e 'a[]]b' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#41 failed + failures=1 +fi +status=`echo 'aed'| { ${GREP} -E -e 'a[^bc]d' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#42 failed + failures=1 +fi +status=`echo 'abd'| { ${GREP} -E -e 'a[^bc]d' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#43 failed + failures=1 +fi +status=`echo 'adc'| { ${GREP} -E -e 'a[^-b]c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#44 failed + failures=1 +fi +status=`echo 'a-c'| { ${GREP} -E -e 'a[^-b]c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#45 failed + failures=1 +fi +status=`echo 'a]c'| { ${GREP} -E -e 'a[^]b]c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#46 failed + failures=1 +fi +status=`echo 'adc'| { ${GREP} -E -e 'a[^]b]c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#47 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'ab|cd' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#48 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e 'ab|cd' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#49 failed + failures=1 +fi +status=`echo 'def'| { ${GREP} -E -e '()ef' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#50 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '()*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#51 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '*a' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#52 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '^*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#53 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '$*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#54 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(*)b' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#55 failed + failures=1 +fi +status=`echo 'b'| { ${GREP} -E -e '$b' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#56 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e 'a\' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 2 ; then + echo Spencer test \#57 failed + failures=1 +fi +status=`echo 'a(b'| { ${GREP} -E -e 'a\(b' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#58 failed + failures=1 +fi +status=`echo 'ab'| { ${GREP} -E -e 'a\(*b' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#59 failed + failures=1 +fi +status=`echo 'a((b'| { ${GREP} -E -e 'a\(*b' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#60 failed + failures=1 +fi +status=`echo 'a\x'| { ${GREP} -E -e 'a\x' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#61 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e 'abc)' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 2 ; then + echo Spencer test \#62 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 2 ; then + echo Spencer test \#63 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e '((a))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#64 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e '(a)b(c)' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#65 failed + failures=1 +fi +status=`echo 'aabbabc'| { ${GREP} -E -e 'a+b+c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#66 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e 'a**' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#67 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e 'a*?' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#68 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(a*)*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#69 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(a*)+' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#70 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(a|)*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#71 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(a*|b)*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#72 failed + failures=1 +fi +status=`echo 'ab'| { ${GREP} -E -e '(a+|b)*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#73 failed + failures=1 +fi +status=`echo 'ab'| { ${GREP} -E -e '(a+|b)+' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#74 failed + failures=1 +fi +status=`echo 'ab'| { ${GREP} -E -e '(a+|b)?' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#75 failed + failures=1 +fi +status=`echo 'cde'| { ${GREP} -E -e '[^ab]*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#76 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(^)*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#77 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '(ab|)*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#78 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e ')(' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 2 ; then + echo Spencer test \#79 failed + failures=1 +fi +status=`echo ''| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#80 failed + failures=1 +fi +status=`echo ''| { ${GREP} -E -e 'abc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#81 failed + failures=1 +fi +status=`echo ''| { ${GREP} -E -e 'a*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#82 failed + failures=1 +fi +status=`echo 'abbbcd'| { ${GREP} -E -e '([abc])*d' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#83 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e '([abc])*bcd' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#84 failed + failures=1 +fi +status=`echo 'e'| { ${GREP} -E -e 'a|b|c|d|e' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#85 failed + failures=1 +fi +status=`echo 'ef'| { ${GREP} -E -e '(a|b|c|d|e)f' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#86 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '((a*|b))*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#87 failed + failures=1 +fi +status=`echo 'abcdefg'| { ${GREP} -E -e 'abcd*efg' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#88 failed + failures=1 +fi +status=`echo 'xabyabbbz'| { ${GREP} -E -e 'ab*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#89 failed + failures=1 +fi +status=`echo 'xayabbbz'| { ${GREP} -E -e 'ab*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#90 failed + failures=1 +fi +status=`echo 'abcde'| { ${GREP} -E -e '(ab|cd)e' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#91 failed + failures=1 +fi +status=`echo 'hij'| { ${GREP} -E -e '[abhgefdc]ij' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#92 failed + failures=1 +fi +status=`echo 'abcde'| { ${GREP} -E -e '^(ab|cd)e' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#93 failed + failures=1 +fi +status=`echo 'abcdef'| { ${GREP} -E -e '(abc|)ef' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#94 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e '(a|b)c*d' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#95 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e '(ab|ab*)bc' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#96 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e 'a([bc]*)c*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#97 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e 'a([bc]*)(c*d)' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#98 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e 'a([bc]+)(c*d)' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#99 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e 'a([bc]*)(c+d)' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#100 failed + failures=1 +fi +status=`echo 'adcdcde'| { ${GREP} -E -e 'a[bcd]*dcdcde' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#101 failed + failures=1 +fi +status=`echo 'adcdcde'| { ${GREP} -E -e 'a[bcd]+dcdcde' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#102 failed + failures=1 +fi +status=`echo 'abc'| { ${GREP} -E -e '(ab|a)b*c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#103 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e '((a)(b)c)(d)' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#104 failed + failures=1 +fi +status=`echo 'alpha'| { ${GREP} -E -e '[A-Za-z_][A-Za-z0-9_]*' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#105 failed + failures=1 +fi +status=`echo 'abh'| { ${GREP} -E -e '^a(bc+|b[eh])g|.h$' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#106 failed + failures=1 +fi +status=`echo 'effgz'| { ${GREP} -E -e '(bc+d$|ef*g.|h?i(j|k))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#107 failed + failures=1 +fi +status=`echo 'ij'| { ${GREP} -E -e '(bc+d$|ef*g.|h?i(j|k))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#108 failed + failures=1 +fi +status=`echo 'effg'| { ${GREP} -E -e '(bc+d$|ef*g.|h?i(j|k))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#109 failed + failures=1 +fi +status=`echo 'bcdd'| { ${GREP} -E -e '(bc+d$|ef*g.|h?i(j|k))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#110 failed + failures=1 +fi +status=`echo 'reffgz'| { ${GREP} -E -e '(bc+d$|ef*g.|h?i(j|k))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#111 failed + failures=1 +fi +status=`echo '-'| { ${GREP} -E -e '((((((((((a))))))))))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#112 failed + failures=1 +fi +status=`echo 'a'| { ${GREP} -E -e '(((((((((a)))))))))' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#113 failed + failures=1 +fi +status=`echo 'uh-uh'| { ${GREP} -E -e 'multiple words of text' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#114 failed + failures=1 +fi +status=`echo 'multiple words, yeah'| { ${GREP} -E -e 'multiple words' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#115 failed + failures=1 +fi +status=`echo 'abcde'| { ${GREP} -E -e '(.*)c(.*)' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#116 failed + failures=1 +fi +status=`echo '(.*)\)'| { ${GREP} -E -e '\((.*),' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#117 failed + failures=1 +fi +status=`echo 'ab'| { ${GREP} -E -e '[k]' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 1 ; then + echo Spencer test \#118 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e 'abcd' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#119 failed + failures=1 +fi +status=`echo 'abcd'| { ${GREP} -E -e 'a(bc)d' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#120 failed + failures=1 +fi +status=`echo 'ac'| { ${GREP} -E -e 'a[-]?c' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#121 failed + failures=1 +fi +status=`echo 'beriberi'| { ${GREP} -E -e '(....).*\1' >/dev/null 2>&1 ; echo $?; }` +if test $status -ne 0 ; then + echo Spencer test \#122 failed + failures=1 +fi +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/spencer1.sh b/src/apps/bin/grep-2.5/tests/spencer1.sh new file mode 100644 index 0000000000..2391761ab6 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/spencer1.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Regression test for GNU grep. + +: ${srcdir=.} + +failures=0 + +# . . . and the following by Henry Spencer. + +${AWK-awk} -f $srcdir/spencer1.awk $srcdir/spencer1.tests > spencer1.script + +sh spencer1.script && exit $failures +exit 1 diff --git a/src/apps/bin/grep-2.5/tests/spencer1.tests b/src/apps/bin/grep-2.5/tests/spencer1.tests new file mode 100644 index 0000000000..2a60f00c14 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/spencer1.tests @@ -0,0 +1,122 @@ +0@abc@abc +1@abc@xbc +1@abc@axc +1@abc@abx +0@abc@xabcy +0@abc@ababc +0@ab*c@abc +0@ab*bc@abc +0@ab*bc@abbc +0@ab*bc@abbbbc +0@ab+bc@abbc +1@ab+bc@abc +1@ab+bc@abq +0@ab+bc@abbbbc +0@ab?bc@abbc +0@ab?bc@abc +1@ab?bc@abbbbc +0@ab?c@abc +0@^abc$@abc +1@^abc$@abcc +0@^abc@abcc +1@^abc$@aabc +0@abc$@aabc +0@^@abc +0@$@abc +0@a.c@abc +0@a.c@axc +0@a.*c@axyzc +1@a.*c@axyzd +1@a[bc]d@abc +0@a[bc]d@abd +1@a[b-d]e@abd +0@a[b-d]e@ace +0@a[b-d]@aac +0@a[-b]@a- +0@a[b-]@a- +1@a[b-a]@- +2@a[]b@- +2@a[@- +0@a]@a] +0@a[]]b@a]b +0@a[^bc]d@aed +1@a[^bc]d@abd +0@a[^-b]c@adc +1@a[^-b]c@a-c +1@a[^]b]c@a]c +0@a[^]b]c@adc +0@ab|cd@abc +0@ab|cd@abcd +0@()ef@def +0@()*@- +1@*a@- +0@^*@- +0@$*@- +1@(*)b@- +1@$b@b +2@a\@- +0@a\(b@a(b +0@a\(*b@ab +0@a\(*b@a((b +1@a\x@a\x +2@abc)@- +2@(abc@- +0@((a))@abc +0@(a)b(c)@abc +0@a+b+c@aabbabc +0@a**@- +0@a*?@- +0@(a*)*@- +0@(a*)+@- +0@(a|)*@- +0@(a*|b)*@- +0@(a+|b)*@ab +0@(a+|b)+@ab +0@(a+|b)?@ab +0@[^ab]*@cde +0@(^)*@- +0@(ab|)*@- +2@)(@- +1@abc@ +1@abc@ +0@a*@ +0@([abc])*d@abbbcd +0@([abc])*bcd@abcd +0@a|b|c|d|e@e +0@(a|b|c|d|e)f@ef +0@((a*|b))*@- +0@abcd*efg@abcdefg +0@ab*@xabyabbbz +0@ab*@xayabbbz +0@(ab|cd)e@abcde +0@[abhgefdc]ij@hij +1@^(ab|cd)e@abcde +0@(abc|)ef@abcdef +0@(a|b)c*d@abcd +0@(ab|ab*)bc@abc +0@a([bc]*)c*@abc +0@a([bc]*)(c*d)@abcd +0@a([bc]+)(c*d)@abcd +0@a([bc]*)(c+d)@abcd +0@a[bcd]*dcdcde@adcdcde +1@a[bcd]+dcdcde@adcdcde +0@(ab|a)b*c@abc +0@((a)(b)c)(d)@abcd +0@[A-Za-z_][A-Za-z0-9_]*@alpha +0@^a(bc+|b[eh])g|.h$@abh +0@(bc+d$|ef*g.|h?i(j|k))@effgz +0@(bc+d$|ef*g.|h?i(j|k))@ij +1@(bc+d$|ef*g.|h?i(j|k))@effg +1@(bc+d$|ef*g.|h?i(j|k))@bcdd +0@(bc+d$|ef*g.|h?i(j|k))@reffgz +1@((((((((((a))))))))))@- +0@(((((((((a)))))))))@a +1@multiple words of text@uh-uh +0@multiple words@multiple words, yeah +0@(.*)c(.*)@abcde +1@\((.*),@(.*)\) +1@[k]@ab +0@abcd@abcd +0@a(bc)d@abcd +0@a[-]?c@ac +0@(....).*\1@beriberi diff --git a/src/apps/bin/grep-2.5/tests/spencer2.sh b/src/apps/bin/grep-2.5/tests/spencer2.sh new file mode 100644 index 0000000000..a26869c512 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/spencer2.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Regression test for GNU grep. + +: ${srcdir=.} + +failures=0 + +# . . . and the following by Henry Spencer. + +${AWK-awk} -f $srcdir/scriptgen.awk $srcdir/spencer2.tests > tmp2.script + +sh tmp2.script && exit $failures +exit 1 diff --git a/src/apps/bin/grep-2.5/tests/spencer2.tests b/src/apps/bin/grep-2.5/tests/spencer2.tests new file mode 100644 index 0000000000..47b61914c6 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/spencer2.tests @@ -0,0 +1,317 @@ +0@a@a +0@abc@abc +0@abc|de@abc +0@a|b|c@abc +0@a(b)c@abc +1@a\(b\)c@abc +2@a(@EPAREN +2@a(@a( +0@a\(@a( +1@a\(@EPAREN +1@a\(b@EPAREN +2@a(b@EPAREN +2@a(b@a(b +2@a)@a) +2@)@) +2@a)@a) +1@a\)@EPAREN +1@\)@EPAREN +0@a()b@ab +1@a\(\)b@ab +0@^abc$@abc +1@a^b@a^b +1@a^b@a^b +1@a$b@a$b +1@a$b@a$b +0@^@abc +0@$@abc +1@^$@"" +1@$^@"" +1@\($\)\(^\)@"" +0@^^@"" +0@$$@"" +1@b$@abNc +1@b$@abNc +1@^b$@aNbNc +1@^b$@aNbNc +1@^$@aNNb +1@^$@abc +1@^$@abcN +1@$^@aNNb +1@\($\)\(^\)@aNNb +0@^^@aNNb +0@$$@aNNb +0@^a@a +0@a$@a +0@^a@aNb +1@^b@aNb +0@a$@bNa +1@b$@bNa +0@a*(^b$)c*@b +1@a*\(^b$\)c*@b +0@|@EMPTY +0@|@| +0@*@BADRPT +0@*@* +0@+@BADRPT +0@?@BADRPT +1@""@EMPTY +0@()@abc +1@\(\)@abc +0@a||b@EMPTY +0@|ab@EMPTY +0@ab|@EMPTY +1@(|a)b@EMPTY +1@(a|)b@EMPTY +1@(*a)@BADRPT +1@(+a)@BADRPT +1@(?a)@BADRPT +1@({1}a)@BADRPT +1@\(\{1\}a\)@BADRPT +1@(a|*b)@BADRPT +1@(a|+b)@BADRPT +1@(a|?b)@BADRPT +1@(a|{1}b)@BADRPT +0@^*@BADRPT +0@^*@* +0@^+@BADRPT +0@^?@BADRPT +0@^{1}@BADRPT +1@^\{1\}@BADRPT +0@a.c@abc +0@a[bc]d@abd +0@a\*c@a*c +1@ac@abc +1@a\bc@ac +1@\{@BADRPT +0@a\[b@a[b +2@a[b@EBRACK +0@a$@a +1@a$@a$ +1@a\$@a +0@a\$@a$ +1@a\$@a +1@a\$@a\$ +2@a\(b\)\2c@ESUBREG +2@a\(b\1\)c@ESUBREG +2@a\(b*\)c\1d@abbcbd +2@a\(b*\)c\1d@abbcbbbd +2@^\(.\)\1@abc +2@a\(\([bc]\)\2\)*d@abbccd +2@a\(\([bc]\)\2\)*d@abbcbd +2@a\(\(b\)*\2\)*d@abbbd +2@\(a\)\1bcd@aabcd +2@\(a\)\1bc*d@aabcd +2@\(a\)\1bc*d@aabd +2@\(a\)\1bc*d@aabcccd +2@\(a\)\1bc*[ce]d@aabcccd +2@^\(a\)\1b\(c\)*cd$@aabcccd +0@ab*c@abc +0@ab+c@abc +0@ab?c@abc +1@a\(*\)b@a*b +1@a\(**\)b@ab +1@a\(***\)b@BADRPT +0@*a@*a +0@**a@a +1@***a@BADRPT +2@{@{ +2@{abc@{abc +2@{1@BADRPT +0@{1}@BADRPT +2@a{b@a{b +0@a{1}b@ab +1@a\{1\}b@ab +0@a{1,}b@ab +1@a\{1,\}b@ab +0@a{1,2}b@aab +1@a\{1,2\}b@aab +2@a{1@EBRACE +1@a\{1@EBRACE +2@a{1a@EBRACE +1@a\{1a@EBRACE +2@a{1a}@BADBR +1@a\{1a\}@BADBR +0@a{,2}@a{,2} +1@a\{,2\}@BADBR +0@a{,}@a{,} +1@a\{,\}@BADBR +2@a{1,x}@BADBR +1@a\{1,x\}@BADBR +2@a{1,x@EBRACE +1@a\{1,x@EBRACE +1@a{300}@BADBR +1@a\{300\}@BADBR +1@a{1,0}@BADBR +1@a\{1,0\}@BADBR +0@ab{0,0}c@abcac +1@ab\{0,0\}c@abcac +0@ab{0,1}c@abcac +1@ab\{0,1\}c@abcac +0@ab{0,3}c@abbcac +1@ab\{0,3\}c@abbcac +0@ab{1,1}c@acabc +1@ab\{1,1\}c@acabc +0@ab{1,3}c@acabc +1@ab\{1,3\}c@acabc +0@ab{2,2}c@abcabbc +1@ab\{2,2\}c@abcabbc +0@ab{2,4}c@abcabbc +1@ab\{2,4\}c@abcabbc +0@a**@BADRPT +1@a++@BADRPT +0@a??@BADRPT +0@a*+@BADRPT +0@a*?@BADRPT +0@a+*@BADRPT +0@a+?@BADRPT +0@a?*@BADRPT +0@a?+@BADRPT +1@a{1}{1}@BADRPT +0@a*{1}@BADRPT +1@a+{1}@BADRPT +0@a?{1}@BADRPT +0@a{1}*@BADRPT +1@a{1}+@BADRPT +0@a{1}?@BADRPT +2@a*{b}@a{b} +1@a\{1\}\{1\}@BADRPT +1@a*\{1\}@BADRPT +1@a\{1\}*@BADRPT +0@a[b]c@abc +0@a[ab]c@abc +0@a[^ab]c@adc +0@a[]b]c@a]c +0@a[[b]c@a[c +0@a[-b]c@a-c +0@a[^]b]c@adc +0@a[^-b]c@adc +0@a[b-]c@a-c +2@a[b@EBRACK +2@a[]@EBRACK +0@a[1-3]c@a2c +1@a[3-1]c@ERANGE +1@a[1-3-5]c@ERANGE +1@a[[.-.]--]c@a-c +2@a[1-@ERANGE +2@a[[.@EBRACK +2@a[[.x@EBRACK +2@a[[.x.@EBRACK +1@a[[.x.]@EBRACK +1@a[[.x.]]@ax +1@a[[.x,.]]@ECOLLATE +1@a[[.one.]]b@a1b +1@a[[.notdef.]]b@ECOLLATE +1@a[[.].]]b@a]b +0@a[[:alpha:]]c@abc +2@a[[:notdef:]]c@ECTYPE +2@a[[:@EBRACK +2@a[[:alpha@EBRACK +2@a[[:alpha:]@EBRACK +2@a[[:alpha,:]@ECTYPE +2@a[[:]:]]b@ECTYPE +2@a[[:-:]]b@ECTYPE +2@a[[:alph:]]@ECTYPE +2@a[[:alphabet:]]@ECTYPE +1@[[:blank:]]+@aSSTb +1@[[:cntrl:]]+@aNTb +0@[[:digit:]]+@a019b +0@[[:graph:]]+@Sa%bS +0@[[:lower:]]+@AabC +0@[[:print:]]+@NaSbN +0@[[:punct:]]+@S%-&T +1@[[:space:]]+@aSNTb +0@[[:upper:]]+@aBCd +0@[[:xdigit:]]+@p0f3Cq +1@a[[=b=]]c@abc +2@a[[=@EBRACK +2@a[[=b@EBRACK +2@a[[=b=@EBRACK +1@a[[=b=]@EBRACK +1@a[[=b,=]]@ECOLLATE +1@a[[=one=]]b@a1b +0@a(((b)))c@abc +0@a(b|(c))d@abd +0@a(b*|c)d@abbd +0@a[ab]{20}@aaaaabaaaabaaaabaaaab +0@a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]@aaaaabaaaabaaaabaaaab +0@a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)@aaaaabaaaabaaaabaaaabweeknights +0@12345678901234567890123456789@a12345678901234567890123456789b +0@123456789012345678901234567890@a123456789012345678901234567890b +0@1234567890123456789012345678901@a1234567890123456789012345678901b +0@12345678901234567890123456789012@a12345678901234567890123456789012b +0@123456789012345678901234567890123@a123456789012345678901234567890123b +0@1234567890123456789012345678901234567890123456789012345678901234567890@a1234567890123456789012345678901234567890123456789012345678901234567890b +0@[ab][cd][ef][gh][ij][kl][mn]@xacegikmoq +0@[ab][cd][ef][gh][ij][kl][mn][op]@xacegikmoq +0@[ab][cd][ef][gh][ij][kl][mn][op][qr]@xacegikmoqy +0@[ab][cd][ef][gh][ij][kl][mn][op][q]@xacegikmoqy +0@abc@xabcy +2@a\(b\)?c\1d@acd +1@aBc@Abc +1@a[Bc]*d@abBCcd +1@0[[:upper:]]1@0a1 +1@0[[:lower:]]1@0A1 +1@a[^b]c@abc +0@a[^b]c@aBc +0@a[^b]c@adc +0@[a]b[c]@abc +0@[a]b[a]@aba +0@[abc]b[abc]@abc +0@[abc]b[abd]@abd +0@a(b?c)+d@accd +0@(wee|week)(knights|night)@weeknights +0@(we|wee|week|frob)(knights|night|day)@weeknights +0@a[bc]d@xyzaaabcaababdacd +0@a[ab]c@aaabc +0@abc@abc +0@a*@b +0@/\*.*\*/@/*x*/ +0@/\*.*\*/@/*x*/y/*z*/ +0@/\*([^*]|\*[^/])*\*/@/*x*/ +0@/\*([^*]|\*[^/])*\*/@/*x*/y/*z*/ +0@/\*([^*]|\*[^/])*\*/@/*x**/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x*/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x**/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x****/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x**x*/y/*z*/ +0@/\*([^*]|\*+[^*/])*\*+/@/*x***x/y/*z*/ +0@[abc]@a(b)c +0@[abc]@a(d)c +0@[abc]@a(bc)d +0@[abc]@a(dc)d +0@.@a()c +0@b.*c@b(bc)c +0@b.*@b(bc)c +0@.*c@b(bc)c +0@abc@abc +0@abc@xabcy +1@abc@xyz +0@a*b@aba*b +0@a*b@ab +1@""@EMPTY +1@aZb@a +1@aZb@a +0@aZb@(aZb) +0@aZ*b@(ab) +0@a.b@(aZb) +0@a.*@(aZb)c +2@[[:<:]]a@a +2@[[:<:]]a@ba +2@[[:<:]]a@-a +2@a[[:>:]]@a +2@a[[:>:]]@ab +2@a[[:>:]]@a- +2@[[:<:]]a.c[[:>:]]@axcd-dayc-dazce-abc +2@[[:<:]]a.c[[:>:]]@axcd-dayc-dazce-abc-q +2@[[:<:]]a.c[[:>:]]@axc-dayc-dazce-abc +2@[[:<:]]b.c[[:>:]]@a_bxc-byc_d-bzc-q +2@[[:<:]].x..[[:>:]]@y_xa_-_xb_y-_xc_-axdc +2@[[:<:]]a_b[[:>:]]@x_a_b +0@(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A])@A1 +0@abcdefghijklmnop@abcdefghijklmnop +0@abcdefghijklmnopqrstuv@abcdefghijklmnopqrstuv +0@CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a@CC11 +0@a?b@ab +1@-\{0,1\}[0-9]*$@-5 diff --git a/src/apps/bin/grep-2.5/tests/status.sh b/src/apps/bin/grep-2.5/tests/status.sh new file mode 100644 index 0000000000..94f59294a9 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/status.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# Test for status code for GNU grep. +# status code +# 0 match found +# 1 no match +# 2 file not found + +: ${srcdir=.} + +failures=0 + +# should return 0 found a match +echo "abcd" | ${GREP} -E -e 'abc' > /dev/null 2>&1 +if test $? -ne 0 ; then + echo "Status: Wrong status code, test \#1 failed" + failures=1 +fi + +# should return 1 found no match +echo "abcd" | ${GREP} -E -e 'zbc' > /dev/null 2>&1 +if test $? -ne 1 ; then + echo "Status: Wrong status code, test \#2 failed" + failures=1 +fi + +# the filename MMMMMMMM.MMM should not exist hopefully +if test -r MMMMMMMM.MMM; then + echo "Please remove MMMMMMMM.MMM to run check" +else + # should return 2 file not found + ${GREP} -E -e 'abc' MMMMMMMM.MMM > /dev/null 2>&1 + if test $? -ne 2 ; then + echo "Status: Wrong status code, test \#3 failed" + failures=1 + fi + + # should return 2 file not found + ${GREP} -E -s -e 'abc' MMMMMMMM.MMM > /dev/null 2>&1 + if test $? -ne 2 ; then + echo "Status: Wrong status code, test \#4 failed" + failures=1 + fi + + # should return 0 found a match + echo "abcd" | ${GREP} -E -q -s 'abc' MMMMMMMM.MMM - > /dev/null 2>&1 + if test $? -ne 0 ; then + echo "Status: Wrong status code, test \#5 failed" + failures=1 + fi +fi + +exit $failures diff --git a/src/apps/bin/grep-2.5/tests/tests b/src/apps/bin/grep-2.5/tests/tests new file mode 100644 index 0000000000..8ed938d2d7 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/tests @@ -0,0 +1,475 @@ +# regular expression test set +# Lines are at least three fields, separated by one or more tabs. "" stands +# for an empty field. First field is an RE. Second field is flags. If +# C flag given, regcomp() is expected to fail, and the third field is the +# error name (minus the leading REG_). +# +# Otherwise it is expected to succeed, and the third field is the string to +# try matching it against. If there is no fourth field, the match is +# expected to fail. If there is a fourth field, it is the substring that +# the RE is expected to match. If there is a fifth field, it is a comma- +# separated list of what the subexpressions should match, with - indicating +# no match for that one. In both the fourth and fifth fields, a (sub)field +# starting with @ indicates that the (sub)expression is expected to match +# a null string followed by the stuff after the @; this provides a way to +# test where null strings match. The character `N' in REs and strings +# is newline, `S' is space, `T' is tab, `Z' is NUL. +# +# The full list of flags: +# - placeholder, does nothing +# b RE is a BRE, not an ERE +# & try it as both an ERE and a BRE +# C regcomp() error expected, third field is error name +# i REG_ICASE +# m ("mundane") REG_NOSPEC +# s REG_NOSUB (not really testable) +# n REG_NEWLINE +# ^ REG_NOTBOL +# $ REG_NOTEOL +# # REG_STARTEND (see below) +# p REG_PEND +# +# For REG_STARTEND, the start/end offsets are those of the substring +# enclosed in (). + +# basics +a & a a +abc & abc abc +abc|de - abc abc +a|b|c - abc a + +# parentheses and perversions thereof +a(b)c - abc abc +a\(b\)c b abc abc +a( C EPAREN +a( b a( a( +a\( - a( a( +a\( bC EPAREN +a\(b bC EPAREN +a(b C EPAREN +a(b b a(b a(b +# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly) +a) - a) a) +) - ) ) +# end gagging (in a just world, those *should* give EPAREN) +a) b a) a) +a\) bC EPAREN +\) bC EPAREN +a()b - ab ab +a\(\)b b ab ab + +# anchoring and REG_NEWLINE +^abc$ & abc abc +a^b - a^b +a^b b a^b a^b +a$b - a$b +a$b b a$b a$b +^ & abc @abc +$ & abc @ +^$ & "" @ +$^ - "" @ +\($\)\(^\) b "" @ +# stop retching, those are legitimate (although disgusting) +^^ - "" @ +$$ - "" @ +##b$ & abNc +##b$ &n abNc b +##^b$ & aNbNc +##^b$ &n aNbNc b +##^$ &n aNNb @Nb +^$ n abc +##^$ n abcN @ +##$^ n aNNb @Nb +##\($\)\(^\) bn aNNb @Nb +##^^ n^ aNNb @Nb +##$$ n aNNb @NN +^a ^ a +a$ $ a +##^a ^n aNb +##^b ^n aNb b +##a$ $n bNa +##b$ $n bNa b +a*(^b$)c* - b b +a*\(^b$\)c* b b b + +# certain syntax errors and non-errors +| C EMPTY +| b | | +* C BADRPT +* b * * ++ C BADRPT +? C BADRPT +"" &C EMPTY +() - abc @abc +\(\) b abc @abc +a||b C EMPTY +|ab C EMPTY +ab| C EMPTY +(|a)b C EMPTY +(a|)b C EMPTY +(*a) C BADRPT +(+a) C BADRPT +(?a) C BADRPT +({1}a) C BADRPT +\(\{1\}a\) bC BADRPT +(a|*b) C BADRPT +(a|+b) C BADRPT +(a|?b) C BADRPT +(a|{1}b) C BADRPT +^* C BADRPT +^* b * * +^+ C BADRPT +^? C BADRPT +^{1} C BADRPT +^\{1\} bC BADRPT + +# metacharacters, backslashes +a.c & abc abc +a[bc]d & abd abd +a\*c & a*c a*c +a\\b & a\b a\b +a\\\*b & a\*b a\*b +a\bc & abc abc +a\ &C EESCAPE +a\\bc & a\bc a\bc +\{ bC BADRPT +a\[b & a[b a[b +a[b &C EBRACK +# trailing $ is a peculiar special case for the BRE code +a$ & a a +a$ & a$ +a\$ & a +a\$ & a$ a$ +a\\$ & a +a\\$ & a$ +a\\$ & a\$ +a\\$ & a\ a\ + +# back references, ugh +##a\(b\)\2c bC ESUBREG +##a\(b\1\)c bC ESUBREG +a\(b*\)c\1d b abbcbbd abbcbbd bb +a\(b*\)c\1d b abbcbd +a\(b*\)c\1d b abbcbbbd +^\(.\)\1 b abc +a\([bc]\)\1d b abcdabbd abbd b +a\(\([bc]\)\2\)*d b abbccd abbccd +a\(\([bc]\)\2\)*d b abbcbd +# actually, this next one probably ought to fail, but the spec is unclear +a\(\(b\)*\2\)*d b abbbd abbbd +# here is a case that no NFA implementation does right +\(ab*\)[ab]*\1 b ababaaa ababaaa a +# check out normal matching in the presence of back refs +\(a\)\1bcd b aabcd aabcd +\(a\)\1bc*d b aabcd aabcd +\(a\)\1bc*d b aabd aabd +\(a\)\1bc*d b aabcccd aabcccd +\(a\)\1bc*[ce]d b aabcccd aabcccd +^\(a\)\1b\(c\)*cd$ b aabcccd aabcccd + +# ordinary repetitions +ab*c & abc abc +ab+c - abc abc +ab?c - abc abc +a\(*\)b b a*b a*b +a\(**\)b b ab ab +a\(***\)b bC BADRPT +*a b *a *a +**a b a a +***a bC BADRPT + +# the dreaded bounded repetitions +{ & { { +{abc & {abc {abc +{1 C BADRPT +{1} C BADRPT +a{b & a{b a{b +a{1}b - ab ab +a\{1\}b b ab ab +a{1,}b - ab ab +a\{1,\}b b ab ab +a{1,2}b - aab aab +a\{1,2\}b b aab aab +a{1 C EBRACE +a\{1 bC EBRACE +a{1a C EBRACE +a\{1a bC EBRACE +a{1a} C BADBR +a\{1a\} bC BADBR +a{,2} - a{,2} a{,2} +a\{,2\} bC BADBR +a{,} - a{,} a{,} +a\{,\} bC BADBR +a{1,x} C BADBR +a\{1,x\} bC BADBR +a{1,x C EBRACE +a\{1,x bC EBRACE +a{300} C BADBR +a\{300\} bC BADBR +a{1,0} C BADBR +a\{1,0\} bC BADBR +ab{0,0}c - abcac ac +ab\{0,0\}c b abcac ac +ab{0,1}c - abcac abc +ab\{0,1\}c b abcac abc +ab{0,3}c - abbcac abbc +ab\{0,3\}c b abbcac abbc +ab{1,1}c - acabc abc +ab\{1,1\}c b acabc abc +ab{1,3}c - acabc abc +ab\{1,3\}c b acabc abc +ab{2,2}c - abcabbc abbc +ab\{2,2\}c b abcabbc abbc +ab{2,4}c - abcabbc abbc +ab\{2,4\}c b abcabbc abbc +((a{1,10}){1,10}){1,10} - a a a,a + +# multiple repetitions +a** &C BADRPT +a++ C BADRPT +a?? C BADRPT +a*+ C BADRPT +a*? C BADRPT +a+* C BADRPT +a+? C BADRPT +a?* C BADRPT +a?+ C BADRPT +a{1}{1} C BADRPT +a*{1} C BADRPT +a+{1} C BADRPT +a?{1} C BADRPT +a{1}* C BADRPT +a{1}+ C BADRPT +a{1}? C BADRPT +a*{b} - a{b} a{b} +a\{1\}\{1\} bC BADRPT +a*\{1\} bC BADRPT +a\{1\}* bC BADRPT + +# brackets, and numerous perversions thereof +a[b]c & abc abc +a[ab]c & abc abc +a[^ab]c & adc adc +a[]b]c & a]c a]c +a[[b]c & a[c a[c +a[-b]c & a-c a-c +a[^]b]c & adc adc +a[^-b]c & adc adc +a[b-]c & a-c a-c +a[b &C EBRACK +a[] &C EBRACK +a[1-3]c & a2c a2c +a[3-1]c &C ERANGE +a[1-3-5]c &C ERANGE +a[[.-.]--]c & a-c a-c +a[1- &C ERANGE +a[[. &C EBRACK +a[[.x &C EBRACK +a[[.x. &C EBRACK +a[[.x.] &C EBRACK +a[[.x.]] & ax ax +a[[.x,.]] &C ECOLLATE +a[[.one.]]b & a1b a1b +a[[.notdef.]]b &C ECOLLATE +a[[.].]]b & a]b a]b +a[[:alpha:]]c & abc abc +a[[:notdef:]]c &C ECTYPE +a[[: &C EBRACK +a[[:alpha &C EBRACK +a[[:alpha:] &C EBRACK +a[[:alpha,:] &C ECTYPE +a[[:]:]]b &C ECTYPE +a[[:-:]]b &C ECTYPE +a[[:alph:]] &C ECTYPE +a[[:alphabet:]] &C ECTYPE +##[[:alnum:]]+ - -%@a0X- a0X +##[[:alpha:]]+ - -%@aX0- aX +[[:blank:]]+ - aSSTb SST +##[[:cntrl:]]+ - aNTb NT +[[:digit:]]+ - a019b 019 +##[[:graph:]]+ - Sa%bS a%b +[[:lower:]]+ - AabC ab +##[[:print:]]+ - NaSbN aSb +##[[:punct:]]+ - S%-&T %-& +[[:space:]]+ - aSNTb SNT +[[:upper:]]+ - aBCd BC +[[:xdigit:]]+ - p0f3Cq 0f3C +a[[=b=]]c & abc abc +a[[= &C EBRACK +a[[=b &C EBRACK +a[[=b= &C EBRACK +a[[=b=] &C EBRACK +a[[=b,=]] &C ECOLLATE +a[[=one=]]b & a1b a1b + +# complexities +a(((b)))c - abc abc +a(b|(c))d - abd abd +a(b*|c)d - abbd abbd +# just gotta have one DFA-buster, of course +a[ab]{20} - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab +# and an inline expansion in case somebody gets tricky +a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab +# and in case somebody just slips in an NFA... +a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) - aaaaabaaaabaaaabaaaabweeknights aaaaabaaaabaaaabaaaabweeknights +# fish for anomalies as the number of states passes 32 +12345678901234567890123456789 - a12345678901234567890123456789b 12345678901234567890123456789 +123456789012345678901234567890 - a123456789012345678901234567890b 123456789012345678901234567890 +1234567890123456789012345678901 - a1234567890123456789012345678901b 1234567890123456789012345678901 +12345678901234567890123456789012 - a12345678901234567890123456789012b 12345678901234567890123456789012 +123456789012345678901234567890123 - a123456789012345678901234567890123b 123456789012345678901234567890123 +# and one really big one, beyond any plausible word width +1234567890123456789012345678901234567890123456789012345678901234567890 - a1234567890123456789012345678901234567890123456789012345678901234567890b 1234567890123456789012345678901234567890123456789012345678901234567890 +# fish for problems as brackets go past 8 +[ab][cd][ef][gh][ij][kl][mn] - xacegikmoq acegikm +[ab][cd][ef][gh][ij][kl][mn][op] - xacegikmoq acegikmo +[ab][cd][ef][gh][ij][kl][mn][op][qr] - xacegikmoqy acegikmoq +[ab][cd][ef][gh][ij][kl][mn][op][q] - xacegikmoqy acegikmoq + +# subtleties of matching +abc & xabcy abc +a\(b\)?c\1d b acd +aBc i Abc Abc +a[Bc]*d i abBCcd abBCcd +0[[:upper:]]1 &i 0a1 0a1 +0[[:lower:]]1 &i 0A1 0A1 +a[^b]c &i abc +a[^b]c &i aBc +a[^b]c &i adc adc +[a]b[c] - abc abc +[a]b[a] - aba aba +[abc]b[abc] - abc abc +[abc]b[abd] - abd abd +a(b?c)+d - accd accd +(wee|week)(knights|night) - weeknights weeknights +(we|wee|week|frob)(knights|night|day) - weeknights weeknights +a[bc]d - xyzaaabcaababdacd abd +a[ab]c - aaabc abc +abc s abc abc +a* & b @b + +# Let's have some fun -- try to match a C comment. +# first the obvious, which looks okay at first glance... +/\*.*\*/ - /*x*/ /*x*/ +# but... +/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/ +# okay, we must not match */ inside; try to do that... +/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/ +/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/ +# but... +/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/ +# and a still fancier version, which does it right (I think)... +/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/ +/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/ +/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/ +/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/ +/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/ +/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/ + +# subexpressions +a(b)(c)d - abcd abcd b,c +a(((b)))c - abc abc b,b,b +a(b|(c))d - abd abd b,- +a(b*|c|e)d - abbd abbd bb +a(b*|c|e)d - acd acd c +a(b*|c|e)d - ad ad @d +a(b?)c - abc abc b +a(b?)c - ac ac @c +a(b+)c - abc abc b +a(b+)c - abbbc abbbc bbb +a(b*)c - ac ac @c +(a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de +# the regression tester only asks for 9 subexpressions +a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j +a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l - abcdefghijkl abcdefghijkl b,c,d,e,f,g,h,i,j,k +a([bc]?)c - abc abc b +a([bc]?)c - ac ac @c +a([bc]+)c - abc abc b +a([bc]+)c - abcc abcc bc +a([bc]+)bc - abcbc abcbc bc +a(bb+|b)b - abb abb b +a(bbb+|bb+|b)b - abb abb b +a(bbb+|bb+|b)b - abbb abbb bb +a(bbb+|bb+|b)bb - abbb abbb b +(.*).* - abcdef abcdef abcdef +##(a*)* - bc @b @b + +# do we get the right subexpression when it is used more than once? +a(b|c)*d - ad ad - +a(b|c)*d - abcd abcd c +a(b|c)+d - abd abd b +a(b|c)+d - abcd abcd c +a(b|c?)+d - ad ad @d +a(b|c?)+d - abcd abcd @d +a(b|c){0,0}d - ad ad - +a(b|c){0,1}d - ad ad - +a(b|c){0,1}d - abd abd b +a(b|c){0,2}d - ad ad - +a(b|c){0,2}d - abcd abcd c +a(b|c){0,}d - ad ad - +a(b|c){0,}d - abcd abcd c +a(b|c){1,1}d - abd abd b +a(b|c){1,1}d - acd acd c +a(b|c){1,2}d - abd abd b +a(b|c){1,2}d - abcd abcd c +a(b|c){1,}d - abd abd b +a(b|c){1,}d - abcd abcd c +a(b|c){2,2}d - acbd acbd b +a(b|c){2,2}d - abcd abcd c +a(b|c){2,4}d - abcd abcd c +a(b|c){2,4}d - abcbd abcbd b +a(b|c){2,4}d - abcbcd abcbcd c +a(b|c){2,}d - abcd abcd c +a(b|c){2,}d - abcbd abcbd b +##a(b+|((c)*))+d - abd abd @d,@d,- +##a(b+|((c)*))+d - abcd abcd @d,@d,- + +# check out the STARTEND option +[abc] &# a(b)c b +[abc] &# a(d)c +[abc] &# a(bc)d b +[abc] &# a(dc)d c +. &# a()c +b.*c &# b(bc)c bc +b.* &# b(bc)c bc +.*c &# b(bc)c bc + +# plain strings, with the NOSPEC flag +abc m abc abc +abc m xabcy abc +abc m xyz +a*b m aba*b a*b +a*b m ab +"" mC EMPTY + +# cases involving NULs +aZb & a a +aZb &p a +#aZb &p# (aZb) aZb +aZ*b &p# (ab) ab +#a.b &# (aZb) aZb +#a.* &# (aZb)c aZb + +# word boundaries (ick) +[[:<:]]a & a a +[[:<:]]a & ba +[[:<:]]a & -a a +a[[:>:]] & a a +a[[:>:]] & ab +a[[:>:]] & a- a +[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc abc +[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc-q abc +[[:<:]]a.c[[:>:]] & axc-dayc-dazce-abc axc +[[:<:]]b.c[[:>:]] & a_bxc-byc_d-bzc-q bzc +[[:<:]].x..[[:>:]] & y_xa_-_xb_y-_xc_-axdc _xc_ +[[:<:]]a_b[[:>:]] & x_a_b + +# past problems, and suspected problems +(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A]) - A1 A1 +abcdefghijklmnop i abcdefghijklmnop abcdefghijklmnop +abcdefghijklmnopqrstuv i abcdefghijklmnopqrstuv abcdefghijklmnopqrstuv +(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN]) - CC11 CC11 +CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a - CC11 CC11 +Char \([a-z0-9_]*\)\[.* b Char xyz[k Char xyz[k xyz +a?b - ab ab +-\{0,1\}[0-9]*$ b -5 -5 diff --git a/src/apps/bin/grep-2.5/tests/warning.sh b/src/apps/bin/grep-2.5/tests/warning.sh new file mode 100644 index 0000000000..bfca533a96 --- /dev/null +++ b/src/apps/bin/grep-2.5/tests/warning.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# +# Tell them not to be alarmed. + +: ${srcdir=.} + +failures=0 + +# +cat <<\EOF + +Please, do not be alarmed if some of the tests failed. +Report them to , +with the line number, the name of the file, +and grep version number 'grep --version'. +Make sure you have the word grep in the subject. +Thank You. + +EOF